1var v=typeof window<"u"?window:void 0,K=typeof globalThis<"u"?globalThis:v;typeof self>"u"&&(K.self=K),typeof File>"u"&&(K.File=function(){});var de=K?.navigator,w=K?.document,Q=K?.location,es=K?.fetch,ts=K!=null&&K.XMLHttpRequest&&"withCredentials"in new K.XMLHttpRequest?K.XMLHttpRequest:void 0,rr=K?.AbortController,Pa=K?.CompressionStream,oe=de?.userAgent,F=v??{},nr="1.374.3",ae={DEBUG:!1,LIB_VERSION:nr,LIB_NAME:"web",JS_SDK_VERSION:nr};function ar(i,e,t,s,r,n,a){try{var o=i[n](a),l=o.value}catch(c){return void t(c)}o.done?e(l):Promise.resolve(l).then(s,r)}function he(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function a(l){ar(n,s,r,a,o,"next",l)}function o(l){ar(n,s,r,a,o,"throw",l)}a(void 0)})}}function m(){return m=Object.assign?Object.assign.bind():function(i){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},m.apply(null,arguments)}function ln(i,e){if(i==null)return{};var t={};for(var s in i)if({}.hasOwnProperty.call(i,s)){if(e.indexOf(s)!==-1)continue;t[s]=i[s]}return t}var mt,or=function(i){return i.GZipJS="gzip-js",i.Base64="base64",i}({}),$a=["$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"],un="NativeGzipValidationError",is=i=>i.length>=2&&i[0]===31&&i[1]===139,lr=i=>!(!i||typeof i!="object")&&("name"in i?String(i.name):"")==="NotReadableError",Wt=i=>{var e=new Error("Native gzip produced invalid output: "+i);throw e.name=un,e},Fa=function(){var i=he(function*(e,t){18>e.size&&Wt("too-short");var s=new Uint8Array(yield e.slice(0,10).arrayBuffer());is(s)&&s[2]===8||Wt("invalid-header");var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(a=>{for(var o=(()=>{if(mt)return mt;mt=[];for(var u=0;256>u;u++){for(var h=u,d=0;8>d;d++)h=1&h?3988292384^h>>>1:h>>>1;mt[u]=h>>>0}return mt})(),l=4294967295,c=0;a.length>c;c++)l=o[255&(l^a[c])]^l>>>8;return(4294967295^l)>>>0})(t)&&Wt("invalid-crc");var n=t.length>>>0;r.getUint32(4,!0)!==n&&Wt("invalid-size")});return function(e,t){return i.apply(this,arguments)}}();function ss(){return ss=he(function*(i,e,t){e===void 0&&(e=!0);try{var s=new TextEncoder().encode(i),r=new CompressionStream("gzip"),n=r.writable.getWriter(),a=n.write(s).then(()=>n.close()).catch(function(){var c=he(function*(u){try{yield n.abort(u)}catch{}throw u});return function(u){return c.apply(this,arguments)}}()),o=new Response(r.readable).blob(),[l]=yield Promise.all([o,a]);return yield Fa(l,s),l}catch(c){if(t!=null&&t.rethrow)throw c;return e&&console.error("Failed to gzip compress data",c),null}}),ss.apply(this,arguments)}var Ia=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],ur=function(i,e){if(e===void 0&&(e=[]),!i)return!1;var t=i.toLowerCase();return Ia.concat(e).some(s=>{var r=s.toLowerCase();return t.indexOf(r)!==-1})};function L(i,e){return i.indexOf(e)!==-1}var Pi=function(i){return i.trim()},rs=function(i){return i.replace(/^\$/,"")},cn=Object.prototype,hn=cn.hasOwnProperty,$i=cn.toString,N=Array.isArray||function(i){return $i.call(i)==="[object Array]"},Oe=i=>typeof i=="function",Y=i=>i===Object(i)&&!N(i),lt=i=>{if(Y(i)){for(var e in i)if(hn.call(i,e))return!1;return!0}return!1},x=i=>i===void 0,B=i=>$i.call(i)=="[object String]",ti=i=>B(i)&&i.trim().length===0,qe=i=>i===null,D=i=>x(i)||qe(i),me=i=>$i.call(i)=="[object Number]"&&i==i,rt=i=>me(i)&&i>0,Pe=i=>$i.call(i)==="[object Boolean]",Ra=i=>i instanceof FormData,Ta=i=>L($a,i);function dn(i){return i===null||typeof i!="object"}function oi(i,e){return{}.toString.call(i)==="[object "+e+"]"}function js(i){return typeof Event<"u"&&function(e,t){try{return e instanceof t}catch{return!1}}(i,Event)}var Ca=[!0,"true",1,"1","yes"],Ci=i=>L(Ca,i),Oa=[!1,"false",0,"0","no"];function $e(i,e,t,s,r){return e>t&&(s.warn("min cannot be greater than max."),e=t),me(i)?i>t?(s.warn(" cannot be greater than max: "+t+". Using max value instead."),t):e>i?(s.warn(" cannot be less than min: "+e+". Using min value instead."),e):i:(s.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+r),$e(r||t,e,t,s))}
1class Ma{constructor(e){this.$t={},this.zt=e.zt,this.Zt=$e(e.bucketSize,0,100,e.Gt),this.Qt=$e(e.refillRate,0,this.Zt,e.Gt),this.Jt=$e(e.refillInterval,0,864e5,e.Gt)}Kt(e,t){var s=Math.floor((t-e.lastAccess)/this.Jt);s>0&&(e.tokens=Math.min(e.tokens+s*this.Qt,this.Zt),e.lastAccess=e.lastAccess+s*this.Jt)}consumeRateLimit(e){var t,s=Date.now(),r=String(e),n=this.$t[r];return n?this.Kt(n,s):this.$t[r]=n={tokens:this.Zt,lastAccess:s},n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.zt)==null||t.call(this,e)),n.tokens===0)}stop(){this.$t={}}}var Gt,cr,Oi,pe="Mobile",li="iOS",Ae="Android",pt="Tablet",pn=Ae+" "+pt,vn="iPad",gn="Apple",fn=gn+" Watch",Ot="Safari",vt="BlackBerry",_n="Samsung",mn=_n+"Browser",yn=_n+" Internet",Xe="Chrome",Aa=Xe+" OS",bn=Xe+" "+li,Hs="Internet Explorer",wn=Hs+" "+pe,Us="Opera",qa=Us+" Mini",zs="Edge",xn="Microsoft "+zs,ht="Firefox",En=ht+" "+li,Dt="Nintendo",Nt="PlayStation",dt="Xbox",kn=Ae+" "+pe,Sn=pe+" "+Ot,$t="Windows",ns=$t+" Phone",hr="Nokia",as="Ouya",Pn="Generic",La=Pn+" "+pe.toLowerCase(),$n=Pn+" "+pt.toLowerCase(),os="Konqueror",Fn="Oculus Browser",ie="(\\d+(\\.\\d+)?)",Mi=new RegExp("Version/"+ie),Da=new RegExp(dt,"i"),Na=new RegExp(Nt+" \\w+","i"),ja=new RegExp(Dt+" \\w+","i"),Vs=new RegExp(vt+"|PlayBook|BB10","i"),Ha={"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"},In=function(i,e){return e=e||"",L(i," OPR/")&&L(i,"Mini")?qa:L(i," OPR/")?Us:Vs.test(i)?vt:L(i,"IE"+pe)||L(i,"WPDesktop")?wn:L(i,"OculusBrowser")?Fn:L(i,mn)?yn:L(i,zs)||L(i,"Edg/")?xn:L(i,"FBIOS")?"Facebook "+pe:L(i,"UCWEB")||L(i,"UCBrowser")?"UC Browser":L(i,"CriOS")?bn:L(i,"CrMo")||L(i,Xe)?Xe:L(i,Ae)&&L(i,Ot)?kn:L(i,"FxiOS")?En:L(i.toLowerCase(),os.toLowerCase())?os:((t,s)=>s&&L(s,gn)||function(r){return L(r,Ot)&&!L(r,Xe)&&!L(r,Ae)}(t))(i,e)?L(i,pe)?Sn:Ot:L(i,ht)?ht:L(i,"MSIE")||L(i,"Trident/")?Hs:L(i,"Gecko")?ht:""},Ua={[wn]:[new RegExp("rv:"+ie)],[xn]:[new RegExp(zs+"?\\/"+ie)],[Xe]:[new RegExp("("+Xe+"|CrMo)\\/"+ie)],[bn]:[new RegExp("CriOS\\/"+ie)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ie)],[Ot]:[Mi],[Sn]:[Mi],[Us]:[new RegExp("(Opera|OPR)\\/"+ie)],[ht]:[new RegExp(ht+"\\/"+ie)],[En]:[new RegExp("FxiOS\\/"+ie)],[os]:[new RegExp("Konqueror[:/]?"+ie,"i")],[vt]:[new RegExp(vt+" "+ie),Mi],[kn]:[new RegExp("android\\s"+ie,"i")],[yn]:[new RegExp(mn+"\\/"+ie)],[Fn]:[new RegExp("OculusBrowser\\/"+ie)],[Hs]:[new RegExp("(rv:|MSIE )"+ie)],Mozilla:[new RegExp("rv:"+ie)]},za=function(i,e){var t=In(i,e),s=Ua[t];if(x(s))return null;for(var r=0;s.length>r;r++){var n=i.match(s[r]);if(n)return parseFloat(n[n.length-2])}return null},dr=[[new RegExp(dt+"; "+dt+" (.*?)[);]","i"),i=>[dt,i&&i[1]||""]],[new RegExp(Dt,"i"),[Dt,""]],[new RegExp(Nt,"i"),[Nt,""]],[Vs,[vt,""]],[new RegExp($t,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ns,""];if(new RegExp(pe).test(e)&&!/IEMobile\b/.test(e))return[$t+" "+pe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var s=Ha[t[1]]||"";return/arm/i.test(e)&&(s="RT"),[$t,s]}return[$t,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>i&&i[3]?[li,[i[3],i[4],i[5]||"0"].join(".")]:[li,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=x(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+Ae+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ae+")","i"),i=>i&&i[2]?[Ae,[i[2],i[3],i[4]||"0"].join(".")]:[Ae,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];return i&&i[1]&&(e[1]=[i[1],i[2],i[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Aa,""]],[/Linux|debian/i,["Linux",""]]],pr=function(i){return ja.test(i)?Dt:Na.test(i)?Nt:Da.test(i)?dt:new RegExp(as,"i").test(i)?as:new RegExp("("+ns+"|WPDesktop)","i").test(i)?ns:/iPad/.test(i)?vn:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?fn:Vs.test(i)?vt:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(hr,"i").test(i)?hr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?new RegExp(pe).test(i)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)||/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?Ae:pn:new RegExp("(pda|"+pe+")","i").test(i)?La:new RegExp(pt,"i").test(i)&&!new RegExp(pt+" pc","i").test(i)?$n:""},Va=i=>i instanceof Error,Rn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Ba=Rn.info;function Tn(i){if(Pe(i))return{boolValue:i};if(typeof i=="number")return Number.isFinite(i)?Number.isInteger(i)?{intValue:i}:{doubleValue:i}:{stringValue:String(i)};if(typeof i=="string")return{stringValue:i};if(N(i))return{arrayValue:{values:i.map(e=>Tn(e))}};try{return{stringValue:JSON.stringify(i)}}catch{return{stringValue:String(i)}}}function vr(i){var e=[];
1for(var t in i){var s=i[t];qe(s)||x(s)||e.push({key:t,value:Tn(s)})}return e}function Wa(i){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return Oi&&t.length===cr||(cr=t.length,Oi=t.reduce((s,r)=>{Gt||(Gt={});var n=Gt[r];if(n)s[n[0]]=n[1];else for(var a=i(r),o=a.length-1;o>=0;o--){var l=a[o],c=l?.filename,u=e[r];if(c&&u){s[c]=u,Gt[r]=[c,u];break}}return s},{})),Oi}}class Ga{constructor(e,t,s){s===void 0&&(s=[]),this.coercers=e,this.stackParser=t,this.modifiers=s}buildFromUnknown(e,t){t===void 0&&(t={});var s=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(s,t,0).apply(e),n=this.buildParsingContext(t),a=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(a,s),$exception_level:"error"}}modifyFrames(e){var t=this;return he(function*(){for(var s of e)s.stacktrace&&s.stacktrace.frames&&N(s.stacktrace.frames)&&(s.stacktrace.frames=yield t.applyModifiers(s.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)==null?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var s,r;return e.cause!=null&&(s=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),m({},e,{cause:s,stack:r})}applyChunkIds(e,t){return e.map(s=>(s.filename&&t&&(s.chunk_id=t[s.filename]),s))}applyCoercers(e,t){for(var s of this.coercers)if(s.match(e))return s.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return he(function*(){var s=e;for(var r of t.modifiers)s=yield r(s);return s})()}convertToExceptionList(e,t){var s,r,n,a={type:e.type,value:e.value,mechanism:{type:(s=t.type)!==null&&s!==void 0?s:"generic",handled:(r=t.handled)===null||r===void 0||r,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,m({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:Wa(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}buildCoercingContext(e,t,s){s===void 0&&(s=0);var r=(n,a)=>{if(4>=a){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return m({},t,{syntheticException:s==0?t.syntheticException:void 0,mechanism:e,apply:n=>r(n,s),next:n=>r(n,s+1)})}}var gt="?";function ls(i,e,t,s,r){var n={platform:i,filename:e,function:t==="<anonymous>"?gt:t,in_app:!0};return x(s)||(n.lineno=s),x(r)||(n.colno=r),n}var Cn=(i,e)=>{var t=i.indexOf("safari-extension")!==-1,s=i.indexOf("safari-web-extension")!==-1;return t||s?[i.indexOf("@")!==-1?i.split("@")[0]:gt,t?"safari-extension:"+e:"safari-web-extension:"+e]:[i,e]},Ya=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Xa=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ja=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ka=(i,e)=>{var t=Ya.exec(i);if(t){var[,s,r,n]=t;return ls(e,s,gt,+r,+n)}var a=Xa.exec(i);if(a){if(a[2]&&a[2].indexOf("eval")===0){var o=Ja.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,c]=Cn(a[1]||gt,a[2]);return ls(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},Za=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Qa=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,eo=(i,e)=>{var t=Za.exec(i);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var s=Qa.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}var r=t[3],n=t[1]||gt;return[n,r]=Cn(n,r),ls(e,r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},gr=/\(error: (.*)\)/;class to{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var s=B(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:s?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return oi(e,"DOMException")}isDOMError(e){return oi(e,"DOMError")}}class io{match(e){return(t=>t instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var s=e.message;return String(s.error&&typeof s.error.message=="string"?s.error.message:s)}getStack(e){return e.stacktrace||e.stack||void 0}}class so{constructor(){}match(e){return oi(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var s;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}}}var ro=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class no{match(e){return typeof e=="string"}coerce(e,t){var s,[r,n]=this.getInfos(e);return{type:r??"Error",value:n??e,stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}}getInfos(e){var t="Error",s=e,r=e.match(ro);return r&&(t=r[1],s=r[2]),[t,s]}}var ao=["fatal","error","warning","log","info","debug"];function On(i,e){e===void 0&&(e=40);var t=Object.keys(i);if(t.sort(),!t.length)return"[object has no keys]";for(var s=t.length;s>0;s--){var r=t.slice(0,s).join(", ");
1if(e>=r.length)return s===t.length?r:r.length>e?r.slice(0,e)+"...":r}return""}class oo{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var s,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(s=t.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return js(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var t="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&typeof e.message=="string")return e.message;var s=this.getObjectClassName(e);return(s&&s!=="Object"?"'"+s+"'":"Object")+" captured as exception with keys: "+On(e)}isSeverityLevel(e){return B(e)&&!ti(e)&&ao.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var s=e[t];if(Va(s))return s}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class lo{match(e){return js(e)}coerce(e,t){var s,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+On(e),stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class uo{match(e){return dn(e)}coerce(e,t){var s;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class co{match(e){return oi(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!js(e))return!1;try{var t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var s,r=this.getUnhandledRejectionReason(e);return dn(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var ui="$message",ci="$timestamp",ho=new Set([ui,ci]),Ai={enabled:!0,max_bytes:32768};function hi(i){var e;return i?{enabled:(e=i.enabled)!==null&&e!==void 0?e:Ai.enabled,max_bytes:vo(i.max_bytes,Ai.max_bytes)}:m({},Ai)}class po{constructor(e){this.Yt=[],this.Xt=0,this.qt=hi(e)}setConfig(e){this.qt=hi(e),this.er()}add(e){var t=function(r){var n=function(u){var h=new WeakSet;try{return JSON.stringify(u,(d,p)=>{if(typeof p=="bigint")return p.toString();if(typeof p!="function"&&typeof p!="symbol"){if(p instanceof Date)return p.toISOString();if(p instanceof Error)return{name:p.name,message:p.message,stack:p.stack};if(p&&typeof p=="object"){if(h.has(p))return"[Circular]";h.add(p)}return p}})}catch{return}}(r);if(n)try{var a=JSON.parse(n);if(!Y(a))return;var o=a,l=o[ui],c=o[ci];return!B(l)||l.trim().length===0||!B(c)&&!me(c)?void 0:{step:o,json:n}}catch{return}}(e);if(t){var s=function(r){if(typeof TextEncoder<"u")return new TextEncoder().encode(r).length;for(var n=encodeURIComponent(r),a=0,o=0;n.length>o;o++)n[o]==="%"?(a+=1,o+=2):a+=1;return a}(t.json);s>this.qt.max_bytes||(this.Yt.push({step:t.step,bytes:s}),this.Xt+=s,this.er())}}getAttachable(){return this.Yt.map(e=>e.step)}clear(){this.Yt=[],this.Xt=0}size(){return this.Yt.length}er(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var e=this.Yt.shift();e&&(this.Xt-=e.bytes)}}}function vo(i,e){if(!me(i)||i===1/0||i===-1/0)return e;var t=Math.floor(i);return 0>t?e:t}var Mn=function(i,e){var{debugEnabled:t}=e===void 0?{}:e,s={k(r){if(v&&(ae.DEBUG||F.POSTHOG_DEBUG||t)&&!x(v.console)&&v.console){for(var n=("__rrweb_original__"in v.console[r])?v.console[r].__rrweb_original__:v.console[r],a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];n(i,...o)}},debug(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];s.k("debug",...n)},info(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];s.k("log",...n)},warn(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];s.k("warn",...n)},error(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];s.k("error",...n)},critical(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];console.error(i,...n)},uninitializedWarning(r){s.error("You must initialize PostHog before calling "+r)},createLogger:(r,n)=>Mn(i+" "+r,n)};return s},b=Mn("[PostHog.js]"),z=b.createLogger,go=z("[ExternalScriptsLoader]"),qi=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return go.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var s=w?.querySelectorAll("script");
1if(s){for(var r,n=function(){if(s[a].src===e){var l=s[a];return l.__posthog_loading_callback_fired?{v:t()}:(l.addEventListener("load",c=>{l.__posthog_loading_callback_fired=!0,t(void 0,c)}),l.onerror=c=>t(c),{v:void 0})}},a=0;s.length>a;a++)if(r=n())return r.v}var o=()=>{if(!w)return t("document not found");var l=w.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,t(void 0,h)},l.onerror=h=>t(h),i.config.prepare_external_dependency_script&&(l=i.config.prepare_external_dependency_script(l)),!l)return t("prepare_external_dependency_script returned null");if(i.config.external_scripts_inject_target==="head")w.head.appendChild(l);else{var c,u=w.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):w.body.appendChild(l)}};w!=null&&w.body?o():w?.addEventListener("DOMContentLoaded",o)};F.__PosthogExtensions__=F.__PosthogExtensions__||{},F.__PosthogExtensions__.loadExternalDependency=(i,e,t)=>{if(e!=="remote-config"){var s;if(i.config.__preview_external_dependency_versioned_paths)s=i.requestRouter.endpointFor("assets","/static/"+i.version+"/"+e+".js");else{var r="/static/"+e+".js?v="+i.version;if(e==="toolbar"){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}s=i.requestRouter.endpointFor("assets",r)}qi(i,s,t)}else{var a=i.requestRouter.endpointFor("assets","/array/"+i.config.token+"/config.js");qi(i,a,t)}},F.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var s=i.requestRouter.endpointFor("api",e);qi(i,s,t)};var An="$people_distinct_id",di="$device_id",Ft="__alias",It="__timers",us="$autocapture_disabled_server_side",cs="$heatmaps_enabled_server_side",hs="$exception_capture_enabled_server_side",ds="$error_tracking_suppression_rules",ps="$error_tracking_capture_extension_exceptions",vs="$web_vitals_enabled_server_side",Bs="$dead_clicks_enabled_server_side",gs="$product_tours_enabled_server_side",fs="$web_vitals_allowed_metrics",Ye="$session_recording_remote_config",qn="$replay_override_sampling",Ln="$replay_override_linked_flag",Dn="$replay_override_url_trigger",Nn="$replay_override_event_trigger",pi="$sesid",Ws="$session_is_sampled",ut="$enabled_feature_flags",ii="$active_feature_flags",Rt="$early_access_features",_s="$feature_flag_details",ms="$feature_flag_payloads",ys="$feature_flag_request_id",Ce="$override_feature_flags",nt="$override_feature_flag_payloads",Tt="$stored_person_properties",We="$stored_group_properties",bs="$surveys",ws="$surveys_activated",si="ph_product_tours",Mt="$flag_call_reported",xs="$flag_call_reported_session_id",Es="$feature_flag_errors",vi="$feature_flag_evaluated_at",xe="$user_state",ks="$client_session_props",Ss="$capture_rate_limit",Ps="$initial_campaign_params",$s="$initial_referrer_info",gi="$initial_person_info",fi="$epp",jn="__POSTHOG_TOOLBAR__",Yt="$posthog_cookieless",Hn="$sdk_debug_extensions_init_method",Un="$sdk_debug_extensions_init_time_ms",zn="$sdk_debug_recording_script_not_loaded",Gs="PostHog loadExternalDependency extension not found.",Ge="on_reject",Me="always",Qe="anonymous",et="identified",Fs="identified_only",_i="visibilitychange",mi="beforeunload",at="$pageview",Li="$pageleave",Di="$identify",fr="$groupidentify";function Xt(i,e){N(i)&&i.forEach(e)}function H(i,e){if(!D(i))if(N(i))i.forEach(e);else if(Ra(i))i.forEach((s,r)=>e(s,r));else for(var t in i)hn.call(i,t)&&e(i[t],t)}var W=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;e>s;s++)t[s-1]=arguments[s];for(var r of t)for(var n in r)r[n]!==void 0&&(i[n]=r[n]);return i};function ri(i){for(var e=Object.keys(i),t=e.length,s=new Array(t);t--;)s[t]=[e[t],i[e[t]]];return s}var _r=function(i){try{return i()}catch{return}},fo=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),s=0;e>s;s++)t[s]=arguments[s];return i.apply(this,t)}catch(r){b.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),b.critical(r)}}},Ys=function(i){var e={};return H(i,function(t,s){(B(t)&&t.length>0||me(t))&&(e[s]=t)}),e},_o=["herokuapp.com","vercel.app","netlify.app"];function mo(i){var e=i?.hostname;if(!B(e))return!1;var t=e.split(".").slice(-2).join(".");for(var s of _o)if(t===s)return!1;return!0}function X(i,e,t,s){var{capture:r=!1,passive:n=!0}=s??{};i?.addEventListener(e,t,{capture:r,passive:n})}
1function Vn(i){return i.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(i){return 0>i?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return me(i)&&isFinite(i)&&Math.floor(i)===i});class yi{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,s,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(s)||!Number.isInteger(r)||0>e||0>t||0>s||0>r||e>0xffffffffffff||t>4095||s>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|s>>>24,n[9]=s>>>16,n[10]=s>>>8,n[11]=s,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new yi(n)}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),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new yi(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var s=this.bytes[t]-e.bytes[t];if(s!==0)return Math.sign(s)}return 0}}class yo{constructor(){this.S=0,this.C=0,this.I=new bo}generate(){var e=this.generateOrAbort();if(x(e)){this.S=0;var t=this.generateOrAbort();if(x(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.T();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.T())}return yi.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var mr,Bn=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;i.length>e;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};v&&!x(v.crypto)&&crypto.getRandomValues&&(Bn=i=>crypto.getRandomValues(i));class bo{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(Bn(this.M),this.O=0),this.M[this.O++]}}var je=()=>wo().toString(),wo=()=>(mr||(mr=new yo)).generate(),yt="",xo=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Se={R:()=>!!w,D(i){b.error("cookieStore error: "+i)},A(i){if(w){try{for(var e=i+"=",t=w.cookie.split(";").filter(n=>n.length),s=0;t.length>s;s++){for(var r=t[s];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},F(i){var e;try{e=JSON.parse(Se.A(i))||{}}catch{}return e},N(i,e,t,s,r){if(w)try{var n="",a="",o=function(u,h){if(h){var d=function(g,f){if(f===void 0&&(f=w),yt)return yt;if(!f||["localhost","127.0.0.1"].includes(g))return"";for(var I=g.split("."),S=Math.min(I.length,8),C="dmn_chk_"+je();!yt&&S--;){var $=I.slice(S).join("."),R=C+"=1;domain=."+$+";path=/";f.cookie=R+";max-age=3",f.cookie.includes(C)&&(f.cookie=R+";max-age=0",yt=$)}return yt}(u);if(!d){var p=(g=>{var f=g.match(xo);return f?f[0]:""})(u);p!==d&&b.info("Warning: cookie subdomain discovery mismatch",p,d),d=p}return d?"; domain=."+d:""}return""}(w.location.hostname,s);if(t){var l=new Date;l.setTime(l.getTime()+864e5*t),n="; expires="+l.toUTCString()}r&&(a="; secure");var c=i+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return c.length>3686.4&&b.warn("cookieStore warning: large cookie, len="+c.length),w.cookie=c,c}catch{return}},q(i,e){if(w!=null&&w.cookie)try{Se.N(i,"",-1,e)}catch{return}}},Ni=null,V={R(){if(!qe(Ni))return Ni;var i=!0;if(x(v))i=!1;else try{var e="__mplssupport__";V.N(e,"xyz"),V.A(e)!=='"xyz"'&&(i=!1),V.q(e)}catch{i=!1}return i||b.error("localStorage unsupported; falling back to cookie store"),Ni=i,i},D(i){b.error("localStorage error: "+i)},A(i){try{return v?.localStorage.getItem(i)}catch(e){V.D(e)}return null},F(i){try{return JSON.parse(V.A(i))||{}}catch{}return null},N(i,e){try{v?.localStorage.setItem(i,JSON.stringify(e))}catch(t){V.D(t)}},q(i){try{v?.localStorage.removeItem(i)}catch(e){V.D(e)}}},Eo=[di,"distinct_id",pi,Ws,fi,gi,xe],Jt={},ko={R:()=>!0,D(i){b.error("memoryStorage error: "+i)},A:i=>
1Jt[i]||null,F:i=>Jt[i]||null,N(i,e){Jt[i]=e},q(i){delete Jt[i]}},Ue=null,ee={R(){if(!qe(Ue))return Ue;if(Ue=!0,x(v))Ue=!1;else try{var i="__support__";ee.N(i,"xyz"),ee.A(i)!=='"xyz"'&&(Ue=!1),ee.q(i)}catch{Ue=!1}return Ue},D(i){b.error("sessionStorage error: ",i)},A(i){try{return v?.sessionStorage.getItem(i)}catch(e){ee.D(e)}return null},F(i){try{return JSON.parse(ee.A(i))||null}catch{}return null},N(i,e){try{v?.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){ee.D(t)}},q(i){try{v?.sessionStorage.removeItem(i)}catch(e){ee.D(e)}}};class So{constructor(e){this._instance=e}get qt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.qt.cookieless_mode===Me||this.isRejected()||this.consent===-1&&this.qt.cookieless_mode===Ge}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qt.opt_out_capturing_by_default}optInOut(e){this.nr.N(this.sr,e?1:0,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:s}=this._instance.config;return s||(t?t+e:"__ph_opt_in_out_"+e)}get ir(){var e=this.nr.A(this.sr);return Ci(e)?1:L(Oa,e)?0:-1}get nr(){var e=this.qt.opt_out_capturing_persistence_type,t=e==="localStorage"?V:Se;if(!this.ar||this.ar!==t){this.ar=t;var s=e==="localStorage"?Se:V;s.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(Ci(s.A(this.sr))),s.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[de?.doNotTrack,de?.msDoNotTrack,F.doNotTrack].some(e=>Ci(e))}}var Kt=z("[Dead Clicks]"),Po=()=>!0,$o=i=>{var e,t=!((e=i.instance.persistence)==null||!e.get_property(Bs)),s=i.instance.config.capture_dead_clicks;return Pe(s)?s:!!Y(s)||t};class yr{get lazyLoadedDeadClicksAutocapture(){return this.ur}constructor(e,t,s){this.instance=e,this.isEnabled=t,this.onCapture=s,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Bs]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr(()=>{this.hr()}):this.stop()}lr(e){var t,s;(t=F.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(s=F.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"dead-clicks-autocapture",r=>{r?Kt.error("failed to load script",r):e()})}hr(){var e;if(w){if(!this.ur&&(e=F.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=Y(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.ur=F.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ur.start(w),Kt.info("starting...")}}else Kt.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,Kt.info("stopping..."))}}var ji=z("[SegmentIntegration]"),Wn="posthog-js";function Gn(i,e){var{organization:t,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,c,u,h,d;if(n!=="*"&&!n.includes(o.level)||!i.__loaded)return o;o.tags||(o.tags={});var p=i.requestRouter.endpointFor("ui","/project/"+i.config.token+"/person/"+i.get_distinct_id());o.tags["PostHog Person URL"]=p,i.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var g,f=((l=o.exception)==null?void 0:l.values)||[],I=f.map(C=>m({},C,{stacktrace:C.stacktrace?m({},C.stacktrace,{type:"raw",frames:(C.stacktrace.frames||[]).map($=>m({},$,{platform:"web:javascript"}))}):void 0})),S={$exception_message:((c=f[0])==null?void 0:c.value)||o.message,$exception_type:(u=f[0])==null?void 0:u.type,$exception_level:o.level,$exception_list:I,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((h=f[0])==null?void 0:h.value)||o.message,$sentry_exception_type:(d=f[0])==null?void 0:d.type,$sentry_tags:o.tags};return t&&s&&(S.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+s+"&query="+o.event_id),a&&((g=i.exceptions)==null||g.sendExceptionEvent(S)),o}}class Fo{constructor(e,t,s,r,n,a){this.name=Wn,this.setupOnce=function(o){o(Gn(e,{organization:t,projectId:s,prefix:r,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}
1class br{constructor(e){this.cr=(t,s,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(b.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){var e;this.pr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.cr)}destroy(){var e;(e=this.pr)==null||e.call(this),this.pr=void 0}doPageView(e,t){var s,r=this.gr(e,t);return this.dr={pathname:(s=v?.location.pathname)!==null&&s!==void 0?s:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.gr(e,(t=this.dr)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.dr)==null?void 0:e.pageViewId}}gr(e,t){var s=this.dr;if(!s)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:s.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:h}=n;if(!(x(a)||x(o)||x(l)||x(c)||x(u)||x(h))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),h=Math.ceil(h);var d=a>1?$e(o/a,0,1,b):1,p=a>1?$e(l/a,0,1,b):1,g=c>1?$e(u/c,0,1,b):1,f=c>1?$e(h/c,0,1,b):1;r=W(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return s.pathname&&(r.$prev_pageview_pathname=s.pathname),s.timestamp&&(r.$prev_pageview_duration=(e.getTime()-s.timestamp.getTime())/1e3),r}}var Io={[An]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[It]:{exposure:"hidden"},[us]:{exposure:"event"},[cs]:{exposure:"hidden"},[hs]:{exposure:"event"},[ds]:{exposure:"hidden"},[ps]:{exposure:"event"},[vs]:{exposure:"event"},[Bs]:{exposure:"event"},[gs]:{exposure:"hidden"},[fs]:{exposure:"event"},[Ye]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[pi]:{exposure:"hidden"},[Ws]:{exposure:"event"},$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"},[ut]:{exposure:"derived",shouldSkipFromEventProperties:(i,e)=>e(),transformToEventProperties(i){if(!Y(i))return{};for(var e={},t=Object.keys(i),s=0;t.length>s;s++)e["$feature/"+t[s]]=i[t[s]];return e}},[ii]:{exposure:"event"},[Rt]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[ms]:{exposure:"event"},[ys]:{exposure:"event"},[Ce]:{exposure:"event"},[nt]:{exposure:"hidden"},[Tt]:{exposure:"hidden"},[We]:{exposure:"hidden"},[bs]:{exposure:"hidden"},[ws]:{exposure:"event"},[si]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Mt]:{exposure:"hidden"},[xs]:{exposure:"hidden"},[Es]:{exposure:"hidden"},[vi]:{exposure:"hidden"},[xe]:{exposure:"hidden"},[ks]:{exposure:"hidden"},[Ss]:{exposure:"hidden"},[Ps]:{exposure:"hidden"},[$s]:{exposure:"hidden"},[gi]:{exposure:"hidden"},[fi]:{exposure:"hidden"},[qn]:{exposure:"event"},[Ln]:{exposure:"event"},[Dn]:{exposure:"event"},[Nn]:{exposure:"event"},[Hn]:{exposure:"event"},[Un]:{exposure:"event"},[zn]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Ro=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],bi=i=>{var e=w?.createElement("a");return x(e)?null:(e.href=i,e)},jt=function(i,e){for(var t,s=((i.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===e){t=n;break}}if(!N(t)||2>t.length)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{b.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Ht=function(i,e,t){if(!i||!e||!e.length)return i;for(var s=i.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),c=[],u=0;l.length>u;u++){var h=l[u].split("=");N(h)&&(e.includes(h[0])?c.push(h[0]+"="+t):c.push(l[u]))}var d=o;return a!=null&&(d+="?"+c.join("&")),r!=null&&(d+="#"+r),d},wi=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Zt="https?://(.*)",ft=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],To=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...ft],Ut="<masked>",Co=["li_fat_id"];function Yn(i,e,t){if(!w)return{};var s,r=e?[...ft,...t||[]]:[],n=Xn(Ht(w.URL,r,Ut),i),a=(s={},H(Co,function(o){var l=Se.A(o);s[o]=l||null}),s);return W(a,n)}function Xn(i,e){var t=To.concat(e||[]),s={};return H(t,function(r){var n=jt(i,r);s[r]=n||null}),s}function Jn(i){var e=function(n){return n?n.search(Zt+"google.([^/?]*)")===0?"google":n.search(Zt+"bing.com")===0?"bing":n.search(Zt+"yahoo.com")===0?"yahoo":n.search(Zt+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",s={};if(!qe(e)){s.$search_engine=e;var r=w?jt(w.referrer,t):"";r.length&&(s.ph_keyword=r)}return s}function wr(){return navigator.language||navigator.userLanguage}var xi="$direct";function Kn(){return w?.referrer||xi}function Zn(i,e){var t=i?[...ft,...e||[]]:[],s=Q?.href.substring(0,1e3);return{r:Kn().substring(0,1e3),u:s?Ht(s,t,Ut):void 0}}function Qn(i){var e,{r:t,u:s}=i,r={$referrer:t,$referring_domain:t==null?void 0:t==xi?xi:(e=bi(t))==null?void 0:e.host};
1if(s){r.$current_url=s;var n=bi(s);r.$host=n?.host,r.$pathname=n?.pathname;var a=Xn(s);W(r,a)}if(t){var o=Jn(t);W(r,o)}return r}function ea(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Oo(){try{return new Date().getTimezoneOffset()}catch{return}}var Mo=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Hi{constructor(e,t){this.qt=e,this.props={},this.mr=!1,this.yr=(s=>{var r="";return s.token&&(r=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+r+"_posthog"})(e),this.nr=this.br(e),this.load(),e.debug&&b.info("Persistence loaded",e.persistence,m({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._r}br(e){Mo.indexOf(e.persistence.toLowerCase())===-1&&(b.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(r){r===void 0&&(r=[]);var n=[...Eo,...r];return m({},V,{F(a){try{var o={};try{o=Se.F(a)||{}}catch{}var l=W(o,JSON.parse(V.A(a)||"{}"));return V.N(a,l),l}catch{}return null},N(a,o,l,c,u,h){try{V.N(a,o,void 0,void 0,h);var d={};n.forEach(p=>{o[p]&&(d[p]=o[p])}),Object.keys(d).length&&Se.N(a,d,l,c,u,h)}catch(p){V.D(p)}},q(a,o){try{v?.localStorage.removeItem(a),Se.q(a,o)}catch(l){V.D(l)}}})}(e.cookie_persisted_properties||[]),s=e.persistence.toLowerCase();return s==="localstorage"&&V.R()?V:s==="localstorage+cookie"&&t.R()?t:s==="sessionstorage"&&ee.R()?ee:s==="memory"?ko:s==="cookie"?Se:t.R()?t:Se}wr(e){var t=e??this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var s=this.props[vi];return!s||typeof s!="number"||Date.now()-s>t}properties(){var e={};return H(this.props,(t,s)=>{var r=(n=>{var a=Io[n];if(a)return a;for(var[o,l]of Ro)if(n.indexOf(o)===0)return l})(s);if(r?.exposure==="derived"){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,s===ut?()=>this.wr():()=>!1))return;r.transformToEventProperties&&W(e,r.transformToEventProperties(t))}else r&&r.exposure!=="event"||(e[s]=t)}),e}load(){if(!this._r){var e=this.nr.F(this.yr);e&&(this.props=W({},e))}}save(){this._r||this.nr.N(this.yr,this.props,this.Sr,this.kr,this.Cr,this.qt.debug)}remove(){this.nr.q(this.yr,!1),this.nr.q(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,s){if(Y(e)){x(t)&&(t="None"),this.Sr=x(s)?this.Ir:s;var r=!1;if(H(e,(n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.Tr(a,n),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(Y(e)){this.Sr=x(t)?this.Ir:t;var s=!1;if(H(e,(r,n)=>{e.hasOwnProperty(n)&&this.props[n]!==r&&(this.Tr(n,r),s=!0)}),s)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Er(e),this.save())}update_campaign_params(){if(!this.mr){var e=Yn(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);lt(Ys(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=w?.referrer)?Jn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Kn(),$referring_domain:w!=null&&w.referrer&&((e=bi(w.referrer))==null?void 0:e.host)||xi},void 0)}set_initial_person_info(){this.props[Ps]||this.props[$s]||this.register_once({[gi]:Zn(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};H([$s,Ps],a=>{var o=this.props[a];o&&H(o,function(l,c){e["$initial_"+rs(c)]=l})});var t,s,r=this.props[gi];if(r){var n=(t=Qn(r),s={},H(t,function(a,o){s["$initial_"+rs(o)]=a}),s);W(e,n)}return e}safe_merge(e){return H(this.props,function(t,s){s in e||(e[s]=t)}),e}update_config(e,t,s){if(this.Ir=this.Sr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!s),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((a,o)=>{if(a.length!==o.length)return!1;var l=[...a].sort(),c=[...o].sort();return l.every((u,h)=>u===c[h])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.br(e),n=this.props;this.clear(),this.nr=r,this.props=n,this.save()}}set_disabled(e){this._r=e,this._r?this.remove():this.save()}set_cross_subdomain(e){e!==this.kr&&(this.kr=e,this.remove(),this.save())}set_secure(e){e!==this.Cr&&(this.Cr=e,this.remove(),this.save())}set_event_timer(e,t){var s=this.props[It]||{};s[e]=t,this.Tr(It,s),this.save()}remove_event_timer(e){var t=this.props[It]||{},s=t[e];return x(s)||(delete t[e],this.Tr(It,t),this.save()),s}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){this.props[e]=t}Er(e){delete this.props[e]}}var bt={Activation:"events",Cancellation:"cancelEvents"},Ui={Popover:"popover",API:"api",Widget:"widget"},Ct={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},zi={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Is={Popover:"popover",Inline:"inline"},Ao={SHOWN:"product tour shown"},xr={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Er=z("[RateLimiter]");class qo{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var s=t.text;
1if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(r=>{Er.info((r||"events")+" is quota limited."),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void Er.warn('could not rate limit - continuing. Error: "'+r?.message+'"',{text:s})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,s,r;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:a}=this,o=new Date().getTime(),l=(t=(s=this.instance.persistence)==null?void 0:s.get_property(Ss))!==null&&t!==void 0?t:{tokens:n,last:o};l.tokens+=(o-l.last)/1e3*a,l.last=o,l.tokens>n&&(l.tokens=n);var c=1>l.tokens;return c||e||(l.tokens=Math.max(0,l.tokens-1)),!c||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=c,(r=this.instance.persistence)==null||r.set_property(Ss,l),{isRateLimited:c,remainingTokens:l.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var wt=z("[RemoteConfig]");class ta{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Mr(e){var t,s;(t=F.__PosthogExtensions__)!=null&&t.loadExternalDependency?(s=F.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Pr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return wt.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Or();if(this._instance.Lr())return void wt.warn("Remote config is disabled. Falling back to local config.");this.Mr(e=>{if(!e)return wt.info("No config found after loading remote JS config. Falling back to JSON."),void this.Pr(t=>{this.Rr(t),this.Or()});this.Rr(e),this.Or()})}catch(e){wt.error("Error loading remote config",e)}}stop(){this.Fr&&(clearInterval(this.Fr),this.Fr=void 0)}refresh(){!this._instance.Lr()&&w&&w.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Or(){var e;if(!this.Fr){var t=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;t!==0&&(this.Fr=setInterval(()=>{this.refresh()},t))}}Rr(e){var t;e||wt.error("Failed to fetch remote config from PostHog."),this._instance.Rr(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}}var ke={GZipJS:"gzip-js",Base64:"base64"},_e=Uint8Array,le=Uint16Array,_t=Uint32Array,Xs=new _e([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]),Js=new _e([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]),kr=new _e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ia=function(i,e){for(var t=new le(31),s=0;31>s;++s)t[s]=e+=1<<i[s-1];var r=new _t(t[30]);for(s=1;30>s;++s)for(var n=t[s];t[s+1]>n;++n)r[n]=n-t[s]<<5|s;return[t,r]},sa=ia(Xs,2),Rs=sa[1];sa[0][28]=258,Rs[258]=28;for(var Sr=ia(Js,0)[1],ra=new le(32768),U=0;32768>U;++U){var tt=(43690&U)>>>1|(21845&U)<<1;ra[U]=((65280&(tt=(61680&(tt=(52428&tt)>>>2|(13107&tt)<<2))>>>4|(3855&tt)<<4))>>>8|(255&tt)<<8)>>>1}var At=function(i,e,t){for(var s=i.length,r=0,n=new le(e);s>r;++r)++n[i[r]-1];var a,o=new le(e);for(r=0;e>r;++r)o[r]=o[r-1]+n[r-1]<<1;for(a=new le(s),r=0;s>r;++r)a[r]=ra[o[i[r]-1]++]>>>15-i[r];return a},Je=new _e(288);for(U=0;144>U;++U)Je[U]=8;for(U=144;256>U;++U)Je[U]=9;for(U=256;280>U;++U)Je[U]=7;for(U=280;288>U;++U)Je[U]=8;var Ei=new _e(32);for(U=0;32>U;++U)Ei[U]=5;var Lo=At(Je,9),Do=At(Ei,5),na=function(i){return(i/8>>0)+(7&i&&1)},aa=function(i,e,t){(t==null||t>i.length)&&(t=i.length);
vendor: 4,742 bytes, line 1
1var s=new(i instanceof le?le:i instanceof _t?_t:_e)(t-e);return s.set(i.subarray(e,t)),s},Ie=function(i,e,t){var s=e/8>>0;i[s]|=t<<=7&e,i[s+1]|=t>>>8},xt=function(i,e,t){var s=e/8>>0;i[s]|=t<<=7&e,i[s+1]|=t>>>8,i[s+2]|=t>>>16},Vi=function(i,e){for(var t=[],s=0;i.length>s;++s)i[s]&&t.push({s,f:i[s]});var r=t.length,n=t.slice();if(!r)return[new _e(0),0];if(r==1){var a=new _e(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort(function(_,P){return _.f-P.f}),t.push({s:-1,f:25001});var o=t[0],l=t[1],c=0,u=1,h=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=r-1;)o=t[t[h].f>t[c].f?c++:h++],l=t[c!=u&&t[h].f>t[c].f?c++:h++],t[u++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new le(d+1),g=Ts(t[u-1],p,0);if(g>e){s=0;var f=0,I=g-e,S=1<<I;for(n.sort(function(_,P){return p[P.s]-p[_.s]||_.f-P.f});r>s;++s){var C=n[s].s;if(e>=p[C])break;f+=S-(1<<g-p[C]),p[C]=e}for(f>>>=I;f>0;){var $=n[s].s;e>p[$]?f-=1<<e-p[$]++-1:++s}for(;s>=0&&f;--s){var R=n[s].s;p[R]==e&&(--p[R],++f)}g=e}return[new _e(p),g]},Ts=function(i,e,t){return i.s==-1?Math.max(Ts(i.l,e,t+1),Ts(i.r,e,t+1)):e[i.s]=t},Pr=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new le(++e),s=0,r=i[0],n=1,a=function(l){t[s++]=l},o=1;e>=o;++o)if(i[o]==r&&o!=e)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=i[o]}return[t.subarray(0,s),e]},Et=function(i,e){for(var t=0,s=0;e.length>s;++s)t+=i[s]*e[s];return t},Cs=function(i,e,t){var s=t.length,r=na(e+2);i[r]=255&s,i[r+1]=s>>>8,i[r+2]=255^i[r],i[r+3]=255^i[r+1];for(var n=0;s>n;++n)i[r+n+4]=t[n];return 8*(r+4+s)},$r=function(i,e,t,s,r,n,a,o,l,c,u){Ie(e,u++,t),++r[256];for(var h=Vi(r,15),d=h[0],p=h[1],g=Vi(n,15),f=g[0],I=g[1],S=Pr(d),C=S[0],$=S[1],R=Pr(f),_=R[0],P=R[1],k=new le(19),E=0;C.length>E;++E)k[31&C[E]]++;for(E=0;_.length>E;++E)k[31&_[E]]++;for(var y=Vi(k,7),T=y[0],O=y[1],q=19;q>4&&!T[kr[q-1]];--q);var M,A,J,Z,ue=c+5<<3,re=Et(r,Je)+Et(n,Ei)+a,G=Et(r,d)+Et(n,f)+a+14+3*q+Et(k,T)+(2*k[16]+3*k[17]+7*k[18]);if(re>=ue&&G>=ue)return Cs(e,u,i.subarray(l,l+c));if(Ie(e,u,1+(re>G)),u+=2,re>G){M=At(d,p),A=d,J=At(f,I),Z=f;var ve=At(T,O);for(Ie(e,u,$-257),Ie(e,u+5,P-1),Ie(e,u+10,q-4),u+=14,E=0;q>E;++E)Ie(e,u+3*E,T[kr[E]]);u+=3*q;for(var te=[C,_],Fe=0;2>Fe;++Fe){var ce=te[Fe];for(E=0;ce.length>E;++E)Ie(e,u,ve[ye=31&ce[E]]),u+=T[ye],ye>15&&(Ie(e,u,ce[E]>>>5&127),u+=ce[E]>>>12)}}else M=Lo,A=Je,J=Do,Z=Ei;for(E=0;o>E;++E)if(s[E]>255){var ye;xt(e,u,M[257+(ye=s[E]>>>18&31)]),u+=A[ye+257],ye>7&&(Ie(e,u,s[E]>>>23&31),u+=Xs[ye]);var be=31&s[E];xt(e,u,J[be]),u+=Z[be],be>3&&(xt(e,u,s[E]>>>5&8191),u+=Js[be])}else xt(e,u,M[s[E]]),u+=A[s[E]];return xt(e,u,M[256]),u+A[256]},No=new _t([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jo=function(){for(var i=new _t(256),e=0;256>e;++e){for(var t=e,s=9;--s;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),Bi=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8};function Ho(i,e){e===void 0&&(e={});var t=function(){var h=4294967295;return{p(d){for(var p=h,g=0;d.length>g;++g)p=jo[255&p^d[g]]^p>>>8;h=p},d(){return 4294967295^h}}}(),s=i.length;t.p(i);var r,n,a,o,l,c=(o=10+((r=e).filename&&r.filename.length+1||0),l=8,function(h,d,p,g,f,I){var S=h.length,C=new _e(g+S+5*(1+Math.floor(S/7e3))+f),$=C.subarray(g,C.length-f),R=0;if(!d||8>S)for(var _=0;S>=_;_+=65535){var P=_+65535;S>P?R=Cs($,R,h.subarray(_,P)):($[_]=!0,R=Cs($,R,h.subarray(_,S)))}else{for(var k=No[d-1],E=k>>>13,y=8191&k,T=(1<<p)-1,O=new le(32768),q=new le(T+1),M=Math.ceil(p/3),A=2*M,J=function(Ti){return(h[Ti]^h[Ti+1]<<M^h[Ti+2]<<A)&T},Z=new _t(25e3),ue=new le(288),re=new le(32),G=0,ve=0,te=(_=0,0),Fe=0,ce=0;S>_;++_){var ye=J(_),be=32767&_,Ze=q[ye];if(O[be]=Ze,q[ye]=be,_>=Fe){var Vt=S-_;if((G>7e3||te>24576)&&Vt>423){R=$r(h,$,0,Z,ue,re,ve,te,ce,_-ce,R),te=G=ve=0,ce=_;for(var we=0;286>we;++we)ue[we]=0;for(we=0;30>we;++we)re[we]=0}var He=2,Bt=0,wa=y,Le=be-Ze&32767;if(Vt>2&&ye==J(_-Le))for(var xa=Math.min(E,Vt)-1,Ea=Math.min(32767,_),ka=Math.min(258,Vt);Ea>=Le&&--wa&&be!=Ze;){if(h[_+He]==h[_+He-Le]){for(var De=0;ka>De&&h[_+De]==h[_+De-Le];++De);if(De>He){if(He=De,Bt=Le,De>xa)break;var Sa=Math.min(Le,De-2),er=0;for(we=0;Sa>we;++we){var Ri=_-Le+we+32768&32767,tr=Ri-O[Ri]+32768&32767;tr>er&&(er=tr,Ze=Ri)}}}Le+=(be=Ze)-(Ze=O[be])+32768&32767}if(Bt){Z[te++]=268435456|Rs[He]<<18|Sr[Bt];var ir=31&Rs[He],sr=31&Sr[Bt];ve+=Xs[ir]+Js[sr],++ue[257+ir],++re[sr],Fe=_+He,++G}else Z[te++]=h[_],++ue[h[_]]}}R=$r(h,$,!0,Z,ue,re,ve,te,ce,_-ce,R)}return aa(C,0,g+na(R)+f)}(n=i,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+a.mem,o,l)),u=c.length;return function(h,d){var p=d.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>
1d.level?4:d.level==9?2:0,h[9]=3,d.mtime!=0&&Bi(h,4,Math.floor(new Date(d.mtime||Date.now())/1e3)),p){h[3]=8;for(var g=0;p.length>=g;++g)h[g+10]=p.charCodeAt(g)}}(c,e),Bi(c,u-8,t.d()),Bi(c,u-4,s),c}var Uo=!!ts||!!es,oa="text/plain",ni=!1,zo=(i,e)=>{var[t,s]=i.split("#"),[r,n]=t.split("?");if(!n)return i;var a=n.split("&").filter(o=>o.split("=")[0]!==e).join("&");return r+(a?"?"+a:"")+(s?"#"+s:"")},Fi=function(i,e,t){var s;t===void 0&&(t=!0);var[r,n]=i.split("?"),a=m({},e),o=(s=n?.split("&").map(c=>{var u,[h,d]=c.split("="),p=t&&(u=a[h])!==null&&u!==void 0?u:d;return delete a[h],h+"="+p}))!==null&&s!==void 0?s:[],l=function(c,u){var h,d;u===void 0&&(u="&");var p=[];return H(c,function(g,f){x(g)||x(f)||f==="undefined"||(h=encodeURIComponent((I=>I instanceof File)(g)?g.name:g.toString()),d=encodeURIComponent(f),p[p.length]=d+"="+h)}),p.join(u)}(a);return l&&o.push(l),r+"?"+o.join("&")},ct=(i,e)=>JSON.stringify(i,(t,s)=>typeof s=="bigint"?s.toString():s,e),Fr=i=>{if(i.tr)return i.tr;var{data:e,compression:t}=i;if(e){if(t===ke.GZipJS){var s=Ho(function(o,l){var c=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var u=new _e(o.length+(o.length>>>1)),h=0,d=function(I){u[h++]=I},p=0;c>p;++p){if(h+5>u.length){var g=new _e(h+8+(c-p<<1));g.set(u),u=g}var f=o.charCodeAt(p);128>f?d(f):2048>f?(d(192|f>>>6),d(128|63&f)):f>55295&&57344>f?(d(240|(f=65536+(1047552&f)|1023&o.charCodeAt(++p))>>>18),d(128|f>>>12&63),d(128|f>>>6&63),d(128|63&f)):(d(224|f>>>12),d(128|f>>>6&63),d(128|63&f))}return aa(u,0,h)}(ct(e)),{mtime:0});return{contentType:oa,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(t===ke.Base64){var r=function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,c)=>String.fromCharCode(parseInt(c,16))))}(ct(e)),n=(o=>"data="+encodeURIComponent(typeof o=="string"?o:ct(o)))(r);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var a=ct(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Wi=i=>{var e,t,s,r=Fr(i);return!r||(t=i.compression,s=jt(i.url,"compression"),t!==or.GZipJS&&s!==or.GZipJS&&s!=="gzip")||((e=r.body)instanceof ArrayBuffer?is(new Uint8Array(e)):ArrayBuffer.isView(e)&&is(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))?{url:i.url,encodedBody:r}:(ni=!0,{url:zo(i.url,"compression"),encodedBody:Fr(m({},i,{compression:void 0,tr:void 0}))})},Vo=function(){var i=he(function*(e){var t=ct(e.data),s=yield function(n,a,o){return ss.apply(this,arguments)}(t,ae.DEBUG,{rethrow:!0});if(!s)return e;var r=yield s.arrayBuffer();return m({},e,{tr:{contentType:oa,body:r,estimatedSize:r.byteLength}})});return function(e){return i.apply(this,arguments)}}(),Ir=(i,e)=>Fi(i,{_:new Date().getTime().toString(),ver:ae.JS_SDK_VERSION,compression:e}),ai=[];es&&ai.push({transport:"fetch",method(i){var e,{url:t,encodedBody:s}=Wi(i),{contentType:r,body:n,estimatedSize:a}=s??{},o=new Headers;H(i.headers,function(u,h){o.append(h,u)}),r&&o.append("Content-Type",r);var l=null;if(rr){var c=new rr;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}es(t,m({method:i?.method||"GET",headers:o,keepalive:i.method==="POST"&&52428.8>(a||0),body:n,signal:(e=l)==null?void 0:e.signal},i.fetchOptions)).then(u=>u.text().then(h=>{var d={statusCode:u.status,text:h};if(u.status===200)try{d.json=JSON.parse(h)}catch(p){b.error(p)}i.callback==null||i.callback(d)})).catch(u=>{b.error(u),i.callback==null||i.callback({statusCode:0,error:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),ts&&ai.push({transport:"XHR",method(i){var e=new ts,{url:t,encodedBody:s}=Wi(i);e.open(i.method||"GET",t,!0);var{contentType:r,body:n}=s??{};H(i.headers,function(a,o){e.setRequestHeader(o,a)}),r&&e.setRequestHeader("Content-Type",r),i.timeout&&(e.timeout=i.timeout),i.disableXHRCredentials||(e.withCredentials=!0),e.onreadystatechange=()=>{if(e.readyState===4){var a={statusCode:e.status,text:e.responseText};if(e.status===200)try{a.json=JSON.parse(e.responseText)}catch{}i.callback==null||i.callback(a)}},e.send(n)}}),de!=null&&de.sendBeacon&&ai.push({transport:"sendBeacon",method(i){try{var{url:e,encodedBody:t}=Wi(i),s=Fi(e,{beacon:"1"}),{contentType:r,body:n}=t??{};if(!n)return;var a=n instanceof Blob?n:new Blob([n],{type:r});de.sendBeacon(s,a)}catch{}}});var Os=3e3;class Bo{constructor(e,t){this.Ar=!0,this.Nr=[],this.$r=$e(t?.flush_interval_ms||Os,250,5e3,b.createLogger("flush interval"),Os),this.Dr=e}enqueue(e){this.Nr.push(e),this.qr||this.jr()}unload(){this.Hr();var e=this.Nr.length>0?this.Ur():{},t=Object.values(e);[...t.filter(s=>s.url.indexOf("/e")===0),...t.filter(s=>s.url.indexOf("/e")!==0)].map(s=>{this.Dr(m({},s,{transport:"sendBeacon"}))})}enable(){this.Ar=!1,this.jr()}jr(){var e=this;this.Ar||(this.qr=setTimeout(()=>{if(this.Hr(),this.Nr.length>0){var t=this.Ur(),s=function(){var n=t[r],a=new Date().getTime();n.data&&N(n.data)&&H(n.data,o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp}
1),e.Dr(n)};for(var r in t)s()}},this.$r))}Hr(){clearTimeout(this.qr),this.qr=void 0}Ur(){var e={};return H(this.Nr,t=>{var s,r=t,n=(r?r.batchKey:null)||r.url;x(e[n])&&(e[n]=m({},r,{data:[]})),(s=e[n].data)==null||s.push(r.data)}),this.Nr=[],e}}var Wo=["retriesPerformedSoFar"];class Go{constructor(e){this.Br=!1,this.zr=3e3,this.Nr=[],this._instance=e,this.Nr=[],this.Vr=!0,!x(v)&&"onLine"in v.navigator&&(this.Vr=v.navigator.onLine,this.Wr=()=>{this.Vr=!0,this.Zr()},this.Gr=()=>{this.Vr=!1},X(v,"online",this.Wr),X(v,"offline",this.Gr))}get length(){return this.Nr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,s=ln(e,Wo);rt(t)&&(s.url=Fi(s.url,{retry_count:t})),this._instance._send_request(m({},s,{callback:r=>{r.statusCode===200||r.statusCode>=400&&500>r.statusCode||(t??0)>=10?s.callback==null||s.callback(r):this.Qr(m({retriesPerformedSoFar:t},s))}}))}Qr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var s=function(a){var o=3e3*Math.pow(2,a),l=o/2,c=Math.min(18e5,o),u=Math.random()-.5;return Math.ceil(c+u*(c-l))}(t),r=Date.now()+s;this.Nr.push({retryAt:r,requestOptions:e});var n="Enqueued failed request for retry in "+s;navigator.onLine||(n+=" (Browser is offline)"),b.warn(n),this.Br||(this.Br=!0,this.Jr())}Jr(){if(this.Kr&&clearTimeout(this.Kr),this.Nr.length===0)return this.Br=!1,void(this.Kr=void 0);this.Kr=setTimeout(()=>{this.Vr&&this.Nr.length>0&&this.Zr(),this.Jr()},this.zr)}Zr(){var e=Date.now(),t=[],s=this.Nr.filter(n=>e>n.retryAt||(t.push(n),!1));if(this.Nr=t,s.length>0)for(var{requestOptions:r}of s)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Kr&&(clearTimeout(this.Kr),this.Kr=void 0),this.Br=!1,x(v)||(this.Wr&&(v.removeEventListener("online",this.Wr),this.Wr=void 0),this.Gr&&(v.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Nr))try{this._instance._send_request(m({},e,{transport:"sendBeacon"}))}catch(t){b.error(t)}this.Nr=[]}}class Yo{constructor(e){this.Yr=()=>{var t,s,r,n;this.Xr||(this.Xr={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=o+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Xr.lastScrollY=Math.ceil(o),this.Xr.maxScrollY=Math.max(o,(t=this.Xr.maxScrollY)!==null&&t!==void 0?t:0),this.Xr.maxScrollHeight=Math.max(l,(s=this.Xr.maxScrollHeight)!==null&&s!==void 0?s:0),this.Xr.lastContentY=c,this.Xr.maxContentY=Math.max(c,(r=this.Xr.maxContentY)!==null&&r!==void 0?r:0),this.Xr.maxContentHeight=Math.max(u,(n=this.Xr.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Xr}resetContext(){var e=this.Xr;return setTimeout(this.Yr,0),e}startMeasuringScrollPosition(){X(v,"scroll",this.Yr,{capture:!0}),X(v,"scrollend",this.Yr,{capture:!0}),X(v,"resize",this.Yr)}scrollElement(){if(!this.ei)return v?.document.documentElement;var e=N(this.ei)?this.ei:[this.ei];for(var t of e){var s=v?.document.querySelector(t);if(s)return s}}scrollY(){if(this.ei){var e=this.scrollElement();return e&&e.scrollTop||0}return v&&(v.scrollY||v.pageYOffset||v.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var e=this.scrollElement();return e&&e.scrollLeft||0}return v&&(v.scrollX||v.pageXOffset||v.document.documentElement.scrollLeft)||0}}var Xo=i=>Zn(i?.config.mask_personal_data_properties,i?.config.custom_personal_data_properties);class Rr{constructor(e,t,s,r){this.ti=n=>{var a=this.ri();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.ii(this._instance)};this.ni.register({[ks]:o})}},this._instance=e,this.si=t,this.ni=s,this.ii=r||Xo,this.si.onSessionId(this.ti)}ri(){return this.ni.props[ks]}getSetOnceProps(){var e,t=(e=this.ri())==null?void 0:e.props;return t?"r"in t?Qn(t):{$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 H(Ys(this.getSetOnceProps()),(t,s)=>{s==="$current_url"&&(s="url"),e["$session_entry_"+rs(s)]=t}),e}}class Ks{constructor(){this.oi={}}on(e,t){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(t),()=>{this.oi[e]=this.oi[e].filter(s=>s!==t)}}emit(e,t){for(var s of this.oi[e]||[])s(t);for(var r of this.oi["*"]||[])r(e,t)}}var Gi=z("[SessionId]");class Tr{on(e,t){return this.ai.on(e,t)}constructor(e,t,s){var r;if(this.ui=[],this.li=void 0,this.ai=new Ks,this.hi=(c,u)=>
1!(!rt(c)||!rt(u))&&Math.abs(c-u)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Me)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=e.config,this.ni=e.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=t||je,this.fi=s||je;var n=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*$e(this.qt.session_idle_timeout_seconds||1800,60,36e3,Gi.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+n+"_window_id",this.mi="ph_"+n+"_primary_window_exists",this.yi()){var a=ee.F(this.gi),o=ee.F(this.mi);a&&!o?this.ci=a:ee.q(this.gi),ee.N(this.mi,!0)}if((r=this.qt.bootstrap)!=null&&r.sessionID)try{var l=(c=>{var u=this.qt.bootstrap.sessionID.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})();this.bi(this.qt.bootstrap.sessionID,new Date().getTime(),l)}catch(c){Gi.error("Invalid sessionID in bootstrap",c)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return x(this.ui)&&(this.ui=[]),this.ui.push(e),this.di&&e(this.di,this.ci),()=>{this.ui=this.ui.filter(t=>t!==e)}}yi(){return this.qt.persistence!=="memory"&&!this.ni._r&&ee.R()}xi(e){e!==this.ci&&(this.ci=e,this.yi()&&ee.N(this.gi,e))}Si(){return this.ci?this.ci:this.yi()?ee.F(this.gi):null}bi(e,t,s){e===this.di&&t===this._sessionActivityTimestamp&&s===this._sessionStartTimestamp||(this._sessionStartTimestamp=s,this._sessionActivityTimestamp=t,this.di=e,this.ni.register({[pi]:[t,e,s]}))}ki(){var e=this.ni.props[pi];return N(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.Ci),this.Ci=void 0,this.li&&v&&(v.removeEventListener(mi,this.li,{capture:!1}),this.li=void 0),this.ui=[]}wi(){this.li=()=>{this.yi()&&ee.q(this.mi)},X(v,mi,this.li,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.qt.cookieless_mode===Me)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=t||new Date().getTime(),[r,n,a]=this.ki(),o=this.Si(),l=rt(a)&&Math.abs(s-a)>864e5,c=!1,u=!n,h=!u&&!e&&this.hi(s,r);u||h||l?(n=this.vi(),o=this.fi(),Gi.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}}),a=s,c=!0):o||(o=this.fi(),c=!0);var d=rt(r)&&e&&!l?r:s,p=rt(a)?a:new Date().getTime();return this.xi(o),this.bi(n,d,p),e||this.pi(),c&&this.ui.forEach(g=>g(n,o,c?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}pi(){clearTimeout(this.Ci),this.Ci=setTimeout(()=>{var[e]=this.ki();if(this.hi(new Date().getTime(),e)){var t=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var la=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&ur(t,e))return!0;try{var s=i?.userAgentData;if(s!=null&&s.brands&&s.brands.some(r=>ur(r?.brand,e)))return!0}catch{}return!!i.webdriver},ki=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function Cr(i,e,t){return ct({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var ua={exact:(i,e)=>e.some(t=>i.some(s=>t===s)),is_not:(i,e)=>e.every(t=>i.every(s=>t!==s)),regex:(i,e)=>e.some(t=>i.some(s=>ki(t,s))),not_regex:(i,e)=>e.every(t=>i.every(s=>!ki(t,s))),icontains:(i,e)=>e.map(Qt).some(t=>i.map(Qt).some(s=>t.includes(s))),not_icontains:(i,e)=>e.map(Qt).every(t=>i.map(Qt).every(s=>!t.includes(s))),gt:(i,e)=>e.some(t=>{var s=parseFloat(t);return!isNaN(s)&&i.some(r=>s>parseFloat(r))}),lt:(i,e)=>e.some(t=>{var s=parseFloat(t);return!isNaN(s)&&i.some(r=>s<parseFloat(r))})},Qt=i=>i.toLowerCase();function ca(i,e){return!i||Object.entries(i).every(t=>{var[s,r]=t,n=e?.[s];if(x(n)||qe(n))return!1;var a=[String(n)],o=ua[r.operator];return!!o&&o(r.values,a)})}var Ms="custom",Or="i.posthog.com",Jo=/^\/static\//;class Ko{constructor(e){this.Ii={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"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=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Or,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Ii[this.apiHost]||(this.Ii[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ms),this.Ii[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof t=="string"&&Jo.test(e))return t.trim().replace(/\/$/,"")||void 0}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(e==="assets"){var s=this.Ti(t);if(s)return""+s+t}if(this.region===Ms)return this.apiHost+t;var r=Or+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var j=z("[Surveys]"),As="seenSurvey_",Zo=[Ui.Popover,Ui.Widget,Ui.API],Qo={ignoreConditions:!1,ignoreDelay:!1,displayType:Is.Popover}
1,el=z("[PostHog ExternalIntegrations]"),tl={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class il{constructor(e){this._instance=e}lr(e,t){var s;(s=F.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,e,r=>{if(r)return el.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(a){var o,l,c;!r||(o=F.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.lr(tl[a],()=>{var u;(u=F.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)}),!r&&(l=F.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=F.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[s,r]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;t(s)}}}var it,qt={},Yi=0,qs=()=>{},Mr='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',kt="Surveys module not available",Ar="sanitize_properties is deprecated. Use before_send instead",ha="Invalid value for property_denylist config: ",ot="posthog",da=!Uo&&oe?.indexOf("MSIE")===-1&&oe?.indexOf("Mozilla")===-1,qr=i=>{var e;return m({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:mo(w?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:qs,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:i??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:Q&&B(Q?.search)&&Q.search.indexOf("__posthog_debug=true")!==-1||!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,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(v==null||(e=v.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){b.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Fs,before_send:void 0,request_queue_config:{flush_interval_ms:Os},error_tracking:{},_onCapture:qs,__preview_eager_load_replay:!1},(t=>({rageclick:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(i))},sl=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],Lr=i=>{var e={};for(var[t,s]of sl)x(i[t])||(e[s]=i[t]);var r=W({},e,i);return N(i.property_blacklist)&&(x(i.property_denylist)?r.property_denylist=i.property_blacklist:N(i.property_denylist)?r.property_denylist=[...i.property_blacklist,...i.property_denylist]:b.error(ha+i.property_denylist)),r};class rl{constructor(){this.__forceAllowLocalhost=!1}get Ei(){return this.__forceAllowLocalhost}set Ei(e){b.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class fe{Mi(e,t){if(e){var s=this.Pi.indexOf(e);s!==-1&&this.Pi.splice(s,1)}return this.Pi.push(t),t.initialize==null||t.initialize(),t}Ri(){return this.config.cookieless_mode===Me||this.config.cookieless_mode===Ge&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new rl,this.Oi=!1,this.version=ae.LIB_VERSION,this.Li=new Ks,this.Pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=qr(),this.SentryIntegration=Fo,this.sentryIntegration=s=>function(r,n){var a=Gn(r,n);return{name:Wn,processEvent:o=>a(o)}}(this,s),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fi=!1,this.Ai=null,this.Ni=null,this.$i=null,this.scrollManager=new Yo(this),this.pageViewM
1anager=new br(this),this.rateLimiter=new qo(this),this.requestRouter=new Ko(this),this.consent=new So(this),this.externalIntegrations=new il(this);var t=(e=fe.__defaultExtensionClasses)!==null&&e!==void 0?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.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(s,r,n)=>{var a=B(s)?{[s]:r}:s;this.setPersonProperties(a),n?.({})},set_once:(s,r,n)=>{var a=B(s)?{[s]:r}:s;this.setPersonProperties(void 0,a),n?.({})}},this.on("eventCaptured",s=>b.info('send "'+s?.event+'"',s))}init(e,t,s){if(s&&s!==ot){var r,n=(r=qt[s])!==null&&r!==void 0?r:new fe;return n._init(e,t,s),qt[s]=n,qt[ot][s]=n,n}return this._init(e,t,s)}_init(e,t,s){var r,n;if(t===void 0&&(t={}),x(e)||ti(e))return b.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Di(t.debug),this.qi=t,this.ji=[],t.person_profiles?this.Ni=t.person_profiles:t.process_person&&(this.Ni=t.process_person),this.set_config(W({},qr(t.defaults),Lr(t),{name:s,token:e})),this.config.on_xhr_error&&b.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:ke.GZipJS;var a=this.Hi();this.persistence=new Hi(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Hi(m({},this.config,{persistence:"sessionStorage"}),a);var o=m({},this.persistence.props),l=m({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Ui=new Bo(I=>this.Bi(I),this.config.request_queue_config),this.zi=new Go(this),this.__request_queue=[];var c=this.Ri();if(c||(this.sessionManager=new Tr(this),this.sessionPropsManager=new Rr(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(b.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Vi(c)},0)):(b.info("Initializing extensions synchronously"),this.Vi(c)),ae.DEBUG=ae.DEBUG||this.config.debug,ae.DEBUG&&b.info("Starting in debug mode",{this:this,config:t,thisC:m({},this.config),p:o,s:l}),!this.config.identity_distinct_id||(r=t.bootstrap)!=null&&r.distinctID||(t.bootstrap=m({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((n=t.bootstrap)==null?void 0:n.distinctID)!==void 0){var u=t.bootstrap.distinctID,h=this.get_distinct_id(),d=this.persistence.get_property(xe);if(t.bootstrap.isIdentifiedID&&h!=null&&h!==u&&d===Qe)this.identify(u);else if(t.bootstrap.isIdentifiedID&&h!=null&&h!==u&&d===et)b.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 p=this.config.get_device_id(je()),g=t.bootstrap.isIdentifiedID?p:u;this.persistence.set_property(xe,t.bootstrap.isIdentifiedID?et:Qe),this.register({distinct_id:u,$device_id:g})}}if(c)this.register_once({distinct_id:Yt,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(je());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(xe,Qe)}return X(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(I,S){var C=I.config.segment;if(!C)return S();(function($,R){var _=$.config.segment;if(!_)return R();var P=E=>{var y=()=>E.anonymousId()||je();$.config.get_device_id=y,E.id()&&($.register({distinct_id:E.id(),$device_id:y()}),$.persistence.set_property(xe,et)),R()},k=_.user();"then"in k&&Oe(k.then)?k.then(P):P(k)})(I,()=>{C.register(($=>{Promise&&Promise.resolve||ji.warn("This browser does not have Promise support, and can not use the segment integration");var R=(_,P)=>{if(!P)return _;_.event.userId||_.event.anonymousId===$.get_distinct_id()||(ji.info("No userId set, resetting PostHog"),$.reset()),_.event.userId&&_.event.userId!==$.get_distinct_id()&&(ji.info("UserId set, identifying with PostHog"),$.identify(_.event.userId)
1);var k=$.calculateEventProperties(P,_.event.properties);return _.event.properties=Object.assign({},k,_.event.properties),_};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:_=>R(_,_.event.event),page:_=>R(_,at),identify:_=>R(_,Di),screen:_=>R(_,"$screen")}})(I)).then(()=>{S()})})}(this,()=>this.Wi()):this.Wi(),Oe(this.config._onCapture)&&this.config._onCapture!==qs&&(b.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",I=>this.config._onCapture(I.event,I))),this.config.ip&&b.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}Vi(e){var t,s,r,n,a,o,l,c=performance.now(),u=m({},fe.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.featureFlags&&this.Pi.push(this.featureFlags=(t=this.featureFlags)!==null&&t!==void 0?t:new u.featureFlags(this)),u.exceptions&&this.Pi.push(this.exceptions=(s=this.exceptions)!==null&&s!==void 0?s:new u.exceptions(this)),u.historyAutocapture&&this.Pi.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Pi.push(new u.tracingHeaders(this)),u.siteApps&&this.Pi.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.Pi.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Pi.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Pi.push(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new u.surveys(this)),u.logs&&this.Pi.push(this.logs=(n=this.logs)!==null&&n!==void 0?n:new u.logs(this)),u.conversations&&this.Pi.push(this.conversations=(a=this.conversations)!==null&&a!==void 0?a:new u.conversations(this)),u.productTours&&this.Pi.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Pi.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Pi.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Pi.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Pi.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,$o)),u.toolbar&&this.Pi.push(this.toolbar=(o=this.toolbar)!==null&&o!==void 0?o:new u.toolbar(this)),u.experiments&&this.Pi.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new u.experiments(this)),this.Pi.forEach(d=>{d.initialize&&h.push(()=>{d.initialize==null||d.initialize()})}),h.push(()=>{if(this.Zi){var d=this.Zi;this.Zi=void 0,this.Rr(d)}}),this.Gi(h,c)}Gi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Gi(e,t)},0);var s=e.shift();if(s)try{s()}catch(n){b.error("Error initializing extension:",n)}}var r=Math.round(performance.now()-t);this.register_for_session({[Hn]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Un]:r}),this.config.__preview_deferred_init_extensions&&b.info("PostHog extensions initialized ("+r+"ms)")}Rr(e){var t;if(!w||!w.body)return b.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Rr(e)},500);this.config.__preview_deferred_init_extensions&&(this.Zi=e),this.Qi=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=L(e.supportedCompression,ke.GZipJS)?ke.GZipJS:L(e.supportedCompression,ke.Base64)?ke.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Ni?this.Ni:Fs}),this.Pi.forEach(s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e))}Wi(){try{this.config.loaded(this)}catch(s){b.critical("`loaded` function failed",s)}if(this.Ji(),this.config.internal_or_test_user_hostname&&Q!=null&&Q.hostname){var e=Q.hostname,t=this.config.internal_or_test_user_hostname;(typeof t=="string"?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Ri())&&this.Ki()},1),this.Yi=new ta(this),this.Yi.load()}Ji(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Ui)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Xt(this.__request_queue,e=>this.Bi(e)),this.__request_queue=[],this.Ji()}_handle_unload(){var e,t,s,r;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.Xi()&&this.capture(Li),(t=this.logs)==null||t.flushLogs("sendBeacon"),(s=this.Ui)==null||s.unload(),(r=this.zi)==null||r.unload()):this.Xi()&&this.capture(Li,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(da?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Fi(e.url,{ip:this.config.ip?1:0}),e.headers=m({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(t=>{var s,r,n,a=m({},t);a.timeout=a.timeout||6e4,a.url=Ir(a.url,a.compression);var o=(s=a.transport)!==null&&s!==void 0?s:"fetch",l=ai.filter(u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport)),c=(r=(n=function(u,h){for(var d=0;u.length>d;d++)if(u[d].transport===o)return u[d]}(l))==null?void 0:n.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");o!=="sendBeacon"&&a.data&&a.compression===ke.GZipJS&&Pa&&!ni?Vo(a).then(u=>{c(u)}).catch(u=>{if(lr(u))return ni=!0,void c(m({},a,{compression:void 0,url:Ir(t.url,void 0)}));(h=>{if(!h||typeof h!="object")return!1;var d="name"in h?String(h.name):"";return lr(h)||d===un})(u)&&(ni=!0),c(a)}):c(a)})(m({},e,{callback:t=>{var s,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(s=(r=this.config).on_request_error)==null||s.call(r,t),e.callback==null||e.callback(t)}}))))}Bi(e){this.zi?this.zi.retriableRequest(e):this._send_request(e)}_execute_array(e){Yi++;try{var t,s=[],r=[],n=[];Xt(e,o=>{if(o)if(N(t=o[0]))n.push(o);else if(Oe(o))try{o.call(this)}catch(l){b.error("Error executing queued PostHog call",o,l)}else N(o)&&t==="alias"?s.push(o):N(o)&&t.indexOf("capture")!==-1&&Oe(this[t])?n.push(o):r.push(o)});var a=function(o,l){Xt(o,function(c){try{if(N(c[0])){var u=l;H(c,function(h){u=u[h[0]].apply(u,h.slice(1))})}else l[c[0]].apply(l,c.slice(1))}catch(h){b.error("Error executing queued PostHog call",c,h)}})};a(s,this),a(r,this),a(n,this)}finally{Yi--}}push(e){if(Yi>0&&N(e)&&B(e[0])){var t=fe.prototype[e[0]];Oe(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,s){var r,n,a,o,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ui){if(this.is_capturing())if(!x(e)&&B(e)){var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var u=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(u==null||!u.isRateLimited){t!=null&&t.$current_url&&!B(t?.$current_url)&&(b.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!=="$exception"||s!=null&&s.en||b.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,d=s?.timestamp||h,p=s?.uuid||je(),g={uuid:p,event:e,properties:this.calculateEventProperties(e,t||{},d,p)};e===at&&this.config.__preview_capture_bot_pageviews&&c&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),u&&(g.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),s?.$set&&(g.$set=s?.$set);var f,I,S,C=this.tn(s?.$set_once,e!==fr,e===Di);if(C&&(g.$set_once=C),s!=null&&s._noTruncate||(n=this.config.properties_string_max_length,a=g,o=y=>B(y)?y.slice(0,n):y,l=new Set,g=function y(T,O){return T!==Object(T)?o?o(T):T:l.has(T)?void 0:(l.add(T),N(T)?(q=[],Xt(T,M=>{q.push(y(M))})):(q={},H(T,(M,A)=>{l.has(M)||(q[A]=y(M))})),q);var q}(a)),g.timestamp=d,x(s?.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=h),e===Ct.DISMISSED||e===Ct.SENT){var $=t?.[zi.SURVEY_ID],R=t?.[zi.SURVEY_ITERATION];(y=>{try{var T=(O=>((q,M)=>{var A=""+As+M.id;return M.current_iteration&&M.current_iteration>0&&(A=""+As+M.id+"_"+M.current_iteration),A})(0,O))(y);if(localStorage.getItem(T))return;localStorage.setItem(T,"true")}catch(O){j.error("Failed to persist survey seen state",O)}})({id:$,current_iteration:R}),g.$set=m({},g.$set,{[(f={id:$,current_iteration:R},I=e===Ct.SENT?"responded":"dismissed",S="$survey_"+I+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(S="$survey_"+I+"/"+f.id+"/"+f.current_iteration),S)]:!0})}else e===Ct.SHOWN&&(g.$set=m({},g.$set,{[zi.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===Ao.SHOWN){var _=t?.[xr.TOUR_TYPE];_&&(g.$set=m({},g.$set,{[xr.TOUR_LAST_SEEN_DATE+"/"+_]:new Date().toISOString()}))}var P=m({},g.properties.$set,g.$set);if(lt(P)||this.setPersonPropertiesForFlags(P),!D(this.config.before_send)){var k=this.rn(g);if(!k)return;g=k}this.Li.emit("eventCaptured",g);var E={method:"POST",url:(r=s?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:g,compression:"best-available",batchKey:s?._batchKey,transport:s?.transport};return!this.config.request_batching||s&&(s==null||!s._batchKey)||s!=null&&s.send_instantly?this.Bi(E):this.Ui.enqueue(E),g}b.critical("This capture call is ignored due to client rate limiting.")}}else b.error("No event name provided to posthog.capture")}else b.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,s,r,n){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=m({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.Ri()&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=m({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!B(o.distinct_id)&&!me(o.distinct_id)||ti(o.distinct_id))&&b.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,u=function(S,C){var $,R,_,P;if(!oe)return{};var k,E,y,T,O,q,M,A,J=S?[...ft,...C||[]]:[],[Z,ue]=function(re){for(var G=0;dr.length>G;G++){var[ve,te]=dr[G],Fe=ve.exec(re),ce=Fe&&(Oe(te)?te(Fe,re):te);if(ce)return ce}return["",""]}(oe);return W(Ys({$os:Z,$os_version:ue,$browser:In(oe,navigator.vendor),$device:pr(oe),$device_type:(E=oe,y={userAgentDataPlatform:($=navigator)==null||($=$.userAgentData)==null?void 0:$.platform,maxTouchPoints:(R=navigator)==null?void 0:R.maxTouchPoints,screenWidth:v==null||(_=v.screen)==null?void 0:_.width,screenHeight:v==null||(P=v.screen)==null?void 0:P.height,devicePixelRatio:v?.devicePixelRatio},A=pr(E),A===vn||A===pn||A==="Kobo"||A==="Kindle Fire"||A===$n?pt:A===Dt||A===dt||A===Nt||A===as?"Console":A===fn?"Wearable":A?pe:y?.userAgentDataPlatform==="Android"&&((T=y?.maxTouchPoints)!==null&&T!==void 0?T:0)>0?600>Math.min((O=y?.screenWidth)!==null&&O!==void 0?O:0,(q=y?.screenHeight)!==null&&q!==void 0?q:0)/((M=y?.devicePixelRatio)!==null&&M!==void 0?M:1)?pe:pt:"Desktop"),$timezone:ea(),$timezone_offset:Oo()}),{$current_url:Ht(Q?.href,J,Ut),$host:Q?.host,$pathname:Q?.pathname,$raw_user_agent:oe.length>1e3?oe.substring(0,997)+"...":oe,$browser_version:za(oe,navigator.vendor),$browser_language:wr(),$browser_language_prefix:(k=wr(),typeof k=="string"?k.split("-")[0]:void 0),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHe
1ight,$viewport_width:v?.innerWidth,$lib:ae.LIB_NAME,$lib_version:ae.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(n,s.getTime());o.$session_id=h,o.$window_id=d}this.sessionPropsManager&&W(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&W(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(p=this.zi)==null?void 0:p.length}catch(S){o.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===Ms&&(o.$lib_custom_api_host=this.config.api_host),c=e!==at||n?e!==Li||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,r),o=W(o,c),e===at&&w&&(o.title=w.title),!x(a)){var g=s.getTime()-a;o.$duration=parseFloat((g/1e3).toFixed(3))}oe&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=W({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),N(this.config.property_denylist)?H(this.config.property_denylist,function(S){delete o[S]}):b.error(ha+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var f=this.config.sanitize_properties;f&&(b.error(Ar),o=f(o,e));var I=this.nn();return o.$process_person_profile=I,I&&!n&&this.sn("_calculate_event_properties"),o}tn(e,t,s){var r;if(t===void 0&&(t=!0),s===void 0&&(s=!1),!this.persistence||!this.nn()||this.Oi&&!s)return e;var n=this.persistence.get_initial_props(),a=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=W({},n,a||{},e||{}),l=this.config.sanitize_properties;return l&&(b.error(Ar),o=l(o,"$set_once")),t&&(this.Oi=!0),lt(o)?void 0:o}register(e,t){var s;(s=this.persistence)==null||s.register(e,t)}register_once(e,t,s){var r;(r=this.persistence)==null||r.register_once(e,t,s)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}an(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var s;return(s=this.featureFlags)==null?void 0:s.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return(t=this.featureFlags)==null?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var s;return(s=this.featureFlags)==null?void 0:s.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var s;return(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,s){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,s)}updateEarlyAccessFeatureEnrollment(e,t,s){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,s)}getEarlyAccessFeatures(e,t,s){var r;return t===void 0&&(t=!1),(r=this.featureFlags)==null?void 0:r.getEarlyAccessFeatures(e,t,s)}on(e,t){return this.Li.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:kt}),()=>{})}onSessionId(e){var t,s;return(t=(s=this.sessionManager)==null?void 0:s.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:kt})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:kt})}renderSurvey(e,t){var s;(s=this.surveys)==null||s.renderSurvey(e,t)}displaySurvey(e,t){var s;t===void 0&&(t=Qo),(s=this.surveys)==null||s.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,s;return(t=(s=this.surveys)==null?void 0:s.canRenderSurvey(e))!==null&&t!==void 0?t:{visible:!1,disabledReason:kt}}canRenderSurveyAsync(e,t){var s,r;return t===void 0&&(t=!1),(s=(r=this.surveys)==null?void 0:r.canRenderSurveyAsync(e,t))!==null&&s!==void 0?s:Promise.resolve({visible:!1,disabledReason:kt})}un(e){return!e||ti(e)?(b.critical("Unique user id has not been set in posthog.identify"),!1):e===Yt?(b.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())||(b.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,s){if(!this.__loaded||!this.persistence)return b.uninitializedWarning("posthog.identify");if(me(e)&&(e=e.toString(),b.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.un(e)&&this.sn("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(di)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(Ft)&&(this.unregister(Ft),this.register({distinct_id:e}));var n,a=(this.persistence.get_property(xe)||Qe)===Qe;e!==r&&a?(this.persistence.set_property(xe,et),this.setPersonPropertiesForFlags({$set:t||{},$set_once:s||{}},!1),this.capture(Di,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:s||{}}),this.$i=Cr(e,t,s),(n=this.featureFlags)==null||n.setAnonymousDistinctId(r)):(t||s)&&this.setPersonProperties(t,s),e!==r&&(this.reloadFeatureFlags(),this.unregister(Mt))}}setPersonProperties(e,t){if((e||t)&&this.sn("posthog.setPersonProperties")){var s=Cr(this.get_distinct_id(),e,t);this.$i!==s?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.$i=s):b.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,s){if(e&&t){var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:m({},r,{[e]:t})}),n||s){var a={$group_type:e,$group_key:t};s&&(a.$group_set=s),this.capture(fr,a)}s&&this.setGroupPropertiesForFlags({[e]:s}),n&&!s&&this.reloadFeatureFlags()}else b.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var s;t===void 0&&(t=!0),(s=this.featureFlags)==null||s.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;(e=this.featureFlags)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var s;t===void 0&&(t=!0),this.sn("posthog.setGroupPropertiesForFlags")&&((s=this.featureFlags)==null||s.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,s,r,n,a,o,l,c;if(b.info("reset"),!this.__loaded)return b.uninitializedWarning("posthog.reset");var u,h=this.get_property(di),d=this.get_property(Ye);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(s=this.sessionPersistence)==null||s.clear(),x(d)||(u=this.persistence)==null||u.register({[Ye]:d}),(r=this.surveys)==null||r.reset(),(n=this.Yi)==null||n.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(l=this.persistence)==null||l.set_property(xe,Qe),(c=this.sessionManager)==null||c.resetSessionId(),this.$i=null,this.config.cookieless_mode===Me)this.register_once({distinct_id:Yt,$device_id:null},"");else{var p=this.config.get_device_id(je());this.register_once({distinct_id:p,$device_id:e?p:h},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var s;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(s=this.conversations)==null||s.ln()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.hn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&s){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!s)return r;
1r+="?t="+Math.max(Math.floor((new Date().getTime()-s)/1e3)-a,0)}return r}alias(e,t){return e===this.get_property(An)?(b.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(x(t)&&(t=this.get_distinct_id()),e!==t?(this.an(Ft,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(b.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=m({},this.config);if(Y(e)){var s,r,n,a,o,l,c,u,h,d;W(this.config,Lr(e));var p=this.Hi();(s=this.persistence)==null||s.update_config(this.config,t,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Hi(m({},this.config,{persistence:"sessionStorage"}),p);var g=this.Di(this.config.debug);Pe(g)&&(this.config.debug=g),Pe(this.config.debug)&&(this.config.debug?(ae.DEBUG=!0,V.R()&&V.N("ph_debug",!0),b.info("set_config",{config:e,oldConfig:t,newConfig:m({},this.config)})):(ae.DEBUG=!1,V.R()&&V.q("ph_debug"))),(r=this.exceptionObserver)==null||r.onConfigChange(),(n=this.exceptions)==null||n.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(l=this.heatmaps)==null||l.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(h=this.surveys)==null||h.loadIfEnabled(),this.cn(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){ae.LIB_NAME=e,ae.LIB_VERSION=t}startSessionRecording(e){var t,s,r,n,a,o=e===!0,l={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),l.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),l.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),l.url_trigger&&((n=this.sessionRecording)==null||n.overrideTrigger("url")),l.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!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(m({},r,t))}}addExceptionStep(e,t){var s;(s=this.exceptions)==null||s.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){var e,t;return(e=(t=this.logs)==null?void 0:t.logger)!==null&&e!==void 0?e:fe.dn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,s;return(t=(s=this.toolbar)==null?void 0:s.loadToolbar(e))!==null&&t!==void 0&&t}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:ot;return t!==ot&&(t=ot+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(xe))===et||((t=this.sessionPersistence)==null?void 0:t.get_property(xe))===et}nn(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles===Fs&&!this._isIdentified()&<(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Ft])&&((t=this.persistence)==null||(t=t.props)==null||!t[fi]))}Xi(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(e){return this.config.person_profiles==="never"?(b.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(fi,!0),!0)}Hi(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ge)}cn(){var e,t,s,r,n=this.Hi();return((e=this.persistence)==null?void 0:e._r)!==n&&((s=this.persistence)==null||s.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t._r)!==n&&((r=this.sessionPersistence)==null||r.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==Me){if(this.Ri()){var s,r,n,a,o;this.reset(!0),(s=this.sessionManager)==null||s.destroy(),(r=this.pageViewM
1anager)==null||r.destroy(),this.sessionManager=new Tr(this),this.pageViewManager=new br(this),this.persistence&&(this.sessionPropsManager=new Rr(this,this.sessionManager,this.persistence));var l,c=(n=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&n!==void 0?n:(o=fe.__defaultExtensionClasses)==null?void 0:o.sessionRecording;c&&(this.sessionRecording=this.Mi(this.sessionRecording,new c(this)),this.Qi&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.Qi)))}var u,h;this.consent.optInOut(!0),this.cn(),this.Ji(),(t=this.sessionRecording)==null||t.startIfEnabledOrStop(),this.config.cookieless_mode==Ge&&((u=this.surveys)==null||u.loadIfEnabled()),(x(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((h=e?.captureEventName)!==null&&h!==void 0?h:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ki()}else b.warn(Mr)}opt_out_capturing(){var e,t,s;this.config.cookieless_mode!==Me?(this.config.cookieless_mode===Ge&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Ge&&(this.register({distinct_id:Yt,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.Ki())):b.warn(Mr)}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 e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Me||(this.config.cookieless_mode===Ge?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return de?la(de,this.config.custom_blocked_useragents):void 0}Ki(){w&&(w.visibilityState==="visible"?this.Fi||(this.Fi=!0,this.capture(at,{title:w.title},{send_instantly:!0}),this.Ai&&(w.removeEventListener(_i,this.Ai),this.Ai=null)):this.Ai||(this.Ai=this.Ki.bind(this),X(w,_i,this.Ai)))}debug(e){e===!1?(v?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(v?.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}))}Lr(){var e,t,s,r,n,a,o=this.qi||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(b.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):(s="advanced_disable_decide",r=b,n=(t="advanced_disable_flags")in(e=o)&&!D(e[t]),a=s in e&&!D(e[s]),n?e[t]:!!a&&(r&&r.warn("Config field '"+s+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[s]))}rn(e){if(D(this.config.before_send))return e;var t=N(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var r of t){if(s=r(s),D(s)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Ta(e.event)?b.warn(n+". This can cause unexpected behavior."):b.info(n),null}s.properties&&!lt(s.properties)||b.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return s}getPageViewId(){var e;return(e=this.pageViewManager.dr)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,s){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(s)})}Di(e){var t=Pe(e)&&!e,s=V.R()&&V.A("ph_debug")==="true";return!t&&(!!s||e)}}fe.__defaultExtensionClasses={},fe.dn={trace:it=()=>{},debug:it,info:it,warn:it,error:it,fatal:it},function(i,e){for(var t=0;e.length>t;t++)i.prototype[e[t]]=fo(i.prototype[e[t]])}(fe,["identify"]);var nl=1,al=3,ol=11;function Dr(i){return i instanceof Element&&(i.id===jn||!(i.closest==null||!i.closest(".toolbar-global-fade-container")))}function Ke(i){return!!i&&i.nodeType===nl}function Ee(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function pa(i){return!!i&&i.nodeType===al}function va(i){return!!i&&i.nodeType===ol&&Ke(i.host)}function Zs(i){return i?Pi(i).split(/\s+/):[]}function Nr(i){var e=v?.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function Si(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return Zs(e)}function ga(i){return D(i)?null:Pi(i).split(/(\s+)/).filter(e=>Lt(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function zt(i){var e="";return Ds(i)&&!_a(i)&&i.childNodes&&i.childNodes.length&&H(i.childNodes,function(t){var s;pa(t)&&t.textContent&&(e+=(s=ga(t.textContent))!==null&&s!==void 0?s:"")}),Pi(e)}function jr(i){return x(i.target)?i.srcElement||null:(e=i.target)!=null&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var Qs=["a","button","form","input","select","textarea","label"];function Hr(i,e){if(x(e))return!0;var t,s=function(n){if(e.some(a=>n.matches(a)))return{v:!0}};for(var r of i)if(t=s(r))return t.v;return!1}function fa(i){var e=i.parentNode;return!(!e||!Ke(e))&&e}var ll=["next","previous","prev",">","<"],Ur=[".ph-no-rageclick",".ph-no-capture"],Ls=i=>!i||Ee(i,"html")||!Ke(i),zr=(i,e)=>{if(!v||Ls(i))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,s=[i],r=i;r.parentNode&&!Ee(r,"body");)if(va(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var n=fa(r);if(!n)break;if(e||Qs.indexOf(n.tagName.toLowerCase())>-1)t=!0;else{var a=v.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}s.push(n),r=n}return{parentIsUsefulElement:t,targetElementList:s}};function Ds(i){for(var e=i;e.parentNode&&!Ee(e,"body");e=e.parentNode){var t=Si(e);if(L(t,"ph-sensitive")||L(t,"ph-no-capture"))return!1}if(L(Si(i),"ph-include"))return!0;var s=i.type||"";if(B(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=i.name||i.id||"";return!B(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function _a(i){return!!(Ee(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||Ee(i,"select")||Ee(i,"textarea")||i.getAttribute("contenteditable")==="true")}var ma="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11}
1)|((?:2131|1800|35[0-9]{3})[0-9]{11})",ul=new RegExp("^(?:"+ma+")$"),cl=new RegExp(ma),ya="\\d{3}-?\\d{2}-?\\d{4}",hl=new RegExp("^("+ya+")$"),dl=new RegExp("("+ya+")");function Lt(i,e){return e===void 0&&(e=!0),!(D(i)||B(i)&&(i=Pi(i),(e?ul:cl).test((i||"").replace(/[- ]/g,""))||(e?hl:dl).test(i)))}function Vr(i){var e=zt(i);return Lt(e=(e+" "+ba(i)).trim())?e:""}function ba(i){var e="";return i&&i.childNodes&&i.childNodes.length&&H(i.childNodes,function(t){var s;if(t&&((s=t.tagName)==null?void 0:s.toLowerCase())==="span")try{var r=zt(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+ba(t)).trim())}catch(n){b.error("[AutoCapture]",n)}}),e}function Br(i){return i.replace(/"|\\"/g,'\\"')}function pl(i){var e=i.attr__class;return e?N(e)?e:Zs(e):void 0}class Wr{constructor(e){this.disabled=e===!1;var t=Y(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,s){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>s-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:s}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:s}];return!1}}var Xi="$copy_autocapture",Ji=z("[AutoCapture]");function Ki(i,e){return e.length>i?e.slice(0,i)+"...":e}function vl(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!Ke(e));return e}function gl(i,e){var t,s,{e:r,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsC
1hainAsString:l}=e;if(!Ke(i))return{props:{}};for(var c=[i],u=i;u.parentNode&&!Ee(u,"body");)if(va(u.parentNode))c.push(u.parentNode.host),u=u.parentNode.host;else{if(!Ke(u.parentNode))break;c.push(u.parentNode),u=u.parentNode}var h,d,p=[],g={},f=!1,I=!1;if(H(c,_=>{var P=Ds(_);if(Ee(_,"a")){var k=_.getAttribute("href");f=P&&!!k&&Lt(k)&&k}L(Si(_),"ph-no-capture")&&(I=!0),p.push(function(y,T,O,q){var M=y.tagName.toLowerCase(),A={tag_name:M};Qs.indexOf(M)>-1&&!O&&(A.$el_text=M.toLowerCase()==="a"||M.toLowerCase()==="button"?Ki(1024,Vr(y)):Ki(1024,zt(y)));var J=Si(y);J.length>0&&(A.classes=J.filter(function(G){return G!==""})),H(y.attributes,function(G){var ve;if((!_a(y)||["name","id","class","aria-label"].indexOf(G.name)!==-1)&&(q==null||!q.includes(G.name))&&!T&&Lt(G.value)&&(!B(ve=G.name)||ve.substring(0,10)!=="_ngcontent"&&ve.substring(0,7)!=="_nghost")){var te=G.value;G.name==="class"&&(te=Zs(te).join(" ")),A["attr__"+G.name]=Ki(1024,te)}});for(var Z=1,ue=1,re=y;re=vl(re);)Z++,re.tagName===y.tagName&&ue++;return A.nth_child=Z,A.nth_of_type=ue,A}(_,n,a,o));var E=function(y){if(!Ds(y))return{};var T={};return H(y.attributes,function(O){if(O.name&&O.name.indexOf("data-ph-capture-attribute")===0){var q=O.name.replace("data-ph-capture-attribute-",""),M=O.value;q&&M&&Lt(M)&&(T[q]=M)}}),T}(_);W(g,E)}),I)return{props:{},explicitNoCapture:I};if(a||(p[0].$el_text=Ee(i,"a")||Ee(i,"button")?Vr(i):zt(i)),f){var S,C;p[0].attr__href=f;var $=(S=bi(f))==null?void 0:S.host,R=v==null||(C=v.location)==null?void 0:C.host;$&&R&&$!==R&&(h=f)}return{props:W({$event_type:r.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:(d=p,function(_){return _.map(P=>{var k,E,y="";if(P.tag_name&&(y+=P.tag_name),P.attr_class)for(var T of(P.attr_class.sort(),P.attr_class))y+="."+T.replace(/"/g,"");var O=m({},P.text?{text:P.text}:{},{"nth-child":(k=P.nth_child)!==null&&k!==void 0?k:0,"nth-of-type":(E=P.nth_of_type)!==null&&E!==void 0?E:0},P.href?{href:P.href}:{},P.attr_id?{attr_id:P.attr_id}:{},P.attributes),q={};return ri(O).sort((M,A)=>{var[J]=M,[Z]=A;return J.localeCompare(Z)}).forEach(M=>{var[A,J]=M;return q[Br(A.toString())]=Br(J.toString())}),(y+=":")+ri(q).map(M=>{var[A,J]=M;return A+'="'+J+'"'}).join("")}).join(";")}(function(_){return _.map(P=>{var k,E,y={text:(k=P.$el_text)==null?void 0:k.slice(0,400),tag_name:P.tag_name,href:(E=P.attr__href)==null?void 0:E.slice(0,2048),attr_class:pl(P),attr_id:P.attr__id,nth_child:P.nth_child,nth_of_type:P.nth_of_type,attributes:{}};return ri(P).filter(T=>{var[O]=T;return O.indexOf("attr__")===0}).forEach(T=>{var[O,q]=T;return y.attributes[O]=q}),y})}(d)))},(t=p[0])!=null&&t.$el_text?{$el_text:(s=p[0])==null?void 0:s.$el_text}:{},h&&r.type==="click"?{$external_click_url:h}:{},g)}}var St=z("[ExceptionAutocapture]");function Gr(i,e,t){try{if(!(e in i))return()=>{};var s=i[e],r=t(s);return Oe(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),i[e]=r,()=>{i[e]=s}}catch{return()=>{}}}var fl=z("[TracingHeaders]"),ze=z("[Web Vitals]"),Yr=9e5,Xr="disabled",Jr="lazy_loading",Pt="awaiting_config",ei="missing_config";z("[SessionRecording]"),z("[SessionRecording]");var Ns="[SessionRecording]",Re=z(Ns),_l=z("[Heatmaps]");function Kr(i){return Y(i)&&"clientX"in i&&"clientY"in i&&me(i.clientX)&&me(i.clientY)}var Zr=z("[Product Tours]"),ml=["$set_once","$set"],Ne=z("[SiteApps]"),Qr="Error while initializing PostHog app with config id ";function st(i,e,t){if(D(i))return!1;switch(t){case"exact":return i===e;case"contains":var s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(i);case"regex":try{return new RegExp(e).test(i)}catch{return!1}default:return!1}}class yl{constructor(e){this.vn=new Ks,this.fn=(t,s)=>this.pn(t,s)&&this.gn(t,s)&&this.mn(t,s)&&this.yn(t,s),this.pn=(t,s)=>s==null||!s.event||t?.event===s?.event,this._instance=e,this.bn=new Set,this._n=new Set}init(){var e,t;x((e=this._instance)==null?void 0:e._addCaptureHook)||(t=this._instance)==null||t._addCaptureHook((s,r)=>{this.on(s,r)})}register(e){var t,s;if(!x((t=this._instance)==null?void 0:t._addCaptureHook)&&(e.forEach(a=>{var o,l;(o=this._n)==null||o.add(a),(l=a.steps)==null||l.forEach(c=>{var u;(u=this.bn)==null||u.add(c?.event||"")})}),(s=this._instance)!=null&&s.autocapture)){var r,n=new Set;e.forEach(a=>{var o;(o=a.steps)==null||o.forEach(l=>{l!=null&&l.selector&&n.add(l?.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(n)}}on(e,t){var s;t!=null&&e.length!=0&&(this.bn.has(e)||this.bn.has(t?.event))&&this._n&&((s=this._n)==null?void 0:s.size)>
vendor: 5,091 bytes, line 1
10&&this._n.forEach(r=>{this.wn(t,r)&&this.vn.emit("actionCaptured",r.name)})}xn(e){this.onAction("actionCaptured",t=>e(t))}wn(e,t){if(t?.steps==null)return!1;for(var s of t.steps)if(this.fn(e,s))return!0;return!1}onAction(e,t){return this.vn.on(e,t)}gn(e,t){if(t!=null&&t.url){var s,r=e==null||(s=e.properties)==null?void 0:s.$current_url;if(!r||typeof r!="string"||!st(r,t.url,t.url_matching||"contains"))return!1}return!0}mn(e,t){return!!this.Sn(e,t)&&!!this.kn(e,t)&&!!this.Cn(e,t)}Sn(e,t){var s;if(t==null||!t.href)return!0;var r=this.In(e);if(r.length>0)return r.some(o=>st(o.href,t.href,t.href_matching||"exact"));var n,a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!a&&st((n=a.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}kn(e,t){var s;if(t==null||!t.text)return!0;var r=this.In(e);if(r.length>0)return r.some(c=>st(c.text,t.text,t.text_matching||"exact")||st(c.$el_text,t.text,t.text_matching||"exact"));var n,a,o,l=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!l&&(n=function(c){for(var u,h=[],d=/(?::|")text="(.*?)"/g;!D(u=d.exec(c));)h.includes(u[1])||h.push(u[1]);return h}(l),a=t.text,o=t.text_matching||"exact",n.some(c=>st(c,a,o)))}Cn(e,t){var s,r;if(t==null||!t.selector)return!0;var n=e==null||(s=e.properties)==null?void 0:s.$element_selectors;if(n!=null&&n.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}In(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}yn(e,t){return t==null||!t.properties||t.properties.length===0||ca(t.properties.reduce((s,r)=>{var n=N(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return s[r.key]={values:n,operator:r.operator||"exact"},s},{}),e?.properties)}}class bl{constructor(e){this._instance=e,this.Tn=new Map,this.En=new Map,this.Mn=new Map}Pn(e,t){return!!e&&ca(e.propertyFilters,t?.properties)}Rn(e,t){var s=new Map;return e.forEach(r=>{var n;(n=r.conditions)==null||(n=n[t])==null||(n=n.values)==null||n.forEach(a=>{if(a!=null&&a.name){var o=s.get(a.name)||[];o.push(r.id),s.set(a.name,o)}})}),s}On(e,t,s){var r=(s===bt.Activation?this.Tn:this.En).get(e),n=[];return this.Ln(a=>{n=a.filter(o=>r?.includes(o.id))}),n.filter(a=>{var o,l=(o=a.conditions)==null||(o=o[s])==null||(o=o.values)==null?void 0:o.find(c=>c.name===e);return this.Pn(l,t)})}register(e){var t;x((t=this._instance)==null?void 0:t._addCaptureHook)||(this.Fn(e),this.An(e))}An(e){var t=e.filter(s=>{var r,n;return((r=s.conditions)==null?void 0:r.actions)&&((n=s.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0});t.length!==0&&(this.Nn==null&&(this.Nn=new yl(this._instance),this.Nn.init(),this.Nn.xn(s=>{this.onAction(s)})),t.forEach(s=>{var r,n,a,o,l;s.conditions&&(r=s.conditions)!=null&&r.actions&&(n=s.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=s.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.Nn)==null||o.register(s.conditions.actions.values),(l=s.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.Mn.get(c.name);u&&u.push(s.id),this.Mn.set(c.name,u||[s.id])}}))}))}Fn(e){var t,s=e.filter(n=>{var a,o;return((a=n.conditions)==null?void 0:a.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}),r=e.filter(n=>{var a,o;return((a=n.conditions)==null?void 0:a.cancelEvents)&&((o=n.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0});s.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook((n,a)=>{this.onEvent(n,a)}),this.Tn=this.Rn(e,bt.Activation),this.En=this.Rn(e,bt.Cancellation))}onEvent(e,t){var s,r=this.le(),n=this.$n(),a=this.Dn(),o=((s=this._instance)==null||(s=s.persistence)==null?void 0:s.props[n])||[];if(a===e&&t&&o.length>0){var l,c;r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(t==null||(l=t.properties)==null?void 0:l.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(u){var h=o.indexOf(u);0>h||(o.splice(h,1),this.qn(o))}}else{if(this.En.has(e)){var d=this.On(e,t,bt.Cancellation);d.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map(g=>g.id)}),d.forEach(g=>{var f=o.indexOf(g.id);0>f||o.splice(f,1),this.jn(g.id)}),this.qn(o))}if(this.Tn.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Tn.get(e)});var p=this.On(e,t,bt.Activation);this.qn(o.concat(p.map(g=>g.id)||[]))}}}onAction(e){var t,s=this.$n(),r=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[s])||[];this.Mn.has(e)&&this.qn(r.concat(this.Mn.get(e)||[]))}qn(e){var t=this.le(),s=[...new Set(e)].filter(r=>!this.Hn(r));t.info("updating activated items",{activatedItems:s}),this.Un(s)}getActivatedIds(){var e,t=this.$n();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}
1getEventToItemsMap(){return this.Tn}Bn(){return this.Nn}}class wl extends bl{constructor(e){super(e)}$n(){return ws}Dn(){return Ct.SHOWN}Ln(e){var t;(t=this._instance)==null||t.getSurveys(e)}jn(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}le(){return j}Un(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[ws]:e})}Hn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Zi="SDK is not enabled or survey functionality is not yet loaded",en="Disabled. Not loading surveys.",xl=v!=null&&v.location?wi(v.location.hash,"__posthog")||wi(location.hash,"state"):null,tn="_postHogToolbarParams",sn=z("[Toolbar]"),ne=z("[FeatureFlags]"),Ve=z("[FeatureFlags]",{debugEnabled:!0}),Qi=`" failed. Feature flags didn't load in time.`,rn=i=>{for(var e={},t=0;i.length>t;t++)e[i[t]]=!0;return e},nn=i=>{var e={};for(var[t,s]of ri(i||{}))s&&(e[t]=s);return e},Te=z("[Error tracking]"),an="Refusing to render web experiment since the viewer is a likely bot",El={icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!v&&ki(e.href,i),not_regex:(i,e)=>!!v&&!ki(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i};class se{get qt(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(s){s===void 0&&(s=!1),t.getWebExperiments(r=>{se.zn("retrieved web experiments from the server"),t.Vn=new Map,r.forEach(n=>{if(n.feature_flag_key){var a;t.Vn&&(se.zn("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.Vn)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);B(o)&&n.variants[o]&&t.Wn(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var c=n.variants[l];se.Zn(c)&&t.Wn(n.name,l,c.transforms)}})},s)},this._instance=e,this._instance.onFeatureFlags(s=>{this.onFeatureFlags(s)})}initialize(){}onFeatureFlags(e){if(this._is_bot())se.zn(an);else if(!this.qt.disable_web_experiments){if(D(this.Vn))return this.Vn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();se.zn("applying feature flags",e),e.forEach(t=>{var s;if(this.Vn&&(s=this.Vn)!=null&&s.has(t)){var r,n=this._instance.getFeatureFlag(t),a=(r=this.Vn)==null?void 0:r.get(t);n&&a!=null&&a.variants[n]&&this.Wn(a.name,n,a.variants[n].transforms)}})}}previewWebExperiment(){var e=se.getWindowLocation();if(e!=null&&e.search){var t=jt(e?.search,"__experiment_id"),s=jt(e?.search,"__experiment_variant");t&&s&&(se.zn("previewing web experiments "+t+" && "+s),this.getWebExperiments(r=>{this.Gn(parseInt(t),s,r)},!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,s){if(this.qt.disable_web_experiments&&!s)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qt.token),method:"GET",callback:n=>e(n.statusCode===200&&n.json&&n.json.experiments||[])})}Gn(e,t,s){var r=s.filter(n=>n.id===e);r&&r.length>0&&(se.zn("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Wn(r[0].name,t,r[0].variants[t].transforms))}static Zn(e){return!D(e.conditions)&&se.Qn(e)&&se.Jn(e)}static Qn(e){var t;if(D(e.conditions)||D((t=e.conditions)==null?void 0:t.url))return!0;var s,r,n,a=se.getWindowLocation();return!!a&&((s=e.conditions)==null||!s.url||El[(r=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}
1static getWindowLocation(){return v?.location}static Jn(e){var t;if(D(e.conditions)||D((t=e.conditions)==null?void 0:t.utm))return!0;var s=Yn();if(s.utm_source){var r,n,a,o,l,c,u,h,d=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==s.utm_campaign,p=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==s.utm_source,g=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==s.utm_medium,f=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==s.utm_term;return d&&g&&f&&p}return!1}static zn(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;t>r;r++)s[r-1]=arguments[r];b.info("[WebExperiments] "+e,s)}Wn(e,t,s){this._is_bot()?se.zn(an):t!=="control"?s.forEach(r=>{if(r.selector){var n;se.zn("applying transform of variant "+t+" for experiment "+e+" ",r);var a=(n=document)==null?void 0:n.querySelectorAll(r.selector);a?.forEach(o=>{var l=o;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):se.zn("Control variants leave the page unmodified.")}_is_bot(){return de&&this._instance?la(de,this.qt.custom_blocked_useragents):void 0}}var ge=z("[Conversations]"),Be="Conversations not available yet.",Ii={featureFlags:class{constructor(i){this.Kn=!1,this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=i,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ni(){return this._instance.persistence}os(i){return this._instance.get_property(i)}us(){var i,e;return(i=(e=this.ni)==null?void 0:e.wr(this.qt.feature_flag_cache_ttl_ms))!==null&&i!==void 0&&i}ls(){return!!this.us()&&(this.ss||this.Xn||(this.ss=!0,ne.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var i,e=(i=this.qt.evaluation_contexts)!==null&&i!==void 0?i:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.ns||(ne.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),e!=null&&e.length?e.filter(t=>{var s=t&&typeof t=="string"&&t.trim().length>0;return s||ne.error("Invalid evaluation context found:",t,"Expected non-empty string"),s}):[]}cs(){return this.hs().length>0}initialize(){var i,e,{config:t}=this._instance,s=(i=(e=t.bootstrap)==null?void 0:e.featureFlags)!==null&&i!==void 0?i:{};if(Object.keys(s).length){var r,n,a=(r=(n=t.bootstrap)==null?void 0:n.featureFlagPayloads)!==null&&r!==void 0?r:{},o=Object.keys(s).filter(c=>!!s[c]).reduce((c,u)=>(c[u]=s[u]||!1,c),{}),l=Object.keys(a).filter(c=>o[c]).reduce((c,u)=>(a[u]&&(c[u]=a[u]),c),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(i,e,t){var s=t!=null&&t.merge?this.getFlagVariants():{},r=t!=null&&t.merge?this.getFlagPayloads():{},n=m({},s,i),a=m({},r,e),o={};for(var[l,c]of Object.entries(n)){var u=typeof c=="string";o[l]={key:l,enabled:!!u||!!c,variant:u?c:void 0,reason:void 0,metadata:x(a?.[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.receivedFeatureFlags({flags:o})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var i=this.os(_s),e=this.os(Ce),t=this.os(nt);if(!t&&!e)return i||{};var s=W({},i||{}),r=[...new Set([...Object.keys(t||{}),...Object.keys(e||{})])];for(var n of r){var a,o,l=s[n],c=e?.[n],u=x(c)?(a=l?.enabled)!==null&&a!==void 0&&a:!!c,h=x(c)?l.variant:typeof c=="string"?c:void 0,d=t?.[n],p=m({},l,{enabled:u,variant:u?h??l?.variant:void 0});u!==l?.enabled&&(p.original_enabled=l?.enabled),h!==l?.variant&&(p.original_variant=l?.variant),d&&(p.metadata=m({},l?.metadata,{payload:d,original_payload:l==null||(o=l.metadata)==null?void 0:o.payload})),s[n]=p}return this.Kn||(ne.warn(" Overriding feature flag details!",{flagDetails:i,overriddenPayloads:t,finalDetails:s}),this.Kn=!0),s}getFlagVariants(){var i=this.os(ut),e=this.os(Ce);if(!e)return i||{};for(var t=W({},i),s=Object.keys(e),r=0;s.length>r;r++)t[s[r]]=e[s[r]];
1return this.Kn||(ne.warn(" Overriding feature flags!",{enabledFlags:i,overriddenFlags:e,finalFlags:t}),this.Kn=!0),t}getFlagPayloads(){var i=this.os(ms),e=this.os(nt);if(!e)return i||{};for(var t=W({},i||{}),s=Object.keys(e),r=0;s.length>r;r++)t[s[r]]=e[s[r]];return this.Kn||(ne.warn(" Overriding feature flag payloads!",{flagPayloads:i,overriddenPayloads:e,finalPayloads:t}),this.Kn=!0),t}reloadFeatureFlags(){this.es||this.qt.advanced_disable_feature_flags||this.ds||(this._instance.Li.emit("featureFlagsReloading",!0),this.ds=setTimeout(()=>{this.vs()},5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Yn||this.Xn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(i){this.$anon_distinct_id=i}setReloadingPaused(i){this.es=i}vs(i){var e;if(this.fs(),!this._instance.Lr())if(this.Xn)this.ts=!0;else{var t=this.qt.token,s=this.os(di),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:m({},((e=this.ni)==null?void 0:e.get_initial_props())||{},this.os(Tt)||{}),group_properties:this.os(We),timezone:ea()};qe(s)||x(s)||(r.$device_id=s),(i!=null&&i.disableFlags||this.qt.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.cs()&&(r.evaluation_contexts=this.hs());var n=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Xn=!0,this._instance._send_request({method:"POST",url:n,data:r,compression:this.qt.disable_compression?void 0:ke.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:a=>{var o,l,c,u=!0;if(a.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),u=!1),this.Xn=!1,!r.disable_flags||this.ts){this.rs=!u;var h=[];a.error?a.error instanceof Error?h.push(a.error.name==="AbortError"?"timeout":"connection_error"):h.push("unknown_error"):a.statusCode!==200&&h.push("api_error_"+a.statusCode),(o=a.json)!=null&&o.errorsWhileComputingFlags&&h.push("errors_while_computing_flags");var d,p=!((l=a.json)==null||(l=l.quotaLimited)==null||!l.includes("feature_flags"));p&&h.push("quota_limited"),(c=this.ni)==null||c.register({[Es]:h}),p?ne.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(r.disable_flags||this.receivedFeatureFlags((d=a.json)!==null&&d!==void 0?d:{},u,{partialResponse:!!this.qt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(i,e){var t;if(e===void 0&&(e={}),!e.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var s=this.getFeatureFlagResult(i,e);return(t=s?.variant)!==null&&t!==void 0?t:s?.enabled}}else ne.warn('getFeatureFlag for key "'+i+Qi)}getFeatureFlagDetails(i){return this.getFlagsWithDetails()[i]}getFeatureFlagPayload(i){var e=this.getFeatureFlagResult(i,{send_event:!1});return e?.payload}getFeatureFlagResult(i,e){if(e===void 0&&(e={}),!e.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var t=this.getFlagVariants(),s=i in t,r=t[i],n=this.getFlagPayloads()[i],a=String(r),o=this.os(ys)||void 0,l=this.os(vi)||void 0,c=this.os(Mt)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var u,h=this._instance.get_session_id(),d=this.os(xs);h&&h!==d&&(c={},(u=this.ni)==null||u.register({[Mt]:c,[xs]:h}))}if((e.send_event||!("send_event"in e))&&(!(i in c)||!c[i].includes(a))){var p,g,f,I,S,C,$,R,_,P;N(c[i])?c[i].push(a):c[i]=[a],(p=this.ni)==null||p.register({[Mt]:c});var k=this.getFeatureFlagDetails(i),E=[...(g=this.os(Es))!==null&&g!==void 0?g:[]];x(r)&&E.push("flag_missing");var y={$feature_flag:i,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((f=this.qt.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[i])||null,$feature_flag_bootstrapped_payload:((I=this.qt.bootstrap)==null||(I=I.featureFlagPayloads)==null?void 0:I[i])||null,$used_bootstrap_value:!this.rs};x(k==null||(S=k.metadata)==null?void 0:S.version)||(y.$feature_flag_version=k.metadata.version);var T,O=(C=k==null||($=k.reason)==null?void 0:$.description)!==null&&C!==void 0?C:k==null||(R=k.reason)==null?void 0:R.code;O&&(y.$feature_flag_reason=O),k!=null&&(_=k.metadata)!=null&&_.id&&(y.$feature_flag_id=k.metadata.id),x(k?.original_variant)&&x(k?.original_enabled)||(y.$feature_flag_original_response=x(k.original_variant)?k.original_enabled:k.original_variant),k!=null&&(P=k.metadata)!=null&&P.original_payload&&(y.$feature_flag_original_payload=k==null||(T=k.metadata)==null?void 0:T.original_payload),E.length&&(y.$feature_flag_error=E.join(",")),this._instance.capture("$feature_flag_called",y)}if(s){var q=n;if(!x(n))try{q=JSON.parse(n)}catch{}return{key:i,enabled:!!r,variant:typeof r=="string"?r:void 0,payload:q}}}}else ne.warn('getFeatureFlagResult for key "'+i+Qi)}getRemoteConfigPayload(i,e){var t=this.qt.token,s={distinct_id:this._instance.get_distinct_id(),token:t};this.cs()&&(s.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this.qt.disable_compression?void 0:ke.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback(r){var n,a=(n=r.json)==null?void 0:n.featureFlagPayloads;e(a?.[i]||void 0)}})}isFeatureEnabled(i,e){if(e===void 0&&(e={}),!e.fresh||this.rs){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var t=this.getFeatureFlag(i,e);return x(t)?void 0:!!t}ne.warn('isFeatureEnabled for key "'+i+Qi)}}addFeatureFlagsHandler(i){this.featureFlagEventHandlers.push(i)}removeFeatureFlagsHandler(i){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==i)}receivedFeatureFlags(i,e,t){if(this.ni){this.Yn=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,c,u,h){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=(E=>{var y=E.flags;return y?(E.featureFlags=Object.fromEntries(Object.keys(y).map(T=>{var O;return[T,(O=y[T].variant)!==null&&O!==void 0?O:y[T].enabled]})),E.featureFlagPayloads=Object.fromEntries(Object.keys(y).filter(T=>y[T].enabled).filter(T=>{var O;return(O=y[T].metadata)==null?void 0:O.payload}).map(T=>{var O;return[T,(O=y[T].metadata)==null?void 0:O.payload]}))):ne.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),E})(a),p=d.flags,g=d.featureFlags,f=d.featureFlagPayloads;if(g){var I=a.requestId,S=a.evaluatedAt;if(N(g)){ne.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var C={};if(g)for(var $=0;g.length>$;$++)C[g[$]]=!0;o&&o.register({[ii]:g,[ut]:C})}else{var R=g,_=f,P=p;if(h!=null&&h.partialResponse)R=m({},l,R),_=m({},c,_),P=m({},u,P);else if(a.errorsWhileComputingFlags)if(p){var k=new Set(Object.keys(p).filter(E=>{var y;return!((y=p[E])!=null&&y.failed)}));R=m({},l,Object.fromEntries(Object.entries(R).filter(E=>{var[y]=E;return k.has(y)}))),_=m({},c,Object.fromEntries(Object.entries(_||{}).filter(E=>{var[y]=E;return k.has(y)}))),P=m({},u,Object.fromEntries(Object.entries(P||{}).filter(E=>{var[y]=E;return k.has(y)})))}else R=m({},l,R),_=m({},c,_),P=m({},u,P);o&&o.register(m({[ii]:Object.keys(nn(R)),[ut]:R||{},[ms]:_||{},[_s]:P||{}},I?{[ys]:I}:{},S?{[vi]:S}:{}))}}})(i,this.ni,s,r,n,t),e||(this.ss=!1),this.ps(e)}}override(i,e){e===void 0&&(e=!1),ne.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:i,suppressWarning:e})}
1overrideFeatureFlags(i){if(!this._instance.__loaded||!this.ni)return ne.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(i===!1)return this.ni.unregister(Ce),this.ni.unregister(nt),this.ps(),Ve.info("All overrides cleared");if(N(i)){var e=rn(i);return this.ni.register({[Ce]:e}),this.ps(),Ve.info("Flag overrides set",{flags:i})}if(i&&typeof i=="object"&&("flags"in i||"payloads"in i)){var t,s=i;if(this.Kn=!!((t=s.suppressWarning)!==null&&t!==void 0&&t),"flags"in s){if(s.flags===!1)this.ni.unregister(Ce),Ve.info("Flag overrides cleared");else if(s.flags){if(N(s.flags)){var r=rn(s.flags);this.ni.register({[Ce]:r})}else this.ni.register({[Ce]:s.flags});Ve.info("Flag overrides set",{flags:s.flags})}}return"payloads"in s&&(s.payloads===!1?(this.ni.unregister(nt),Ve.info("Payload overrides cleared")):s.payloads&&(this.ni.register({[nt]:s.payloads}),Ve.info("Payload overrides set",{payloads:s.payloads}))),void this.ps()}if(i&&typeof i=="object")return this.ni.register({[Ce]:i}),this.ps(),Ve.info("Flag overrides set",{flags:i});ne.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:i})}
1onFeatureFlags(i){if(this.addFeatureFlagsHandler(i),this.Yn){var{flags:e,flagVariants:t}=this.gs();i(e,t)}return()=>this.removeFeatureFlagsHandler(i)}updateEarlyAccessFeatureEnrollment(i,e,t){var s,r=(this.os(Rt)||[]).find(l=>l.flagKey===i),n={["$feature_enrollment/"+i]:e},a={$feature_flag:i,$feature_enrollment:e,$set:n};r&&(a.$early_access_feature_name=r.name),t&&(a.$feature_enrollment_stage=t),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=m({},this.getFlagVariants(),{[i]:e});(s=this.ni)==null||s.register({[ii]:Object.keys(nn(o)),[ut]:o}),this.ps()}getEarlyAccessFeatures(i,e,t){e===void 0&&(e=!1);var s=this.os(Rt),r=t?"&"+t.map(n=>"stage="+n).join("&"):"";if(s&&!e)return i(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.qt.token+r),method:"GET",callback:n=>{var a,o;if(n.json){var l=n.json.earlyAccessFeatures;return(a=this.ni)==null||a.unregister(Rt),(o=this.ni)==null||o.register({[Rt]:l}),i(l)}}})}gs(){var i=this.getFlags(),e=this.getFlagVariants();return{flags:i.filter(t=>e[t]),flagVariants:Object.keys(e).filter(t=>e[t]).reduce((t,s)=>(t[s]=e[s],t),{})}}ps(i){var{flags:e,flagVariants:t}=this.gs();this.featureFlagEventHandlers.forEach(s=>s(e,t,{errorsLoading:i}))}setPersonPropertiesForFlags(i,e){e===void 0&&(e=!0);var t=this.os(Tt)||{},s=i?.$set||(i!=null&&i.$set_once?{}:i),r=i?.$set_once,n={};if(r)for(var a in r)({}).hasOwnProperty.call(r,a)&&(a in t||(n[a]=r[a]));this._instance.register({[Tt]:m({},t,n,s)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Tt)}setGroupPropertiesForFlags(i,e){e===void 0&&(e=!0);var t=this.os(We)||{};Object.keys(t).length!==0&&Object.keys(t).forEach(s=>{t[s]=m({},t[s],i[s]),delete i[s]}),this._instance.register({[We]:m({},t,i)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(i){if(i){var e=this.os(We)||{};this._instance.register({[We]:m({},e,{[i]:{}})})}else this._instance.unregister(We)}reset(){this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Kn=!1}}},kl={sessionRecording:class{get qt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var i;return!((i=this.ys)==null||!i.isStarted)}get status(){var i,e;return this.bs===Pt||this.bs===ei?this.bs:(i=(e=this.ys)==null?void 0:e.status)!==null&&i!==void 0?i:this.bs}constructor(i){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=Xr,this._s=void 0,this._instance=i,!this._instance.sessionManager)throw Re.error("started without valid sessionManager"),new Error(Ns+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===Me)throw new Error(Ns+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var i,e=!((i=this._instance.get_property(Ye))==null||!i.enabled),t=!this.qt.disable_session_recording,s=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return v&&e&&t&&!s}startIfEnabledOrStop(i){var e;if(!this.ws||(e=this.ys)==null||!e.isStarted){var t=!x(Object.assign)&&!x(Array.from);this.ws&&t?(this.xs(i),Re.info("starting")):(this.bs=Xr,this.stopRecording())}}xs(i){var e,t,s;this.ws&&(this.bs!==Pt&&this.bs!==ei&&(this.bs=Jr),F!=null&&(e=F.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(t=F.__PosthogExtensions__)!=null&&t.initSessionRecording?this.Ss(i):(s=F.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.ks,r=>{if(r)return Re.error("could not load recorder",r);this.Ss(i)}))}stopRecording(){var i,e;(i=this._s)==null||i.call(this),this._s=void 0,(e=this.ys)==null||e.stop()}Cs(){var i,e;(i=this._s)==null||i.call(this),this._s=void 0,(e=this.ys)==null||e.discard()}Is(){var i;(i=this.ni)==null||i.unregister(Ws)}Ts(i,e){if(D(i))return null;var t,s=me(i)?i:parseFloat(i);return typeof(t=s)!="number"||!Number.isFinite(t)||0>t||t>1?(Re.warn(e+" must be between 0 and 1. Ignoring invalid value:",i),null):s}Es(i){if(this.ni){var e,t,s=this.ni,r=()=>{var n,a=i.sessionRecording===!1?void 0:i.sessionRecording,o=this.Ts((n=this.qt.session_recording)==null?void 0:n.sampleRate,"session_recording.sampleRate"),l=this.Ts(a?.sampleRate,"remote config sampleRate"),c=o??l;D(c)&&this.Is();var u=a?.minimumDurationMilliseconds;s.register({[Ye]:m({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:m({capturePerformance:i.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:c,minimumDurationMilliseconds:x(u)?null:u,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers,version:a?.version,triggerGroups:a?.triggerGroups})})};r(),(e=this._s)==null||e.call(this),this._s=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(r)}}onRemoteConfig(i){return"sessionRecording"in i?i.sessionRecording===!1?(this.Es(i),void this.Cs()):(this.Es(i),void this.startIfEnabledOrStop()):(this.bs===Pt&&(this.bs=ei,Re.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(i,e){var t;e===void 0&&(e="log"),(t=this.ys)!=null&&t.log?this.ys.log(i,e):Re.warn("log called before recorder was ready")}get ks(){var i,e,t=(i=this._instance)==null||(i=i.persistence)==null?void 0:i.get_property(Ye);return(t==null||(e=t.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Ms(){var i,e,t=this._instance.get_property(Ye);if(!t)return!1;try{e=typeof t=="object"?t:JSON.parse(t)}catch(r){return Re.warn("persisted remote config for session recording is invali
1d and will be ignored",r),!1}var s=(i=e.cache_timestamp)!==null&&i!==void 0?i:Date.now();return 36e5>=Date.now()-s}Ss(i){var e,t;if((e=F.__PosthogExtensions__)==null||!e.initSessionRecording)return Re.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[zn]:!0});if(this.ys||(this.ys=(t=F.__PosthogExtensions__)==null?void 0:t.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms())return this.bs===ei||this.bs===Pt?void 0:(this.bs=Pt,Re.info("persisted remote config is stale, requesting fresh config before starting"),void new ta(this._instance).load());this.bs=Jr,this.ys.start(i)}onRRwebEmit(i){var e;(e=this.ys)==null||e.onRRwebEmit==null||e.onRRwebEmit(i)}overrideLinkedFlag(){var i,e;this.ys||(e=this.ni)==null||e.register({[Ln]:!0}),(i=this.ys)==null||i.overrideLinkedFlag()}overrideSampling(){var i,e;this.ys||(e=this.ni)==null||e.register({[qn]:!0}),(i=this.ys)==null||i.overrideSampling()}overrideTrigger(i){var e,t;this.ys||(t=this.ni)==null||t.register({[i==="url"?Dn:Nn]:!0}),(e=this.ys)==null||e.overrideTrigger(i)}get sdkDebugProperties(){var i;return((i=this.ys)==null?void 0:i.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(i,e){var t;return!((t=this.ys)==null||!t.tryAddCustomEvent(i,e))}}},Sl={autocapture:class{constructor(i){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=i,this.rageclicks=new Wr(i.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get qt(){var i,e,t=Y(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(i=t.url_allowlist)==null?void 0:i.map(s=>new RegExp(s)),t.url_ignorelist=(e=t.url_ignorelist)==null?void 0:e.map(s=>new RegExp(s)),t}Fs(){if(this.isBrowserSupported()){if(v&&w){var i=t=>{t=t||v?.event;try{this.As(t)}catch(s){Ji.error("Failed to capture event",s)}};if(X(w,"submit",i,{capture:!0}),X(w,"change",i,{capture:!0}),X(w,"click",i,{capture:!0}),this.qt.capture_copied_text){var e=t=>{t=t||v?.event;try{this.As(t,Xi)}catch(s){Ji.error("Failed to capture copy/cut event",s)}};X(w,"copy",e,{capture:!0}),X(w,"cut",e,{capture:!0})}}}else Ji.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(i){i.elementsChainAsString&&(this.Os=i.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[us]:!!i.autocapture_opt_out}),this.Rs=!!i.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(i){this.Ls=i}getElementSelectors(i){var e,t=[];return(e=this.Ls)==null||e.forEach(s=>{var r=w?.querySelectorAll(s);r?.forEach(n=>{i===n&&t.push(s)})}),t}get isEnabled(){var i,e,t=(i=this.instance.persistence)==null?void 0:i.props[us];if(qe(this.Rs)&&!Pe(t)&&!this.instance.Lr())return!1;var s=(e=this.Rs)!==null&&e!==void 0?e:!!t;return!!this.instance.config.autocapture&&!s}As(i,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var t,s=jr(i);pa(s)&&(s=s.parentNode||null),e==="$autocapture"&&i.type==="click"&&i instanceof MouseEvent&&this.instance.config.rageclick&&(t=this.rageclicks)!=null&&t.isRageClick(i.clientX,i.clientY,i.timeStamp||new Date().getTime())&&function(h,d){if(!v||Ls(h))return!1;var p,g,f;if(Pe(d)?(p=!!d&&Ur,g=void 0):(p=(f=d?.css_selector_ignorelist)!==null&&f!==void 0?f:Ur,g=d?.content_ignorelist),p===!1)return!1;var{targetElementList:I}=zr(h,!1);return!function(S,C){if(S===!1||x(S))return!1;var $;if(S===!0)$=ll;else{if(!N(S))return!1;if(S.length>10)return b.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;$=S.map(R=>R.toLowerCase())}return C.some(R=>{var{safeText:_,ariaLabel:P}=R;return $.some(k=>_.includes(k)||P.includes(k))})}(g,I.map(S=>{var C;return{safeText:zt(S).toLowerCase(),ariaLabel:((C=S.getAttribute("aria-label"))==null?void 0:C.toLowerCase().trim())||""}}))&&!Hr(I,p)}(s,this.instance.config.rageclick)&&this.As(i,"$rageclick");var r=e===Xi;if(s&&function(h,d,p,g,f){var I,S,C,$;if(p===void 0&&(p=void 0),!v||Ls(h)||(I=p)!=null&&I.url_allowlist&&!Nr(p.url_allowlist)||(S=p)!=null&&S.url_ignorelist&&Nr(p.url_ignorelist))return!1;if((C=p)!=null&&C.dom_event_allowlist){var R=p.dom_event_allowlist;if(R&&!R.some(y=>d.type===y))return!1}var{parentIsUsefulElement:_,targetElementList:P}=zr(h,g);if(!function(y,T){var O=T?.element_allowlist;if(x(O))return!0;var q,M=function(J){if(O.some(Z=>J.tagName.toLowerCase()===Z))return{v:!0}};for(var A of y)if(q=M(A))return q.v;return!1}(P,p)||!Hr(P,($=p)==null?void 0:$.css_selector_allowlist))return!1;var k=v.getComputedStyle(h);if(k&&k.getPropertyValue("cursor")==="pointer"&&d.type==="click")return!0;var E=h.tagName.toLowerCase();switch(E){case"html":return!1;case"form":return(f||["submit"]).indexOf(d.type)>=0;case"input":case"select":case"textarea":return(f||["change","click"]).indexOf(d.type)>=0;default:return _?(f||["click"]).indexOf(d.type)>=0:(f||["click"]).indexOf(d.type)>=0&&(Qs.indexOf(E)>-1||h.getAttribute("contenteditable")==="true")}}(s,i,this.qt,r,r?["copy","cut"]:void 0)){var{props:n,explicitNoCapture:a}=gl(s,{e:i,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsC
1hainAsString:this.Os});if(a)return!1;var o=this.getElementSelectors(s);if(o&&o.length>0&&(n.$element_selectors=o),e===Xi){var l,c=ga(v==null||(l=v.getSelection())==null?void 0:l.toString()),u=i.type||"clipboard";if(!c)return!1;n.$selected_content=c,n.$copy_type=u}return this.instance.capture(e,n),!0}}}isBrowserSupported(){return Oe(w?.querySelectorAll)}},historyAutocapture:class{constructor(i){var e;this._instance=i,this.Ns=(v==null||(e=v.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(b.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.$s&&this.$s(),this.$s=void 0,b.info("History API monitoring stopped")}monitorHistoryChanges(){var i,e;if(v&&v.history){var t=this;(i=v.history.pushState)!=null&&i.__posthog_wrapped__||Gr(v.history,"pushState",s=>function(r,n,a){s.call(this,r,n,a),t.Ds("pushState")}),(e=v.history.replaceState)!=null&&e.__posthog_wrapped__||Gr(v.history,"replaceState",s=>function(r,n,a){s.call(this,r,n,a),t.Ds("replaceState")}),this.qs()}}Ds(i){try{var e,t=v==null||(e=v.location)==null?void 0:e.pathname;if(!t)return;t!==this.Ns&&this.isEnabled&&this._instance.capture(at,{navigation_type:i}),this.Ns=t}catch(s){b.error("Error capturing "+i+" pageview",s)}}qs(){if(!this.$s){var i=()=>{this.Ds("popstate")};X(v,"popstate",i),this.$s=()=>{v&&v.removeEventListener("popstate",i)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(i){var e;this.js=!1,this.Ps=!1,this.Hs=null,this.instance=i,this.js=!((e=this.instance.persistence)==null||!e.props[cs]),this.rageclicks=new Wr(i.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var i=5e3;return Y(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(i=this.qt.capture_heatmaps.flush_interval_milliseconds),i}get isEnabled(){return D(this.qt.capture_heatmaps)?D(this.qt.enable_heatmaps)?this.js:this.qt.enable_heatmaps:this.qt.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Ps)return;_l.info("starting..."),this.Us(),this.At()}else{var i;clearInterval((i=this.Hs)!==null&&i!==void 0?i:void 0),this.Bs(),this.getAndClearBuffer()}}onRemoteConfig(i){if("heatmaps"in i){var e=!!i.heatmaps;this.instance.persistence&&this.instance.persistence.register({[cs]:e}),this.js=e,this.startIfEnabled()}}getAndClearBuffer(){var i=this.M;return this.M=void 0,i}zs(i){this.Mt(i.originalEvent,"deadclick")}At(){this.Hs&&clearInterval(this.Hs),this.Hs=w?.visibilityState==="visible"?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}Us(){v&&w&&(this.Vs=this.Zr.bind(this),X(v,mi,this.Vs),this.Ws=i=>this.Mt(i||v?.event),X(w,"click",this.Ws,{capture:!0}),this.Zs=i=>this.Gs(i||v?.event),X(w,"mousemove",this.Zs,{capture:!0}),this.Qs=new yr(this.instance,Po,this.zs.bind(this)),this.Qs.startIfEnabledOrStop(),this.Js=this.At.bind(this),X(w,_i,this.Js),this.Ps=!0)}Bs(){var i;v&&w&&(this.Vs&&v.removeEventListener(mi,this.Vs),this.Ws&&w.removeEventListener("click",this.Ws,{capture:!0}),this.Zs&&w.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Js&&w.removeEventListener(_i,this.Js),clearTimeout(this.Ks),(i=this.Qs)==null||i.stop(),this.Ps=!1)}Ys(i,e){var t=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),n=function(a,o,l){for(var c=a;c&&Ke(c)&&!Ee(c,"body");){if(c===l)return!1;if(L(o,v?.getComputedStyle(c).position))return!0;c=fa(c)}return!1}(jr(i),["fixed","sticky"],r);return{x:i.clientX+(n?0:s),y:i.clientY+(n?0:t),target_fixed:n,type:e}}Mt(i,e){var t;if(e===void 0&&(e="click"),!Dr(i.target)&&Kr(i)){var s=this.Ys(i,e);(t=this.rageclicks)!=null&&t.isRageClick(i.clientX,i.clientY,new Date().getTime())&&this.Xs(m({},s,{type:"rageclick"})),this.Xs(s)}}Gs(i){!Dr(i.target)&&Kr(i)&&(clearTimeout(this.Ks),this.Ks=setTimeout(()=>{this.Xs(this.Ys(i,"mousemove"))},500))}Xs(i){if(v){var e=v.location.href,t=this.qt.custom_personal_data_properties,s=this.qt.mask_personal_data_properties?[...ft,...t||[]]:[],r=Ht(e,s,Ut);this.M=this.M||{},this.M[r]||(this.M[r]=[]),this.M[r].push(i)}}Zr(){this.M&&!lt(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:yr,webVitalsAutocapture:class{constructor(i){var e;this.js=!1,this.Ps=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.M.metrics.length!==0&&(this._instance.capture("$web_vitals",this.M.metrics.reduce((t,s)=>m({},t,{["$web_vitals_"+s.name+"_event"]:m({},s),["$web_vitals_"+s.name+"_value"]:s.value}),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=t=>{var s;this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.io();if(!x(r))if(D(t?.name)||D(t?.value))ze.error("Invalid metric received",t);else if(!this.no||this.no>t.value){this.M.url!==r&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),x(this.M.url)&&(this.M.url=r),this.M.firstMetricTimestamp=x(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0),a=m({},t,{$current_url:r,timestamp:Date.now()});x(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.M.metrics.push(a),this.M.metrics.length===this.allowedMetrics.length&&this.eo()}else ze.error("Ignoring metric with value >= "+this.no,t)},this.so=()=>
1{if(!this.Ps){var t,s,r,n,a=F.__PosthogExtensions__;x(a)||x(a.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:s,onFCP:r,onINP:n}=a.postHogWebVitalsCallbacks),t&&s&&r&&n?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this.ht.bind(this)),this.Ps=!0):ze.error("web vitals callbacks not loaded - not starting")}},this._instance=i,this.js=!((e=this._instance.persistence)==null||!e.props[vs]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var i,e,t=Y(this.oo)?(i=this.oo)==null?void 0:i.web_vitals_allowed_metrics:void 0;return D(t)?((e=this._instance.persistence)==null?void 0:e.props[fs])||["CLS","FCP","INP","LCP"]:t}get flushToCaptureTimeoutMs(){return(Y(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var i=Y(this.oo)?this.oo.web_vitals_attribution:void 0;return i!=null&&i}get no(){var i=Y(this.oo)&&me(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:Yr;return i>0&&6e4>=i?Yr:i}get isEnabled(){var i=Q?.protocol;if(i!=="http:"&&i!=="https:")return ze.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Y(this.oo)?this.oo.web_vitals:Pe(this.oo)?this.oo:void 0;return Pe(e)?e:this.js}startIfEnabled(){this.isEnabled&&!this.Ps&&(ze.info("enabled, starting..."),this.lr(this.so))}onRemoteConfig(i){if("capturePerformance"in i){var e=Y(i.capturePerformance)&&!!i.capturePerformance.web_vitals,t=Y(i.capturePerformance)?i.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[vs]:e}),this._instance.persistence.register({[fs]:t})),this.js=e,this.startIfEnabled()}}lr(i){var e,t;(e=F.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?i():(t=F.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",s=>{s?ze.error("failed to load script",s):i()})}io(){var i=v?v.location.href:void 0;if(i){var e=this._instance.config.custom_personal_data_properties,t=this._instance.config.mask_personal_data_properties?[...ft,...e||[]]:[];return Ht(i,t,Ut)}ze.error("Could not determine current URL")}}},Pl={exceptionObserver:class{constructor(i){var e,t,s;this.so=()=>{var r;if(v&&this.isEnabled&&(r=F.__PosthogExtensions__)!=null&&r.errorWrappingFunctions){var n=F.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=F.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,o=F.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.qt.capture_unhandled_errors&&(this.ao=n(this.captureException.bind(this))),!this.uo&&this.qt.capture_unhandled_rejections&&(this.uo=a(this.captureException.bind(this))),!this.lo&&this.qt.capture_console_errors&&(this.lo=o(this.captureException.bind(this)))}catch(l){St.error("failed to start",l),this.ho()}}},this._instance=i,this.co=!((e=this._instance.persistence)==null||!e.props[hs]),this.do=new Ma({refillRate:(t=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&t!==void 0?t:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,Gt:St}),this.qt=this.vo(),this.startIfEnabledOrStop()}vo(){var i=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Y(i)?e=m({},e,i):(x(i)?this.co:i)&&(e=m({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(St.info("enabled"),this.ho(),this.lr(this.so)):this.ho()}lr(i){var e,t;(e=F.__PosthogExtensions__)!=null&&e.errorWrappingFunctions&&i(),(t=F.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"exception-autocapture",s=>{if(s)return St.error("failed to load script",s);i()})}ho(){var i,e,t;(i=this.ao)==null||i.call(this),this.ao=void 0,(e=this.uo)==null||e.call(this),this.uo=void 0,(t=this.lo)==null||t.call(this),this.lo=void 0}onRemoteConfig(i){"autocaptureExceptions"in i&&(this.co=!!i.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[hs]:this.co}),this.qt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.vo()}
1captureException(i){var e,t,s,r=(e=i==null||(t=i.$exception_list)==null||(t=t[0])==null?void 0:t.type)!==null&&e!==void 0?e:"Exception";this.do.consumeRateLimit(r)?St.info("Skipping exception capture because of client rate limiting.",{exception:r}):(s=this._instance.exceptions)==null||s.sendExceptionEvent(i)}},exceptions:class{constructor(i){var e,t;this.fo=[],this.po=new Ga([new to,new co,new so,new io,new lo,new oo,new no,new uo],function(s){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;r>a;a++)n[a-1]=arguments[a];return function(o,l){l===void 0&&(l=0);for(var c=[],u=o.split(` 2`),h=l;u.length>h;h++){var d=u[h];if(1024>=d.length){var p=gr.test(d)?d.replace(gr,"$1"):d;if(!p.match(/\S*Error: /)){for(var g of n){var f=g(p,s);if(f){c.push(f);break}}if(c.length>=50)break}}}return function(I){if(!I.length)return[];var S=Array.from(I);return S.reverse(),S.slice(0,50).map(C=>{return m({},C,{filename:C.filename||($=S,$[$.length-1]||{}).filename,function:C.function||gt});var $})}(c)}}("web:javascript",Ka,eo)),this._instance=i,this.fo=(e=(t=this._instance.persistence)==null?void 0:t.get_property(ds))!==null&&e!==void 0?e:[],this.mo=hi(this.yo()),this.bo=new po(this.mo)}onConfigChange(){this.mo=hi(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(i){var e,t,s;if("errorTracking"in i){var r=(e=(t=i.errorTracking)==null?void 0:t.suppressionRules)!==null&&e!==void 0?e:[],n=(s=i.errorTracking)==null?void 0:s.captureExtensionExceptions;this.fo=r,this._instance.persistence&&this._instance.persistence.register({[ds]:this.fo,[ps]:n})}}get _o(){var i,e=!!this._instance.get_property(ps),t=this._instance.config.error_tracking.captureExtensionExceptions;return(i=t??e)!==null&&i!==void 0&&i}buildProperties(i,e){return this.po.buildFromUnknown(i,{syntheticException:e?.syntheticException,mechanism:{handled:e?.handled}})}addExceptionStep(i,e){if(this.mo.enabled)try{if(!B(i)||i.trim().length===0)return void Te.warn("Ignoring exception step because message must be a non-empty string");var t=this.wo(e),{sanitizedProperties:s,droppedKeys:r}=function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(n).reduce((o,l)=>ho.has(l)?(a.push(l),o):(o[l]=n[l],o),{}),droppedKeys:a}}(t);r.length>0&&Te.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.bo.add(m({[ui]:i,[ci]:new Date().toISOString()},s))}catch(n){Te.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(i){try{var e=i.$exception_list;if(this.xo(e)){if(this.So(e))return this.ko("Exception dropped: matched a suppression rule"),void Te.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.Co(e))return this.ko("Exception dropped: thrown by a browser extension"),void Te.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Io(e))return this.ko("Exception dropped: thrown by the PostHog SDK"),void Te.info("Skipping exception capture because it was thrown by the PostHog SDK")}var t=this.mo.enabled&&D(i.$exception_steps)?this.To(i):i;try{var s=this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return s&&this.bo.clear(),s}catch(r){return Te.error("Failed to capture exception event. Dropping this exception.",r),void this.bo.clear()}}catch(r){return void Te.error("Failed to process exception event. Ignoring this exception.",r)}}To(i){try{var e=this.bo.getAttachable();return e.length===0?i:m({},i,{$exception_steps:e})}catch(t){return Te.error("Failed to read buffered exception steps. Capturing exception without steps.",t),i}}ko(i){this.mo.enabled&&this.bo.add({[ui]:i,[ci]:new Date().toISOString()})}wo(i){return Y(i)?m({},i):{}}yo(){var i,e;return(i=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&i!==void 0?i:{}}So(i){if(i.length===0)return!1;var e=i.reduce((t,s)=>{var{type:r,value:n}=s;return B(r)&&r.length>0&&t.$exception_types.push(r),B(n)&&n.length>0&&t.$exception_values.push(n),t},{$exception_types:[],$exception_values:[]});return this.fo.some(t=>{var s=t.values.map(r=>{var n,a=ua[r.operator],o=N(r.value)?r.value:[r.value],l=(n=e[r.key])!==null&&n!==void 0?n:[];return o.length>0&&a(o,l)});return t.type==="OR"?s.some(Boolean):s.every(Boolean)})}Co(i){return i.flatMap(e=>{var t,s;return(t=(s=e.stacktrace)==null?void 0:s.frames)!==null&&t!==void 0?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}Io(i){if(i.length>0){var e,t,s,r,n=(e=(t=i[0].stacktrace)==null?void 0:t.frames)!==null&&e!==void 0?e:[],a=n[n.length-1];return(s=a==null||(r=a.filename)==null?void 0:r.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}xo(i){return!D(i)&&N(i)}}},$l=m({productTours:class{get ni(){return this._instance.persistence}constructor(i){this.Eo=null,this.Mo=null,this._instance=i}initialize(){this.loadIfEnabled()}onRemoteConfig(i){"productTours"in i&&(this.ni&&this.ni.register({[gs]:!!i.productTours}),this.loadIfEnabled())}loadIfEnabled(){var i,e;this.Eo||(i=this._instance).config.disable_product_tours||(e=i.persistence)==null||!e.get_property(gs)||this.lr(()=>this.Po())}lr(i){var e,t;(e=F.__PosthogExtensions__)!=null&&e.generateProductTours?i():(t=F.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"product-tours",s=>{s?Zr.error("Could not load product tours script",s):i()})}Po(){var i;!this.Eo&&(i=F.__PosthogExtensions__)!=null&&i.generateProductTours&&(this.Eo=F.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(i,e){if(e===void 0&&(e=!1),!N(this.Mo)||e){var t=this.ni;if(t){var s=t.props[si];if(N(s)&&!e)return this.Mo=s,void i(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:r=>{var n=r.statusCode;if(n!==200||!r.json){var a="Product Tours API could not be loaded, status: "+n;return Zr.error(a),void i([],{isLoaded:!1,error:a})}var o=N(r.json.product_tours)?r.json.product_tours:[];this.Mo=o,t&&t.register({[si]:o}),i(o,{isLoaded:!0})}})}else i(this.Mo,{isLoaded:!0})}getActiveProductTours(i){D(this.Eo)?i([],{isLoaded:!1,error:"Product tours not loaded"}):this.Eo.getActiveProductTours(i)}showProductTour(i){var e;(e=this.Eo)==null||e.showTourById(i)}previewTour(i){this.Eo?this.Eo.previewTour(i):this.lr(()=>{var e;this.Po(),(e=this.Eo)==null||e.previewTour(i)})}dismissProductTour(){var i;(i=this.Eo)==null||i.dismissTour("user_clicked_skip")}nextStep(){var i;(i=this.Eo)==null||i.nextStep()}previousStep(){var i;(i=this.Eo)==null||i.previousStep()}clearCache(){var i;this.Mo=null,(i=this.ni)==null||i.unregister(si)}resetTour(i){var e;(e=this.Eo)==null||e.resetTour(i)}resetAllTours(){var i;(i=this.Eo)==null||i.resetAllTours()}cancelPendingTour(i){var e;(e=this.Eo)==null||e.cancelPendingTour(i)}}},Ii),Fl={siteApps:class{constructor(i){this._instance=i,this.Ro=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Oo(i,e){if(e){var t=this.globalsForEvent(e);this.Ro.push(t),this.Ro.length>1e3&&(this.Ro=this.Ro.slice(10))}}get siteAppLoaders(){var i;return(i=F._POSTHOG_REMOTE_CONFIG)==null||(i=i[this._instance.config.token])==null?void 0:i.siteApps}initialize(){if(this.isEnabled){var i=this._instance._addCaptureHook(this.Oo.bind(this));this.Lo=()=>{i(),this.Ro=[],this.Lo=void 0}}}globalsForEvent(i){var e,t,s,r,n,a,o;if(!i)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[h,d]of Object.entries(u))l[h]={id:c[h],type:h,properties:d};var{$set_once:p,$set:g}=i;return{event:m({},ln(i,ml),{properties:m({},i.properties,g?{$set:m({},(e=(t=i.properties)==null?void 0:t.$set)!==null&&e!==void 0?e:{},g)}:{},p?{$set_once:m({},(s=(r=i.properties)==null?void 0:r.$set_once)!==null&&s!==void 0?s:{},p)}:{}),elements_chain:(n=(a=i.properties)==null?void 0:a.$elements_chain)!==null&&n!==void 0?n:"",distinct_id:(o=i.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(i){var e=this.apps[i.id],t=()=>{var a;!e.errored&&this.Ro.length&&(Ne.info("Processing "+this.Ro.length+" events for site app with id "+i.id),this.Ro.forEac
2h(o=>e.processEvent==null?void 0:e.processEvent(o)),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((a=this.Lo)==null||a.call(this))},s=!1,r=a=>{e.errored=!a,e.loaded=!0,Ne.info("Site app with id "+i.id+" "+(a?"loaded":"errored")),s&&t()};try{var{processEvent:n}=i.init({posthog:this._instance,callback(a){r(a)}});n&&(e.processEvent=n),s=!0}catch(a){Ne.error(Qr+i.id,a),r(!1)}if(s&&e.loaded)try{t()}catch(a){Ne.error("Error while processing buffered events PostHog app with config id "+i.id,a),e.errored=!0}}Fo(){var i=this.siteAppLoaders||[];for(var e of i)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var t of i)this.setupSiteApp(t)}Ao(i){if(Object.keys(this.apps).length!==0){var e=this.globalsForEvent(i);for(var t of Object.values(this.apps))try{t.processEvent==null||t.processEvent(e)}catch(s){Ne.error("Error while processing event "+i.event+" for site app "+t.id,s)}}}onRemoteConfig(i){var e,t,s,r=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Fo(),void this._instance.on("eventCaptured",l=>this.Ao(l))):void Ne.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((t=this.Lo)==null||t.call(this),(s=i.siteApps)!=null&&s.length)if(this.isEnabled){var n=function(l){var c;F["__$$ph_site_app_"+l]=r._instance,(c=F.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(r._instance,o,u=>{if(u)return Ne.error(Qr+l,u)})};for(var{id:a,url:o}of i.siteApps)n(a)}else Ne.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Il={tracingHeaders:class{constructor(i){this.No=void 0,this.$o=void 0,this.so=()=>{var e,t,s=this.Do()||[];x(this.No)&&((e=F.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(s,this._instance.get_distinct_id(),this._instance.sessionManager)),x(this.$o)&&((t=F.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchFetch(s,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=i}initialize(){this.startIfEnabledOrStop()}lr(i){var e,t;(e=F.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns&&i(),(t=F.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"tracing-headers",s=>{if(s)return fl.error("failed to load script",s);i()})}Do(){var i;return(i=this._instance.config.addTracingHeaders)!==null&&i!==void 0?i:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var i,e;this.Do()?this.lr(this.so):((i=this.No)==null||i.call(this),(e=this.$o)==null||e.call(this),this.No=void 0,this.$o=void 0)}}},Rl=m({surveys:class{get qt(){return this._instance.config}constructor(i){this.qo=void 0,this._surveyManager=null,this.jo=!1,this.Ho=[],this.Uo=null,this._instance=i,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(!this.qt.disable_surveys){var e=i.surveys;if(D(e))return j.warn("Flags not loaded yet. Not loading surveys.");var t=N(e);this.qo=t?e.length>0:e,j.info("flags response received, isSurveysEnabled: "+this.qo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var i=[],e=0;e<localStorage.length;e++){var t=localStorage.key(e);(t!=null&&t.startsWith(As)||t!=null&&t.startsWith("inProgressSurvey_"))&&i.push(t)}i.forEach(s=>localStorage.removeItem(s))}loadIfEnabled(){if(!this._surveyManager)if(this.jo)j.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)j.info(en);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())j.info("Not loading surveys in cookieless mode without consent.");else{var i=F?.__PosthogExtensions__;if(i){if(!x(this.qo)||this.qt.advanced_enable_surveys){var e=this.qo||this.qt.advanced_enable_surveys;this.jo=!0;try{var t=i.generateSurveys;if(t)return void this.Bo(t,e);var s=i.loadExternalDependency;if(!s)return void this.zo(Gs);s(this._instance,"surveys",r=>{r||!i.generateSurveys?this.zo("Could not load surveys script",r):this.Bo(i.generateSurveys,e)})}catch(r){throw this.zo("Error initializing surveys",r),r}finally{this.jo=!1}}}else j.error("PostHog Extensions not found.")}}Bo(i,e){this._surveyManager=i(this._instance,e),this._surveyEventReceiver=new wl(this._instance),j.info("Surveys loaded successfully"),this.Vo({isLoaded:!0})}zo(i,e){j.error(i,e),this.Vo({isLoaded:!1,error:i})}onSurveysLoaded(i){return this.Ho.push(i),this._surveyManager&&this.Vo({isLoaded:!0}),()=>{this.Ho=this.Ho.filter(e=>e!==i)}}getSurveys(i,e){if(e===void 0&&(e=!1),this.qt.disable_surveys)return j.info(en),i([]);var t,s=this._instance.get_property(bs);if(s&&!e)return i(s,{isLoaded:!0});typeof Promise<"u"&&this.Uo?this.Uo.then(r=>{var{surveys:n,context:a}=r;return i(n,a)}):(typeof Promise<"u"&&(this.Uo=new Promise(r=>{t=r})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qt.token),method:"GET",timeout:this.qt.surveys_request_timeout_ms,callback:r=>{var n;this.Uo=null;var a=r.statusCode;if(a!==200||!r.json){var o="Surveys API could not be loaded, status: "+a;j.error(o);var l={isLoaded:!1,error:o};return i([],l),void(t==null||t({surveys:[],context:l}))}var c,u=r.json.surveys||[],h=u.filter(p=>function(g){return!(!g.start_date||g.end_date)}
2(p)&&(function(g){var f;return!((f=g.conditions)==null||(f=f.events)==null||(f=f.values)==null||!f.length)}(p)||function(g){var f;return!((f=g.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)}(p)));h.length>0&&((c=this._surveyEventReceiver)==null||c.register(h)),(n=this._instance.persistence)==null||n.register({[bs]:u});var d={isLoaded:!0};i(u,d),t?.({surveys:u,context:d})}}))}Vo(i){for(var e of this.Ho)try{if(!i.isLoaded)return e([],i);this.getSurveys(e)}catch(t){j.error("Error in survey callback",t)}}getActiveMatchingSurveys(i,e){if(e===void 0&&(e=!1),!D(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(i,e);j.warn("init was not called")}Wo(i){var e=null;return this.getSurveys(t=>{var s;e=(s=t.find(r=>r.id===i))!==null&&s!==void 0?s:null}),e}Zo(i){if(D(this._surveyManager))return{eligible:!1,reason:Zi};var e=typeof i=="string"?this.Wo(i):i;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(i){if(D(this._surveyManager))return j.warn("init was not called"),{visible:!1,disabledReason:Zi};var e=this.Zo(i);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(i,e){return D(this._surveyManager)?(j.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Zi})):new Promise(t=>{this.getSurveys(s=>{var r,n=(r=s.find(o=>o.id===i))!==null&&r!==void 0?r:null;if(n){var a=this.Zo(n);t({visible:a.eligible,disabledReason:a.reason})}else t({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(i,e,t){var s;if(D(this._surveyManager))j.warn("init was not called");else{var r=typeof i=="string"?this.Wo(i):i;if(r!=null&&r.id)if(Zo.includes(r.type)){var n=w?.querySelector(e);if(n)return(s=r.appearance)!=null&&s.surveyPopupDelaySeconds?(j.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,o;j.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(r,n,t),j.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,t);j.warn("Survey element not found")}else j.warn("Surveys of type "+r.type+" cannot be rendered in the app");else j.warn("Survey not found")}}displaySurvey(i,e){var t;if(D(this._surveyManager))j.warn("init was not called");else{var s=this.Wo(i);if(s){var r=s;if((t=s.appearance)!=null&&t.surveyPopupDelaySeconds&&e.ignoreDelay&&(r=m({},s,{appearance:m({},s.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Is.Popover&&e.initialResponses&&j.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var n=this.canRenderSurvey(s);if(!n.visible)return void j.warn("Survey is not eligible to be displayed: ",n.disabledReason)}e.displayType!==Is.Inline?this._surveyManager.handlePopoverSurvey(r,e):this.renderSurvey(r,e.selector,e.properties)}else j.warn("Survey not found")}}cancelPendingSurvey(i){D(this._surveyManager)?j.warn("init was not called"):this._surveyManager.cancelSurvey(i)}handlePageUnload(){var i;(i=this._surveyManager)==null||i.handlePageUnload()}}},Ii),Tl={toolbar:class{constructor(i){this.instance=i}Go(i){F.ph_toolbar_state=i}Qo(){var i;return(i=F.ph_toolbar_state)!==null&&i!==void 0?i:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(i,e,t){if(i===void 0&&(i=void 0),e===void 0&&(e=void 0),t===void 0&&(t=void 0),Vn(this.instance.config)||!v||!w)return!1;i=i??v.location,t=t??v.history;try{if(!e){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}e=v?.localStorage}var s,r=xl||wi(i.hash,"__posthog")||wi(i.hash,"state"),n=r?_r(()=>JSON.parse(atob(decodeURIComponent(r))))||_r(()=>JSON.parse(decodeURIComponent(r))):null;return n&&n.action==="ph_authorize"?((s=n).source="url",s&&Object.keys(s).length>0&&(n.desiredHash?i.hash=n.desiredHash:t?t.replaceState(t.state,"",i.pathname+i.search):i.hash="")):((s=JSON.parse(e.getItem(tn)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch{return!1}}Jo(i){var e=F.ph_load_toolbar||F.ph_load_editor;!D(e)&&Oe(e)?e(i,this.instance):sn.warn("No toolbar load function found")}loadToolbar(i){var e=!(w==null||!w.getElementById(jn));if(!v||e)return!1;var t=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=m({token:this.instance.config.token},i,{apiURL:this.instance.requestRouter.endpointFor("ui")},t?{instrument:!1}:{});if(v.localStorage.setItem(tn,JSON.stringify(m({},s,{source:void 0}))),this.Qo()===2)this.Jo(s);else if(this.Qo()===0){var r;this.Go(1),(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"toolbar",n=>{if(n)return sn.error("[Toolbar] Failed to load",n),void this.Go(0);this.Go(2),this.Jo(s)}),X(v,"turbolinks:load",()=>{this.Go(0),this.loadToolbar(s)})}return!0}Ko(i){return this.loadToolbar(i)}maybeLoadEditor(i,e,t){return i===void 0&&(i=void 0),e===void 0&&(e=void 0),t===void 0&&(t=void 0),this.maybeLoadToolbar(i,e,t)}}},Cl=m({experiments:se},Ii),Ol={conversations:class{constructor(i){this.Yo=void 0,this._conversationsManager=null,this.Xo=!1,this.ea=null,this._instance=i}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(!this._instance.config.disable_conversations){var e=i.conversations;D(e)||(Pe(e)?this.Yo=e:(this.Yo=e.enabled,this.ea=e),this.loadIfEnabled())}}reset(){var i;(i=this._conversationsManager)==null||i.reset(),this._conversationsManager=null,this.Yo=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Xo||this._instance.config.disable_conversations||Vn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var i=F?.__PosthogExtensions__;if(i&&!x(this.Yo)&&this.Yo)if(this.ea&&this.ea.token){this.Xo=!0;try{var e=i.initConversations;if(e)return this.ta(e),void(this.Xo=!1);var t=i.loadExternalDependency;if(!t)return void this.ra(Gs);t(this._instance,"conversations",s=>{s||!i.initConversations?this.ra("Could not load conversations script",s):this.ta(i.initConversations),this.Xo=!1})}catch(s){this.ra("Error initializing conversations",s),this.Xo=!1}}else ge.error("Conversations enabled but missing token in remote config.")}}ta(i){if(this.ea)try{this._conversationsManager=i(this.ea,this._instance),ge.info("Conversations loaded successfully")}catch(e){this.ra("Error completing conversations initialization",e)}else ge.error("Cannot complete initialization: remote config is null")}ra(i,e){ge.error(i,e),this._conversationsManager=null,this.Xo=!1}show(){this._conversationsManager?this._conversationsManager.show():ge.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Yo===!0&&!qe(this._conversationsManager)}isVisible(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&i!==void 0&&i}sendMessage(i,e,t){var s=this;return he(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(i,e,t):(ge.warn(Be),null)})()}getMessages(i,e){var t=this;return he(function*(){return t._conversationsManager?t._conversationsManager.getMessages(i,e):(ge.warn(Be),null)})()}markAsRead(i){var e=this;return he(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(i):(ge.warn(Be),null)})()}getTickets(i){var e=this;return he(function*(){return e._conversationsManager?e._conversationsManager.getTickets(i):(ge.warn(Be),null)})()}requestRestoreLink(i){var e=this;return he(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(i):(ge.warn(Be),null)})()}restoreFromToken(i){var e=this;return he(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(i):(ge.warn(Be),null)})()}restoreFromUrlToken(){var i=this;return he(function*(){return i._conversationsManager?i._conversationsManager.restoreFromUrlToken():(ge.warn(Be),null)})()}getCurrentTicketId(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&i!==void 0?i:null}getWidgetSessionId(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&i!==void 0?i:null}ln(){var i;(i=this._conversationsManager)==null||i.setIdentity()}hn(){var i;(i=this._conversationsManager)==null||i.clearIdentity()}}},Ml={logs:class{constructor(i){var e;this.ia=!1,this.na=!1,this.Gt=z("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.ua=!1,this._instance=i,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(i){var e,t=(e=i.logs)==null?void 0:e.captureConsoleLogs;!D(t)&&t&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.oa=0,this.aa=0,this.ua=!1}loadIfEnabled(){if(this.ia&&!this.na){var i=F?.__PosthogExtensions__;if(i){var e=i.loadExternalDependency;e?e(this._instance,"logs",t=>{var s;t||(s=i.logs)==null||!s.initializeLogs?this.Gt.error("Could not load logs script",t):(i.logs.initializeLogs(this._instance),this.na=!0)}):this.Gt.error(Gs)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(i){var e,t,s,r,n,a;if(this._instance.is_capturing())if(i&&i.body){var o=(e=(t=this._instance.config.logs)==null?void 0:t.flushIntervalMs)!==null&&e!==void 0?e:3e3,l=(s=(r=this._instance.config.logs)==null?void 0:r.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,c=Date.now();if(o>c-this.aa||(this.aa=c,this.oa=0,this.ua=!1),l>this.oa){this.oa++;var u=function(h,d){var p=h.level||"info",{text:g,number:f}=Rn[p]||Ba,I=String(Date.now())+"000000",S={};d.distinctId&&(S.posthogDistinctId=d.distinctId),d.sessionId&&(S.sessionId=d.sessionId),d.currentUrl&&(S["url.full"]=d.currentUrl),d.screenName&&(S["screen.name"]=d.screenName),d.appState&&(S["app.state"]=d.appState),d.activeFeatureFlags&&d.activeFeatureFlags.length>0&&(S.feature_flags=d.activeFeatureFlags);var C=m({},S,h.attributes||{}),$={timeUnixNano:I,observedTimeUnixNano:I,severityNumber:f,severityText:g,body:{stringValue:h.body},attributes:vr(C)};return h.trace_id&&($.traceId=h.trace_id),h.span_id&&($.spanId=h.span_id),x(h.trace_flags)||($.flags=h.trace_flags),$}(i,this.la());this.sa.push({record:u}),((n=(a=this._instance.config.logs)==null?void 0:a.maxBufferSize)!==null&&n!==void 0?n:100)>this.sa.length?this.ha():this.flushLogs()}else this.ua||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+o+"ms"),this.ua=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(i,e)=>this.captureLog({body:i,level:"trace",attributes:e}),debug:(i,e)=>this.captureLog({body:i,level:"debug",attributes:e}),info:(i,e)=>this.captureLog({body:i,level:"info",attributes:e}),warn:(i,e)=>this.captureLog({body:i,level:"warn",attributes:e}),error:(i,e)=>this.captureLog({body:i,level:"error",attributes:e}),fatal:(i,e)=>this.captureLog({body:i,level:"fatal",attributes:e})}),this.ca}flushLogs(i){if(this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.sa.length!==0){var e=this.sa;this.sa=[];var t=this._instance.config.logs,s=m({"service.name":t?.serviceName||"unknown_service"},t?.environment&&{"deployment.environment":t.environment},t?.serviceVersion&&{"service.version":t.serviceVersion}
2,t?.resourceAttributes),r=function(a,o,l,c){return{resourceLogs:[{resource:{attributes:vr(o)},scopeLogs:[{scope:{name:l,version:c},logRecords:a}]}]}}(e.map(a=>a.record),s,ae.LIB_NAME,ae.LIB_VERSION),n=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Bi({method:"POST",url:n,data:r,compression:"best-available",batchKey:"logs",transport:i})}}ha(){var i,e;this.qr||(this.qr=setTimeout(()=>{this.qr=void 0,this.flushLogs()},(i=(e=this._instance.config.logs)==null?void 0:e.flushIntervalMs)!==null&&i!==void 0?i:3e3))}la(){var i,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:t}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=t}if(F!=null&&(i=F.location)!=null&&i.href&&(e.currentUrl=F.location.href),this._instance.featureFlags){var s=this._instance.featureFlags.getFlags();s&&s.length>0&&(e.activeFeatureFlags=s)}return e}}},Al=m({},Ii,kl,Sl,Pl,$l,Fl,Rl,Il,Tl,Cl,Ol,Ml);fe.__defaultExtensionClasses=m({},Al);var on,ql=(on=qt[ot]=new fe,function(){function i(){i.done||(i.done=!0,da=!1,H(qt,function(e){e._dom_loaded()}))}w!=null&&w.addEventListener?w.readyState==="complete"?i():X(w,"DOMContentLoaded",i,{capture:!1}):v&&b.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),on);export{ke as Compression,Is as DisplaySurveyType,fe as PostHog,Ao as ProductTourEventName,xr as ProductTourEventProperties,Ct as SurveyEventName,zi as SurveyEventProperties,bt as SurveyEventType,Ui as SurveyType,ql as default,ql as posthog};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.