@funnel10x/tracking 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tag.js CHANGED
@@ -1,10 +1,10 @@
1
- (()=>{var b="u">typeof window?window:void 0,be="u">typeof globalThis?globalThis:b,pe=be==null?void 0:be.navigator,E=be==null?void 0:be.document,K=be==null?void 0:be.location,Ci=be==null?void 0:be.fetch,nr=be!=null&&be.XMLHttpRequest&&"withCredentials"in new be.XMLHttpRequest?be.XMLHttpRequest:void 0,to=be==null?void 0:be.AbortController,sd=be==null?void 0:be.CompressionStream,xe=pe==null?void 0:pe.userAgent,li=typeof globalThis!="undefined"?globalThis:b;li&&typeof self=="undefined"&&(li.self=li),li&&typeof File=="undefined"&&(li.File=function(){});var F=b!=null?b:{},io="0.9.2",st={DEBUG:!1,LIB_VERSION:io,LIB_NAME:"browser-common",JS_SDK_VERSION:io},Ye=(function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({}),Pn=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),nd=["$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"],rd=["token"];function A(e,t){return e.indexOf(t)!==-1}var Zt=function(e){return e.trim()},Mn=function(e){return e.replace(/^\$/,"")};function Da(e){var t;let i=[];return(t=JSON.stringify(e,function(s,n){if(typeof n=="bigint")return n.toString();if(typeof n!="function"&&typeof n!="symbol"){if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n=="object"){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(n))return"[Circular]";i.push(n)}return n}}))!==null&&t!==void 0?t:"null"}var Na=Object.prototype,rr=Na.hasOwnProperty,Ms=Na.toString,O=Array.isArray||function(e){return Ms.call(e)==="[object Array]"},le=e=>typeof e=="function",j=e=>e===Object(e)&&!O(e),Me=e=>{if(j(e)){for(let t in e)if(rr.call(e,t))return!1;return!0}return!1},x=e=>e===void 0,V=e=>Ms.call(e)=="[object String]",bi=e=>V(e)&&e.trim().length===0,ne=e=>e===null,L=e=>x(e)||ne(e),oe=e=>Ms.call(e)=="[object Number]"&&e==e,Qe=e=>oe(e)&&e>0,Se=e=>Ms.call(e)==="[object Boolean]",od=e=>A(nd,e),ad=e=>A(rd,e);function ja(e){return e===null||typeof e!="object"}function ls(e,t){return{}.toString.call(e)===`[object ${t}]`}function ii(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Va(e,Error)}}function or(e){return"u">typeof Event&&Va(e,Event)}function Va(e,t){try{return e instanceof t}catch{return!1}}var ld=[!0,"true",1,"1","yes"],Vs=e=>A(ld,e),cd=[!1,"false",0,"0","no"];function so(e,t,i,s,n,r,o){try{var a=e[r](o),l=a.value}catch(c){return void i(c)}a.done?t(l):Promise.resolve(l).then(s,n)}function ee(e){return function(){var t=this,i=arguments;return new Promise(function(s,n){var r=e.apply(t,i);function o(l){so(r,s,n,o,a,"next",l)}function a(l){so(r,s,n,o,a,"throw",l)}o(void 0)})}}var ud=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],zi=new Map,no=function(e,t=[]){if(!e)return!1;let i=(function(o,a){let l="";for(let c=0;a.length>c;c++){let u=a[c];l+=u.length+":"+u}return o.length+":"+o+"|"+a.length+":"+l})(e,t),s=zi.get(i);if(s!==void 0)return s;let n=e.toLowerCase(),r=ud.concat(t).some(o=>n.indexOf(o.toLowerCase())!==-1);return 256>zi.size||zi.clear(),zi.set(i,r),r};function Xe(e,t,i,s,n){return t>i&&(s.warn("min cannot be greater than max."),t=i),oe(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),Xe(n!=null?n:i,t,i,s))}var dd=class{constructor(e){this.C={},this.I=e.I,this.R=Xe(e.bucketSize,0,100,e.A),this.$=Xe(e.refillRate,0,this.R,e.A),this.O=Xe(e.refillInterval,0,864e5,e.A)}F(e,t){let i=Math.floor((t-e.lastAccess)/this.O);i>0&&(e.tokens=Math.min(e.tokens+i*this.$,this.R),e.lastAccess=e.lastAccess+i*this.O)}consumeRateLimit(e){var t;let i=Date.now(),s=String(e),n=this.C[s];return n?this.F(n,i):(n={tokens:this.R,lastAccess:i},this.C[s]=n),n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.I)===null||t===void 0||t.call(this,e)),n.tokens===0)}stop(){this.C={}}},Yt="Mobile",Fi="Android",cs="Tablet",Ha="Android Tablet",Wa="iPad",Ba="Apple Watch",es="Safari",Ts="BlackBerry",Ua="Samsung Internet",ts="Chrome",za="Chrome iOS",Ga="Internet Explorer",qa="Internet Explorer Mobile",Za="Opera",Ya="Microsoft Edge",is="Firefox",Xa="Firefox iOS",us="Nintendo",ds="PlayStation",Is="Xbox",Ja="Android Mobile",Ka="Mobile Safari",Hs="Windows",Qa="Windows Phone",ro="Nokia",Tn="Ouya",hd="Generic "+Yt.toLowerCase(),el="Generic "+cs.toLowerCase(),In="Konqueror",tl="Oculus Browser",il="Vivaldi",sl="Yandex",nl="Whale",rl="DuckDuckGo",ol="Pale Moon",al="Waterfox",Cn="Brave",ll="Claude",cl="Codex",ul="ChatGPT",dl="Google Search App",Ws=new RegExp("Version/(\\d+(\\.\\d+)?)"),Bs=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),pd=new RegExp(Is,"i"),fd=new RegExp("PlayStation \\w+","i"),vd=new RegExp("Nintendo \\w+","i"),ar=new RegExp("BlackBerry|PlayBook|BB10","i"),gd={"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"},hl=function(e,t,i,s){return t=t||"",(function(r){return r!=null&&r.brave?Cn:null})(i)||(s!=null&&s.detectGoogleSearchApp&&A(e,"GSA/")?dl:A(e," OPR/")&&A(e,"Mini")?"Opera Mini":A(e," OPR/")?Za:ar.test(e)?Ts:A(e,"IEMobile")||A(e,"WPDesktop")?qa:A(e,"OculusBrowser")?tl:A(e,"SamsungBrowser")?Ua:A(e,"Edge")||A(e,"Edg/")?Ya:A(e,"Vivaldi/")?il:A(e,"YaBrowser/")?sl:A(e,"Whale/")?nl:A(e,"DuckDuckGo/")||A(e,"Ddg/")?rl:A(e,"Claude/")?ll:A(e,"Codex/")?cl:A(e,"ChatGPT/")?ul:A(e,"FBIOS")?"Facebook Mobile":A(e,"UCWEB")||A(e,"UCBrowser")?"UC Browser":A(e,"CriOS")?za:A(e,"CrMo")||A(e,ts)?ts:A(e,Fi)&&A(e,es)?Ja:A(e,"FxiOS")?Xa:A(e.toLowerCase(),In.toLowerCase())?In:A(e,"Brave/")?Cn:((r,o)=>o&&A(o,"Apple")||(function(a){return A(a,es)&&!A(a,ts)&&!A(a,Fi)})(r))(e,t)?A(e,Yt)?Ka:es:A(e,"PaleMoon/")?ol:A(e,"Waterfox/")?al:A(e,is)?is:A(e,"MSIE")||A(e,"Trident/")?Ga:A(e,"Gecko")?is:"")},_d={[qa]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[Ya]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ts]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[za]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[es]:[Ws],[Ka]:[Ws],[Za]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[is]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[Xa]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[In]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Ts]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Ws],[Ja]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[Ua]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[tl]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[il]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[sl]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[nl]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Cn]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[ll]:[Bs],[cl]:[Bs],[ul]:[Bs],[rl]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[ol]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[al]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[dl]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[Ga]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},md=function(e,t,i,s){let n=hl(e,t,i,s),r=_d[n];if(x(r))return null;for(let o=0;r.length>o;o++){let a=e.match(r[o]);if(a)return parseFloat(a[a.length-2])}return null},oo=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[Is,e&&e[1]||""]],[new RegExp(us,"i"),[us,""]],[new RegExp(ds,"i"),[ds,""]],[ar,[Ts,""]],[new RegExp(Hs,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Qa,""];if(new RegExp(Yt).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];let i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){let s=gd[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[Hs,s]}return[Hs,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=x(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[Fi,[e[2],e[3],e[4]||"0"].join(".")]:[Fi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],pl=function(e){for(let t=0;oo.length>t;t++){let[i,s]=oo[t],n=i.exec(e),r=n&&(le(s)?s(n,e):s);if(r)return r}return["",""]},fl=function(e){return vd.test(e)?us:fd.test(e)?ds:pd.test(e)?Is:new RegExp(Tn,"i").test(e)?Tn:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?Qa:/iPad/.test(e)?Wa:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ba:ar.test(e)?Ts:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ro,"i").test(e)?ro:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Yt).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Fi:Ha:new RegExp("(pda|Mobile)","i").test(e)?hd:new RegExp(cs,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?el:""},yd=function(e,t){var i;let s=fl(e);return s===Wa||s===Ha||s==="Kobo"||s==="Kindle Fire"||s===el?cs:s===us||s===Is||s===ds||s===Tn?"Console":s===Ba?"Wearable":s?Yt:(t==null?void 0:t.userAgentDataPlatform)==="Android"&&((i=t==null?void 0:t.maxTouchPoints)!==null&&i!==void 0?i:0)>0?600>Math.min((n=t==null?void 0:t.screenWidth)!==null&&n!==void 0?n:0,(r=t==null?void 0:t.screenHeight)!==null&&r!==void 0?r:0)/((o=t==null?void 0:t.devicePixelRatio)!==null&&o!==void 0?o:1)?Yt:cs:"Desktop";var n,r,o},Us=/\bFBAV\/(\d+(?:\.\d+)*)/i,ao=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Us],[/\bFBAN\/EMA\b/i,"Facebook Lite",Us],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Us],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Fn="[Truncated]",Ni="[Unserializable]";function zt(e){let t="";for(let i=0;e.length>i;i++){let s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"\uFFFD";else{let n=e.charCodeAt(i+1);56320>n||n>57343?t+="\uFFFD":(t+=e[i]+e[i+1],i++)}}return t}function vl(e,t){if(!t)return e;let i=[];try{i=Object.keys(t)}catch{i=[]}for(let s of i){let n;try{n=t[s]}catch{n=Ni}Object.defineProperty(e,s,{value:n,enumerable:!0,writable:!0,configurable:!0})}return e}var ss=3e5,gl=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;let t=this.isOpen(),i=Date.now(),s=Math.min(e.retryAfterMs,ss);if(!t)return this.ts=i,void(this.es=i+s);this.es=Math.max(this.es,Math.min(i+s,this.ts+ss))}remainingMs(){let e=Date.now();if(this.ts-5e3>e)return this.reset(),0;let t=Math.min(ss,Math.max(0,this.es-e));return t===0&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}},bd=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function lo(e,t){return typeof(i=e)=="string"&&bd.test(i)?e:t();var i}function _l(e,t){let i=new Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}return i}function yt(e){return e&&e.split("#")[0]}function co(e){try{return e()}catch{return}}function ml(e,t){let i=setTimeout(e,t);return i!=null&&i.unref&&(i==null||i.unref()),i}function uo(e,t,i){return yl.apply(this,arguments)}function yl(){return(yl=ee(function*(e,t,i){let s;try{return yield Promise.race([e,new Promise((n,r)=>{s=ml(()=>{try{i==null||i(),n()}catch(o){r(o)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var Gi,ho,zs;function wd(e){let t=globalThis._posthogChunkIds;if(!t)return;let i=Object.keys(t);return zs&&i.length===ho||(ho=i.length,zs=i.reduce((s,n)=>{Gi||(Gi={});let r=Gi[n];if(r)s[r[0]]=r[1];else{let o=e(n);for(let a=o.length-1;a>=0;a--){let l=o[a],c=l==null?void 0:l.filename,u=t[n];if(c&&u){s[c]=u,Gi[n]=[c,u];break}}}return s},{})),zs}function wi(e){return wi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wi(e)}function xd(e,t,i){return(t=(function(s){var n=(function(r){if(wi(r)!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var a=o.call(r,"string");if(wi(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)})(s);return wi(n)=="symbol"?n:n+""})(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function po(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,s)}return i}function f(e){for(var t=1;arguments.length>t;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?po(Object(i),!0).forEach(function(s){xd(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):po(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}var kd=class{constructor(e,t,i=[]){this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t={}){let i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(t),r=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(r,i),$exception_level:"error"}}modifyFrames(e){var t=this;return ee(function*(){for(let i of e)i.stacktrace&&i.stacktrace.frames&&O(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)===null||t===void 0?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i;let s,n;if(e.cause!=null&&(s=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null)try{n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch{}return f(f({},e),{},{cause:s,stack:n,errors:(i=e.errors)===null||i===void 0?void 0:i.map(r=>this.parseStacktrace(r,t))})}applyChunkIds(e,t){return e.map(i=>(i.filename&&t&&(i.chunk_id=t[i.filename]),i))}applyCoercers(e,t){for(let i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return ee(function*(){let i=e;for(let s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){let i=[],s=(n,r,o)=>{var a;let l=i.length,c=r===void 0?f(f({type:typeof t.type=="string"&&t.type.length>0?t.type:"generic"},typeof t.handled=="boolean"?{handled:t.handled}:t.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof t.synthetic=="boolean"?t.synthetic:n.synthetic,exception_id:l}):{type:"chained",source:o,synthetic:n.synthetic,exception_id:l,parent_id:r},u={type:n.type,value:n.value,mechanism:c};n.stack&&(u.stacktrace={type:"raw",frames:n.stack}),i.push(u),n.cause&&s(n.cause,l,"cause");for(let d of(a=n.errors)!==null&&a!==void 0?a:[])s(d,l,"member")};return s(e),i}buildParsingContext(e){var t;return{chunkIdMap:wd(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}getAggregateErrors(e){try{if(ii(e)){let i=Object.getPrototypeOf(e);for(let s=0;i&&100>s;s++){var t;let n=(t=Object.getOwnPropertyDescriptor(i,"constructor"))===null||t===void 0?void 0:t.value;if(typeof n=="function"&&n.name==="AggregateError"){let r=e.errors;return O(r)?r:void 0}i=Object.getPrototypeOf(i)}}}catch{}}buildCoercingContext(e,t,i=0){let s=0,n=0,r=!1,o=new Set,a=[],l={},c=(h,p,v=0)=>{let _=u(p,v),g=_.apply;if(_.apply=k=>{a.push(h);try{return g(k)}finally{a.pop()}},v>4||v>0&&a.indexOf(h)!==-1)return this.coerceFallback(_);let y=typeof h=="object"&&h!==null||typeof h=="function";if(v===0&&s>=50||y&&o.has(h))return;y&&o.add(h),v===0&&s++;let m=this.getAggregateErrors(h),w,M;r||(r=!!m);try{if(w=this.applyCoercers(h,_),!w)throw l}catch(k){if(k===l)return void(v===0&&s--);if(!r)throw k;w=this.coerceFallback(_)}if(!m||s>=50)return w;try{M=m.length}catch{return w}if(!Number.isInteger(M)||0>M||M>4294967295)return w;let P=[];for(let k=0;50>s&&1e3>n&&M>k;k++){let I;n++;try{I=_.next(m[k])}catch{s++,I=this.coerceFallback(u(p+1))}I&&P.push(I)}return f(f({},w),{},{errors:P})},u=(h,p=0)=>f(f({},t),{},{syntheticException:h==0?t.syntheticException:void 0,mechanism:h==0?e:{},apply(v){let _=c(v,h,p+1);if(!_)throw l;return _},next:v=>c(v,h+1)}),d=u(i);return f(f({},d),{},{apply:h=>{var p;return(p=c(h,i))!==null&&p!==void 0?p:this.coerceFallback(d)}})}},Sd=/^([a-z][a-z0-9.+-]+):/i,Ed=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function $d(e){if(!e||e==="<anonymous>")return!1;let t=Sd.exec(e);return!t||Ed.includes(t[1].toLowerCase())}function An(e,t,i,s,n){let r={platform:e,filename:t,function:i==="<anonymous>"?"?":i,in_app:$d(t)};return x(s)||(r.lineno=s),x(n)||(r.colno=n),r}var bl=(e,t)=>{let i=e.indexOf("safari-extension")!==-1,s=e.indexOf("safari-web-extension")!==-1;return i||s?[e.indexOf("@")!==-1?e.split("@")[0]:"?",i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Pd=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Md=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Td=/\((\S*)(?::(\d+))(?::(\d+))\)/,Id=(e,t)=>{let i=Pd.exec(e);if(i){let[,n,r,o]=i;return An(t,n,"?",+r,+o)}let s=Md.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){let o=Td.exec(s[2]);o&&(s[2]=o[1],s[3]=o[2],s[4]=o[3])}let[n,r]=bl(s[1]||"?",s[2]);return An(t,r,n,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Cd=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Fd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ad=(e,t)=>{let i=Cd.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){let r=Fd.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}let s=i[3],n=i[1]||"?";return[n,s]=bl(n,s),An(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},fo=/\(error: (.*)\)/;function lr(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function Od(e){for(let t=1;10>=t;t++){let i=e.length-2*t;if(0>i)break;let s=!0;for(let n=0;t>n;n++)if(!lr(e[i+n],e[i+t+n])){s=!1;break}if(s){for(let n=0;t>n;n++)e[i+n]=e[i+t+n];return e.length=i+t,{start:i,length:t}}}}function Rd(e,t){let i=t.start+t.length,s=xl(e,t);s&&e.splice(i+s===e.length?i:t.start,s)}function wl(e,t){let i=t.start;for(;i>0&&lr(e[i-1],e[i-1+t.length]);)i--;return t.start-i}function xl(e,t){let i=t.start+t.length,s=i;for(;e.length>s&&lr(e[s],e[s-t.length]);)s++;return s-i}function Ld(e,t){let i=t[0],s=e.length-(i?wl(e,i):0);for(let n of t)s-=xl(e,n);return s}function Dd(e,t,i){for(let s=0;e.length>s;s++){let n=e[(t+s)%e.length],r=e[(i+s)%e.length];if(n!==r)return r>n}return!1}var Nd=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let i=V(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return ls(e,"DOMException")}isDOMError(e){return ls(e,"DOMError")}},jd=class{match(e){return ii(e)}coerce(e,t){var i;let s=this.getStack(e),n=s===void 0?(i=t.syntheticException)===null||i===void 0?void 0:i.stack:void 0,r=!!n;return{type:this.getType(e),value:this.getMessage(e,t),stack:s!=null?s:n,cause:e.cause?t.next(e.cause):void 0,synthetic:r}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let i=e.message;return String(i.error&&typeof i.error.message=="string"?i.error.message:i)}getStack(e){try{let t=e.stacktrace;if(typeof t=="string"&&t.length>0)return t;let i=e.stack;return typeof i=="string"&&i.length>0?i:void 0}catch{return}}},Vd=class{match(e){return!!ls(e,"ErrorEvent")&&(e.error!=null||this.ar(e))}coerce(e,t){var i;if(e.error!=null)return t.apply(e.error);let s=t.apply(e.message);return f(f({},s),{},{stack:(i=this.lr(e))!==null&&i!==void 0?i:s.stack,synthetic:!0})}ar(e){return V(e.message)&&e.message.length>0}lr(e){var t,i;let s=e,n=(t=s.lineno)!==null&&t!==void 0?t:0,r=(i=s.colno)!==null&&i!==void 0?i:0;if(V(s.filename)&&s.filename.length!==0&&n!==0)return`Error
2
- at ${s.filename}:${n}:${r}`}},Hd=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Wd=class{match(e){return typeof e=="string"}coerce(e,t){var i;let[s,n]=this.getInfos(e);return{type:s!=null?s:"Error",value:n!=null?n:e,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}getInfos(e){let t="Error",i=e,s=e.match(Hd);return s&&(t=s[1],i=s[2]),[t,i]}},Bd=["fatal","error","warning","log","info","debug"];function kl(e,t=40){let i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(let s=i.length;s>0;s--){let n=i.slice(0,s).join(", ");if(t>=n.length)return s===i.length?n:n.length>t?`${n.slice(0,t)}...`:n}return""}var Ud=class{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var i,s;let n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(i=this.getStack(e))!==null&&i!==void 0?i:(s=t.syntheticException)===null||s===void 0?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(or(e))return e.constructor.name;let t="name"in e?e.name:void 0;return V(t)&&!bi(t)?t:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let i=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(i+=` with message: '${e.message}'`),i}if("message"in e&&typeof e.message=="string")return e.message;let t=this.getObjectClassName(e);return`${t&&t!=="Object"?`'${t}'`:"Object"} captured as exception with keys: ${kl(e)}`}isSeverityLevel(e){return V(e)&&!bi(e)&&Bd.indexOf(e)>=0}getStack(e){try{return V(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:V(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(let t in e)if({}.hasOwnProperty.call(e,t)){let i=e[t];if(ii(i))return i}}getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},zd=class{match(e){return or(e)}coerce(e,t){var i;let s=e.constructor.name;return{type:s,value:`${s} captured as exception with keys: ${kl(e)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}},Gd=class{match(e){return ja(e)}coerce(e,t){var i;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}},qd=class{match(e){return ls(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!or(e))return!1;try{let t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var i;let s=this.getUnhandledRejectionReason(e);return ja(s)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}:t.apply(s)}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}},hs="$message",ps="$timestamp",Zd=new Set([hs,ps]),Gs={enabled:!0,max_bytes:32768};function fs(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:Gs.enabled,max_bytes:Xd(e.max_bytes,Gs.max_bytes)}:f({},Gs)}var Yd=class{constructor(e){this.ns=[],this.ss=0,this.Mr=fs(e)}setConfig(e){this.Mr=fs(e),this.rs()}add(e){let t=(function(s){let n;try{n=Da(s)}catch{return}try{let r=JSON.parse(n);if(!j(r))return;let o=r,a=o[hs],l=o[ps];return!V(a)||a.trim().length===0||!V(l)&&!oe(l)?void 0:{step:o,json:n}}catch{return}})(e);if(!t)return;let i=(function(s){if("u">typeof TextEncoder)return new TextEncoder().encode(s).length;let n=encodeURIComponent(s),r=0;for(let o=0;n.length>o;o++)n[o]==="%"?(r+=1,o+=2):r+=1;return r})(t.json);i>this.Mr.max_bytes||(this.ns.push({step:t.step,bytes:i}),this.ss+=i,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Mr.max_bytes&&this.ns.length>0;){let e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function Xd(e,t){if(!oe(e)||e===1/0||e===-1/0)return t;let i=Math.floor(e);return 0>i?t:i}var vo=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function go(e){return typeof e=="string"||e}function _o(e){return typeof e=="string"?e:void 0}var Jd=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server","$react_native_version"],Sl="NativeGzipValidationError",On=e=>e.length>=2&&e[0]===31&&e[1]===139,mo=(e,t)=>e===Pn.GZipJS||t===Pn.GZipJS||t==="gzip",yo=e=>!(!e||typeof e!="object")&&("name"in e?String(e.name):"")==="NotReadableError",ci,qi=e=>{throw _l(Sl,`Native gzip produced invalid output: ${e}`)},Kd=(bo=ee(function*(e,t){18>e.size&&qi("too-short");let i=new Uint8Array(yield e.slice(0,10).arrayBuffer());On(i)&&i[2]===8||qi("invalid-header");let s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(r=>{let o=(()=>{if(ci)return ci;ci=[];for(let l=0;256>l;l++){let c=l;for(let u=0;8>u;u++)c=1&c?3988292384^c>>>1:c>>>1;ci[l]=c>>>0}return ci})(),a=4294967295;for(let l=0;r.length>l;l++)a=o[255&(a^r[l])]^a>>>8;return(4294967295^a)>>>0})(t)&&qi("invalid-crc");let n=t.length>>>0;s.getUint32(4,!0)!==n&&qi("invalid-size")}),function(e,t){return bo.apply(this,arguments)}),bo;function Rn(){return Rn=ee(function*(e,t=!0,i){try{let n=new TextEncoder().encode(e),r=new globalThis.CompressionStream("gzip"),o=r.writable.getWriter(),a=o.write(n).then(()=>o.close()).catch((s=ee(function*(u){try{yield o.abort(u)}catch{}throw u}),function(u){return s.apply(this,arguments)})),l=new Response(r.readable).blob(),[c]=yield Promise.all([l,a]);return yield Kd(c,n),c}catch(n){if(i!=null&&i.rethrow)throw n;return t&&console.error("Failed to gzip compress data",n),null}var s}),Rn.apply(this,arguments)}function El(e,t){if(e==null)return{};var i,s,n=(function(o,a){if(o==null)return{};var l={};for(var c in o)if({}.hasOwnProperty.call(o,c)){if(a.includes(c))continue;l[c]=o[c]}return l})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;r.length>s;s++)t.includes(i=r[s])||{}.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var ye="[redacted]",Qd=/^[A-Za-z0-9+/\n\r]+=*$/,eh=/^[A-Za-z0-9_-]+={0,2}$/,th=/[-_]/,ih=/^data:[^,\s]*;base64,/i,sh=/^[A-Za-z0-9+/_-]+={0,2}$/,nh=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,rh=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,$l=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,oh=/[\s<>"]/,Pl=new RegExp($l.source,"i"),Ml=/[a-z][a-z0-9+.-]{0,63}:\/\//i,ah=new RegExp(`^${Ml.source}`,"i"),lh=new RegExp(Ml.source,"gi"),ch=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,uh=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,dh=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,hh=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,ph=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,fh=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,vh=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,gh=/\b\d(?:[ ./-]?\d){12,}\b/g,wo=/\d+/g,_h=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,mh=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function Ln(e){return(function(t){return rh.test(t)})(e)||ch.test(e)||uh.test(e)}function qs(e){return e.split("&",129).length>128}function yh(e,t,i){return Ln(e)||t.includes(";")&&(function(s){return s.split(";").some(n=>Ln(n.split("=",1)[0]))})(t)?ye:Pl.test(t)?i?cr(t,{allowNestedUrls:!1,stripPunctuation:!0}):ye:t}function Tl(e,t){let i=new URLSearchParams,s=!1,n=!1;for(let[r,o]of new URLSearchParams(e)){let a=yh(r,o,t);s||(s=a!==o),n=Ln(r)||a!==o,i.append(r,a)}return{changed:s,lastFieldSensitive:n,serialized:i.toString()}}function xo(e,t){if(!e.includes("="))return{value:bh(e,t),lastFieldSensitive:!1};let i=Tl(e,t);return{value:i.changed?i.serialized:e,lastFieldSensitive:i.lastFieldSensitive}}function bh(e,t){return t?cr(e,{allowNestedUrls:!1,stripPunctuation:!0}):Pl.test(e)?ye:e}function wh(e,t,i){return e==="#"?!t.fragment&&(t.fragment=!0):e==="?"&&(t.fragment?i!=="="&&!t.fragmentQuery&&(t.fragmentQuery=!0):!t.query&&(t.query=!0))}function Zs(e,t){var i;if(e.length>8192&&ah.test(e))return ye;let{address:s,suffix:n}=t.stripPunctuation?(function(g){let y=g.length;for(;y>0&&".,;:!?)]}'".includes(g[y-1]);)y--;return{address:g.slice(0,y),suffix:g.slice(y)}})(e):{address:e,suffix:""},r;try{r=new URL(s)}catch{return ye+n}let o=r.search.slice(1),a=r.hash!=="",l=(function(g){let y=g.slice(1),m=y.indexOf("?");return 0>m?{head:y,tail:null}:{head:y.slice(0,m),tail:y.slice(m+1)}})(r.hash);if(qs(o)||qs(l.head)||qs((i=l.tail)!==null&&i!==void 0?i:""))return ye+n;let c=!1;(r.username||r.password)&&(r.username=ye,r.password="",c=!0);let u=Tl(o,t.allowNestedUrls);u.changed&&(r.search=u.serialized,c=!0);let d=xo(l.head,t.allowNestedUrls),h=l.tail===null?null:(p=l.tail,d.lastFieldSensitive?{value:p===""?"":ye,lastFieldSensitive:!0}:xo(p,t.allowNestedUrls));var p;let v=h===null?d.value:`${d.value}?${h.value}`;v!==r.hash.slice(1)&&(r.hash=v,c=!0);let _=a?h!=null?h:d:u;return(c?r.toString():s)+(_.lastFieldSensitive?"":n)}function cr(e,t){return e.replace($l,i=>(function(s,n){let r=(function(l){if(!l.includes("://"))return[];let c=[...l.matchAll(lh)].map(_=>_.index),u=[],d={query:!1,fragment:!1,fragmentQuery:!1},h=0,p=!1,v="";for(let _=0;l.length>_&&c.length>h;_++){c[h]===_&&(_>0&&v!=="="&&u.push(_),h++);let g=l[_];wh(g,d,v)?(v=g,p=!0):p&&"=&".includes(g)&&(v=g)}return u})(s);if(r.length===0)return Zs(s,n);let o="",a=0;for(let l of r)o+=Zs(s.slice(a,l),f(f({},n),{},{stripPunctuation:!1})),a=l;return o+Zs(s.slice(a),n)})(i,f(f({},t),{},{stripPunctuation:t.stripPunctuation&&i.length!==e.length})))}function xh(e,t){return(function(i){return i.length>=10240&&(Qd.test(i)||(function(s){let n=ih.exec(s);if(!n)return!1;let r;try{r=decodeURIComponent(s.slice(n[0].length))}catch{return!1}return sh.test(r.replace(/[\r\n]/g,""))})(i)||th.test(i)&&eh.test(i))})(e)?"[binary data redacted - not supported by PostHog MCP analytics]":(function(i,s,n){let r=4*n.maxStringLength;if(i.length>r){let o=s(i.slice(0,(function(a,l){let c=l;for(;c>0&&!oh.test(a[c-1]);)c--;return c})(i,r)));if(o.length>=2*n.maxStringLength)return o+n.truncationSuffix}return s(i)})(e,i=>(function(s){return cr(s,{allowNestedUrls:!0,stripPunctuation:!0})})((function(s){let n=s.replace(dh," ");return n=n.replace(hh,ye),n=n.replace(ph,ye),n=n.replace(fh,`$1${ye}`),n=n.replace(gh,Sh),n=n.replace(vh,ye),n=n.replace(_h,`$1${ye}`),n=n.replace(mh,`$1${ye}`),n})((function(s){return s.replace(nh,ye)})(i))),t)}function kh(e){let t=0,i=!1;for(let s=e.length-1;s>=0;s--){let n=e.charCodeAt(s)-48;if(0>n||n>9)return!1;i&&(n*=2,n>9&&(n-=9)),t+=n,i=!i}return t%10==0}function Sh(e){let t=[];for(let r=wo.exec(e);r!==null;r=wo.exec(e))t.push({digits:r[0],start:r.index,end:r.index+r[0].length});let i="",s=0,n=0;for(;t.length>n;){let r="",o=-1;for(let a=n;t.length>a&&(r+=t[a].digits,19>=r.length);a++)r.length>=13&&kh(r)&&(o=a);0>o?n++:(i+=e.slice(s,t[n].start)+ye,s=t[o].end,n=o+1)}return i+e.slice(s)}var Eh={}.propertyIsEnumerable;function vs(e,t){try{return Il(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function ur(e,t,i,s){if(0>=i.remainingNodes)return{stringValue:Fn};if(i.remainingNodes--,Se(e))return{boolValue:e};if(typeof e=="bigint")return(function(n,r){let o=n.toString(),a=BigInt("9223372036854775808");return n>=a||-a>n?(r==null||r.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};let n=BigInt(e).toString();return e>=9223372036854776e3||-9223372036854776e3>e?(t==null||t.debug(`Attribute ${n} is outside the int64 range; encoding it as a string`),{stringValue:n}):{intValue:n}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:zt(e)};if(typeof e=="function")return{stringValue:"[Function]"};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(i.ancestors.has(e))return{stringValue:"[Circular]"};if(s>=20)return{stringValue:Fn};if(e instanceof Date){let n=e.getTime(),r=Number.isFinite(n)?e.toISOString():String(e);return{stringValue:typeof r=="string"?zt(r):String(r)}}i.ancestors.add(e);try{try{let n=e.toJSON;if(typeof n=="function")return ur(n.call(e),t,i,s+1)}catch{}return O(e)?{arrayValue:{values:$h(e,t,i,s+1)}}:{kvlistValue:{values:Il(e,t,i,s+1)}}}finally{i.ancestors.delete(e)}}return{stringValue:zt(String(e))}}function $h(e,t,i,s){let n=[],r=Math.min(e.length,1e3),o=0;for(;r>o&&i.remainingNodes>0;o++)try{let a=o in e?e[o]:void 0;if(L(a))continue;n.push(ur(a,t,i,s))}catch{n.push({stringValue:Ni})}return e.length>o&&n.push({stringValue:Fn}),n}function Il(e,t,i,s){let n=[];for(let r in e)if(Eh.call(e,r)){if(!r){t==null||t.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){t==null||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let o=e[r];if(ne(o)||x(o))continue;n.push({key:zt(r),value:ur(o,t,i,s)})}catch{n.push({key:zt(r),value:{stringValue:Ni}})}}return n}function Cl(e,t,i){return f(f(f(f({},vl({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}var Ph=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Fl(e,t){let i=vl({},e),s={};for(let n of Ph)({}).hasOwnProperty.call(i,n)&&(s[n]=i[n],delete i[n]);return[...vs(i,t),...vs(s,t)]}var ko={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},Al={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}},Mh=Al.info;function Th(e){try{return zt(String(e))}catch{return Ni}}function Ih(e,t,i,s){let n=e.level||"info",{text:r,number:o}=Al[n]||Mh,a=(function(h=Date.now()){return String(h)+"000000"})(oe(s)?s:void 0),l={};t.distinctId&&(l.posthogDistinctId=t.distinctId),t.sessionId&&(l.sessionId=t.sessionId),t.windowId&&(l["window.id"]=t.windowId),L(t.sessionStartTimestamp)||(l.sessionStartTimestamp=String(t.sessionStartTimestamp)),L(t.lastActivityTimestamp)||(l.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(l["url.full"]=t.currentUrl),t.screenName&&(l["screen.name"]=t.screenName),t.appState&&(l["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(l.feature_flags=t.activeFeatureFlags);let c=f({},l),u=e.attributes;if(u){let h=[];try{h=Object.keys(u)}catch{h=[]}for(let p of h){let v;try{v=u[p]}catch{v=Ni}Object.defineProperty(c,p,{value:v,enumerable:!0,writable:!0,configurable:!0})}}let d={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:o,severityText:r,body:{stringValue:Th(e.body)},attributes:vs(c,i)};return e.trace_id&&(d.traceId=e.trace_id),e.span_id&&(d.spanId=e.span_id),x(e.trace_flags)||(d.flags=e.trace_flags),d}function Ol(e,t,i){return Cl(e,t,i)}function Rl(e,t,i,s){return{resourceLogs:[{resource:{attributes:Fl(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}var Ll=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.cs}arm(e){this.clear(),this.us=Date.now()+e,this.cs=ml(()=>{this.cs=void 0,this.ls()},e)}armNoEarlierThan(e){this.cs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function Dl(){return .75+.5*Math.random()}function Nl(e,t,i,s){let n=Math.min(Math.max(0,t-1),6),r=e*Math.pow(2,n);return Math.round((s===void 0?r:Math.min(r,Math.max(s,e)))*i)}var Ch=class{constructor(e,t,i,s,n,r=()=>Promise.resolve(),o){var a;this._instance=e,this.Mr=t,this.A=i,this.hs=s,this.ds=n,this.vs=r,this.fs=o,this.ps=new Ll(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new gl,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=t.maxBufferSize,this.Is=Math.max((a=t.maxQueueSize)!==null&&a!==void 0?a:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Ye.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,t){var i;if(this._instance.isDisabled||this._instance.optedOut||!(e!=null&&e.body))return;let s=this.Os(e);if(s===null)return;if(!s.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;let n={record:Ih(s,(i=t==null?void 0:t.context)!==null&&i!==void 0?i:this.hs(),this.A,t==null?void 0:t.occurredAtMs)};this.ds(()=>this.Ls(n))}Os(e){let t=this.Mr.beforeSend;if(!t)return e;let i=O(t)?t:[t],s=e;for(let n of i)try{let r=n(s);if(!r)return this.A.info("Log was rejected in beforeSend function"),null;s=r}catch(r){return this.A.error("Error in beforeSend function for log:",r),null}return s}Ds(){if(this.Rs===void 0)return!0;let e=Date.now(),t=e-this.xs;return this.Ps>t&&t>=0||(this.xs=e,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.Cs=!0),!1)}flush(){var e=this;return ee(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return ee(function*(){var t;e.ps.clear();let i=(t=e._instance.getPersistedProperty(Ye.LogsQueue))!==null&&t!==void 0?t:[];if(i.length===0)return;let s=i.length,n=0;for(;i.length>0&&s>n;){var r,o;let a=e._s;e.bs=0;let l=Math.min(i.length,e.Es),c=i.slice(0,l),u=Rl(c.map(h=>h.record),e.qs(),(r=e.fs)!==null&&r!==void 0?r:e._instance.getLibraryId(),e._instance.getLibraryVersion()),d=yield e._instance.js(u);if(e._s!==a)return;if(d.kind==="too-large"&&c.length>1)e.Es=Math.max(1,Math.floor(c.length/2)),e.A.warn(`Logs batch of size ${c.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(d),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),d.kind==="retry-later"||(d.kind==="too-large"?e.A.warn("Dropping a single log record with batch size 1 \u2014 the record is larger than the server cap and cannot be split further."):d.kind==="ok"&&e.Mr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Mr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(c.length),i=(o=e._instance.getPersistedProperty(Ye.LogsQueue))!==null&&o!==void 0?o:[],n+=c.length,d.kind==="fatal"))throw d.error}})()}Bs(e){var t=this;return ee(function*(){var i;let s=Math.max(0,e-t.bs),n=(i=t._instance.getPersistedProperty(Ye.LogsQueue))!==null&&i!==void 0?i:[];t._instance.setPersistedProperty(Ye.LogsQueue,n.slice(s)),yield t.vs()})()}qs(){return Ol(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;let i=(t=this._instance.getPersistedProperty(Ye.LogsQueue))!==null&&t!==void 0?t:[];this.Is>i.length||(i.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(Ye.LogsQueue,i),this.Ts>i.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(Nl(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){let e=this._instance.getPersistedProperty(Ye.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return ee(function*(){t.ps.clear();let i=t.flush().catch(()=>{});e!==void 0?yield uo(i,e):yield i})()}flushWithTimeout(e){var t=this;return ee(function*(){let i=t.flush();yield uo(i,e,()=>{i.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=Dl(),this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.zs())})}},Ys=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function So(e){return String(e)+"000000"}function Eo(e,t,i,s){let n="";return s&&(n=Object.keys(s).sort().map(r=>`${JSON.stringify(r)}:${JSON.stringify(s[r])}`).join(",")),`${e}\0${t}\0${i!=null?i:""}\0${n}`}var Fh=class{constructor(e,t,i){this._instance=e,this.Mr=t,this.A=i,this.Hs=new Map,this.ps=new Ll(()=>this.flush().catch(s=>{this.A.error("Metrics flush failed:",s)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new gl,this.ks=0,this.Ss=1,this.Gs=0}count(e,t=1,i){this.Qs({name:e,type:"count",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}gauge(e,t,i){this.Qs({name:e,type:"gauge",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}histogram(e,t,i){this.Qs({name:e,type:"histogram",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}flush(){var e=this;let t=this.ys,i=(function(){var s=ee(function*(){t&&(yield t.catch(()=>{})),yield e.Zs()});return function(){return s.apply(this,arguments)}})()().finally(()=>{this.ys===i&&(this.ys=null)});return this.ys=i,i}drainWindow(){if(this.Hs.size===0)return null;let e=this.Hs;return this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.Hs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Qs(e){if(this._instance.isDisabled||this._instance.optedOut)return;let t=this.Os(e);if(t===null)return;if(!t.name||typeof t.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof t.value!="number"||!Number.isFinite(t.value))return void this.A.warn(`Dropping metric '${t.name}': value must be a finite number`);if(t.type==="count"&&0>t.value)return void this.A.warn(`Dropping count '${t.name}': counters are monotonic, value must be >= 0`);let i,s;try{i=t.attributes?f({},t.attributes):void 0,s=Eo(t.type,t.name,t.unit,i)}catch(o){return void this.A.warn(`Dropping metric '${t.name}': attributes could not be serialized`,o)}let n=this.Hs.get(s);if(!n){if(!this.Ks())return;n={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Hs.set(s,n)}let r=this.Ws.get(t.name);r===void 0?this.Ws.set(t.name,t.type):r===t.type||this.Vs.has(t.name)||(this.Vs.add(t.name),this.A.warn(`Metric name '${t.name}' is already used as a ${r}; recording it as a ${t.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(n,t.value),this.Fs()}Ks(){return this.Mr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,t){switch(e.type){case"count":var i;e.total=((i=e.total)!==null&&i!==void 0?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(Ys.length+1).fill(0)});let s=e.hist;s.count+=1,s.sum+=t,s.min=Math.min(s.min,t),s.max=Math.max(s.max,t),s.bucketCounts[(function(n,r){for(let o=0;r.length>o;o++)if(r[o]>=n)return o;return r.length})(t,Ys)]+=1;break}}}Os(e){let t=this.Mr.beforeSend;if(!t)return e;let i=O(t)?t:[t],s=e;for(let n of i)try{let r=n(s);if(!r)return this.A.info("Metric was rejected in beforeSend function"),null;s=r}catch(r){return this.A.error("Error in beforeSend function for metric:",r),null}return s}Fs(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(Nl(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Zs(){var e=this;return ee(function*(){if(e.ps.clear(),e.Hs.size===0)return;let t=e.Hs;e.Hs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;let i=e.Gs,s=yield e._instance.Ys(e.Js(t));if(i===e.Gs)switch(e.ws.record(s),s.kind==="retry-later"?(e.ks++,e.Ss=Dl()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.zs()),s.kind){case"ok":return;case"retry-later":return e.co(t),void e.ps.armNoEarlierThan(e.zs());case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",s.error)}})()}Js(e){return t=this.ho(e),i=(function(r,o,a){return Cl(r,o,a)})(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Fl(i)},scopeMetrics:[{scope:{name:s,version:n},metrics:t}]}]};var t,i,s,n}ho(e){let t=So(Date.now()),i=new Map;for(let o of e.values()){var s;let a=Eo(o.type,o.name,o.unit,void 0),l=i.get(a);l||(l=f({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},i.set(a,l));let c=vs((s=o.attributes)!==null&&s!==void 0?s:{},this.A),u=So(o.windowStartMs);if(o.type==="count"){var n;let d={attributes:c,startTimeUnixNano:u,timeUnixNano:t,asDouble:(n=o.total)!==null&&n!==void 0?n:0};l.sum.dataPoints.push(d)}else if(o.type==="gauge"){var r;let d={attributes:c,timeUnixNano:t,asDouble:(r=o.last)!==null&&r!==void 0?r:0};l.gauge.dataPoints.push(d)}else o.hist&&l.histogram.dataPoints.push({attributes:c,startTimeUnixNano:u,timeUnixNano:t,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:Ys})}return Array.from(i.values())}co(e){for(let[s,n]of e){let r=this.Hs.get(s);if(r)switch(r.windowStartMs=Math.min(r.windowStartMs,n.windowStartMs),r.type){case"count":var t,i;r.total=((t=r.total)!==null&&t!==void 0?t:0)+((i=n.total)!==null&&i!==void 0?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(r.hist){r.hist.count+=n.hist.count,r.hist.sum+=n.hist.sum,r.hist.min=Math.min(r.hist.min,n.hist.min),r.hist.max=Math.max(r.hist.max,n.hist.max);for(let o=0;r.hist.bucketCounts.length>o;o++)r.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else r.hist=n.hist}else this.Ks()&&this.Hs.set(s,n)}}},jl=(e,{debugEnabled:t}={})=>{let i={N(s,...n){let r;try{r=typeof window>"u"?void 0:window}catch{return}r&&(st.DEBUG||r.POSTHOG_DEBUG||t)&&!x(r.console)&&r.console&&("__rrweb_original__"in r.console[s]?r.console[s].__rrweb_original__:r.console[s])(e,...n)},debug(...s){i.N("debug",...s)},info(...s){i.N("log",...s)},warn(...s){i.N("warn",...s)},error(...s){i.N("error",...s)},critical(...s){console.error(e,...s)},uninitializedWarning(s){i.error(`You must initialize PostHog before calling ${s}`)},createLogger:(s,n)=>jl(`${e} ${s}`,n)};return i},T=jl("[PostHog.js]"),re=T.createLogger,Ah=re("[ExternalScriptsLoader]"),gs=e=>{let t=E==null?void 0:E.querySelectorAll("script");if(t){for(let i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},Pt=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return Ah.warn(`${t} was requested but loading of external scripts is disabled.`),i("Loading of external scripts is disabled");let s=gs(t);if(s){if(s.__posthog_loading_callback_fired)return i();let r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",o=>{s.__posthog_loading_callback_fired=!0,i(void 0,o)}),void s.addEventListener("error",o=>{s.__posthog_loading_error=o,i(o)}))}let n=()=>{if(!E)return i("document not found");if(gs(t))return Pt(e,t,i);let r=E.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=a=>{r.__posthog_loading_callback_fired=!0,i(void 0,a)},r.onerror=a=>{r.__posthog_loading_error=a,i(a)},e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")E.head.appendChild(r);else{let a=E.querySelectorAll("body > script");var o;a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(r,a[0]):E.body.appendChild(r)}};E!=null&&E.body?n():E==null||E.addEventListener("DOMContentLoaded",n)},Xs={},$o=(e,t)=>{let i=`/static/${t}.js?v=${e.version}`;return t==="toolbar"&&(i=`${i}&t=${Math.floor(Date.now()/3e5)*3e5}`),e.requestRouter.endpointFor("assets",i)};F.__PosthogExtensions__=F.__PosthogExtensions__||{},F.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if(t==="remote-config"){let n=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void Pt(e,n,i)}let s=e.config.strict_script_versioning;if(s){let n=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),r=Xs[n];if(s==="fallback"&&r){if(gs(r))return void Pt(e,r,i);delete Xs[n]}return void Pt(e,n,s==="fallback"?(o,a)=>{if(o)if(typeof o=="string")i(o);else{var l;let c=$o(e,t);Xs[n]=c;let u=gs(n);u==null||(l=u.parentNode)===null||l===void 0||l.removeChild(u),Pt(e,c,i)}else i(void 0,a)}:i)}Pt(e,$o(e,t),i)},F.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{let s=e.requestRouter.endpointFor("api",t);Pt(e,s,i)},st.DEBUG=!1,st.LIB_VERSION="1.438.2",st.LIB_NAME="web";var ue=st,Dn="$early_access_features",tt="$active_feature_flags",It="$feature_flag_details",Ai="$feature_flag_errors",mt="$feature_flag_evaluated_at",Ct="$feature_flag_request_id",xi="$minimal_flag_called_events",Ve="$enabled_feature_flags",ft="$stored_group_properties",vt="$stored_person_properties",gt="$flag_call_reported",_i="$flag_call_reported_session_id",_t="$feature_flag_payloads",Ze="$override_feature_flags",Mt="$override_feature_flag_payloads",Oi="visibilitychange",Oh="$people_distinct_id",je="distinct_id",dr="$device_id",Js="$device_model",_s="__alias",Rh="__cmpns",Po="$fbc",Gt="$fbc_persistence",Mo="$fbp",ki="$fbp_persistence",Nn="__timers",Vl="$autocapture_disabled_server_side",jn="$heatmaps_enabled_server_side",Vn="$exception_capture_enabled_server_side",Hl="$error_tracking_suppression_rules",Hn="$error_tracking_capture_extension_exceptions",Wn="$web_vitals_enabled_server_side",hr="$dead_clicks_enabled_server_side",pr="$product_tours_enabled_server_side",Wl="$logs_capture_enabled_server_side",Bl="$web_vitals_allowed_metrics",Si="$session_recording_remote_config",Lh="$session_recording_enabled_server_side",Dh="$replay_sample_rate",Nh="$replay_override_sampling",jh="$replay_override_linked_flag",Vh="$replay_override_url_trigger",Hh="$replay_override_event_trigger",Ht="$sesid",Ul="$session_is_sampled",Wh="$session_past_minimum_duration",Bh="$session_recording_url_trigger_activated_session",Uh="$session_recording_event_trigger_activated_session",zh="$debug_first_full_snapshot_timestamp",Gh="$sess_rec_flush_size",zl="$groups",mi="$surveys",ms="$surveys_loaded_at",Gl="$surveys_activated",ql="$surveys_activated_session",Zl="$surveys_activated_timestamps",Bn="ph_product_tours",qh="$product_tours_activated",Zh="$product_tours_activated_session",Yh="$conversations_widget_session_id",Xh="$conversations_ticket_id",Jh="$conversations_widget_state",Kh="$conversations_user_traits",ke="$user_state",Un="$client_session_props",Qh="$capture_rate_limit",Yl="$initial_campaign_params",Xl="$initial_referrer_info",Wt="$initial_person_info",fr="$epp",Ks="$posthog_cookieless",Jl="$cookieless_mode",Kl="$sdk_debug_extensions_init_method",Ql="$sdk_debug_extensions_init_time_ms",vr="$sdk_debug_recording_script_not_loaded",gr="$sdk_debug_replay_stale_config",ec="$sdk_debug_replay_event_trigger_status",tc="$sdk_debug_replay_linked_flag_trigger_status",ic="$sdk_debug_replay_matched_recording_trigger_groups",sc="$sdk_debug_replay_pending_trigger_conditions",nc="$sdk_debug_replay_remote_trigger_matching_config",rc="$sdk_debug_replay_trigger_groups_count",oc="$sdk_debug_replay_url_trigger_status",ep="$session_recording_start_reason",_r="PostHog loadExternalDependency extension not found.",it="anonymous",ns="identified",ac="identified_only",ys="beforeunload",mr="$pageview",To="$pageleave",lc="$identify",Io="$groupidentify";function Bt(e,t){O(e)&&e.forEach(t)}function Z(e,t){if(!L(e))if(O(e))e.forEach(t);else if((i=>i instanceof FormData)(e))e.forEach((i,s)=>t(i,s));else for(let i in e)rr.call(e,i)&&t(e[i],i)}var Q=function(e,...t){for(let i of t)for(let s in i)i[s]!==void 0&&(e[s]=i[s]);return e};function rs(e){let t=Object.keys(e),i=t.length,s=new Array(i);for(;i--;)s[i]=[t[i],e[t[i]]];return s}var tp=function(e){return function(...t){try{return e.apply(this,t)}catch(i){T.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),T.critical(i)}}},yr=function(e){let t={};return Z(e,function(i,s){(V(i)&&i.length>0||oe(i))&&(t[s]=i)}),t};function cc(e){let t=f({},e);for(let i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch{}return t}var ip=["herokuapp.com","vercel.app","netlify.app"];function sp(e){let t=e==null?void 0:e.hostname;if(!V(t))return!1;let i=t.split(".").slice(-2).join(".");for(let s of ip)if(i===s)return!1;return!0}function G(e,t,i,s){let{capture:n=!1,passive:r=!0}=s!=null?s:{};e==null||e.addEventListener(t,i,{capture:n,passive:r})}function zn(e){return e.name==="ph_toolbar_internal"}var Ei=e=>{if(E){try{let t=e+"=",i=E.cookie.split(";").filter(s=>s.length);for(let s=0;i.length>s;s++){let n=i[s];for(;n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(t)===0)return decodeURIComponent(n.substring(t.length,n.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return oe(e)&&isFinite(e)&&Math.floor(e)===e});var np=class Gn{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,i,s,n){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(n)||0>t||0>i||0>s||0>n||t>0xffffffffffff||i>4095||s>1073741823||n>4294967295)throw new RangeError("invalid field value");let r=new Uint8Array(16);return r[0]=t/Math.pow(2,40),r[1]=t/Math.pow(2,32),r[2]=t/Math.pow(2,24),r[3]=t/Math.pow(2,16),r[4]=t/256,r[5]=t,r[6]=112|i>>>8,r[7]=i,r[8]=128|s>>>24,r[9]=s>>>16,r[10]=s>>>8,r[11]=s,r[12]=n>>>24,r[13]=n>>>16,r[14]=n>>>8,r[15]=n,new Gn(r)}toString(){let t="";for(let i=0;this.bytes.length>i;i++)t=t+(this.bytes[i]>>>4).toString(16)+(15&this.bytes[i]).toString(16),i!==3&&i!==5&&i!==7&&i!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Gn(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let i=0;16>i;i++){let s=this.bytes[i]-t.bytes[i];if(s!==0)return Math.sign(s)}return 0}},rp=class{generate(){let e=this.generateOrAbort();if(!x(e))return e;{this.Ct=0;let t=this.generateOrAbort();if(x(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){let e=(()=>{let t=Date.now();return oe(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.It();else{if(this.Ct>=e+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Ct++,this.It())}return np.fromFieldsV7(this.Ct,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new op}},uc=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};b&&!x(b.crypto)&&crypto.getRandomValues&&(uc=e=>crypto.getRandomValues(e));var op=class{nextUint32(){return this.Rt.length>this.Et||(uc(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}},Co,He=()=>ap().toString(),ap=()=>(Co||(Co=new rp)).generate(),ui="",lp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Ot=null,se={At(){if(!ne(Ot))return Ot;if(Ot=!1,E)try{let e=`__ph_cookie_support_${He()}`;se.$t(e,"xyz"),Ot=Ei(e)==='"xyz"',se.Pt(e)}catch{Ot=!1}return Ot},Dt(e){T.error("cookieStore error: "+e)},Ot:Ei,Lt(e){let t;try{t=JSON.parse(se.Ot(e))||{}}catch{}return t},$t(e,t,i,s,n){if(!E)return!1;try{let r="",o="",a=(function(c,u){if(u){let d=(function(h,p=E){if(ui)return ui;if(!p||["localhost","127.0.0.1"].includes(h))return"";let v=h.split("."),_=Math.min(v.length,8),g="dmn_chk_"+He();for(;!ui&&_--;){let y=v.slice(_).join("."),m=g+"=1;domain=."+y+";path=/";p.cookie=m+";max-age=3",p.cookie.includes(g)&&(p.cookie=m+";max-age=0",ui=y)}return ui})(c);if(!d){let h=(p=>{let v=p.match(lp);return v?v[0]:""})(c);h!==d&&T.info("Warning: cookie subdomain discovery mismatch",h,d),d=h}return d?"; domain=."+d:""}return""})(E.location.hostname,s);if(i){let c=new Date;c.setTime(c.getTime()+864e5*i),r="; expires="+c.toUTCString()}n&&(o="; secure");let l=e+"="+encodeURIComponent(JSON.stringify(t))+r+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&T.warn("cookieStore warning: large cookie, len="+l.length),E.cookie=l,!0}catch{return!1}},Pt(e,t){if(E!=null&&E.cookie&&(!t||!ne(Ei(e))))try{se.$t(e,"",-1,t)}catch{return}}},Qs=null,U={At(){if(!ne(Qs))return Qs;let e=!0;if(x(b))e=!1;else try{let t="__mplssupport__";U.$t(t,"xyz"),U.Ot(t)!=='"xyz"'&&(e=!1),U.Pt(t)}catch{e=!1}return e||T.error("localStorage unsupported; falling back to cookie store"),Qs=e,e},Dt(e){T.error("localStorage error: "+e)},Ot(e){try{return b==null?void 0:b.localStorage.getItem(e)}catch(t){U.Dt(t)}return null},Lt(e){try{return JSON.parse(U.Ot(e))||{}}catch{}return null},$t(e,t){try{return b==null||b.localStorage.setItem(e,JSON.stringify(t)),!0}catch(i){U.Dt(i)}return!1},Pt(e){try{b==null||b.localStorage.removeItem(e)}catch(t){U.Dt(t)}}},en=[vt,tt,Ve,It,_t,Ct,mt,Ai,gt],Tt=[dr,je,Ht,Ul,fr,Wt,Gt,ke],bs=e=>e+"_cpm",cp=["__proto__","constructor","prototype"],tn=e=>{if(!j(e))return{};let t={};return Object.keys(e).forEach(i=>{cp.indexOf(i)===-1&&(t[i]=e[i])}),t},sn=(e,t=[])=>{let i={};return[...Tt,...t].forEach(s=>{let n=e[s];x(n)||ne(n)||n===""||(i[s]=n)}),i},dc=e=>{let t=5381,i=2166136261;for(let s=0;e.length>s;s++){let n=e.charCodeAt(s);t=33*t^n,i=Math.imul(i^n,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},Fo=(e,t)=>({p:t,f:dc(JSON.stringify(e))}),Ao=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{let i=se.Lt(bs(e)),s=(i==null?void 0:i.f)===dc(t)&&O(i.p);return{properties:s?i.p:[],isValid:s}}catch{return{properties:[],isValid:!1}}},nn=(e,t)=>t+"|"+(se.Ot(bs(e))||""),Rt={},qn={At:()=>!0,Dt(e){T.error("memoryStorage error: "+e)},Ot:e=>e in Rt?Rt[e]:null,Lt:e=>e in Rt?Rt[e]:null,$t:(e,t)=>(Rt[e]=t,!0),Pt(e){delete Rt[e]}},xt=null,J={At(){if(!ne(xt))return xt;if(xt=!0,x(b))xt=!1;else try{let e="__support__";J.$t(e,"xyz"),J.Ot(e)!=='"xyz"'&&(xt=!1),J.Pt(e)}catch{xt=!1}return xt},Dt(e){T.error("sessionStorage error: ",e)},Ot(e){try{return b==null?void 0:b.sessionStorage.getItem(e)}catch(t){J.Dt(t)}return null},Lt(e){try{return JSON.parse(J.Ot(e))||null}catch{}return null},$t(e,t){try{return b==null||b.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(i){J.Dt(i)}return!1},Pt(e){try{b==null||b.sessionStorage.removeItem(e)}catch(t){J.Dt(t)}}},up=class{constructor(e){this._instance=e}get Mr(){return this._instance.config}get consent(){return this.Do()?0:this.Lo}isOptedOut(){return this.Mr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Mr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Mr.opt_out_capturing_by_default}optInOut(e){this.No.$t(this.qo,e?1:0,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.No.Pt(this.qo,this.Mr.cross_subdomain_cookie)}get qo(){let{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get Lo(){let e=this.No.Ot(this.qo);return Vs(e)?1:A(cd,e)?0:-1}get No(){let e=this.Mr.opt_out_capturing_persistence_type,t=e==="localStorage"?U:se,i=t.At()?t:qn;if(!this.jo||this.jo!==i){this.jo=i;let s=e==="localStorage"?se:U;s.Ot(this.qo)&&(this.jo.Ot(this.qo)||this.optInOut(Vs(s.Ot(this.qo))),s.Pt(this.qo,this.Mr.cross_subdomain_cookie))}return this.jo}Do(){return!!this.Mr.respect_dnt&&[pe==null?void 0:pe.doNotTrack,pe==null?void 0:pe.msDoNotTrack,F.doNotTrack,pe==null?void 0:pe.globalPrivacyControl].some(e=>Vs(e))}};function hc(e,t){var i;let s=e==null||(i=e.config)===null||i===void 0?void 0:i.get_current_url;if(!le(s))return t;try{let n=s(t);return V(n)&&n?n:t}catch(n){return T.error("Error in get_current_url, falling back to window.location.href",n),t}}function Oo(e){var t;return e instanceof Element&&(e.id==="__POSTHOG_TOOLBAR__"||!!(!((t=e.closest)===null||t===void 0)&&t.call(e,".toolbar-global-fade-container")))}function We(e){return!!e&&e.nodeType===1}function _e(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function pc(e){return!!e&&e.nodeType===3}function br(e){return!!e&&e.nodeType===11&&We(e.host)}function wr(e){return e?Zt(e).split(/\s+/):[]}function Ro(e,t){let i=(function(s){var n;let r=b==null||(n=b.location)===null||n===void 0?void 0:n.href;return x(r)?void 0:hc(s,r)})(t);return!!(i&&e&&e.some(s=>i.match(s)))}function Xt(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return wr(t)}function fc(e){return L(e)?null:Zt(e).split(/(\s+)/).filter(t=>qt(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ri(e){let t="";return Ft(e)&&!Jt(e)&&e.childNodes&&e.childNodes.length&&Z(e.childNodes,function(i){var s;pc(i)&&i.textContent&&(t+=(s=fc(i.textContent))!==null&&s!==void 0?s:"")}),Zt(t)}function $i(e){var t;return x(e.target)?e.srcElement||null:!((t=e.target)===null||t===void 0)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var xr=["a","button","form","input","select","textarea","label"];function Zn(e,t){let i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch{return!1}}function Yn(e,t){if(x(t))return!0;for(let i of e)if(t.some(s=>Zn(i,s)))return!0;return!1}function vc(e){let t=e.parentNode;return!(!t||!We(t))&&t}var rn=[".ph-no-autocapture","[data-ph-no-autocapture]"],gc=["next","previous","prev",">","<","\u2192","\u2190","\u203A","\u2039","\xBB","\xAB","\u25B6","\u25C0","\u276F","\u276E"],kr=[...gc,"+","-","\u2212","\u2013"],Lo=kr.length+10,dp=["button","a","input","select","textarea","label"],hp=["button","link","tab","menuitem","option"],Do=(e,t)=>/[a-z0-9]/i.test(t)?A(kr,t)?new RegExp(`\\b${t}\\b`).test(e):e.includes(t):e===t,pp=e=>A(dp,e.tagName.toLowerCase())||A(hp,(e.getAttribute("role")||"").toLowerCase());function on(e){let t="",i="",s=o=>{We(o)&&Ft(o)&&!Jt(o)&&(t+=` ${Ri(o)}`,i=i||o.getAttribute("aria-label")||"",Z(o.childNodes,s))};s(e),t=Zt(t.replace(/\s+/g," "));let n=(qt(t)?t:"").toLowerCase(),r=e.getAttribute("aria-label")||(n?"":i);return{safeText:n,ariaLabel:Zt(r).toLowerCase()}}var No=[".ph-no-rageclick",".ph-no-capture"],fp=["","text","search","email","password","url","tel","number"];function _c(e,t){if(!b||Sr(e))return!1;let i,s,n;var r,o;if(Se(t)?(i=!!t&&No,s=void 0,n=!1):(i=(r=t==null?void 0:t.css_selector_ignorelist)!==null&&r!==void 0?r:No,s=t==null?void 0:t.content_ignorelist,n=(o=t==null?void 0:t.ignore_text_selection)!==null&&o!==void 0&&o),i===!1||n&&(function(l){return!(!l||!We(l))&&(!!_e(l,"textarea")||(_e(l,"input")?A(fp,(l.getAttribute("type")||"").toLowerCase()):(function(c){var u;if(c.isContentEditable)return!0;let d=(u=c.getAttribute)===null||u===void 0?void 0:u.call(c,"contenteditable");return d==="true"||d===""})(l)))})(e))return!1;let{targetElementList:a}=mc(e,!1);return!(s&&(function(l,{safeText:c,ariaLabel:u}){let d;if(l===!0)d=gc;else{if(!O(l))return!1;if(l.length>Lo)return T.error(`[PostHog] content_ignorelist array cannot exceed ${Lo} items. Use css_selector_ignorelist for more complex matching.`),!1;d=l.map(h=>h.toLowerCase())}return d.some(h=>Do(c,h)||Do(u,h))})(s,(function(l,c){for(let u of c)if(pp(u))return on(u);for(let u of c){try{if((b==null?void 0:b.getComputedStyle(u).getPropertyValue("cursor"))!=="pointer")break}catch{break}let d=on(u);if(d.safeText||d.ariaLabel)return d}return on(l)})(e,a))||Yn(a,i))}var Sr=e=>!e||_e(e,"html")||!We(e),mc=(e,t)=>{if(!b||Sr(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1,s=[e],n=e;for(;n.parentNode&&!_e(n,"body");){if(br(n.parentNode)){s.push(n.parentNode.host),n=n.parentNode.host;continue}let r=vc(n);if(!r)break;if(t||xr.indexOf(r.tagName.toLowerCase())>-1)i=!0;else try{let o=b.getComputedStyle(r);o&&o.getPropertyValue("cursor")==="pointer"&&(i=!0)}catch{}s.push(r),n=r}return{parentIsUsefulElement:i,targetElementList:s}};function Ft(e){let t=new Set,i=0;for(let r=e;r.parentNode&&!_e(r,"body");r=r.parentNode){if(i++>=1e3||t.has(r))return!1;t.add(r);let o=Xt(r);if(A(o,"ph-sensitive")||A(o,"ph-no-capture"))return!1}if(A(Xt(e),"ph-include"))return!0;let s=e.type||"";if(V(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}let n=e.name||e.id||"";return!V(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function Jt(e){return!!(_e(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||_e(e,"select")||_e(e,"textarea")||e.getAttribute("contenteditable")==="true")}var jo=new RegExp("^(?:(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})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),Vo=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,vp=[16,15,14,13],gp=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ho=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Wo=/[0-9A-Za-z_]/;function _p(e){let t=0,i=!1;for(let s=e.length-1;s>=0;s--){let n=e.charCodeAt(s)-48;i&&(n*=2,n>9&&(n-=9)),t+=n,i=!i}return t%10==0}function qt(e,t=!0){return!(L(e)||V(e)&&(e=Zt(e),(t?jo.test((e||"").replace(/[- ]/g,"")):(function(i){let s;for(Vo.lastIndex=0;s=Vo.exec(i);){let n=s[2];if(!n)continue;let r=n.replace(/[- ]/g,"");for(let o=0;r.length>o;o++)for(let a of vp){let l=o+a;if(r.length>=l){let c=r.slice(o,l);if(jo.test(c)&&_p(c))return!0}}}return!1})(e))||(t?gp.test(e):(function(i){let s;for(Ho.lastIndex=0;s=Ho.exec(i);){let n=s[1],r=s[3];if(!(n&&r&&Wo.test(n)&&Wo.test(r)))return!0}return!1})(e))))}function Bo(e){let t=Ri(e);return t=`${t} ${yc(e)}`.trim(),qt(t)?t:""}function yc(e){let t="";return e&&e.childNodes&&e.childNodes.length&&Z(e.childNodes,function(i){var s;if(i&&((s=i.tagName)===null||s===void 0?void 0:s.toLowerCase())==="span")try{let n=Ri(i);t=`${t} ${n}`.trim(),i.childNodes&&i.childNodes.length&&(t=`${t} ${yc(i)}`.trim())}catch(n){T.error("[AutoCapture]",n)}}),t}function Uo(e){return e.replace(/"|\\"/g,'\\"')}function mp(e){let t=e.attr__class;if(t)return O(t)?t:wr(t)}var Zi=re("[Dead Clicks]"),yp=()=>!0,bp=e=>{var t;let i=!!(!((t=e.instance.persistence)===null||t===void 0)&&t.get_property(hr)),s=e.instance.config.capture_dead_clicks;return Se(s)?s:!!j(s)||i},zo=class{get lazyLoadedDeadClicksAutocapture(){return this.Bo}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[hr]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Ho()}):this.stop()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this.instance,"dead-clicks-autocapture",n=>{n?Zi.error("failed to load script",n):e()})}Ho(){var e;if(E){if(!this.Bo&&(!((e=F.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){let t=j(this.instance.config.capture_dead_clicks)?f({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Bo=F.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Bo.start(E),Zi.info("starting...")}}else Zi.error("`document` not found. Cannot start.")}stop(){this.Bo&&(this.Bo.stop(),this.Bo=void 0,Zi.info("stopping..."))}},di=re("[SegmentIntegration]");function Go(e,t,i=!0){let s=e.config.segment;if(!s)return t();let{analytics:n,filterProperties:r}=(a=>le(a.register))(o=s)?{analytics:o}:o;var o;(function(a,l,c,u){let d=p=>{let v=()=>p.anonymousId()||He();a.config.get_device_id=v,u&&p.id()&&(a.register({distinct_id:p.id(),$device_id:v()}),a.persistence.set_property(ke,ns)),c(u?void 0:p.anonymousId()||void 0)},h=l.user();"then"in h&&le(h.then)?h.then(d):d(h)})(e,n,a=>{n.register(((l,c,{filterProperties:u}={})=>{typeof Promise!="undefined"&&Promise.resolve||di.warn("This browser does not have Promise support, and can not use the segment integration");let d=(h,p)=>{if(!p)return h;let v=!!c&&h.event.anonymousId===c&&!h.event.userId;v||h.event.userId||h.event.anonymousId===l.get_distinct_id()||(di.info("No userId set, resetting PostHog"),l.reset()),v||(c=void 0),h.event.userId&&h.event.userId!==l.get_distinct_id()&&(di.info("UserId set, identifying with PostHog"),l.identify(h.event.userId));let _=l.calculateEventProperties(p,h.event.properties);if(!L(u)){let g=h.event.properties||{},y={};for(let w of Object.keys(_))rr.call(g,w)||(y[w]=_[w]);let m=((w,M)=>{let P=O(w)?w:[w],k=f({},M);for(let I of P)try{if(k=I(k),L(k))return null}catch(S){return di.error("Error in Segment filterProperties:",S),null}return k})(u,y);if(L(m))return h;_=m}return h.event.properties=Object.assign({},_,h.event.properties),h};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(h){return d(h,h.event.event)},page(h){return d(h,mr)},identify(h){return d(h,lc)},screen(h){return d(h,"$screen")}}})(e,a,{filterProperties:r})).then(()=>{t()},l=>{di.error("Failed to register the Segment integration",l),t()})},i)}var bc="posthog-js";function wc(e,{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:r=!0}={}){return o=>{var a,l,c,u,d;if(n!=="*"&&!n.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});let h=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));let p=((a=o.exception)===null||a===void 0?void 0:a.values)||[],v=p.map(y=>f(f({},y),{},{stacktrace:y.stacktrace?f(f({},y.stacktrace),{},{type:"raw",frames:(y.stacktrace.frames||[]).map(m=>f(f({},m),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((l=p[0])===null||l===void 0?void 0:l.value)||o.message,$exception_type:(c=p[0])===null||c===void 0?void 0:c.type,$exception_level:o.level,$exception_list:v,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((u=p[0])===null||u===void 0?void 0:u.value)||o.message,$sentry_exception_type:(d=p[0])===null||d===void 0?void 0:d.type,$sentry_tags:o.tags};var g;return t&&i&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),r&&((g=e.exceptions)===null||g===void 0||g.sendExceptionEvent(_)),o}}var wp=class{constructor(e,t,i,s,n,r){this.name=bc,this.setupOnce=function(o){o(wc(e,{organization:t,projectId:i,prefix:s,severityAllowList:n,sendExceptionsToPostHog:r==null||r}))}}},qo=class{constructor(e){this.Uo=(t,i,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(T.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:s}),this.Wo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Vo()}Vo(){var e;this.Go=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.Uo)}destroy(){var e;(e=this.Go)===null||e===void 0||e.call(this),this.Go=void 0}doPageView(e,t){var i;let s=this.Qo(e,t);return this.Wo={pathname:(i=b==null?void 0:b.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Qo(e,(t=this.Wo)===null||t===void 0?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Wo)===null||e===void 0?void 0:e.pageViewId}}Qo(e,t){let i=this.Wo;if(!i)return{$pageview_id:t};let s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:r,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=n;if(!(x(r)||x(o)||x(a)||x(l)||x(c)||x(u))){r=Math.ceil(r),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);let d=r>1?Xe(o/r,0,1,T):1,h=r>1?Xe(a/r,0,1,T):1,p=l>1?Xe(c/l,0,1,T):1,v=l>1?Xe(u/l,0,1,T):1;s=Q(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}},hi=["flags","surveys"],xp={[Oh]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[Rh]:{exposure:"hidden"},[Nn]:{exposure:"hidden"},[Gt]:{exposure:"hidden"},[ki]:{exposure:"hidden"},[Vl]:{exposure:"event"},[jn]:{exposure:"hidden"},[Wl]:{exposure:"hidden"},[Vn]:{exposure:"event"},[Hl]:{exposure:"hidden"},[Hn]:{exposure:"event"},[Wn]:{exposure:"event"},[hr]:{exposure:"event"},[pr]:{exposure:"hidden"},[Bl]:{exposure:"event"},[Si]:{exposure:"hidden"},[Lh]:{exposure:"hidden"},[Ht]:{exposure:"hidden"},[Ul]:{exposure:"event"},[Dh]:{exposure:"event",shouldSkipFromEventProperties:e=>ne(e)},[Wh]:{exposure:"event"},[Bh]:{exposure:"event"},[Uh]:{exposure:"event"},[zh]:{exposure:"event"},[Gh]:{exposure:"hidden"},[Ve]:{exposure:"hidden",storageGroup:"flags"},[tt]:{exposure:"hidden",storageGroup:"flags"},[Dn]:{exposure:"hidden"},[It]:{exposure:"hidden",storageGroup:"flags"},[_t]:{exposure:"hidden",storageGroup:"flags"},[Ct]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xi]:{exposure:"hidden",storageGroup:"flags"},[Ze]:{exposure:"hidden"},[Mt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ft]:{exposure:"hidden"},[mi]:{exposure:"hidden",storageGroup:"surveys"},[ms]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Gl]:{exposure:"event"},[ql]:{exposure:"hidden"},[Zl]:{exposure:"hidden"},[Bn]:{exposure:"hidden"},[qh]:{exposure:"hidden"},[Zh]:{exposure:"hidden"},[Yh]:{exposure:"event"},[Xh]:{exposure:"event"},[Jh]:{exposure:"event"},[Kh]:{exposure:"event"},[gt]:{exposure:"hidden"},[_i]:{exposure:"hidden"},[zl]:{exposure:"event"},[Ai]:{exposure:"hidden"},[mt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ke]:{exposure:"hidden"},[Un]:{exposure:"hidden"},[Qh]:{exposure:"hidden"},[Yl]:{exposure:"hidden"},[Xl]:{exposure:"hidden"},[Wt]:{exposure:"hidden"},[fr]:{exposure:"hidden"},[Nh]:{exposure:"event"},[jh]:{exposure:"event"},[Vh]:{exposure:"event"},[Hh]:{exposure:"event"},[Kl]:{exposure:"event"},[Ql]:{exposure:"event"},[vr]:{exposure:"hidden"},[gr]:{exposure:"hidden"},[ec]:{exposure:"hidden"},[tc]:{exposure:"hidden"},[ic]:{exposure:"hidden"},[sc]:{exposure:"hidden"},[nc]:{exposure:"hidden"},[rc]:{exposure:"hidden"},[oc]:{exposure:"hidden"},[ep]:{exposure:"event"}},kp=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],fe=e=>{let t=xp[e];if(t)return t;for(let[i,s]of kp)if(e.indexOf(i)===0)return s};function xc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}var kc=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},Sc=(e,t)=>e>=t&&kc(),Ec=(e,t,i,s)=>{if(e===0){if(kc()){let n=t+1;return n===i&&s(),n}return t}return 0},Ut=(e,t)=>{try{let i;return JSON.stringify(e,(s,n)=>{var r;return ii(n)?((r=i)!==null&&r!==void 0||(i=new WeakMap),i.has(n)||i.set(n,cc(n)),i.get(n)):typeof n=="bigint"?n.toString():n},t)}catch{return Da(e)}},nt=e=>{let t=E==null?void 0:E.createElement("a");return x(t)?null:(t.href=e,t)},Kt=function(e,t){let i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s;for(let n=0;i.length>n;n++){let r=i[n].split("=");if(r[0]===t){s=r;break}}if(!O(s)||2>s.length)return"";{let n=s[1];try{n=decodeURIComponent(n)}catch{T.error("Skipping decoding for malformed query param: "+n)}return n.replace(/\+/g," ")}},Li=function(e,t,i){if(!e||!t||!t.length)return e;let s=e.split("#"),n=s[1],r=(s[0]||"").split("?"),o=r[1],a=r[0],l=(o||"").split("&"),c=[];for(let d=0;l.length>d;d++){let h=l[d].split("=");O(h)&&(t.includes(h[0])?c.push(h[0]+"="+i):c.push(l[d]))}let u=a;return o!=null&&(u+="?"+c.join("&")),n!=null&&(u+="#"+n),u},ws=function(e,t){let i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},Qt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],Sp=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qt],Di="<masked>",Ep=["li_fat_id"];function $c(e,t,i){if(!E)return{};let s=t?[...Qt,...i||[]]:[],n=Pc(Li(E.URL,s,Di),e),r=(function(){let o={};return Z(Ep,function(a){let l=Ei(a);o[a]=l||null}),o})();return Q(r,n)}function Pc(e,t){let i=Sp.concat(t||[]),s={};return Z(i,function(n){let r=Kt(e,n);s[n]=r||null}),s}function Mc(e){let t=(function(n){return n?n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(e),i=t!="yahoo"?"q":"p",s={};if(!ne(t)){s.$search_engine=t;let n=E?Kt(E.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Tc(){return navigator.language||navigator.userLanguage}function $p(){let e=Tc();return typeof e=="string"?e.split("-")[0]:void 0}var xs="$direct";function Ic(){return(E==null?void 0:E.referrer)||xs}function Cc(e,t,i=!1){let s=e?[...Qt,...t||[]]:[],n=i?yt(K==null?void 0:K.href):K==null?void 0:K.href,r=n==null?void 0:n.substring(0,1e3);return{r:Ic().substring(0,1e3),u:r?Li(r,s,Di):void 0}}function Fc(e,t=!1){var i;let{r:s,u:n}=e,r=t?yt(n):n,o={$referrer:s,$referring_domain:s==null?void 0:s==xs?xs:(i=nt(s))===null||i===void 0?void 0:i.host};if(r){o.$current_url=r;let a=nt(r);o.$host=a==null?void 0:a.host,o.$pathname=a==null?void 0:a.pathname;let l=Pc(r);Q(o,l)}if(s){let a=Mc(s);Q(o,a)}return o}function Pp(){try{return new Date().getTimezoneOffset()}catch{return}}var Mp={flags:mt,surveys:ms},Tp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Yi=e=>`${e}_cookie_identity_change_pending`,Xi=e=>{let t="",i=0;for(let s of e){let n=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+n>1e3)break;t+=s,i+=n}return t},ce="main",et=[Ve,tt,It,_t,Ct,mt,xi,vt],an=e=>et.indexOf(e)!==-1,Ac=[Gt,ki],Zo=e=>Ac.indexOf(e)!==-1,ut=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}},Lt=e=>{if(!e)return{};let t=JSON.parse(e);return j(t)?t:{}},Yo=(e,t)=>{Z(e,(i,s)=>{let n=fe(s);n&&n.exposure!=="event"||{}.hasOwnProperty.call(t,s)||delete e[s]})},ln=class{constructor(e,t,i=!0,s=!e.cookieless_mode){if(this.Zo={},this.Jo=!1,this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=new Map,this.ia=!1,this.na=!1,this.sa=!1,this.ra=new Set,this.oa=new Set,this.Mr=e,this.aa=i,this.props={},this.la=void 0,this.ua=(n=>{let r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.hi=e.disable_persistence||!!t,this.No=this.ca(e),this.Xo=this.ha(e),this.load(s),this.da(),e.debug&&T.info("Persistence loaded",e.persistence,f({},this.props)),this.update_config(e,e,t),this.save(),b){let n=()=>this.flush();G(b,"beforeunload",n,{capture:!1}),G(b,"pagehide",n,{capture:!1}),this.va=r=>{if(this.Jo&&(!r.storageArea||r.storageArea===(b==null?void 0:b.localStorage))&&r.key)if(r.key!==this.ua){if(this.Xo){let o=hi.find(a=>r.key===this.fa(a));o&&this.pa(r.key,o)}}else this.pa(r.key,ce)},G(b,"storage",this.va)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([t,i])=>{let s=this.ea.get(t);if(!an(t)||s===!0)return;if(i===!0)return void this.ga(t,!0);let n=new Set(s||[]);i.forEach(r=>n.add(r)),n.size&&this.ga(t,n)})}onCrossTabFeatureFlagChange(e){return this.oa.add(e),()=>this.oa.delete(e)}destroy(){this.va&&b&&(b.removeEventListener("storage",this.va),this.va=void 0),this.oa.clear()}pa(e,t,i=!0){if(this.hi)return!1;let s,n;try{if(n=U.Ot(e),ne(n)){let a=this.ma(t);return a.storageValue=null,t!==ce&&(a.persisted=!1),!1}s=Lt(n)}catch{return!1}let r=t===ce?s:U.Lt(this.ua);if(r&&this.ya(r))return!1;let o=this.ba(s,t,i);return t===ce&&this.Xo&&!ut(this._a().main,s)||this.wa(s,t,!0,n),o}ya(e){let t=this.props[je],i=e[je];return!x(t)&&!x(i)&&t!==i}wa(e,t,i,s){let n=this.ma(t);n.storageValue=s,t!==ce&&(n.persisted=i);try{n.fingerprint=this.ka(e,t)}catch{n.fingerprint=void 0}}ba(e,t,i){let s=!1;return et.forEach(n=>{var r;let o=(r=fe(n))===null||r===void 0?void 0:r.storageGroup;if(t===ce&&this.Xo&&o||t!==ce&&o!==t)return;let a=n in e,l=this.Sa(n,a?e[n]:void 0),c=this.ea.has(n)?n in this.props:a;c===n in this.props&&ut(l,this.props[n])||(c?this.xa(n,l,!1):this.$a(n,!1),s=!0)}),s&&i&&this.oa.forEach(n=>n()),s}Ca(){if(!this.Jo)return!1;try{this.sa=!1;let e=U.Ot(this.ua),t=this.ma(ce),i,s=!1,n=!1;if(e!==t.storageValue)if(ne(e))t.storageValue=null;else{if(i=Lt(e),this.sa=!this.na&&this.ya(i),this.sa)return!1;n=this.ba(i,ce,!1),!this.Xo||ut(this._a().main,i)?this.wa(i,ce,!0,e):t.storageValue=e,s=!0}return this.Xo&&hi.forEach(r=>{let o=U.Ot(this.fa(r)),a=this.ma(r),l=i||{},c=s&&et.some(d=>{var h;return((h=fe(d))===null||h===void 0?void 0:h.storageGroup)===r&&d in l});if(o===a.storageValue&&!c)return;if(ne(o))return a.storageValue=null,a.persisted=!1,void(c&&(n=this.ba(l,r,!1)||n));let u=Lt(o);n=this.ba(u,r,!1)||n,this.wa(u,r,!0,o)}),n}catch{return!1}}ga(e,t){this.ea.set(e,t);let i=fe(e);i!=null&&i.volatile||(this.ma((this.Xo?i==null?void 0:i.storageGroup:void 0)||ce).fingerprint=void 0,this.Ta(e))}Ia(){et.forEach(e=>this.ea.set(e,!0))}da(){if(this.Jo)try{let e=U.Ot(this.ua),t=Lt(e);this.ma(ce).storageValue=e,et.forEach(i=>{var s;let n=this.Xo?(s=fe(i))===null||s===void 0?void 0:s.storageGroup:void 0,r=n?U.Ot(this.fa(n)):null;if(n){let a=this.ma(n);a.storageValue=r,a.persisted=!ne(r)}let o=n&&!ne(r)?Lt(r):t;i in this.props?this.Ma(i,o[i],this.props[i]):i in o&&this.ga(i,!0)})}catch{}}Sa(e,t){let i=this.ea.get(e);if(!i)return t;if(i===!0)return this.props[e];if(e==="$active_feature_flags"){let r=new Set(O(t)?t:[]),o=new Set(O(this.props[e])?this.props[e]:[]);return i.forEach(a=>o.has(a)?r.add(a):r.delete(a)),Array.from(r)}let s=j(t)?f({},t):{},n=j(this.props[e])?this.props[e]:{};return i.forEach(r=>{r in n?s[r]=n[r]:delete s[r]}),s}Ma(e,t,i){if(!an(e))return;let s=this.ea.get(e);if(s===!0)return;let n=t;if(this.Jo)try{var r;let a=this.Xo?(r=fe(e))===null||r===void 0?void 0:r.storageGroup:void 0,l=a?this.fa(a):this.ua;n=Lt(U.Ot(l))[e]}catch{}let o=new Set(s||[]);if(e==="$active_feature_flags"){if(!x(t)&&!O(t)||!x(n)&&!O(n)||!O(i))return void this.ga(e,!0);let a=new Set(t||[]),l=new Set(n||[]),c=new Set(i);new Set([...a,...c]).forEach(u=>{a.has(u)!==c.has(u)&&o.add(u)}),o.forEach(u=>{l.has(u)===c.has(u)&&o.delete(u)})}else{if(!j(i))return void(ut(n,i)?this.ea.delete(e):this.ga(e,!0));{if(!x(t)&&!j(t)||x(t)&&Me(i)&&x(n))return void this.ga(e,!0);let a=j(t)?t:{},l=j(n)?n:{};new Set([...Object.keys(a),...Object.keys(i)]).forEach(c=>{c in a==c in i&&ut(a[c],i[c])||o.add(c)}),o.forEach(c=>{c in l==c in i&&ut(l[c],i[c])&&o.delete(c)})}}o.size?this.ga(e,o):this.ea.delete(e)}Ea(){var e;let t=(e=this.Mr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return oe(t)&&t>0?t:0}Pa(e){if(this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie")if(e)try{let t=sn(e,this.Mr.cookie_persisted_properties||[]),i=Fo(t,this.Mr.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),n=se.Ot(this.ua)||void 0;n&&nn(this.ua,n)===s&&(this.Ra=s,this.Aa=n)}catch{}else try{let t=se.Ot(this.ua)||void 0;this.Ra=t?nn(this.ua,t):void 0,this.Aa=t}catch{}}syncCookieProperties(){return this.Fa(this.Mr)}Fa(e,t=!1){if(this.hi&&!t||this.ta||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;let i;try{i=se.Ot(this.ua)||void 0}catch{}if(!i||i===this.Aa)return!1;let s=nn(this.ua,i),n;try{n=tn(JSON.parse(i))}catch{return!1}if((se.Ot(this.ua)||void 0)!==i)return!1;this.Ra=s,this.Aa=i;let r=Ao(this.ua,i),o=[...Tt,...r.properties],a={};if(Object.keys(n).forEach(_=>{let g=n[_];(x(g)||ne(g)||g===""||_==="$user_state"&&g!=="anonymous"&&g!=="identified")&&(a[_]=!0,delete n[_])}),Me(n))return!1;let l="distinct_id"in n||n.$user_state==="anonymous"||n.$user_state==="identified",c=this.props,u=c[je],d=c[ke],h=Q({},c);[...Tt,...e.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in n)&&!a[_]&&(l||_!=="distinct_id"&&_!=="$user_state")){let g=h[_];(r.isValid||Tt.indexOf(_)===-1||g!==!1&&g!==0)&&delete h[_]}}),this.props=Q(h,n),et.forEach(_=>{let g=_ in this.props;_ in c===g&&ut(c[_],this.props[_])||(g?this.Ma(_,c[_],this.props[_]):this.ga(_,!0))}),!l||"$user_state"in n||"$user_state"in this.props||this.xa(ke,it);let p=this.props[je],v=this.props[ke];return!l||p===u&&v===d||(this.na=!0,this.Yo=!0,J.$t(Yi(this.ua),!0),this.$a(vt),this.$a(tt),this.$a(Ve),this.$a(It),this.$a(_t),this.$a(Ct),this.$a(mt),this.$a(Ai),this.$a(gt),v!=="anonymous"||d!=="identified"&&n.$user_state!=="anonymous"&&(x(u)||p===u)||(Yo(this.props,n),this.$a(ft)),v==="identified"?this.props.$user_id=p:delete this.props.$user_id,this.$a(_s)),!0}consumeCookieIdentityChange(){let e=Yi(this.ua),t=this.Yo||!!J.Ot(e);return this.Yo=!1,t&&J.Pt(e),t}Oa(e=!1){return!(this.ta||this.hi&&!e||!this.Mr.cookieWinsOnConflict||this.Mr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ta=!0,0))}Da(){this.ta&&(x(this.La)||(clearTimeout(this.La),this.La=void 0),delete this.Zo[ce],this.Na(!0))}qa(e=!0){if(this.ta)try{e?this.Da():x(this.La)||(clearTimeout(this.La),this.La=void 0)}finally{this.ta=!1}}isDisabled(){return!!this.hi}ca(e){Tp.indexOf(e.persistence.toLowerCase())===-1&&(T.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");let t=((o=[],a=!1,l=()=>!1)=>{let c=[...Tt,...o];return f(f({},U),{},{Lt(u){try{let h,p={};try{h=se.Ot(u)||void 0,p=h?tn(JSON.parse(h)):{}}catch{}let v=JSON.parse(U.Ot(u)||"{}"),_;if(a){let g=Ao(u,h),y=[...Tt,...g.properties],m={};Object.keys(p).forEach(M=>{let P=p[M];ne(P)||P===""||M==="$user_state"&&P!=="anonymous"&&P!=="identified"||(m[M]=P)});let w="distinct_id"in m||m.$user_state==="anonymous"||m.$user_state==="identified";if(Object.keys(m).length>0){var d;let M=v[je],P=(d=v.$user_state)!==null&&d!==void 0?d:it;c.forEach(k=>{if(y.indexOf(k)!==-1&&!(k in p)&&(w||k!=="distinct_id"&&k!=="$user_state")){let I=v[k];(g.isValid||Tt.indexOf(k)===-1||I!==!1&&I!==0)&&delete v[k]}}),!w||"$user_state"in p||"$user_state"in v||(v[ke]=it),!w||("distinct_id"in m?m[je]:v[je])===M&&("$user_state"in m?m[ke]:v[ke])===P||(en.forEach(k=>delete v[k]),m.$user_state==="identified"&&"distinct_id"in m?v.$user_id=m[je]:delete v.$user_id,m.$user_state!=="identified"&&(delete v[zl],delete v[ft]),delete v.__alias)}_=Q(v,m)}else _=Q(p,v);return l()||U.$t(u,_),_}catch{}return null},$t(u,d,h,p,v,_){let g=U.$t(u,d,void 0,void 0,_);try{let y=sn(d,o);if(Object.keys(y).length){if(a){let m=bs(u),w=Fo(y,o);if(se.$t(m,w,h,p,v,_),se.Ot(m)!==JSON.stringify(w)){se.Pt(m,p);let M=sn(d);return se.$t(u,M,h,p,v,_),g}}se.$t(u,y,h,p,v,_)}}catch(y){U.Dt(y)}return g},Pt(u,d){try{b==null||b.localStorage.removeItem(u),se.Pt(u,d),se.Pt(bs(u),d)}catch(h){U.Dt(h)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict,()=>!!this.hi),i,s=!1,n=!1,r=e.persistence.toLowerCase();return r==="localstorage"&&U.At()?(i=U,n=!0):r==="localstorage+cookie"&&t.At()?(i=t,n=!0,s=!0):r==="sessionstorage"&&J.At()?i=J:r==="memory"?i=qn:r==="cookie"&&se.At()?(i=se,s=!0):t.At()?(i=t,n=!0,s=!0):se.At()?(i=se,s=!0):i=qn,this.Jo=n,this.Ko=s,i}fa(e){return`${this.ua}__${e}`}ha(e){return this.Jo&&!!e.split_storage}properties(){let e={};return Z(this.props,(t,i)=>{let s=fe(i);if(!s||s.exposure==="event"){var n;if(!(s==null||(n=s.shouldSkipFromEventProperties)===null||n===void 0)&&n.call(s,t))return;e[i]=t}}),e}load(e=!1){if(this.hi&&!e)return;let t=this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie",i=t?U.Lt(this.ua):null,s={};if(t)try{s=tn(se.Lt(this.ua)),Z(s,(a,l)=>{(x(a)||ne(a)||a==="")&&delete s[l]})}catch{}let n=this.No.Lt(this.ua);if(n&&(this.props=Q({},n)),this.Xo&&this.ja(),t&&n){var r,o;let a=i==null?void 0:i[je],l=(r=i==null?void 0:i.$user_state)!==null&&r!==void 0?r:it,c=n[je],u=(o=n.$user_state)!==null&&o!==void 0?o:it;if(c!==a||u!==l){this.Yo=!0,this.hi||J.$t(Yi(this.ua),!0);let d=Q({},this.props);en.forEach(p=>delete d[p]),u!=="anonymous"||l!=="identified"&&s.$user_state!=="anonymous"&&(x(a)||c===a)||(Yo(d,s),delete d[ft]),this.props=d;let h=new Set;en.forEach(p=>{var v;let _=(v=fe(p))===null||v===void 0?void 0:v.storageGroup;_&&h.add(_)}),h.forEach(p=>{if(this.hi)return;let v={};Z(this.props,(_,g)=>{var y;((y=fe(g))===null||y===void 0?void 0:y.storageGroup)===p&&(v[g]=_)}),Me(v)?(U.Pt(this.fa(p)),this.Zo[p]={}):U.$t(this.fa(p),v)&&(this.Zo[p]={persisted:!0,fingerprint:this.ka(v,p)})})}}J.Ot(Yi(this.ua))&&(this.Yo=!0)}ja(){for(let e of hi){let t=U.Lt(this.fa(e));if(t&&!Me(t)){let i=this.ma(e);i.persisted=!0,this.Ba(e)||(i.fingerprint=this.ka(t,e)),this.za(e,t)||Q(this.props,t)}}}Ba(e){return Object.keys(this.props).some(t=>{var i;return((i=fe(t))===null||i===void 0?void 0:i.storageGroup)===e})}za(e,t){let i=Mp[e];if(!i)return!1;let s=t[i],n=this.props[i];return oe(s)&&oe(n)&&n>s}refreshKey(e){var t;if(this.hi||this.ra.has(e))return;let i=this.Xo?(t=fe(e))===null||t===void 0?void 0:t.storageGroup:void 0,s=i?U.Lt(this.fa(i)):this.No.Lt(this.ua);if(s&&e in s)this.xa(e,s[e],!1);else{if(i){let n=this.No.Lt(this.ua);if(n&&e in n)return void this.xa(e,n[e],!1)}this.$a(e,!1)}}save(){if(this.hi)return;let e=this.Ea();e>0?x(this.La)&&(this.La=setTimeout(()=>{this.La=void 0,this.Na()},e)):this.Na()}flush(){x(this.La)||(clearTimeout(this.La),this.La=void 0,this.Na())}Na(e=!1){if(this.hi||this.ta&&!e)return;e||(this.syncCookieProperties(),this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie"||Ac.forEach(n=>this.refreshKey(n)));let t=!e&&!this.ia;t||(this.sa=!1);let i=!!t&&this.Ca();if(this.sa)return void(this.Mr.debug&&T.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Xo)return this.Ha(),void(i&&this.oa.forEach(n=>n()));let s=this.Ua(this.No,this.ua,this.props,ce);s==="written"&&this.Pa(this.props),s!=="failed"&&(this.ea.clear(),this.na=!1,this.ra.clear()),i&&this.oa.forEach(n=>n())}Ha(){let{main:e,groups:t}=this._a(),i=this.Ua(this.No,this.ua,e,ce);i==="written"&&this.Pa(e),i!=="failed"&&(this.na=!1,this.ra.clear(),et.forEach(n=>{var r;!((r=fe(n))===null||r===void 0)&&r.storageGroup||this.ea.delete(n)}));for(let n of hi){var s;let r=t[n];if(Me(r)&&!(!((s=this.Zo[n])===null||s===void 0)&&s.persisted)){et.forEach(a=>{var l;((l=fe(a))===null||l===void 0?void 0:l.storageGroup)===n&&this.ea.delete(a)});continue}let o=this.Ua(U,this.fa(n),r,n);o!=="failed"&&et.forEach(a=>{let l=fe(a);(l==null?void 0:l.storageGroup)!==n||o!=="written"&&l.volatile||this.ea.delete(a)})}}_a(){let e={},t={flags:{},surveys:{}};return Z(this.props,(i,s)=>{var n;let r=(n=fe(s))===null||n===void 0?void 0:n.storageGroup;r?t[r][s]=i:e[s]=i}),{main:e,groups:t}}ka(e,t){if(t===ce)return JSON.stringify(e)+"|"+this.Wa+"|"+this.Va+"|"+this.Ga;let i={};return Z(e,(s,n)=>{var r;i[n]=!((r=fe(n))===null||r===void 0)&&r.volatile?"__volatile__":s}),JSON.stringify(i)}Ua(e,t,i,s){let n=this.ma(s);if(s!==ce&&!n.dirty&&!x(n.fingerprint))return"skipped";let r;try{if(r=this.ka(i,s),r===n.fingerprint)return n.dirty=!1,"skipped"}catch{r=void 0}return e.$t(t,i,this.Wa,this.Va,this.Ga,this.Mr.debug)?(n.dirty=!1,s!==ce&&(n.persisted=!0),x(r)||(n.fingerprint=r),this.Jo&&(n.storageValue=U.Ot(t)),"written"):(this.Mr.debug&&T.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ia(),x(this.La)||(clearTimeout(this.La),this.La=void 0),this.No.Pt(this.ua,!1),this.No.Pt(this.ua,!0),!e&&this.aa)for(let t of hi)U.Pt(this.fa(t));e?delete this.Zo[ce]:this.Zo={},this.Ra=void 0,this.Aa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(j(e)){this.syncCookieProperties(),x(t)&&(t="None"),this.Wa=x(i)?this.Qa:i;let s=!1;if(Z(e,(n,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.xa(r,n),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(j(e)){this.syncCookieProperties(),this.Wa=x(t)?this.Qa:t;let i=!1;if(Z(e,(s,n)=>{e.hasOwnProperty(n)&&(this.props[n]!==s||j(s)||O(s))&&(this.xa(n,s),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();let t=typeof e=="string"?[e]:e,i=!1;for(let s of t)s in this.props&&(this.$a(s),i=!0);i&&this.save()}update_campaign_params(){let e=E==null?void 0:E.URL;if(e===this.la)return;let t=$c(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),i=!Me(yr(t));return i&&this.register(t),this.la=e,i?t:void 0}update_search_keyword(){this.register((function(){let e=E==null?void 0:E.referrer;return e?Mc(e):{}})())}update_referrer_info(){var e;this.register_once({$referrer:Ic(),$referring_domain:(E==null?void 0:E.referrer)&&((e=nt(E.referrer))===null||e===void 0?void 0:e.host)||xs},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;let e=Cc(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[Wt]:this.Ko?{r:Xi(e.r),u:e.u?Xi(e.u):void 0}:e},void 0)}get_initial_props(){let e={};Z([Xl,Yl],i=>{let s=this.props[i];s&&Z(s,function(n,r){e["$initial_"+Mn(r)]=n})});let t=this.props[Wt];if(t){let i=(function(s,n=!1){let r=Fc(s,n),o={};return Z(r,function(a,l){o[`$initial_${Mn(l)}`]=a}),o})(t,this.Mr.disable_capture_url_hashes);Q(e,i)}return e}safe_merge(e){return Z(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){let s=e.persistence!==t.persistence,n=!((p,v)=>{if(p.length!==v.length)return!1;let _=[...p].sort(),g=[...v].sort();return _.every((y,m)=>y===g[m])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),r=s||n,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.hi&&!a;a||this.Fa(t,l),this.Mr=e,!a&&(s||n||o)&&(this.Ra=void 0,this.Aa=void 0,this.Fa(f(f({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),l));let c=r||o?this.ca(e):this.No;this.Za();let u=this.ha(e),d=r||u!==this.Xo,h=!a&&(d||e.cross_subdomain_cookie!==this.Va||e.secure_cookie!==this.Ga)&&this.Oa(l);this.ia=d;try{if(this.Qa=this.Wa=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),d){let p=this.props;this.clear(),this.No=c,this.Xo=u,this.props=p,this.save()}else o&&(this.No=c,a||(delete this.Zo[ce],this.Na()))}finally{this.ia=!1,h&&this.qa()}}Za(){let e=this.props[Wt];if(!this.Ko||!j(e)||typeof e.r!="string")return;let t=Xi(e.r),i=typeof e.u=="string"?Xi(e.u):e.u;t===e.r&&i===e.u||this.xa(Wt,f(f({},e),{},{r:t,u:i}))}set_disabled(e){this.hi=e,this.hi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Va&&(this.Va=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ga&&(this.Ga=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){let i=this.props.__timers||{};i[e]=t,this.xa(Nn,i),this.save()}remove_event_timer(e){let t=this.props.__timers||{},i=t[e];return x(i)||(delete t[e],this.xa(Nn,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.xa(e,t),this.save()}xa(e,t,i=!0){var s;let n=this.props[e];this.props[e]=t,i&&(e!=="distinct_id"&&e!=="$user_state"||n===t||(this.na=!0),Zo(e)&&!ut(n,t)&&this.ra.add(e),this.Ma(e,n,t),!((s=fe(e))===null||s===void 0)&&s.volatile||this.Ta(e))}$a(e,t=!0){delete this.props[e],t&&(an(e)&&this.ga(e,!0),Zo(e)&&this.ra.add(e),this.Ta(e))}Ta(e){var t;let i=(t=fe(e))===null||t===void 0?void 0:t.storageGroup;i&&(this.ma(i).dirty=!0)}ma(e){return this.Zo[e]||(this.Zo[e]={})}},Ce={GZipJS:"gzip-js",Base64:"base64"},pi={Activation:"events",Cancellation:"cancelEvents"};var cn={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"};var Ie={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},un={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Xn={Popover:"popover",Inline:"inline"};function Ji(e){let t=!0;return{dispose(){if(t){t=!1;let i=e();i&&le(i.then)&&i.then(void 0,()=>{})}}}}var Ip={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Xo={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Jo=re("[RateLimiter]"),Cp=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{let i=t.text;if(i&&i.length)try{(JSON.parse(i).quota_limited||[]).forEach(s=>{Jo.info(`${s||"events"} is quota limited.`),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void Jo.warn(`could not rate limit - continuing. Error: "${s==null?void 0:s.message}"`,{text:i})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var t,i,s;let{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,o=new Date().getTime(),a=(t=(i=this.instance.persistence)===null||i===void 0?void 0:i.get_property("$capture_rate_limit"))!==null&&t!==void 0?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*r,a.last=o,a.tokens>n&&(a.tokens=n);let l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){let c=(oe(a.dropped)?a.dropped:0)+1;a.dropped=c,!this.lastEventRateLimited&&this.Ja(c)&&(a.dropped=0)}return this.lastEventRateLimited=l,(s=this.instance.persistence)===null||s===void 0||s.set_property("$capture_rate_limit",a),{isRateLimited:l,remainingTokens:a.tokens}}Ka(e){let t=this.instance.config.property_denylist;return!O(t)||!t.includes(e)}Xa(){var e;if(this.Ka("$current_url")&&this.Ka("$pathname")&&(K!=null&&K.pathname))return`${(e=K.origin)!==null&&e!==void 0?e:""}${K.pathname}`}Ja(e){var t,i;let{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,r=this.Xa(),o=this.Ka("$session_id")?(t=(i=this.instance).get_session_id)===null||t===void 0?void 0:t.call(i):void 0,a=[`${e} event(s) dropped since the last warning`,r?`triggered on ${r}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${a}. Config is set to ${n} events per second and ${s} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){let t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},dt=re("[RemoteConfig]"),Oc=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.config}Ya(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.loadExternalDependency?(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}tl(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return dt.info("Using preloaded remote config",this.remoteConfig),void this.el(this.remoteConfig);if(this._instance.il())return void dt.warn("Remote config is disabled. Falling back to local config.");this.Ya(e=>{if(!e)return dt.info("No config found after loading remote JS config. Falling back to JSON."),void this.tl(t=>{this.el(t.json,t)});this.el(e)})}catch(e){dt.error("Error loading remote config",e),this.el()}}el(e,t){!e&&t&&(t.statusCode===0?t.error||dt.warn("Failed to fetch remote config from PostHog."):dt.error("Failed to fetch remote config from PostHog."));try{this._instance.el(e?{ok:!0,config:e}:{ok:!1})}catch(s){dt.error("Error applying remote config",s)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;(i=this._instance.featureFlags)===null||i===void 0||i.ensureFlagsLoaded()}catch(s){dt.error("Error loading feature flags",s)}}};var Fe=Uint8Array,Ee=Uint16Array,ei=Uint32Array,Er=new Fe([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]),$r=new Fe([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]),Ko=new Fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rc=function(e,t){for(var i=new Ee(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var n=new ei(i[30]);for(s=1;30>s;++s)for(var r=i[s];i[s+1]>r;++r)n[r]=r-i[s]<<5|s;return[i,n]},Lc=Rc(Er,2),Jn=Lc[1];Lc[0][28]=258,Jn[258]=28;for(Kn=Rc($r,0)[1],ks=new Ee(32768),te=0;32768>te;++te)kt=(43690&te)>>>1|(21845&te)<<1,ks[te]=((65280&(kt=(61680&(kt=(52428&kt)>>>2|(13107&kt)<<2))>>>4|(3855&kt)<<4))>>>8|(255&kt)<<8)>>>1;var kt,Kn,ks,te,Pi=function(e,t,i){for(var s=e.length,n=0,r=new Ee(t);s>n;++n)++r[e[n]-1];var o,a=new Ee(t);for(n=0;t>n;++n)a[n]=a[n-1]+r[n-1]<<1;if(i){o=new Ee(1<<t);var l=15-t;for(n=0;s>n;++n)if(e[n])for(var c=n<<4|e[n],u=t-e[n],d=a[e[n]-1]++<<u,h=d|(1<<u)-1;h>=d;++d)o[ks[d]>>>l]=c}else for(o=new Ee(s),n=0;s>n;++n)o[n]=ks[a[e[n]-1]++]>>>15-e[n];return o},At=new Fe(288);for(te=0;144>te;++te)At[te]=8;for(te=144;256>te;++te)At[te]=9;for(te=256;280>te;++te)At[te]=7;for(te=280;288>te;++te)At[te]=8;var Ss=new Fe(32);for(te=0;32>te;++te)Ss[te]=5;var Fp=Pi(At,9,0),Ap=Pi(Ss,5,0),Dc=function(e){return(e/8|0)+(7&e&&1)},Nc=function(e,t,i){(t==null||0>t)&&(t=0),(i==null||i>e.length)&&(i=e.length);var s=new(e instanceof Ee?Ee:e instanceof ei?ei:Fe)(i-t);return s.set(e.subarray(t,i)),s},Je=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},fi=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},dn=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s,f:e[s]});var n=i.length,r=i.slice();if(!n)return[new Fe(0),0];if(n==1){var o=new Fe(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(P,k){return P.f-k.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=n-1;)a=i[i[d].f>i[c].f?c++:d++],l=i[c!=u&&i[d].f>i[c].f?c++:d++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=r[0].s;for(s=1;n>s;++s)r[s].s>h&&(h=r[s].s);var p=new Ee(h+1),v=Qn(i[u-1],p,0);if(v>t){s=0;var _=0,g=v-t,y=1<<g;for(r.sort(function(P,k){return p[k.s]-p[P.s]||P.f-k.f});n>s;++s){var m=r[s].s;if(t>=p[m])break;_+=y-(1<<v-p[m]),p[m]=t}for(_>>>=g;_>0;){var w=r[s].s;t>p[w]?_-=1<<t-p[w]++-1:++s}for(;s>=0&&_;--s){var M=r[s].s;p[M]==t&&(--p[M],++_)}v=t}return[new Fe(p),v]},Qn=function(e,t,i){return e.s==-1?Math.max(Qn(e.l,t,i+1),Qn(e.r,t,i+1)):t[e.s]=i},Qo=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Ee(++t),s=0,n=e[0],r=1,o=function(l){i[s++]=l},a=1;t>=a;++a)if(e[a]==n&&a!=t)++r;else{if(!n&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(n),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(n);r=1,n=e[a]}return[i.subarray(0,s),t]},vi=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},os=function(e,t,i){var s=i.length,n=Dc(t+2);e[n]=255&s,e[n+1]=s>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var r=0;s>r;++r)e[n+r+4]=i[r];return 8*(n+4+s)},ea=function(e,t,i,s,n,r,o,a,l,c,u){Je(t,u++,i),++n[256];for(var d=dn(n,15),h=d[0],p=d[1],v=dn(r,15),_=v[0],g=v[1],y=Qo(h),m=y[0],w=y[1],M=Qo(_),P=M[0],k=M[1],I=new Ee(19),S=0;m.length>S;++S)I[31&m[S]]++;for(S=0;P.length>S;++S)I[31&P[S]]++;for(var $=dn(I,7),D=$[0],R=$[1],N=19;N>4&&!D[Ko[N-1]];--N);var W,C,H,B,Y=c+5<<3,z=vi(n,At)+vi(r,Ss)+o,ie=vi(n,h)+vi(r,_)+o+14+3*N+vi(I,D)+(2*I[16]+3*I[17]+7*I[18]);if(z>=Y&&ie>=Y)return os(t,u,e.subarray(l,l+c));if(Je(t,u,1+(z>ie)),u+=2,z>ie){W=Pi(h,p,0),C=h,H=Pi(_,g,0),B=_;var ge=Pi(D,R,0);for(Je(t,u,w-257),Je(t,u+5,k-1),Je(t,u+10,N-4),u+=14,S=0;N>S;++S)Je(t,u+3*S,D[Ko[S]]);u+=3*N;for(var de=[m,P],me=0;2>me;++me){var Te=de[me];for(S=0;Te.length>S;++S)Je(t,u,ge[he=31&Te[S]]),u+=D[he],he>15&&(Je(t,u,Te[S]>>>5&127),u+=Te[S]>>>12)}}else W=Fp,C=At,H=Ap,B=Ss;for(S=0;a>S;++S)if(s[S]>255){var he;fi(t,u,W[257+(he=s[S]>>>18&31)]),u+=C[he+257],he>7&&(Je(t,u,s[S]>>>23&31),u+=Er[he]);var Re=31&s[S];fi(t,u,H[Re]),u+=B[Re],Re>3&&(fi(t,u,s[S]>>>5&8191),u+=$r[Re])}else fi(t,u,W[s[S]]),u+=C[s[S]];return fi(t,u,W[256]),u+C[256]},Op=new ei([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Rp=new Fe(0),Lp=(function(){for(var e=new ei(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e})(),hn=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Dp(e,t){t===void 0&&(t={});var i=(function(){var h=4294967295;return{p(p){for(var v=h,_=0;p.length>_;++_)v=Lp[255&v^p[_]]^v>>>8;h=v},d(){return 4294967295^h}}})(),s=e.length;i.p(e);var n,r,o,a,l,c,u=(a=10+((n=t).filename&&n.filename.length+1||0),l=8,(function(h,p,v,_,g,y){var m=h.length,w=new Fe(_+m+5*(1+Math.floor(m/7e3))+g),M=w.subarray(_,w.length-g),P=0;if(!p||8>m)for(var k=0;m>=k;k+=65535){var I=k+65535;m>I?P=os(M,P,h.subarray(k,I)):(M[k]=y,P=os(M,P,h.subarray(k,m)))}else{for(var S=Op[p-1],$=S>>>13,D=8191&S,R=(1<<v)-1,N=new Ee(32768),W=new Ee(R+1),C=Math.ceil(v/3),H=2*C,B=function(js){return(h[js]^h[js+1]<<C^h[js+2]<<H)&R},Y=new ei(25e3),z=new Ee(288),ie=new Ee(32),ge=0,de=0,me=(k=0,0),Te=0,he=0;m>k;++k){var Re=B(k),ot=32767&k,at=W[Re];if(N[ot]=at,W[Re]=ot,k>=Te){var wt=m-k;if((ge>7e3||me>24576)&&wt>423){P=ea(h,M,0,Y,z,ie,de,me,he,k-he,P),me=ge=de=0,he=k;for(var Pe=0;286>Pe;++Pe)z[Pe]=0;for(Pe=0;30>Pe;++Pe)ie[Pe]=0}var Ge=2,Ui=0,Ku=D,lt=ot-at&32767;if(wt>2&&Re==B(k-lt))for(var Qu=Math.min($,wt)-1,ed=Math.min(32767,k),td=Math.min(258,wt);ed>=lt&&--Ku&&ot!=at;){if(h[k+Ge]==h[k+Ge-lt]){for(var ct=0;td>ct&&h[k+ct]==h[k+ct-lt];++ct);if(ct>Ge){if(Ge=ct,Ui=lt,ct>Qu)break;var id=Math.min(lt,ct-2),Jr=0;for(Pe=0;id>Pe;++Pe){var Ns=k-lt+Pe+32768&32767,Kr=Ns-N[Ns]+32768&32767;Kr>Jr&&(Jr=Kr,at=Ns)}}}lt+=(ot=at)-(at=N[ot])+32768&32767}if(Ui){Y[me++]=268435456|Jn[Ge]<<18|Kn[Ui];var Qr=31&Jn[Ge],eo=31&Kn[Ui];de+=Er[Qr]+$r[eo],++z[257+Qr],++ie[eo],Te=k+Ge,++ge}else Y[me++]=h[k],++z[h[k]]}}P=ea(h,M,y,Y,z,ie,de,me,he,k-he,P),y||(P=os(M,P,Rp))}return Nc(w,0,_+Dc(P)+g)})(r=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,a,l,!c)),d=u.length;return(function(h,p){var v=p.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>p.level?4:p.level==9?2:0,h[9]=3,p.mtime!=0&&hn(h,4,Math.floor(new Date(p.mtime||Date.now())/1e3)),v){h[3]=8;for(var _=0;v.length>=_;++_)h[_+10]=v.charCodeAt(_)}})(u,t),hn(u,d-8,i.d()),hn(u,d-4,s),u}var Np=!!nr||!!Ci,jc=new WeakMap,Vc="text/plain",pn=0,as=!1,Hc=(e,t)=>{let[i,s]=e.split("#"),[n,r]=i.split("?");if(!r)return e;let o=r.split("&").filter(a=>a.split("=")[0]!==t).join("&");return`${n}${o?`?${o}`:""}${s?`#${s}`:""}`},ji=(e,t,i=!0)=>{var s;let[n,r]=e.split("?"),o=f({},t),a=(s=r==null?void 0:r.split("&").map(c=>{var u;let[d,h]=c.split("="),p=i&&(u=o[d])!==null&&u!==void 0?u:h;return delete o[d],`${d}=${p}`}))!==null&&s!==void 0?s:[],l=(function(c,u="&"){let d,h,p=[];return Z(c,function(v,_){x(v)||x(_)||_==="undefined"||(d=encodeURIComponent((g=>g instanceof File)(v)?v.name:v.toString()),h=encodeURIComponent(_),p[p.length]=h+"="+d)}),p.join(u)})(o);return l&&a.push(l),a.length>0?`${n}?${a.join("&")}`:n},fn=e=>{if(e.nl)return e.nl;let{data:t,compression:i}=e;if(!t)return;if(i===Ce.GZipJS){let n=Dp((function(r){var o=r.length;if(typeof TextEncoder!="undefined")return new TextEncoder().encode(r);for(var a=new Fe(r.length+(r.length>>>1)),l=0,c=function(p){a[l++]=p},u=0;o>u;++u){if(l+5>a.length){var d=new Fe(l+8+(o-u<<1));d.set(a),a=d}var h=r.charCodeAt(u);128>h?c(h):2048>h?(c(192|h>>>6),c(128|63&h)):h>55295&&57344>h?(c(240|(h=65536+(1047552&h)|1023&r.charCodeAt(++u))>>>18),c(128|h>>>12&63),c(128|h>>>6&63),c(128|63&h)):(c(224|h>>>12),c(128|h>>>6&63),c(128|63&h))}return Nc(a,0,l)})(Ut(t)),{mtime:0});return{contentType:Vc,body:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),estimatedSize:n.byteLength}}if(i===Ce.Base64){let n=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(a,l)=>String.fromCharCode(parseInt(l,16))))})(Ut(t)),r=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Ut(o)))(n);return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}let s=Ut(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}},Wc=e=>{let t=()=>e.transport==="sendBeacon"?{url:ji(e.url,{compression:Ce.Base64}),encodedBody:fn(f(f({},e),{},{compression:Ce.Base64,nl:void 0}))}:{url:Hc(e.url,"compression"),encodedBody:fn(f(f({},e),{},{compression:void 0,nl:void 0}))},i;try{i=fn(e)}catch(n){if(mo(e.compression,Kt(e.url,"compression")))return T.error("Failed to gzip request body, sending uncompressed payload",n),t();throw n}return i&&mo(e.compression,Kt(e.url,"compression"))&&!((s=i.body)instanceof ArrayBuffer?On(new Uint8Array(s)):ArrayBuffer.isView(s)&&On(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)))?(as=!0,t()):{url:e.url,encodedBody:i};var s},Bc=e=>{try{return Wc(e)}catch(i){var t;return T.error(i),void((t=e.callback)===null||t===void 0||t.call(e,{statusCode:0,error:i}))}},jp=(function(){var e=ee(function*(t){let i=yield(function(n){return Rn.apply(this,arguments)})(Ut(t.data),ue.DEBUG,{rethrow:!0});if(!i)return t;let s=yield i.arrayBuffer();return f(f({},t),{},{nl:{contentType:Vc,body:s,estimatedSize:s.byteLength}})});return function(t){return e.apply(this,arguments)}})(),Vp=/Failed to fetch|NetworkError|Load failed/i,Uc=e=>(e==null?void 0:e.name)==="TypeError"&&Vp.test((e==null?void 0:e.message)||""),zc=e=>{try{let t=(function(i,s=Date.now()){if(typeof i!="string"||!i)return;let n=i.trim(),r=/^\d+\s*,/.test(n)?n.slice(0,n.indexOf(",")).trim():n;if(/^\d+$/.test(r)){let l=1e3*Math.min(Number(r),300);return l>0?l:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(r))return;let o=/^\w{3} \w{3} /.test(r)?r+" GMT":r,a=Date.parse(o)-s;return Number.isFinite(a)&&a>0?Math.min(a,ss):void 0})(e());return x(t)?void 0:Math.min(t,3e4)}catch{return}},Gc=e=>{let t=Bc(e);if(!t)return;let i=new nr;jc.set(i,!0);let{url:s,encodedBody:n}=t;i.open(e.method||"GET",s,!0);let{contentType:r,body:o}=n!=null?n:{};Z(e.headers,function(a,l){i.setRequestHeader(l,a)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(i.readyState===4){var a;let l={statusCode:i.status,text:i.responseText};if(i.status===200)try{l.json=JSON.parse(i.responseText)}catch{}(a=e.callback)===null||a===void 0||a.call(e,l,zc(()=>i.getResponseHeader("Retry-After")))}},i.send(o)},qc=e=>{let t=Bc(e);if(!t)return;let{url:i,encodedBody:s}=t,{contentType:n,body:r,estimatedSize:o}=s!=null?s:{},a=new Headers;Z(e.headers,function(v,_){a.append(_,v)}),n&&a.append("Content-Type",n);let l=null,c=!1;if(to){let v=new to;l={signal:v.signal,timeout:setTimeout(()=>{c=!0;try{v.abort(_l("AbortError","PostHog request timed out"+((_=e.timeout)?` after ${_}ms`:"")))}catch(g){d(g)}var _},e.timeout)}}let u=!1,d=v=>{var _;u||(u=!0,c&&(v==null?void 0:v.name)==="AbortError"||Uc(v)?T.warn(v):T.error(v),(_=e.callback)===null||_===void 0||_.call(e,{statusCode:0,error:v}))},h=0,p=()=>{pn-=h,h=0,l&&clearTimeout(l.timeout)};try{let v=f({method:(e==null?void 0:e.method)||"GET",headers:a,referrerPolicy:"strict-origin",body:r,signal:l==null?void 0:l.signal},e.fetchOptions),_=o!=null?o:x(r)?0:void 0;v.keepalive=v.method==="POST"&&!e.sl&&v.keepalive!==!1&&v.body===r&&!x(_)&&_>=0&&52428.8>pn+_,v.keepalive&&(h=_,pn+=h),Ci(i,v).then(g=>g.text().then(y=>{var m;if(u)return;let w={statusCode:g.status,text:y};if(g.status===200)try{w.json=JSON.parse(y)}catch(M){T.error(M)}u=!0,p(),(m=e.callback)===null||m===void 0||m.call(e,w,zc(()=>g.headers.get("Retry-After")))})).catch(g=>{p(),d(g)}).finally(p)}catch(v){p(),d(v)}},er=e=>{try{var t;let{url:i,encodedBody:s}=Wc(e),{contentType:n,body:r,estimatedSize:o}=s!=null?s:{};if(!r)return;let a=r instanceof Blob?r:new Blob([r],{type:n});if(pe.sendBeacon(i,a))return;let l=O(e.data)?e.data:(t=e.data)===null||t===void 0?void 0:t.batch;if(O(l)&&l.length>1&&(o!=null?o:0)>16384){let c=Math.ceil(l.length/2),u=d=>O(e.data)?d:f(f({},e.data),{},{batch:d});return er(f(f({},e),{},{data:u(l.slice(0,c))})),void er(f(f({},e),{},{data:u(l.slice(c))}))}T.warn(`Beacon of ~${o!=null?o:0} bytes was rejected by the browser, falling back to ${Ci?"fetch":"XHR"}`),Ci?qc(f(f({},e),{},{sl:!0})):Gc(e)}catch(i){T.warn("Beacon send failed",i)}},ta=(e,t,i,s)=>{let n=s==="query"?t==="POST"?"sent_at":"_":void 0;return ji(i===Ce.GZipJS?Hc(e,"compression"):e,f(f({},n?{[n]:Date.now().toString()}:{}),i===Ce.GZipJS?{}:{compression:i}))},Hp=(()=>{let e=[];return Ci&&e.push({transport:"fetch",method:qc}),nr&&e.push({transport:"XHR",method:Gc}),pe!=null&&pe.sendBeacon&&e.push({transport:"sendBeacon",method:er}),e})(),Zc=!Np&&(xe==null?void 0:xe.indexOf("MSIE"))===-1&&(xe==null?void 0:xe.indexOf("Mozilla"))===-1;function Yc(e,t,i){var s,n,r;i&&(t=f(f({},t),{},{callback:o=>i(o)})),e.__loaded?Zc?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&((n=t.callback)===null||n===void 0||n.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=f(f({},e.config.request_headers),t.headers),t.compression=t.compression==="best-available"?(s=e.compression)!==null&&s!==void 0?s:t.compressionFallback:t.compression,(x(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,((o,a)=>{var l,c,u;let d=f(f({},o),{},{callback:a!=null?a:g=>{var y;return(y=o.callback)===null||y===void 0?void 0:y.call(o,g)}});d.timeout=d.timeout||6e4;let h=(l=d.transport)!==null&&l!==void 0?l:"fetch";h==="sendBeacon"&&x(d.compression)&&d.data&&(d.compression=Ce.Base64),d.method==="POST"&&d.data&&(d.timestampMode==="capture-body"?d.data=(g=>{var y,m;let w=(O(g)?g:[g]).map(P=>f(f({},P),P.timestamp instanceof Date&&!isNaN(P.timestamp.getTime())?{timestamp:P.timestamp.toISOString()}:{})),M=w[0];return{api_key:(y=M==null||(m=M.properties)===null||m===void 0?void 0:m.token)!==null&&y!==void 0?y:M==null?void 0:M.token,batch:w,sent_at:new Date().toISOString()}})(d.data):d.timestampMode==="body"&&(d.data=((g,y=new Date().toISOString())=>O(g)?g.map(m=>f(f({},m),{},{sent_at:y})):f(f({},g),{},{sent_at:y}))(d.data))),d.url=ta(d.url,d.method,d.compression,d.timestampMode);let p=Hp.filter(g=>!d.disableTransport||!g.transport||!d.disableTransport.includes(g.transport)),v=(c=(u=(function(g,y){for(let m=0;g.length>m;m++)if(y(g[m]))return g[m]})(p,g=>g.transport===h))===null||u===void 0?void 0:u.method)!==null&&c!==void 0?c:p[0].method;if(!v)throw new Error("No available transport method");let _=g=>{try{v(g)}catch(m){var y;Uc(m)?T.warn(m):T.error(m),(y=d.callback)===null||y===void 0||y.call(d,{statusCode:0,error:m})}};h!=="sendBeacon"&&!d.preferSyncCompression&&d.data&&d.compression===Ce.GZipJS&&sd&&typeof Promise!="undefined"&&!as?jp(d).then(g=>{_(g)}).catch(g=>{if(yo(g))return as=!0,void _(f(f({},d),{},{compression:void 0,url:ta(o.url,o.method,void 0,o.timestampMode)}));(y=>{if(!y||typeof y!="object")return!1;let m="name"in y?String(y.name):"";return yo(y)||m===Sl})(g)&&(as=!0),_(d)}):_(d)})(t,(o,a)=>{var l,c,u;e.rateLimiter.checkForLimiting(o),400>o.statusCode||(l=(c=e.config).on_request_error)===null||l===void 0||l.call(c,o),i?i(o,a):(u=t.callback)===null||u===void 0||u.call(t,o)})):t.fireCallbackOnDrop&&((r=t.callback)===null||r===void 0||r.call(t,{statusCode:0}))}var Wp=class{constructor(e,t){this.rl=!0,this.ol=[],this.al=Xe((t==null?void 0:t.flush_interval_ms)||3e3,250,5e3,T.createLogger("flush interval"),3e3),this.ll=e}enqueue(e){this.ol.push(e),this.ul||this.cl()}unload(){this.hl();let e=this.ol.length>0?this.dl():{},t=Object.values(e);[...t.filter(i=>i.url.indexOf("/e")===0),...t.filter(i=>i.url.indexOf("/e")!==0)].map(i=>{this.vl(f(f({},i),{},{callback:void 0}),"sendBeacon")})}enable(){this.rl=!1,this.cl()}cl(){this.rl||(this.ul=setTimeout(()=>{this.hl(),this.fl()},this.al))}fl(){if(this.ol.length>0){let e=this.dl();for(let t in e)this.vl(e[t])}}vl(e,t){try{this.ll(e,t)}catch(i){T.error(i)}}hl(){clearTimeout(this.ul),this.ul=void 0}dl(){let e={},t={};Z(this.ol,i=>{var s;let n=i,r=((n?n.batchKey:null)||n.url)+(n.batchGroup?`:${n.batchGroup}`:"");x(e[r])&&(e[r]=f(f({},n),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[r]=[]),(s=e[r].data)===null||s===void 0||s.push(n.data),n.callback&&t[r].push(n.callback)});for(let i in t){let s=t[i];s.length&&(e[i].callback=n=>{for(let r of s)r(n)})}return this.ol=[],e}},Bp=["retriesPerformedSoFar"],Up=class{constructor(e){this._instance=e,this.pl=!1,this.gl=3e3,this.ol=[],this.ol=[],this.ml=!0,this.resume()}resume(){if(!x(b)&&"onLine"in b.navigator){if(this.ml=b.navigator.onLine,this.yl)return;this.yl=()=>{this.ml=!0,this.fl()},this.bl=()=>{this.ml=!1},G(b,"online",this.yl),G(b,"offline",this.bl)}}get length(){return this.ol.length}retriableRequest(e,t){let{retriesPerformedSoFar:i}=e,s=El(e,Bp);Qe(i)&&(s.url=ji(s.url,{retry_count:i})),Yc(this._instance,t?f(f({},s),{},{transport:t}):s,(n,r)=>{var o;if(n.statusCode!==200&&(400>n.statusCode||n.statusCode>=500)){if((n.statusCode===0?3:10)>(i!=null?i:0))return void this.Ls(f({retriesPerformedSoFar:i},s),r);n.statusCode===0&&T.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${i!=null?i:0} retries.`)}(o=s.callback)===null||o===void 0||o.call(s,n)})}Ls(e,t){let i=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=i+1;let s=Math.max((function(o){let a=3e3*Math.pow(2,o),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(i),t!=null?t:0),n=Date.now()+s;this.ol.push({retryAt:n,requestOptions:e});let r=`Enqueued failed request for retry in ${s}`;navigator.onLine||(r+=" (Browser is offline)"),T.warn(r),this.pl||(this.pl=!0,this._l())}_l(){if(this.wl&&clearTimeout(this.wl),this.ol.length===0)return this.pl=!1,void(this.wl=void 0);this.wl=setTimeout(()=>{this.ml&&this.ol.length>0&&this.fl(),this._l()},this.gl)}fl(){let e=Date.now(),t=[],i=this.ol.filter(s=>e>s.retryAt||(t.push(s),!1));if(this.ol=t,i.length>0)for(let{requestOptions:s}of i)this.retriableRequest(s)}unload(){this.wl&&(clearTimeout(this.wl),this.wl=void 0),this.pl=!1,x(b)||(this.yl&&(b.removeEventListener("online",this.yl),this.yl=void 0),this.bl&&(b.removeEventListener("offline",this.bl),this.bl=void 0));for(let{requestOptions:e}of this.ol)try{this._instance._send_request(f(f({},e),{},{callback:O(e.data)?void 0:e.callback,transport:"sendBeacon"}))}catch(t){T.error(t)}this.ol=[]}},zp=class{constructor(e){this._instance=e,this.kl=()=>{var t,i,s,n;this.Sl||(this.Sl={});let r=this.scrollElement(),o=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,l=o+((r==null?void 0:r.clientHeight)||0),c=(r==null?void 0:r.scrollHeight)||0;this.Sl.lastScrollY=Math.ceil(o),this.Sl.maxScrollY=Math.max(o,(t=this.Sl.maxScrollY)!==null&&t!==void 0?t:0),this.Sl.maxScrollHeight=Math.max(a,(i=this.Sl.maxScrollHeight)!==null&&i!==void 0?i:0),this.Sl.lastContentY=l,this.Sl.maxContentY=Math.max(l,(s=this.Sl.maxContentY)!==null&&s!==void 0?s:0),this.Sl.maxContentHeight=Math.max(c,(n=this.Sl.maxContentHeight)!==null&&n!==void 0?n:0)}}get xl(){return this._instance.config.scroll_root_selector}getContext(){return this.Sl}resetContext(){let e=this.Sl;return this.Sl=void 0,setTimeout(this.kl,0),e}startMeasuringScrollPosition(){G(b,"scroll",this.kl,{capture:!0}),G(b,"scrollend",this.kl,{capture:!0}),G(b,"resize",this.kl)}scrollElement(){if(this.xl){let i=O(this.xl)?this.xl:[this.xl];for(let s of i){var e;let n=b==null||(e=b.document)===null||e===void 0?void 0:e.querySelector(s);if(n)return n}return}var t;return b==null||(t=b.document)===null||t===void 0?void 0:t.documentElement}$l(e){var t,i;let s=e==="y"?"scrollTop":"scrollLeft";if(this.xl){let n=this.scrollElement();return n&&n[s]||0}return b?e==="y"?b.scrollY||b.pageYOffset||((t=b.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.scrollTop)||0:b.scrollX||b.pageXOffset||((i=b.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.scrollLeft)||0:0}scrollY(){return this.$l("y")}scrollX(){return this.$l("x")}},Gp=e=>Cc(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties,e==null?void 0:e.config.disable_capture_url_hashes),ia=class{constructor(e,t,i,s){this.qe=n=>{let r=this.Cl();if(r&&r.sessionId===n)return;let o={sessionId:n,props:this.Tl(this._instance)};this.Il.register({[Un]:o})},this._instance=e,this.Ml=t,this.Il=i,this.Tl=s||Gp,this.Ml.onSessionId(this.qe)}Cl(){return this.Il.props[Un]}getSetOnceProps(){var e;let t=(e=this.Cl())===null||e===void 0?void 0:e.props;return t?"r"in t?Fc(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){let e={};return Z(yr(this.getSetOnceProps()),(t,i)=>{i==="$current_url"&&(i="url"),e[`$session_entry_${Mn(i)}`]=t}),e}},Es=class{on(e,t){return this.El[e]||(this.El[e]=[]),this.El[e].push(t),()=>{this.El[e]=this.El[e].filter(i=>i!==t)}}emit(e,t){for(let i of this.El[e]||[])i(t);for(let i of this.El["*"]||[])i(e,t)}constructor(){this.El={}}},Dt=re("[SessionId]"),sa=864e5,na=class{on(e,t){return this.Pl.on(e,t)}constructor(e,t,i){var s;if(this.Rl=null,this.Al=null,this.Fl=[],this.Ol=void 0,this.Dl=!1,this.Pl=new Es,this.Ll=(r,o)=>!(!Qe(r)||!Qe(o))&&Math.abs(r-o)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Mr=e.config,this.Il=e.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Nl=void 0,this._sessionActivityTimestamp=null,this.ql=t||He,this.jl=i||He;let n=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*Xe(this.Mr.session_idle_timeout_seconds||1800,60,36e3,Dt.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Bl(),this.zl="ph_"+n+"_window_id",this.Hl="ph_"+n+"_primary_window_exists",this.Ul()){let r=J.Lt(this.zl),o=J.Lt(this.Hl);r&&!o?this.je=r:J.Pt(this.zl),J.$t(this.Hl,!0)}!((s=this.Mr.bootstrap)===null||s===void 0)&&s.sessionID&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Wl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return x(this.Fl)&&(this.Fl=[]),this.Fl.push(e),this.Xt&&e(this.Xt,this.je),()=>{this.Fl=this.Fl.filter(t=>t!==e)}}Ul(){return this.Mr.persistence!=="memory"&&!this.Il.hi&&J.At()}Vl(e){e!==this.je&&(this.je=e,this.Ul()&&J.$t(this.zl,e))}Gl(){return this.je?this.je:this.Ul()?J.Lt(this.zl):null}Ql(e){let t=this.Rl;return!ne(t)&&!ne(e)&&5e3>Math.abs(e-t)}Zl(e,t,i){let s=t!==this._sessionActivityTimestamp,n=!(e!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,n&&!s||n&&this.Ql(t)||(this.Rl=t,this.Il.register({[Ht]:[t,e,i]}))}Jl(){var e;let t=(e=this.Mr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return Qe(t)&&t>0}Kl(){this.Jl()?this.Il.refreshKey(Ht):(this.Il.flush(),this.Il.load())}Xl(){var e;if(ne(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Rl)return;this.Kl();let[,t,i]=this.Yl();t===this.Xt&&i===this._sessionStartTimestamp&&(this.Rl=this._sessionActivityTimestamp,this.Il.register({[Ht]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Il.flush())}tu(){let[e]=this.Yl(),t=Qe(e)?e:0,i=Qe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,i)}eu(e){return this.Kl(),this.Ll(e,this.tu())}Yl(){let e=this.Il.props[Ht];return O(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Rl=null,this.Nl=void 0,clearTimeout(this.iu),this.iu=void 0,this.Zl(null,null,null)}setBootstrapSessionId(e,t=!1){let i=((s,n=new Date().getTime())=>{try{let r=(o=>{let a=o.replace(/-/g,"");if(a.length!==32)throw new Error("Not a valid UUID");if(a[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(a.substring(0,12),16)})(s);return r>n+6e4?void Dt.error("Bootstrap sessionID cannot be in the future"):r}catch(r){return void Dt.error("Invalid sessionID in bootstrap",r)}})(e);return!x(i)&&(t?this.Nl={sessionId:e,sessionStartTimestamp:i}:this.Zl(e,new Date().getTime(),i),!0)}destroy(){this.Dl=!0,this.Xl(),clearTimeout(this.iu),this.iu=void 0,this.Ol&&b&&(b.removeEventListener(ys,this.Ol,{capture:!1}),this.Ol=void 0),this.Fl=[]}Wl(){this.Ol=()=>{this.Xl(),this.Ul()&&J.Pt(this.Hl)},G(b,ys,this.Ol,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,t=null,i=!1){if(this.Mr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');let s=t||new Date().getTime(),n=this.Xt;if(i)this.Al=s;else if(ne(this.Al)||this.Al>s||s-this.Al>=1e3){var r,o;(r=(o=this.Il).syncCookieProperties)===null||r===void 0||r.call(o),this.Al=s}let[,a,l]=this.Yl(),c=!x(n)&&a!==n,u=this.tu(),d=this.Gl(),h=this.Nl,p=!!h&&(h.sessionStartTimestamp>s+6e4||s-h.sessionStartTimestamp>sa),v=h?p:Qe(l)&&Math.abs(s-l)>sa,_=!1,g=c,y=!a||!!h,m=a,w=!y&&!e&&this.Ll(s,u);if(w&&(w=this.eu(s),w||Dt.info("cross-tab refresh kept the session alive",{sessionId:a}),[,a,l]=this.Yl(),w||(y=!a||!!h)),y||w||v){g=!1;let I=h&&!p;a=I?h.sessionId:this.ql(),d=this.jl(),Dt.info("new session ID assigned",{sessionId:a,windowId:d,bootstrapped:!!I,changeReason:{noSessionId:y,activityTimeout:w,sessionPastMaximumLength:v}}),l=I?h.sessionStartTimestamp:s,this.Nl=void 0,_=!0}else d||(d=this.jl(),_=!0),g=g||a!==m,g&&(Dt.info("adopted cross-tab session id",{sessionId:a,windowId:d}),_=!0);let M=Qe(u)&&e&&!v?u:s,P=Qe(l)?l:new Date().getTime();this.Vl(d),this.Zl(a,M,P),e||this.Bl();let k={noSessionId:y,activityTimeout:w,sessionPastMaximumLength:v,crossTabAdoption:g};return _&&this.Fl.forEach(I=>I(a,d,k)),{sessionId:a,windowId:d,sessionStartTimestamp:P,changeReason:_?k:void 0,lastActivityTimestamp:u}}Bl(){this.Dl||(clearTimeout(this.iu),this.iu=setTimeout(()=>{if(!this.Dl)if(this.eu(new Date().getTime())){let e=this.Xt;this.resetSessionId(),this.Pl.emit("forcedIdleReset",{idleSessionId:e})}else this.Bl()},1.1*this.sessionTimeoutMs))}},Xc=function(e,t){if(!e)return!1;let i=e.userAgent;if(i&&no(i,t))return!0;try{let s=e==null?void 0:e.userAgentData;if(s!=null&&s.brands&&s.brands.some(n=>no(n==null?void 0:n.brand,t)))return!0}catch{}return!!e.webdriver};function Jc(){return(Jc=ee(function*(){let e=pe==null?void 0:pe.userAgentData;if(e!=null&&e.getHighEntropyValues)try{let t=yield e.getHighEntropyValues(["model"]),i=t==null?void 0:t.model;return V(i)&&i.length>0?i:void 0}catch(t){return void T.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function qp(e,t){let i=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(i=`$survey_${t}/${e.id}/${e.current_iteration}`),i}function Kc(e){var t;return!!(!((t=e.conditions)===null||t===void 0||(t=t.events)===null||t===void 0||(t=t.values)===null||t===void 0)&&t.length)}var $s=(e,t)=>{if(!(i=>{try{new RegExp(i)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},Ki=e=>e.toLowerCase(),Qc={exact:(e,t)=>t.some(i=>e.some(s=>i===s)),is_not:(e,t)=>t.every(i=>e.every(s=>i!==s)),regex:(e,t)=>t.some(i=>e.some(s=>$s(i,s))),not_regex:(e,t)=>t.every(i=>e.every(s=>!$s(i,s))),icontains:(e,t)=>t.map(Ki).some(i=>e.map(Ki).some(s=>i.includes(s))),not_icontains:(e,t)=>t.map(Ki).every(i=>e.map(Ki).every(s=>!i.includes(s))),gt:(e,t)=>t.some(i=>{let s=parseFloat(i);return!isNaN(s)&&e.some(n=>s>parseFloat(n))}),lt:(e,t)=>t.some(i=>{let s=parseFloat(i);return!isNaN(s)&&e.some(n=>s<parseFloat(n))})};function eu(e,t){return!e||Object.entries(e).every(([i,s])=>{let n=t==null?void 0:t[i];if(n==null)return!1;let r=Qc[s.operator];return!!r&&r(s.values.map(String),[String(n)])})}function vn(e,t,i){return Ut({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var tr="custom",ra="i.posthog.com",Zp=/^\/static\//,Yp=["/s/","/e/","/i/"],Xp=class{constructor(e){this.nu={},this.instance=e}get apiHost(){let e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){let e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${ra}`,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.nu[this.apiHost]||(this.nu[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":tr),this.nu[this.apiHost]}su(e){if(!Zp.test(e))return;let t=this.instance.config.asset_host;return typeof t=="string"&&t.trim().replace(/\/$/,"")||void 0}ru(e){let t=nt(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}ou(e,t,i){if(e==="ui")return i;let s=i,n=this.instance.config.rewriteRequestPath;if(n){var r;let o=((r=nt(i))===null||r===void 0?void 0:r.href)||i;s=n(new URL(o)).toString()}if(n&&e==="api"&&Yp.some(o=>t.indexOf(o)===0)){let o=this.ru(s);if(o){let a=this.apiHost,l=this.au;(l==null?void 0:l.apiHost)===a&&l.rewriteRequestPath===n||(l={apiHost:a,rewriteRequestPath:n,urls:new Set},this.au=l),l.urls.add(o)}}return s}isIngestionEndpoint(e){let t=this.au,i=this.ru(e);return(t==null?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t=""){if(t&&(t=t[0]==="/"?t:`/${t}`),e==="ui")return this.ou(e,t,this.uiHost+t);if(e==="flags")return this.ou(e,t,this.flagsApiHost+t);if(e==="assets"){let s=this.su(t);if(s)return this.ou(e,t,`${s}${t}`)}if(this.region===tr)return this.ou(e,t,this.apiHost+t);let i=ra+t;switch(e){case"assets":return this.ou(e,t,`https://${this.region}-assets.${i}`);case"api":return this.ou(e,t,`https://${this.region}.${i}`)}}},q=re("[Surveys]"),tu=e=>{try{let t=(i=>((s,n)=>`seenSurvey_${(function(r){return r.current_iteration&&r.current_iteration>0?`${r.id}_${r.current_iteration}`:r.id})(n)}`)(0,i))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(t){q.error("Failed to persist survey seen state",t)}},Jp=[cn.Popover,cn.Widget,cn.API],Kp={ignoreConditions:!1,ignoreDelay:!1,displayType:Xn.Popover},Qp=re("[PostHog ExternalIntegrations]"),ef={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},tf=class{constructor(e){this._instance=e}zo(e,t){var i,s;(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,e,n=>{if(n)return Qp.error("failed to load script",n);t()})}startIfEnabledOrStop(){var e;for(let[n,r]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var t,i,s;r&&!(!((t=F.__PosthogExtensions__)===null||t===void 0||(t=t.integrations)===null||t===void 0)&&t[n])&&this.zo(ef[n],()=>{var o;(o=F.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[n])===null||o===void 0||o.start(this._instance)}),!r&&(!((i=F.__PosthogExtensions__)===null||i===void 0||(i=i.integrations)===null||i===void 0)&&i[n])&&((s=F.__PosthogExtensions__)===null||s===void 0||(s=s.integrations)===null||s===void 0||(s=s[n])===null||s===void 0||s.stop())}}},sf=class{constructor(e,t){this.A=e,this.bo=t,this.lu=new Map,this.To=!1}add(e){var t=this;return ee(function*(){if(t.To)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.lu.has(e.name))throw new Error(`Browser extension "${e.name}" is already registered`);t.lu.set(e.name,e);try{let i=e.setup(t.bo);i&&(yield i)}catch(i){let s=t.lu.get(e.name)===e;s&&t.lu.delete(e.name),t.A.error(`Failed to set up browser extension "${e.name}"`,i),s&&t.uu(e)}})()}getExtension(e){return this.lu.get(e)}dispose(){if(this.To)return;this.To=!0;let e=Array.from(this.lu.values()).reverse();this.lu.clear();for(let t of e)this.uu(t)}uu(e){try{var t;let i=(t=e.dispose)===null||t===void 0?void 0:t.call(e);i&&le(i.then)&&i.then(void 0,s=>{this.A.error(`Failed to dispose browser extension "${e.name}"`,s)})}catch(i){this.A.error(`Failed to dispose browser extension "${e.name}"`,i)}}},nf=class{constructor(e){this._instance=e}initialize(){}get(e){let t=this._instance.persistence;if(typeof e=="string")return t==null?void 0:t.get_property(e);let i={};for(let s of e){let n=t==null?void 0:t.get_property(s);x(n)||(i[s]=n)}return i}set(e,t){var i;(i=this._instance.persistence)===null||i===void 0||i.register(typeof e=="string"?{[e]:t}:e)}remove(e){var t;(t=this._instance.persistence)===null||t===void 0||t.unregister(e)}},oa="extensionsRemoteConfig",rf=class{constructor(e){this.instance=e,this.To=!1,this.A=T,this.cu=e.hu,this.kv=new nf(e),this.onEvent=t=>Ji(this.instance.on("eventCaptured",i=>{try{t({event:i.event,properties:i.properties})}catch(s){this.A.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=t=>{if(this.To)return Ji(()=>{});let i=n=>{try{t(n)}catch(r){this.A.error("Browser extension remote config listener failed",r)}},s=this.instance.du.on(oa,i);return this.cu&&i(this.cu),Ji(s)},this.vu=new sf(T.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){let e=this.instance.get_property(dr);return typeof e=="string"?e:void 0}get library(){return{name:ue.LIB_NAME,version:ue.LIB_VERSION}}get initialPersonProperties(){var e,t;return(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s;let n=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(t=n==null?void 0:n.sessionId)!==null&&t!==void 0?t:"",windowId:(i=n==null?void 0:n.windowId)!==null&&i!==void 0?i:"",sessionStartTimestamp:(s=n==null?void 0:n.sessionStartTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.vu.add(e)}getExtension(e){return this.vu.getExtension(e)}capture(e,t,i){i?this.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):this.instance.capture(e,t)}registerDynamicEventProperties(e){return Ji(this.instance.fu(e))}handleRemoteConfig(e){this.To||(this.cu=e,this.instance.du.emit(oa,e))}sendRequest(e){var t=this;return ee(function*(i,s={}){var n;let r=t.instance.requestRouter.endpointFor((n=s.target)!==null&&n!==void 0?n:"api",i),o={method:s.method,url:s.query?ji(r,s.query):r,data:s.body,headers:s.headers,timeout:s.timeoutMs,fireCallbackOnDrop:!0,transport:s.transport,compression:s.compression,compressionFallback:s.target==="flags"&&s.compression==="best-available"?Pn.Base64:void 0,timestampMode:s.sentAt};return s.transport==="sendBeacon"?(t.instance._send_request(o),{statusCode:202}):new Promise(a=>{o.callback=a,t.instance._send_request(o)})}).apply(this,arguments)}dispose(){this.To||(this.To=!0,this.vu.dispose())}},Mi={},gn=0,Ti=()=>{},aa='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Nt="Surveys module not available",la="sanitize_properties is deprecated. Use before_send instead",iu="Invalid value for property_denylist config: ",of=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],af=["$feature_flag_called","$$heatmap","$snapshot"],ca=e=>e.charAt(0)==="$"&&!A(af,e),lf=/^[A-Za-z0-9_-]{1,400}$/,ua=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,da=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,cf=["token","distinct_id",Jl],yi="posthog",uf=e=>{let t={};return e&&e!=="unset"&&("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0)),t},_n=e=>{var t;return f({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:sp(E==null?void 0:E.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ti,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e!=null?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:K&&V(K==null?void 0:K.search)&&K.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,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(b==null||(t=b.location)===null||t===void 0?void 0:t.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,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(i){T.error("Bad HTTP status: "+i.statusCode+" "+i.text)},get_device_id:i=>i,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ac,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Ti},(i=>({rageclick:i&&i>="2026-05-30"?{content_ignorelist:kr,ignore_text_selection:!0}:!i||"2025-11-30">i||{content_ignorelist:!0},capture_pageview:!i||"2025-05-24">i||"history_change",session_recording:uf(i),external_scripts_inject_target:i&&i>="2026-01-30"?"head":"body",internal_or_test_user_hostname:i&&i>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:i&&i>="2026-05-30"?250:0,split_storage:!(!i||"2026-05-30">i),detect_google_search_app:!(!i||"2026-05-30">i),disable_capture_url_hashes:!(!i||"2026-06-25">i),cookieWinsOnConflict:!(!i||i==="unset"||"2026-08-29">i)}))(e))},df=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],ha=e=>{let t={};for(let[n,r]of df)x(e[n])||(t[r]=e[n]);let i=Q({},t,e),s=e.__preview_external_dependency_versioned_paths;return x(s)||(x(e.strict_script_versioning)&&(i.strict_script_versioning=!!s),V(s)&&x(e.asset_host)&&(i.asset_host=s)),O(e.property_blacklist)&&(x(e.property_denylist)?i.property_denylist=e.property_blacklist:O(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:T.error(iu+e.property_denylist)),i},hf=class{constructor(){this.__forceAllowLocalhost=!1}get pu(){return this.__forceAllowLocalhost}set pu(e){T.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Ii=class pt{gu(t){if(!t)return;let i=this.lu.indexOf(t);i!==-1&&this.lu.splice(i,1)}mu(t,i){var s;return this.gu(t),this.lu.push(i),(s=i.initialize)===null||s===void 0||s.call(i),i}yu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}bu(){if(this._u||this.config.reuseAnonymousId||this.config.segment||this.yu())return;let t=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!t&&!this.config.disable_persistence||this.wu)return;let i,s,n;t?(i=`persistence is set to '${this.config.persistence}'`,s=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(i="persistence is disabled (disable_persistence is true)",s="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._u=!0,console.warn("[PostHog.js]",`${i} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${s}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${n}`)}ku(){let t=this.persistence;if(!t||this.Su)return;if(this.yu())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.xu(),this.$u()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.Cu()||t.load(!0);let i=this.get_distinct_id();if(!i||i==="$posthog_cookieless"){let s=this.config.get_device_id(He());this.register({distinct_id:s,$device_id:s}),t.set_property(ke,it)}this.xu()}get decideEndpointWasHit(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.Tu=!1,this.Iu=!1,this.webPerformance=new hf,this.Mu=!1,this.version=ue.LIB_VERSION,this.Eu=new Set,this.Pu="",this.du=new Es,this.lu=[],this.Ru=[],this.Au=!1,this.wu=!1,this._u=!1,this.Su=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=_n(),this.SentryIntegration=wp,this.sentryIntegration=s=>(function(n,r){let o=wc(n,r);return{name:bc,processEvent:a=>o(a)}})(this,s),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fu=!1,this.Ou=null,this.Du=null,this.Lu=null,this.scrollManager=new zp(this),this.pageViewManager=new qo(this),this.rateLimiter=new Cp(this),this.requestRouter=new Xp(this),this.consent=new up(this),this.externalIntegrations=new tf(this);let i=(t=pt.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(s,n,r)=>{let o=V(s)?{[s]:n}:s;this.setPersonProperties(o),r==null||r({})},set_once:(s,n,r)=>{let o=V(s)?{[s]:n}:s;this.setPersonProperties(void 0,o),r==null||r({})}},this.on("eventCaptured",s=>T.info(`send "${s==null?void 0:s.event}"`,s))}init(t,i,s){if(s&&s!==yi){var n;let r=(n=Mi[s])!==null&&n!==void 0?n:new pt;return r._init(t,i,s),Mi[s]=r,Mi[yi][s]=r,r}return this._init(t,i,s)}_init(t,i={},s){var n,r,o;let a=V(t)?t.trim():"";if(!a)return T.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var l;if(this.__loaded)return a!==((l=this.config)===null||l===void 0?void 0:l.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=_n(i.defaults),i.debug=this.Nu(i.debug),this.qu=i,this.ju=[],i.person_profiles?this.Du=i.person_profiles:i.process_person&&(this.Du=i.process_person);let c=_n(i.defaults),u=ha(i),d=Q({},c,u,{name:s,token:a});j(c.rageclick)&&j(u.rageclick)&&(d.rageclick=Q({},c.rageclick,u.rageclick)),j(c.session_recording)&&j(u.session_recording)&&(d.session_recording=Q({},c.session_recording,u.session_recording)),this.set_config(d),this.config.on_xhr_error&&T.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Ce.GZipJS;let h=this.Cu(),p=!this.yu();if(this.persistence=new ln(this.config,h,!0,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ln(f(f({},this.config),{},{persistence:"sessionStorage"}),h,!1,p),this.Pu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!h&&J.At()){let m=J.Lt(this.Pu);O(m)&&m.forEach(w=>{V(w)&&this.Eu.add(w)})}else J.Pt(this.Pu);let v=f({},this.persistence.props),_=f({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Bu=new Wp((m,w)=>this.zu(m,w),this.config.request_queue_config),this.Hu=new Up(this),this.__request_queue=[];let g=this.yu();g||(this.sessionManager=new na(this),this.sessionPropsManager=new ia(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((m,w,M)=>{(M!=null&&M.activityTimeout||M!=null&&M.sessionPastMaximumLength||M!=null&&M.crossTabAdoption)&&this.Uu()})),this.Wu(),this.config.__preview_deferred_init_extensions?(T.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Vu(g)},0)):(T.info("Initializing extensions synchronously"),this.Vu(g)),ue.DEBUG=ue.DEBUG||this.config.debug,ue.DEBUG&&T.info("Starting in debug mode",{this:this,config:i,thisC:f({},this.config),p:v,s:_}),this.config.identity_distinct_id&&!(!((n=i.bootstrap)===null||n===void 0)&&n.distinctID)&&(i.bootstrap=f(f({},i.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));let y=(r=i.bootstrap)===null||r===void 0?void 0:r.distinctID;if(this.wu=!!y&&!bi(y),(o=i.bootstrap)===null||o===void 0?void 0:o.distinctID){let m=i.bootstrap.distinctID,w=this.get_distinct_id(),M=this.persistence.get_property(ke);if(i.bootstrap.isIdentifiedID&&w!=null&&w!==m&&M==="anonymous")this.identify(m);else if(i.bootstrap.isIdentifiedID&&w!=null&&w!==m&&M==="identified")T.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{let P=this.config.get_device_id(He()),k=i.bootstrap.isIdentifiedID?P:m;this.persistence.set_property(ke,i.bootstrap.isIdentifiedID?ns:it),this.register({distinct_id:m,$device_id:k})}}if(g)this.register_once({distinct_id:Ks,$device_id:null},"");else if(!this.get_distinct_id()){let m=this.config.get_device_id(He());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ke,it)}return G(b,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),G(b,"pageshow",()=>{var m;this.Tu=!1,this.Iu||(m=this.Hu)===null||m===void 0||m.resume()}),i.segment?Go(this,()=>this.Gu()):this.Gu(),le(this.config._onCapture)&&this.config._onCapture!==Ti&&(T.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",m=>this.config._onCapture(m.event,m))),this.config.ip&&T.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return Jc.apply(this,arguments)})().then(m=>{m&&this.register({[Js]:m})}).catch(Ti),this}Qu(t){let i=t;return V(i.name)&&le(i.setup)}Zu(t,i){this.Qu(t)?i.push(()=>{this.Ju().add(t).catch(()=>{var s;return(s=t.dispose)===null||s===void 0?void 0:s.call(t)}).catch(s=>{T.error(`Failed to dispose browser extension "${t.name}"`,s)})}):this.lu.push(t)}Wu(){var t,i,s;let n=(t=(i=this.config.__extensionClasses)===null||i===void 0?void 0:i.featureFlags)!==null&&t!==void 0?t:(s=pt.__defaultExtensionClasses)===null||s===void 0?void 0:s.featureFlags;var r,o,a;n&&(this.featureFlags&&this.featureFlags instanceof n||((r=this.Ku)===null||r===void 0||r.call(this),this.Ku=void 0,this.featureFlags=new n(this)),le(this.featureFlags.onReloading)&&le(this.featureFlags.setup)?this.Ku||(this.Ku=this.featureFlags.onReloading(()=>{this.du.emit("featureFlagsReloading",!0)}),this.Ju().add(this.featureFlags)):(o=(a=this.featureFlags).initialize)===null||o===void 0||o.call(a))}Vu(t){let i=performance.now(),s=f(f({},pt.__defaultExtensionClasses),this.config.__extensionClasses),n=[];var r,o,a,l,c,u,d,h;s.exceptions&&this.lu.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new s.exceptions(this)),s.historyAutocapture&&this.lu.push(this.historyAutocapture=new s.historyAutocapture(this)),s.tracingHeaders&&this.lu.push(this.tracingHeaders=new s.tracingHeaders(this)),s.siteApps&&this.lu.push(this.siteApps=new s.siteApps(this)),s.sessionRecording&&!t&&this.lu.push(this.sessionRecording=new s.sessionRecording(this)),this.config.disable_scroll_properties||n.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),s.autocapture&&this.Zu(this.autocapture=new s.autocapture(this),n),s.surveys&&this.Zu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new s.surveys(this),n),s.logs&&this.Zu(this.logs=(a=this.logs)!==null&&a!==void 0?a:new s.logs(this),n),s.metrics&&this.lu.push(this.metrics=(l=this.metrics)!==null&&l!==void 0?l:new s.metrics(this)),s.conversations&&this.lu.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new s.conversations(this)),s.productTours&&this.lu.push(this.productTours=new s.productTours(this)),s.heatmaps&&this.lu.push(this.heatmaps=new s.heatmaps(this)),s.webVitalsAutocapture&&this.lu.push(this.webVitalsAutocapture=new s.webVitalsAutocapture(this)),s.exceptionObserver&&this.lu.push(this.exceptionObserver=new s.exceptionObserver(this)),s.deadClicksAutocapture&&this.lu.push(this.deadClicksAutocapture=new s.deadClicksAutocapture(this,bp)),s.toolbar&&this.lu.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new s.toolbar(this)),s.experiments&&this.lu.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new s.experiments(this)),s.webMCP&&this.lu.push(this.webMCP=(h=this.webMCP)!==null&&h!==void 0?h:new s.webMCP(this)),this.lu.forEach(p=>{p.initialize&&n.push(()=>{var v;(v=p.initialize)===null||v===void 0||v.call(p)})}),n.push(()=>{if(this.Xu){let p=this.Xu;this.Xu=void 0,this.lu.forEach(v=>{var _;return(_=v.onRemoteConfig)===null||_===void 0?void 0:_.call(v,p)})}}),this.Yu(n,i)}Yu(t,i){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-i>=30&&t.length>0)return void setTimeout(()=>{this.Yu(t,i)},0);let n=t.shift();if(n)try{n()}catch(r){T.error("Error initializing extension:",r)}}let s=Math.round(performance.now()-i);this.register_for_session({[Kl]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ql]:s}),this.config.__preview_deferred_init_extensions&&T.info(`PostHog extensions initialized (${s}ms)`)}el(t){var i;if(!E||!E.body)return T.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.el(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Xu=t),this.hu=t,this.compression=void 0,t.ok){var s;let n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=A(n.supportedCompression,Ce.GZipJS)?Ce.GZipJS:A(n.supportedCompression,Ce.Base64)?Ce.Base64:void 0),!((s=n.analytics)===null||s===void 0)&&s.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Du?this.Du:ac}),(i=this.tc)===null||i===void 0||i.handleRemoteConfig(t),this.lu.forEach(n=>{var r;return(r=n.onRemoteConfig)===null||r===void 0?void 0:r.call(n,t)})}Gu(){try{this.config.loaded(this)}catch(t){T.critical("`loaded` function failed",t)}if(this.ec(),this.config.internal_or_test_user_hostname&&(K==null?void 0:K.hostname)){let t=K.hostname,i=this.config.internal_or_test_user_hostname;(typeof i=="string"?t===i:i.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.yu())&&this.nc()},1),this.sc=new Oc(this),this.sc.load()}ec(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Bu)===null||t===void 0||t.enable())}_dom_loaded(){this.is_capturing()&&Bt(this.__request_queue,t=>this.zu(t)),this.__request_queue=[],this.ec()}_handle_unload(){var t,i,s,n,r,o;this.Tu=!0,(t=this.surveys)===null||t===void 0||(i=t.handlePageUnload)===null||i===void 0||i.call(t),(s=this.metrics)===null||s===void 0||s.flush("sendBeacon"),this.config.request_batching?(this.rc()&&this.capture(To),(n=this.logs)===null||n===void 0||n.flushLogs("sendBeacon"),(r=this.Bu)===null||r===void 0||r.unload(),(o=this.Hu)===null||o===void 0||o.unload()):this.rc()&&this.capture(To,null,{transport:"sendBeacon"})}_send_request(t){Yc(this,t)}zu(t,i){this.Hu?this.Hu.retriableRequest(t,i):this._send_request(i?f(f({},t),{},{transport:i}):t)}_execute_array(t){gn++;try{let i,s=[],n=[],r=[];Bt(t,a=>{if(a)if(i=a[0],O(i))r.push(a);else if(le(a))try{a.call(this)}catch(l){T.error("Error executing queued PostHog call",a,l)}else O(a)&&i==="alias"?s.push(a):O(a)&&i.indexOf("capture")!==-1&&le(this[i])?r.push(a):n.push(a)});let o=function(a,l){Bt(a,function(c){try{if(O(c[0])){let u=l;Z(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else l[c[0]].apply(l,c.slice(1))}catch(u){T.error("Error executing queued PostHog call",c,u)}})};o(s,this),o(n,this),o(r,this)}finally{gn--}}push(t){if(gn>0&&O(t)&&V(t[0])){let i=pt.prototype[t[0]];return void(le(i)&&i.apply(this,t.slice(1)))}this._execute_array([t])}get oc(){return{property:Po,persistenceKey:Gt,cookieName:"_fbc",pattern:ua,register:(t,i)=>{var s;return(s=this.persistence)===null||s===void 0?void 0:s.register({[Gt]:{value:t,delivered:i}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(Gt)}}}get ac(){return{property:Mo,persistenceKey:ki,cookieName:"_fbp",pattern:da,register:(t,i)=>{var s;return(s=this.persistence)===null||s===void 0?void 0:s.register({[ki]:{value:t,delivered:i}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(ki)}}}lc(t){var i;let s=(i=this.persistence)===null||i===void 0?void 0:i.get_property(t.persistenceKey);return V(s)&&t.pattern.test(s)?{value:s,delivered:!1}:j(s)&&V(s.value)&&t.pattern.test(s.value)?{value:s.value,delivered:s.delivered===!0}:void 0}uc(t,i,s){return i===(s==null?void 0:s.value)?{value:i,pending:!s.delivered}:(t.register(i,!1),{value:i,pending:!0})}cc(t){if(!this.config.save_campaign_params||this.yu())return;let i=Ei(t.cookieName);return V(i)&&t.pattern.test(i)?i:void 0}hc(t,i,s,n){if(!this.persistence)return;let r=this.oc;this.persistence.refreshKey(r.persistenceKey);let o=this.lc(r);if(n)return void r.unregister();if(s)return V(i)&&ua.test(i)?this.uc(r,i,o):void r.unregister();let a=V(t)&&lf.test(t)?t:void 0,l=this.cc(r);return l&&((c,u,d)=>{let h=c.split(".");if(u)return h[3]===u;if(!d)return!0;let p=d.value.split(".");return h[3]===p[3]||Number(h[2])>Number(p[2])})(l,a,o)?this.uc(r,l,o):a?(o==null?void 0:o.value.split(".")[3])===a?{value:o.value,pending:!o.delivered}:this.uc(r,`fb.1.${Date.now()}.${a}`,o):o?{value:o.value,pending:!o.delivered}:void 0}dc(t,i,s){if(!this.persistence)return;let n=this.ac;this.persistence.refreshKey(n.persistenceKey);let r=this.lc(n);if(s)return void n.unregister();if(i)return V(t)&&da.test(t)?this.uc(n,t,r):void n.unregister();let o=this.cc(n);return o?this.uc(n,o,r):r?{value:r.value,pending:!r.delivered}:void 0}vc(t,i){if(!this.persistence)return;this.persistence.refreshKey(t.persistenceKey);let s=this.lc(t);(s==null?void 0:s.value)!==i||s.delivered||t.register(i,!0)}capture(t,i,s){var n,r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Bu))return void T.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(x(t)||!V(t))return void T.error("No event name provided to posthog.capture");if(this.ku(),t==="$snapshot"&&this.yu())return;let o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;let a=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a!=null&&a.isRateLimited)return void T.critical("This capture call is ignored due to client rate limiting.");let l;i!=null&&i.$current_url&&!V(i==null?void 0:i.$current_url)&&(T.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),i==null||delete i.$current_url),t!=="$exception"||s!=null&&s.fc||T.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&&(l=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();let c=new Date,u=(s==null?void 0:s.timestamp)||c,d=lo(s==null?void 0:s.uuid,He),h={uuid:d,event:t,properties:this.calculateEventProperties(t,i||{},u,d)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),a&&(h.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens);let p=t==="$feature_flag_called"&&h.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;s!=null&&s.$set&&!p&&(h.$set=s==null?void 0:s.$set);let v=j(i==null?void 0:i.$set)?i.$set:void 0,_=O(i==null?void 0:i.$unset)?i.$unset:[],g=(s==null?void 0:s.$unset)||[],y=C=>{var H;let B=!!(s!=null&&s.$set)&&C in s.$set;return{hasProvided:B||!!v&&C in v,provided:B?s==null||(H=s.$set)===null||H===void 0?void 0:H[C]:v==null?void 0:v[C],unset:_.indexOf(C)!==-1||g.indexOf(C)!==-1}},m=y(Po),w=y(Mo),M=[{channel:this.oc,hasProvided:m.hasProvided,update:this.hc(l==null?void 0:l.fbclid,m.provided,m.hasProvided,m.unset)},{channel:this.ac,hasProvided:w.hasProvided,update:this.dc(w.provided,w.hasProvided,w.unset)}];for(let{channel:C,hasProvided:H,update:B}of M)B&&h.properties.$process_person_profile===!0&&B.pending&&!H&&!p&&(h.$set=f({[C.property]:B.value},h.$set));let P=s==null?void 0:s.$unset;P&&(h.$unset=P);let k=p?void 0:this.gc(s==null?void 0:s.$set_once,t!==Io,t===lc);if(k&&(h.$set_once=k),s!=null&&s._noTruncate||(I=this.config.properties_string_max_length,h=(function(C,H){let B=new Set;return(function Y(z,ie){if(z!==Object(z))return H?H(z):z;if(B.has(z))return;let ge;if(B.add(z),O(z))ge=[],Bt(z,de=>{ge.push(Y(de))});else{let de={};Z(ii(z)?cc(z):z,(me,Te)=>{B.has(me)||(de[Te]=Y(me,Te))}),ge=de}return ge})(C)})(h,C=>V(C)?C.slice(0,I):C)),h.timestamp=u,x(s==null?void 0:s.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=c),p&&(h.properties=((C,H=[])=>{let B={},Y=z=>{C[z]!==void 0&&(B[z]=C[z])};return Jd.forEach(Y),H.forEach(Y),B})(h.properties,cf)),t===Ie.DISMISSED||t===Ie.SENT){let C=i==null?void 0:i[un.SURVEY_ID],H=i==null?void 0:i[un.SURVEY_ITERATION];tu({id:C,current_iteration:H}),h.$set=f(f({},h.$set),{},{[qp({id:C,current_iteration:H},t===Ie.SENT?"responded":"dismissed")]:!0})}else t===Ie.SHOWN&&(h.$set=f(f({},h.$set),{},{[un.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var I;if(t===Ip.SHOWN){let C=i==null?void 0:i[Xo.TOUR_TYPE];C&&(h.$set=f(f({},h.$set),{},{[`${Xo.TOUR_LAST_SEEN_DATE}/${C}`]:new Date().toISOString()}))}let S=f(f({},h.properties.$set),h.$set);if(Me(S)||this.setPersonPropertiesForFlags(S),!L(this.config.before_send)){let C=this.Os(h);if(!C)return;h=C,h.uuid=lo(h.uuid,He)}this.sessionRecording&&!this.Au&&ca(t)&&(this.Au=!0,setTimeout(()=>this.Au=!1,3e4));let $=M.filter(({channel:C,update:H})=>{var B,Y,z;let ie=(B=(Y=h.$set)===null||Y===void 0?void 0:Y[C.property])!==null&&B!==void 0?B:j((z=h.properties)===null||z===void 0?void 0:z.$set)?h.properties.$set[C.property]:void 0;return(H==null?void 0:H.pending)&&ie===H.value});this.du.emit("eventCaptured",h);let D=(n=s==null?void 0:s._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),R=(s==null?void 0:s._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D),N=f(f(f({method:"POST",url:D,data:h,compression:"best-available",preferSyncCompression:s==null?void 0:s.send_instantly,timestampMode:R?"body":"capture-body",batchKey:s==null?void 0:s._batchKey},R&&(!((r=h.properties)===null||r===void 0)&&r.$session_id)?{batchGroup:h.properties.$session_id+(h.properties.$window_id?`-${h.properties.$window_id}`:"")}:{}),s!=null&&s.transport?{transport:s.transport}:{}),$.length?{fireCallbackOnDrop:!0,callback:C=>{if(C.statusCode>=200&&300>C.statusCode)for(let{channel:H,update:B}of $)this.vc(H,B.value)}}:{});if(!this.config.request_batching||s&&!(s!=null&&s._batchKey)||s!=null&&s.send_instantly){var W;let C;!N.transport&&!N.callback&&Me((W=this.config.request_headers)!==null&&W!==void 0?W:{})&&this.Tu&&(C="sendBeacon"),this.zu(N,C)}else this.Bu.enqueue(N);return h}_addCaptureHook(t){return this.on("eventCaptured",i=>t(i.event,i))}getExtension(t){var i;return(i=this.tc)===null||i===void 0?void 0:i.getExtension(t)}Ju(){var t;return(t=this.tc)!==null&&t!==void 0?t:this.tc=new rf(this)}fu(t){this.Ru.push(t);let i=!0;return()=>{if(!i)return;i=!1;let s=this.Ru.indexOf(t);s!==-1&&this.Ru.splice(s,1)}}mc(t=!0){var i,s,n;return!!(!((i=this.persistence)===null||i===void 0)&&i.consumeCookieIdentityChange())&&(this.Lu=null,this.persistence.get_property("$user_state")==="anonymous"&&((n=this.sessionPersistence)===null||n===void 0||n.clear(),this.Eu.clear(),this.yc()),(s=this.featureFlags)===null||s===void 0||s.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,i,s,n,r){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.ku(),this.persistence.syncCookieProperties(),this.mc();let o=r?void 0:this.persistence.remove_event_timer(t),a=f({},i);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.yu()&&(a[Jl]=!0),t==="$snapshot"){let m=f(f({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=m.distinct_id,(!V(a.distinct_id)&&!oe(a.distinct_id)||bi(a.distinct_id))&&T.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}let l=(function(m,w,M,P=!1){var k,I,S,$;if(!xe)return{};let D=m?[...Qt,...w||[]]:[],[R,N]=pl(xe),[W,C]=(function(he){for(let Re=0;ao.length>Re;Re++){let[ot,at,wt]=ao[Re],Pe=he.match(ot);if(Pe){let Ge=wt&&he.match(wt)||Pe;return[at,(Ge==null?void 0:Ge[1])||""]}}return["",""]})(xe),H=(function(){let he="u">typeof navigator?navigator:void 0;return he!=null&&he.brave?{brave:!0}:{}})(),B={};x(M)||(B.detectGoogleSearchApp=M);let Y={},z=(k=navigator)===null||k===void 0||(k=k.userAgentData)===null||k===void 0?void 0:k.platform,ie=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,ge=b==null||(S=b.screen)===null||S===void 0?void 0:S.width,de=b==null||($=b.screen)===null||$===void 0?void 0:$.height,me=b==null?void 0:b.devicePixelRatio;x(z)||(Y.userAgentDataPlatform=z),x(ie)||(Y.maxTouchPoints=ie),x(ge)||(Y.screenWidth=ge),x(de)||(Y.screenHeight=de),x(me)||(Y.devicePixelRatio=me);let Te=Q(yr({$os:R,$os_version:N,$browser:hl(xe,navigator.vendor,H,B),$webview_app:W,$webview_app_version:C,$device:fl(xe),$device_type:yd(xe,Y),$timezone:xc(),$timezone_offset:Pp()}),{$current_url:Li(P?yt(K==null?void 0:K.href):K==null?void 0:K.href,D,Di),$host:K==null?void 0:K.host,$pathname:K==null?void 0:K.pathname,$raw_user_agent:xe.length>1e3?xe.substring(0,997)+"...":xe,$browser_version:md(xe,navigator.vendor,H,B),$browser_language:Tc(),$browser_language_prefix:$p(),$screen_height:b==null?void 0:b.screen.height,$screen_width:b==null?void 0:b.screen.width,$viewport_height:b==null?void 0:b.innerHeight,$viewport_width:b==null?void 0:b.innerWidth,$lib:st.LIB_NAME,$lib_version:st.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return st.SDK_DIST_CHANNEL&&(Te.$sdk_dist_channel=st.SDK_DIST_CHANNEL),Te})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){let{sessionId:m,windowId:w}=this.sessionManager.checkAndGetSessionAndWindowId(r,s.getTime(),!0);a.$session_id=m,a.$window_id=w}this.sessionPropsManager&&Q(a,this.sessionPropsManager.getSessionProps());try{var c;if(this.sessionRecording){let m=this.sessionRecording.sdkDebugProperties,w=!this.Au&&ca(t);for(let M in m)(w||A(of,M))&&(a[M]=m[M])}a.$sdk_debug_retry_queue_size=(c=this.Hu)===null||c===void 0?void 0:c.length}catch(m){a.$sdk_debug_error_capturing_properties=String(m)}let u;if(this.requestRouter.region===tr&&(a.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||r?t!=="$pageleave"||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,n),a=Q(a,u),t==="$pageview"&&E&&(a.title=E.title),!x(o)){let m=s.getTime()-o;a.$duration=parseFloat((m/1e3).toFixed(3))}xe&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");let d=this.persistence.properties(),h=this.sessionPersistence.properties(),p=a.$groups,v=d.$groups;j(p)&&!Me(p)&&(a.$groups=f(f({},j(v)?v:{}),p)),Z(["$referrer","$referring_domain"],m=>{m in d&&delete h[m]});let _={};if(this.Ru.length>0)for(let m of this.Ru.slice())try{Q(_,m())}catch(w){T.error("Failed to produce browser extension event properties",w)}a=Q({},l,d,h,f(f({},_),a)),a.$is_identified=this._isIdentified(),O(this.config.property_denylist)?Z(this.config.property_denylist,function(m){delete a[m]}):T.error(iu+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let g=this.config.sanitize_properties;g&&(T.error(la),a=g(a,t));let y=this.bc();return a.$process_person_profile=y,y&&!r&&this._c("_calculate_event_properties"),a}gc(t,i=!0,s=!1){var n;if(!this.persistence||!this.bc()||this.Mu&&!s)return t;let r=this.persistence.get_initial_props(),o=(n=this.sessionPropsManager)===null||n===void 0?void 0:n.getSetOnceProps(),a=Q({},r,o||{},t||{}),l=this.config.sanitize_properties;return l&&(T.error(la),a=l(a,"$set_once")),i&&(this.Mu=!0),Me(a)?void 0:a}register(t,i){var s;(s=this.persistence)===null||s===void 0||s.register(t,i)}register_once(t,i,s){var n;(n=this.persistence)===null||n===void 0||n.register_once(t,i,s)}register_for_session(t){var i,s;(i=this.persistence)===null||i===void 0||i.syncCookieProperties(),this.mc(),(s=this.sessionPersistence)===null||s===void 0||s.register(t),Object.keys(t).forEach(n=>this.Eu.add(n)),this.yc()}unregister(t){var i;(i=this.persistence)===null||i===void 0||i.unregister(t)}unregister_for_session(t){var i;(i=this.sessionPersistence)===null||i===void 0||i.unregister(t),this.Eu.delete(t),this.yc()}wc(t,i){this.register({[t]:i})}Uu(){this.Eu.forEach(t=>{var i;(i=this.sessionPersistence)===null||i===void 0||i.unregister(t)}),this.Eu.clear(),this.yc()}yc(){var t;if(!this.Pu)return;if(this.config.persistence==="memory"||!((t=this.sessionPersistence)===null||t===void 0)&&t.hi||!J.At())return void J.Pt(this.Pu);let i=[];this.Eu.forEach(s=>i.push(s)),i.length>0?J.$t(this.Pu,i):J.Pt(this.Pu)}getFeatureFlag(t,i){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getFeatureFlag(t,i)}getFeatureFlagPayload(t){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getFeatureFlagPayload(t)}getFeatureFlagResult(t,i){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getFeatureFlagResult(t,i)}getAllFeatureFlags(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.getAllFeatureFlags())!==null&&t!==void 0?t:[]}isFeatureEnabled(t,i){var s,n;return(s=(n=this.featureFlags)===null||n===void 0?void 0:n.isFeatureEnabled(t,i))!==null&&s!==void 0?s:i==null?void 0:i.defaultValue}reloadFeatureFlags(){var t;(t=this.featureFlags)===null||t===void 0||t.reloadFeatureFlags()}updateFlags(t,i,s){var n;(n=this.featureFlags)===null||n===void 0||n.updateFlags(t,i,s)}updateEarlyAccessFeatureEnrollment(t,i,s){var n;(n=this.featureFlags)===null||n===void 0||n.updateEarlyAccessFeatureEnrollment(t,i,s)}getEarlyAccessFeatures(t,i=!1,s){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getEarlyAccessFeatures(t,i,s)}on(t,i){return this.du.on(t,i)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Nt}),()=>{})}onSessionId(t){var i,s;return(i=(s=this.sessionManager)===null||s===void 0?void 0:s.onSessionId(t))!==null&&i!==void 0?i:()=>{}}getSurveys(t,i=!1){this.surveys?this.surveys.getSurveys(t,i):t([],{isLoaded:!1,error:Nt})}getActiveMatchingSurveys(t,i=!1){this.surveys?this.surveys.getActiveMatchingSurveys(t,i):t([],{isLoaded:!1,error:Nt})}onActiveMatchingSurveysChanged(t){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(t):(t([],{isLoaded:!1,error:Nt}),()=>{})}renderSurvey(t,i){var s;(s=this.surveys)===null||s===void 0||s.renderSurvey(t,i)}displaySurvey(t,i=Kp){var s;(s=this.surveys)===null||s===void 0||s.displaySurvey(t,i)}cancelPendingSurvey(t){var i;(i=this.surveys)===null||i===void 0||i.cancelPendingSurvey(t)}canRenderSurvey(t){var i,s;return(i=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurvey(t))!==null&&i!==void 0?i:{visible:!1,disabledReason:Nt}}canRenderSurveyAsync(t,i=!1){var s,n;return(s=(n=this.surveys)===null||n===void 0?void 0:n.canRenderSurveyAsync(t,i))!==null&&s!==void 0?s:Promise.resolve({visible:!1,disabledReason:Nt})}kc(t){return!t||bi(t)?(T.critical("Unique user id has not been set in posthog.identify"),!1):t==="$posthog_cookieless"?(T.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(T.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(t,i,s){if(!this.__loaded||!this.persistence)return T.uninitializedWarning("posthog.identify");if(oe(t)&&(t=t.toString(),T.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.kc(t)||!this._c("posthog.identify"))return;this.ku();let n=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==n,o=this.mc(!1),a=this.persistence.Oa(),l=!1;try{let u=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),t!==u&&t!==this.get_property("__alias")&&(this.unregister(_s),this.register({distinct_id:t}));let d=(this.persistence.get_property("$user_state")||"anonymous")===it,h=t!==u,p=!h&&d;if(h&&d){var c;let v=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:u};this.persistence.set_property(ke,ns),this.setPersonPropertiesForFlags({$set:i||{},$set_once:s||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$identify",v,{$set:i||{},$set_once:s||{}})&&(this.Lu=vn(t,i,s)),(c=this.featureFlags)===null||c===void 0||c.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(p){this.persistence.set_property(ke,ns);let v=i||{},_=s||{};this.setPersonPropertiesForFlags({$set:v,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$set",{$set:v,$set_once:_})&&(this.Lu=vn(t,i,s))}else(i||s)&&this.setPersonProperties(i,s);h||r||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(gt)):p&&(i||s)&&this.reloadFeatureFlags(),l=!0}finally{a&&this.persistence.qa(l)}}setPersonProperties(t,i){if(!t&&!i||!this._c("posthog.setPersonProperties"))return;let s=vn(this.get_distinct_id(),t,i);this.Lu!==s?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!0),this.capture("$set",{$set:t||{},$set_once:i||{}})&&(this.Lu=s)):T.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(t){var i;let s=(O(t)?t:[t]).filter(n=>V(n)&&n.length>0);s.length!==0&&this._c("posthog.unsetPersonProperties")&&((i=this.featureFlags)===null||i===void 0||i.unsetPersonPropertiesForFlags(s,!0),this.capture("$set",{$unset:s}),this.Lu=null)}group(t,i,s){var n;if(!t||!i)return void T.error("posthog.group requires a group type and group key");(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.mc();let r=this.getGroups(),o=r[t]!==i;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:f(f({},r),{},{[t]:i})}),(o||s)&&this.bc()){let a={$group_type:t,$group_key:i};s&&(a.$group_set=s),this.capture(Io,a)}s&&this.setGroupPropertiesForFlags({[t]:s}),o&&!s&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,i=!0){var s;(s=this.featureFlags)===null||s===void 0||s.setPersonPropertiesForFlags(t,i)}resetPersonPropertiesForFlags(t=!0){var i;(i=this.featureFlags)===null||i===void 0||i.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,i=!0){var s;this._c("posthog.setGroupPropertiesForFlags")&&((s=this.featureFlags)===null||s===void 0||s.setGroupPropertiesForFlags(t,i))}resetGroupPropertiesForFlags(t){var i;(i=this.featureFlags)===null||i===void 0||i.resetGroupPropertiesForFlags(t)}reset(t){let i=Se(t)?t:t==null?void 0:t.resetDeviceID,s=Se(t)||t==null?void 0:t.bootstrap;this.Sc(i,!1,s)}Sc(t,i=!1,s){var n,r,o,a,l,c;if(T.info("reset"),!this.__loaded)return T.uninitializedWarning("posthog.reset");let u=s==null?void 0:s.sessionID;this.config.bootstrap=s||((n=this.qu)===null||n===void 0?void 0:n.bootstrap)||{},(r=this.featureFlags)===null||r===void 0||(o=r.updateConfig)===null||o===void 0||o.call(r,this.config,this.il());let d=this.get_property(dr),h=this.get_property(Js),p=this.get_property(Si);(a=this.sessionRecording)===null||a===void 0||a.flushBeforeIdentityReset();let v=this.is_capturing();i||this.consent.reset(),i||!v||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");let _=(l=this.persistence)===null||l===void 0||(c=l.Oa)===null||c===void 0?void 0:c.call(l),g=this.Su;this.Su=g||i;let y=!1;try{var m,w,M,P,k,I,S,$,D,R,N,W,C;if((m=this.persistence)===null||m===void 0||m.clear(),(w=this.sessionPersistence)===null||w===void 0||w.clear(),this.Eu.clear(),this.yc(),x(p)||(R=this.persistence)===null||R===void 0||R.register({$session_recording_remote_config:p}),(M=this.surveys)===null||M===void 0||M.reset(),(P=this.featureFlags)===null||P===void 0||P.reset(),(k=this.conversations)===null||k===void 0||k.reset(),(I=this.logs)===null||I===void 0||I.reset(),(S=this.metrics)===null||S===void 0||S.reset(),($=this.persistence)===null||$===void 0||$.set_property("$user_state","anonymous"),(D=this.sessionManager)===null||D===void 0||D.resetSessionId(),this.Lu=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Ks,$device_id:null},"");else{let Y=this.config.get_device_id(He());this.register_once({distinct_id:Y,$device_id:t?Y:d},""),t||x(h)||this.register({[Js]:h})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),s&&(s.distinctID&&!this.yu()&&((C=this.persistence)===null||C===void 0||C.set_property("$user_state",s.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.distinctID})),(N=this.featureFlags)===null||N===void 0||N.initialize(),!L(u)&&!(!((W=this.sessionManager)===null||W===void 0)&&W.setBootstrapSessionId(u,!0)))){let Y=f({},s);delete Y.sessionID,this.config.bootstrap=Y}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,y=!0}finally{var H,B;this.Su=g,_&&((H=this.persistence)===null||H===void 0||(B=H.qa)===null||B===void 0||B.call(H,y))}this.reloadFeatureFlags()}shutdown(t){var i=this;return ee(function*(){var s,n,r,o,a,l,c,u;if(i.__loaded){i.Iu=!0,i.Ju().dispose(),(s=i.sessionRecording)===null||s===void 0||s.dispose(),(n=i.logs)===null||n===void 0||n.flushLogs("sendBeacon"),(r=i.metrics)===null||r===void 0||r.flush("sendBeacon"),(o=i.metrics)===null||o===void 0||o.dispose(),(a=i.Bu)===null||a===void 0||a.unload(),(l=i.Hu)===null||l===void 0||l.unload();try{var d;(d=i.featureFlags)===null||d===void 0||d.destroy()}catch(h){T.error("Error while destroying feature flags",h)}(c=i.persistence)===null||c===void 0||c.destroy(),(u=i.sessionPersistence)===null||u===void 0||u.destroy()}else T.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,i){var s;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=i,this.alias(t),(s=this.conversations)===null||s===void 0||s.xc()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(t=this.conversations)===null||t===void 0||t.$c()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";let{sessionId:i,sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${i}`);if(t!=null&&t.withTimestamp&&s){var r;let o=(r=t.timestampLookBack)!==null&&r!==void 0?r:10;if(!s)return n;n+=`?t=${Math.max(Math.floor((new Date().getTime()-s)/1e3)-o,0)}`}return n}alias(t,i){return t===this.get_property("$people_distinct_id")?(T.critical("Attempting to create alias for existing People user - aborting."),-2):this._c("posthog.alias")?(x(i)&&(i=this.get_distinct_id()),t!==i?(this.wc(_s,t),this.capture("$create_alias",{alias:t,distinct_id:i})):(T.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){let i=f({},this.config);if(j(t)){var s,n,r,o,a,l,c,u,d,h,p,v,_,g;Q(this.config,ha(t));let P=this.Cu();if(this.persistence){let I=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var y,m;if(I&&this.sessionPersistence!==this.persistence&&((y=this.sessionPersistence)===null||y===void 0||y.remove(),(m=this.sessionPersistence)===null||m===void 0||m.destroy()),this.persistence.update_config(this.config,i,P),I)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new ln(f(f({},this.config),{},{persistence:"sessionStorage"}),P,!1);else{var w;(w=this.sessionPersistence)===null||w===void 0||w.update_config(f(f({},this.config),{},{persistence:"sessionStorage"}),f(f({},i),{},{persistence:"sessionStorage"}),P)}}let k=this.Nu(this.config.debug);var M;Se(k)&&(this.config.debug=k),Se(this.config.debug)&&(this.config.debug?(ue.DEBUG=!0,U.At()&&U.$t("ph_debug",!0),T.info("set_config",{config:t,oldConfig:i,newConfig:f({},this.config)})):(ue.DEBUG=!1,U.At()&&U.Pt("ph_debug"))),(s=this.featureFlags)===null||s===void 0||(n=s.updateConfig)===null||n===void 0||n.call(s,this.config,this.il()),(r=this.exceptionObserver)===null||r===void 0||r.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(a=this.metrics)===null||a===void 0||a.onConfigChange(),(l=this.webMCP)===null||l===void 0||l.startIfEnabled(),(c=this.sessionRecording)===null||c===void 0||c.startIfEnabledOrStop(),(u=this.tracingHeaders)===null||u===void 0||u.startIfEnabledOrStop(),(d=this.autocapture)===null||d===void 0||d.startIfEnabled(),(h=this.heatmaps)===null||h===void 0||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&((M=this.historyAutocapture)===null||M===void 0||M.startIfEnabledOrStop()),(p=this.exceptionObserver)===null||p===void 0||p.startIfEnabledOrStop(),(v=this.deadClicksAutocapture)===null||v===void 0||v.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.xu(),(g=this.externalIntegrations)===null||g===void 0||g.startIfEnabledOrStop(),!i.segment&&this.config.segment&&this.persistence&&Go(this,Ti,!1)}}_overrideSDKInfo(t,i){ue.LIB_NAME=t,ue.LIB_VERSION=i}startSessionRecording(t){let i=t===!0,s={sampling:i||!!(t!=null&&t.sampling),linked_flag:i||!!(t!=null&&t.linked_flag),url_trigger:i||!!(t!=null&&t.url_trigger),event_trigger:i||!!(t!=null&&t.event_trigger)};var n,r,o,a,l;Object.values(s).some(Boolean)&&((n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),s.sampling&&((r=this.sessionRecording)===null||r===void 0||r.overrideSampling()),s.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),s.url_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("url")),s.event_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!!(!((t=this.sessionRecording)===null||t===void 0)&&t.started)}captureException(t,i){try{if(!this.exceptions)return;let s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(f(f({},s),i))}catch{return}}addExceptionStep(t,i){var s;(s=this.exceptions)===null||s===void 0||s.addExceptionStep(t,i)}captureLog(t){var i;(i=this.logs)===null||i===void 0||i.captureLog(t)}get logger(){var t,i;return(t=(i=this.logs)===null||i===void 0?void 0:i.logger)!==null&&t!==void 0?t:pt.Cc}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var i,s;return(i=(s=this.toolbar)===null||s===void 0?void 0:s.loadToolbar(t))!==null&&i!==void 0&&i}get_property(t){var i;return(i=this.persistence)===null||i===void 0?void 0:i.props[t]}getSessionProperty(t){var i;return(i=this.sessionPersistence)===null||i===void 0?void 0:i.props[t]}toString(){var t;let i=(t=this.config.name)!==null&&t!==void 0?t:yi;return i!==yi&&(i="posthog."+i),i}_isIdentified(){var t,i;return((t=this.persistence)===null||t===void 0?void 0:t.get_property("$user_state"))==="identified"||((i=this.sessionPersistence)===null||i===void 0?void 0:i.get_property("$user_state"))==="identified"}bc(){var t,i;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Me(this.getGroups())&&!(!((t=this.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t.__alias)&&!(!((i=this.persistence)===null||i===void 0||(i=i.props)===null||i===void 0)&&i.$epp))}rc(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.bc()||this._c("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._c("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_c(t){return this.config.person_profiles==="never"?(T.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.bu(),this.wc(fr,!0),!0)}Cu(){if(this.config.cookieless_mode==="always")return!0;let t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}xu(){var t,i;let s=this.Cu();var n,r,o;return this.is_capturing()||(n=this.logs)===null||n===void 0||n.Tc(),((t=this.persistence)===null||t===void 0?void 0:t.hi)!==s&&((r=this.persistence)===null||r===void 0||r.set_disabled(s)),((i=this.sessionPersistence)===null||i===void 0?void 0:i.hi)!==s&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(s)),this.yc(),s}opt_in_capturing(t){var i;if(this.config.cookieless_mode!=="always"){if(this.yu()){var s,n,r,o,a,l;(s=this.sessionRecording)===null||s===void 0||s.dispose({discardBufferedEvents:!0}),this.Sc(!0,!0),(n=this.sessionManager)===null||n===void 0||n.destroy(),(r=this.pageViewManager)===null||r===void 0||r.destroy(),this.sessionManager=new na(this),this.pageViewManager=new qo(this),this.persistence&&(this.sessionPropsManager=new ia(this,this.sessionManager,this.persistence));let p=(o=(a=this.config.__extensionClasses)===null||a===void 0?void 0:a.sessionRecording)!==null&&o!==void 0?o:(l=pt.__defaultExtensionClasses)===null||l===void 0?void 0:l.sessionRecording;var c,u;p&&(this.sessionRecording=this.mu(this.sessionRecording,new p(this)),this.hu&&((c=this.sessionRecording)===null||c===void 0||(u=c.onRemoteConfig)===null||u===void 0||u.call(c,this.hu)))}var d,h;this.consent.optInOut(!0),this.xu(),this.ec(),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((d=this.surveys)===null||d===void 0||d.loadIfEnabled()),(x(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((h=t==null?void 0:t.captureEventName)!==null&&h!==void 0?h:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.nc()}else T.warn(aa)}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.xu(),this.config.cookieless_mode==="on_reject"&&this.$u()):T.warn(aa)}$u(){var t,i;let s=this.sessionRecording;s==null||s.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.Sc(!0,!0),this.register({distinct_id:Ks,$device_id:null}),this.gu(s),this.sessionRecording=void 0,(t=this.sessionManager)===null||t===void 0||t.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.nc(),this.ec()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){let t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return!this.Su&&(this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.xu()}_is_bot(){return pe?Xc(pe,this.config.custom_blocked_useragents):void 0}nc(){E&&(E.visibilityState==="visible"?this.Fu||(this.Fu=!0,this.capture(mr,{title:E.title},{send_instantly:!0}),this.Ou&&(E.removeEventListener(Oi,this.Ou),this.Ou=null)):this.Ou||(this.Ou=this.nc.bind(this),G(E,Oi,this.Ou)))}debug(t){t===!1?(b==null||b.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(b==null||b.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}))}il(){let t=this.qu||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(T.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(i,s,n,r,o){let a=s in i&&!L(i[s]),l=n in i&&!L(i[n]);return a?i[s]:!!l&&(o&&o.warn(`Config field '${n}' is deprecated. Please use '${s}' instead. The old field will be removed in a future major version.`),i[n])})(t,"advanced_disable_flags","advanced_disable_decide",0,T)}Os(t){var i;if(L(this.config.before_send))return t;let s=Object.keys((i=t.properties)!==null&&i!==void 0?i:{}).filter(ad),n=O(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(let o of n)try{if(r=o(r),L(r)){let a=`Event '${t.event}' was rejected in beforeSend function`;return od(t.event)?T.warn(`${a}. This can cause unexpected behavior.`):T.info(a),null}r.properties&&!Me(r.properties)||T.warn(`Event '${t.event}' has no properties after beforeSend function, this is likely an error.`)}catch(a){return T.error(`Error in beforeSend function for event '${t.event}':`,a),null}for(let o of s)if(r.properties&&L(r.properties[o]))return T.warn(`Event '${t.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){var t;return(t=this.pageViewManager.Wo)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,i){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:i})}captureTraceMetric(t,i,s){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:i,$ai_metric_value:String(s)})}Nu(t){let i=Se(t)&&!t,s=U.At()&&U.Ot("ph_debug")==="true";return!i&&(!!s||t)}};Ii.__defaultExtensionClasses={},Ii.Cc=(()=>{let e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),(function(e,t){for(let i=0;t.length>i;i++)e.prototype[t[i]]=tp(e.prototype[t[i]])})(Ii,["identify"]);var su=class{constructor(e){this.disabled=e===!1;let t=j(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,i){if(this.disabled)return!1;let s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&this.timeoutMs>i-s.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}},mn="$copy_autocapture",yn=re("[AutoCapture]");function bn(e,t){return t.length>e?t.slice(0,e)+"...":t}function pf(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!We(t));return t}function ff(e,{e:t,maskAllElementAttributes:i,maskAllText:s,elementAttributeIgnoreList:n,elementsChainAsString:r,disableCaptureUrlHashes:o}){var a,l;if(!We(e))return{props:{}};let c=[e],u=new Set([e]),d=e;for(;d.parentNode&&!_e(d,"body")&&1e3>c.length;){if(br(d.parentNode)){let k=d.parentNode.host;if(u.has(k))break;u.add(k),c.push(k),d=k;continue}if(!We(d.parentNode)||u.has(d.parentNode))break;u.add(d.parentNode),c.push(d.parentNode),d=d.parentNode}let h=t.type==="click"&&e.namespaceURI==="http://www.w3.org/2000/svg"?c.findIndex(k=>_e(k,"button")||_e(k,"a")):-1;h>0&&(s=s||c.slice(0,h+1).some(k=>!Ft(k)||Jt(k)));let p=[],v={},_,g=!1,y=!1;if(Z(c,k=>{let I=Ft(k);if(_e(k,"a")&&!i&&!(n!=null&&n.includes("href"))){let S=k.getAttribute("href");g=!!(I&&S&&qt(S))&&(o?yt(S):S)}A(Xt(k),"ph-no-capture")&&(y=!0),p.push((function(S,$,D,R,N=!1){let W=S.tagName.toLowerCase(),C={tag_name:W};xr.indexOf(W)>-1&&!D&&(C.$el_text=W.toLowerCase()==="a"||W.toLowerCase()==="button"?bn(1024,Bo(S)):bn(1024,Ri(S)));let H=Xt(S);$||R!=null&&R.includes("class")||0>=H.length||(C.classes=H.filter(function(ie){return ie!==""})),Z(S.attributes,function(ie){var ge;if((!Jt(S)||["name","id","class","aria-label"].indexOf(ie.name)!==-1)&&!(R!=null&&R.includes(ie.name))&&!$&&qt(ie.value)&&(!V(ge=ie.name)||ge.substring(0,10)!=="_ngcontent"&&ge.substring(0,7)!=="_nghost")){let de=ie.value;ie.name==="class"&&(de=wr(de).join(" ")),C["attr__"+ie.name]=bn(1024,ie.name==="href"&&N?yt(de):de)}});let B=1,Y=1,z=S;for(;z=pf(z);)B++,z.tagName===S.tagName&&Y++;return C.nth_child=B,C.nth_of_type=Y,C})(k,i,s,n,o)),Z((function(S){if(!Ft(S))return{};let $={};return Z(S.attributes,function(D){if(D.name&&D.name.indexOf("data-ph-capture-attribute")===0){let R=D.name.replace("data-ph-capture-attribute-",""),N=D.value;R&&N&&qt(N)&&($[R]=N)}}),$})(k),(S,$)=>{({}).hasOwnProperty.call(v,$)||(v[$]=S)})}),y)return{props:{},explicitNoCapture:y};if(h>0&&(e=c[h],p.splice(0,h)),s||(p[0].$el_text=_e(e,"a")||_e(e,"button")?Bo(e):Ri(e)),g){var m,w;p[0].attr__href=g;let k=(m=nt(g))===null||m===void 0?void 0:m.host,I=b==null||(w=b.location)===null||w===void 0?void 0:w.host;k&&I&&k!==I&&(_=g)}return{props:Q((P=t.type,{$event_type:P,$ce_version:1}),r?{}:{$elements:p},{$elements_chain:(M=p,O(M)?(function(k){return k.map(I=>{var S,$;let D="";if(I.tag_name&&(D+=I.tag_name),I.attr_class){I.attr_class.sort();for(let W of I.attr_class)D+=`.${W.replace(/"/g,"")}`}let R=f(f(f(f({},I.text?{text:I.text}:{}),{},{"nth-child":(S=I.nth_child)!==null&&S!==void 0?S:0,"nth-of-type":($=I.nth_of_type)!==null&&$!==void 0?$:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),N={};return rs(R).sort(([W],[C])=>(function(H,B){return B>H?-1:H>B?1:0})(W,C)).forEach(([W,C])=>N[Uo(W.toString())]=Uo(C.toString())),D+=":",D+=rs(N).map(([W,C])=>`${W}="${C}"`).join(""),D}).join(";")})((function(k){return k.map(I=>{var S,$;let D={text:(S=I.$el_text)===null||S===void 0?void 0:S.slice(0,400),tag_name:I.tag_name,href:($=I.attr__href)===null||$===void 0?void 0:$.slice(0,2048),attr_class:mp(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return rs(I).filter(([R])=>R.indexOf("attr__")===0).forEach(([R,N])=>D.attributes[R]=N),D})})(M)):"")},!((a=p[0])===null||a===void 0)&&a.$el_text?{$el_text:(l=p[0])===null||l===void 0?void 0:l.$el_text}:{},_&&t.type==="click"?{$external_click_url:_}:{},v),target:e};var M,P}var vf=class{do(){this.vo=void 0,clearTimeout(this.fo),this.fo=void 0}po(e){var t;if(!Ft(e))return!0;let i=(t=this.mo().css_selector_ignorelist)!==null&&t!==void 0?t:rn,s=new Set,n=e;for(;n;){if(s.size>=1e3||s.has(n))return!0;s.add(n);let r=n,o=Xt(r);if(A(o,"ph-no-capture")||A(o,"ph-sensitive")||Jt(r)||i.some(l=>Zn(r,l)))return!0;let a=n.parentNode;n=br(a)?a.host:a&&We(a)?a:null}return!1}yo(e){if(!this.isEnabled||e.type==="pointercancel")return void this.do();if(e.type==="pointerdown"){this.do();let s=$i(e);var t;return void(e.isPrimary&&e.button===0&&!e.ctrlKey&&s&&We(s)&&(this.vo={target:s,excluded:this.po(s),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(t=this.bo)===null||t===void 0?void 0:t.distinctId}))}let i=this.vo;i&&(e.pointerId!==i.id||Math.abs(e.clientX-i.x)>5||Math.abs(e.clientY-i.y)>5?this.do():e.type==="pointerup"&&(i.released=!0,this.fo=setTimeout(()=>this.do(),0)))}_o(e){var t;let i=this.vo;this.do();let s=$i(e);if(i!=null&&i.released&&i.target.isConnected&&i.distinctId===((t=this.bo)===null||t===void 0?void 0:t.distinctId)&&e.pointerId===i.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-i.x)&&5>=Math.abs(e.clientY-i.y)&&s&&(_e(s,"html")||_e(s,"body"))){var n;if(i.excluded)return null;let r=(n=this.mo().css_selector_ignorelist)!==null&&n!==void 0?n:rn;return[s,E==null?void 0:E.documentElement,E==null?void 0:E.body].some(o=>{if(!o)return!1;let a=Xt(o);return A(a,"ph-no-capture")||A(a,"ph-sensitive")||!Ft(o)||Jt(o)||r.some(l=>Zn(o,l))})?null:i.target}}constructor(e){this.wo=e,this.name="autocapture",this.ko=!1,this.So=null,this.xo=!1,this.$o=new Map,this.Co=!1,this.Mr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.To=!1,this.wo.refresh(this.Mr),this.rageclicks=new su(this.Mr.rageclick),this.Io=null}setup(e){this.Mo(),this.bo=e;let t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.To?t.dispose():(this.Eo=t,this.startIfEnabled())}dispose(){var e;this.To||(this.To=!0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.$o.clear(),this.Io=null,this.Po())}mo(){return this.wo.refresh(this.Mr),this.Mr}Mo(){var e,t;return this.mo(),this.Mr.url_allowlist=(e=this.Mr.url_allowlist)===null||e===void 0?void 0:e.map(i=>new RegExp(i)),this.Mr.url_ignorelist=(t=this.Mr.url_ignorelist)===null||t===void 0?void 0:t.map(i=>new RegExp(i)),this.Mr}Ro(){if(!this.isBrowserSupported())return void yn.info("Disabling Automatic Event Collection because this browser is not supported");if(!b||!E)return;let e=this.Ao=t=>{t=t||(b==null?void 0:b.event);try{if(t.type==="blur")return void this.do();if(t.type.indexOf("pointer")===0)return void this.yo(t);let i=t.type==="click"?this._o(t):void 0;if(ne(i))return;this.Fo(t,"$autocapture",i)}catch(i){yn.error("Failed to capture event",i)}};if(G(b,"blur",e),G(E,"submit",e,{capture:!0}),G(E,"change",e,{capture:!0}),G(E,"click",e,{capture:!0}),Z(["pointerdown","pointermove","pointerup","pointercancel"],t=>{G(E,t,e,{capture:!0})}),this.mo().capture_copied_text){let t=this.Oo=i=>{i=i||(b==null?void 0:b.event);try{this.Fo(i,mn)}catch(s){yn.error("Failed to capture clipboard event",s)}};G(E,"copy",t,{capture:!0}),G(E,"cut",t,{capture:!0}),G(E,"paste",t,{capture:!0})}}Po(){this.do(),this.Ao&&(b==null||b.removeEventListener("blur",this.Ao),Z(["pointerdown","pointermove","pointerup","pointercancel"],e=>{E==null||E.removeEventListener(e,this.Ao,!0)}),E==null||E.removeEventListener("submit",this.Ao,!0),E==null||E.removeEventListener("change",this.Ao,!0),E==null||E.removeEventListener("click",this.Ao,!0),this.Ao=void 0),this.Oo&&(E==null||E.removeEventListener("copy",this.Oo,!0),E==null||E.removeEventListener("cut",this.Oo,!0),E==null||E.removeEventListener("paste",this.Oo,!0),this.Oo=void 0),this.ko=!1}startIfEnabled(){this.isEnabled||this.do(),!this.To&&this.bo&&this.isEnabled&&!this.ko&&(this.Ro(),this.ko=!0)}onRemoteConfig(e){if(this.To)return;if(this.xo=!0,!e.ok)return void this.startIfEnabled();let t=e.config;t.elementsChainAsString&&(this.Co=t.elementsChainAsString);let i=t.autocapture_opt_out;var s;Se(i)&&((s=this.bo)===null||s===void 0||s.kv.set("$autocapture_disabled_server_side",i),this.So=i),this.startIfEnabled()}setElementSelectors(e,t=this){if(this.To)return;e.size?this.$o.set(t,new Set(e)):this.$o.delete(t);let i=new Set;this.$o.forEach(s=>{s.forEach(n=>i.add(n))}),this.Io=i}getElementSelectors(e,t){var i;let s=[];return(i=this.Io)===null||i===void 0||i.forEach(n=>{let r=E==null?void 0:E.querySelectorAll(n);r==null||r.forEach(o=>{e!==o&&t!==o||A(s,n)||s.push(n)})}),s}get isEnabled(){var e,t;if(this.To)return!1;let i=(e=this.bo)===null||e===void 0?void 0:e.kv.get(Vl),s=this.So,n=this.mo();if(!n.remoteRequestsDisabled&&!this.xo)return!1;let r=n.remoteRequestsDisabled&&!this.xo;if(ne(s)&&!Se(i)&&!r)return!1;let o=(t=this.So)!==null&&t!==void 0?t:!!i;return!!n.enabled&&!o}Fo(e,t="$autocapture",i){if(!this.isEnabled)return void this.do();let s=i||$i(e);pc(s)&&(s=s.parentNode||null);let n=this.Mo();var r;t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&n.rageclick&&(!((r=this.rageclicks)===null||r===void 0)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime()))&&_c(s,n.rageclick)&&this.Fo(e,"$rageclick",i);let o=t===mn,a=o?f(f({},n),{},{dom_event_allowlist:void 0}):n;if(s&&(function(d,h,p,v,_,g){var y;if(!b||Sr(d)||p!=null&&p.url_allowlist&&!Ro(p.url_allowlist,g)||p!=null&&p.url_ignorelist&&Ro(p.url_ignorelist,g))return!1;if(p!=null&&p.dom_event_allowlist){let P=p.dom_event_allowlist;if(P&&!P.some(k=>h.type===k))return!1}let{parentIsUsefulElement:m,targetElementList:w}=mc(d,v);if(!(function(P,k){let I=k==null?void 0:k.element_allowlist;if(x(I))return!0;for(let S of P)if(I.some($=>S.tagName.toLowerCase()===$))return!0;return!1})(w,p)||!Yn(w,p==null?void 0:p.css_selector_allowlist)||Yn(w,(y=p==null?void 0:p.css_selector_ignorelist)!==null&&y!==void 0?y:rn))return!1;try{let P=b.getComputedStyle(d);if(P&&P.getPropertyValue("cursor")==="pointer"&&h.type==="click")return!0}catch{}let M=d.tagName.toLowerCase();switch(M){case"html":return!1;case"form":return(_||["submit"]).indexOf(h.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(h.type)>=0;default:return m?(_||["click"]).indexOf(h.type)>=0:(_||["click"]).indexOf(h.type)>=0&&(xr.indexOf(M)>-1||d.getAttribute("contenteditable")==="true")}})(s,e,a,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:n.getCurrentUrl}})){var l;let{props:d,explicitNoCapture:h,target:p}=ff(s,{e,maskAllElementAttributes:n.maskAllElementAttributes,maskAllText:n.maskAllText,elementAttributeIgnoreList:n.element_attribute_ignorelist,elementsChainAsString:this.Co,disableCaptureUrlHashes:n.disableCaptureUrlHashes});if(h)return!1;let v=this.getElementSelectors(s,p);if(v&&v.length>0&&(d.$element_selectors=v),t===mn){let _=e.type||"clipboard";if(_!=="paste"){var c,u;let g=b==null||(c=b.getSelection())===null||c===void 0?void 0:c.toString(),y=fc(g);if(!y)return!1;d.$selected_content=y,d.$clipboard_text_length=(u=g==null?void 0:g.length)!==null&&u!==void 0?u:0}d.$copy_type=_}return(l=this.bo)===null||l===void 0||l.capture(t,d),!0}}isBrowserSupported(){return le(E==null?void 0:E.querySelectorAll)}},gf=class{constructor(e){this._instance=e}refresh(e){let t=this._instance.config,i=j(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.il(),e.url_allowlist=i==null?void 0:i.url_allowlist,e.url_ignorelist=i==null?void 0:i.url_ignorelist,e.dom_event_allowlist=i==null?void 0:i.dom_event_allowlist,e.element_allowlist=i==null?void 0:i.element_allowlist,e.css_selector_allowlist=i==null?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=i==null?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=i==null?void 0:i.element_attribute_ignorelist,e.capture_copied_text=i==null?void 0:i.capture_copied_text}},gi=re("[ExceptionAutocapture]"),pa=()=>{},fa=e=>{var t;if(le(e))return(t=e.__posthog_layer__)!==null&&t!==void 0?t:e.__rrweb_layer__};function ti(e,t,i){try{if(!(t in e))return pa;let s={next:e[t]},n=i(function(...r){return s.next.apply(this,r)});return le(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=n,()=>{if(e[t]===n)return void(e[t]=s.next);let r=e[t],o=fa(r);for(;o;){if(o.next===n)return void(o.next=s.next);r=o.next,o=fa(r)}}}catch{return pa}}var _f=re("[TracingHeaders]"),St=re("[Web Vitals]"),va=9e5,ga=["CLS","FCP","INP","LCP"],mf=["INP","LCP"],yf=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],wn="disabled",_a="lazy_loading",Ke=re("[SessionRecording]"),bf=[vr,gr,ec,tc,ic,sc,nc,rc,oc],wf=re("[Heatmaps]");function xn(e){return j(e)&&"clientX"in e&&"clientY"in e&&oe(e.clientX)&&oe(e.clientY)}var Qi=re("[Product Tours]"),kn=e=>{var t;return!e.config.disable_product_tours&&!!(!((t=e.persistence)===null||t===void 0)&&t.get_property(pr))},xf=["$set_once","$set"],qe=re("[SiteApps]"),ma="Error while initializing PostHog app with config id ",nu=(e,t)=>e!=null&&e.then?e.then(t):t(e),jt="SDK is not enabled or survey functionality is not yet loaded",ya="Disabled. Not loading surveys.",kf=class{constructor(e,t){this.wo=e,this.Ic=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Mc=!1,this.Ec=!1,this.Pc=[],this.Rc=[],this.Ac=null,this.Fc=null,this.To=!1,this.Oc=new Set,this.onRemoteConfig=i=>{if(this.To||this.Mr.disableSurveys)return;if(!i.ok)return this.Ec=!0,this.Dc({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),q.warn("Remote config unavailable. Not loading surveys.");let s=i.config.surveys;if(L(s))return q.warn("Flags not loaded yet. Not loading surveys.");this.Lc=Se(s)?s:s.length>0,q.info(`flags response received, isSurveysEnabled: ${this.Lc}`),this.loadIfEnabled()},this.Dc=i=>{this.Rc.slice().forEach(s=>this.Nc(s,i))}}setup(e){if(!this.To)return this.qc=e,nu(e.kv.initialize(),()=>{if(this.qc!==e||this.To)return;this.qc=void 0,this.bo=e;let t=e.onRemoteConfig(this.onRemoteConfig);this.To?t.dispose():(this.Eo=t,this.loadIfEnabled())})}dispose(){var e,t,i,s,n;this.To||(this.To=!0,this.qc=void 0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,(t=this._surveyEventReceiver)===null||t===void 0||t.dispose(),this._surveyEventReceiver=null,(i=this._surveyManager)===null||i===void 0||(s=i.dispose)===null||s===void 0||s.call(i),this._surveyManager=null,this.Pc=[],this.Rc.forEach(r=>{r.active=!1}),this.Rc=[],(n=this.jc)===null||n===void 0||n.call(this),this.jc=void 0,this.Ac=null,this.Oc.forEach(r=>clearTimeout(r)),this.Oc.clear())}get Mr(){return this.wo.get()}initialize(){this.loadIfEnabled()}reset(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.clearInMemoryInProgressSurveyState)===null||t===void 0||t.call(e);try{var i;(i=this._surveyEventReceiver)===null||i===void 0||i.reset(),localStorage.removeItem("lastSeenSurveyDate");let s=[];for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);(r!=null&&r.startsWith("seenSurvey_")||r!=null&&r.startsWith("inProgressSurvey_"))&&s.push(r)}s.forEach(n=>localStorage.removeItem(n))}catch{}this.Dc()}loadIfEnabled(){if(this.To||!this.bo)return;let e=this.Mr;if(this._surveyManager)return;if(this.Mc)return void q.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void q.info(ya);if(e.cookielessMode&&this.wo.isOptedOut())return void q.info("Not loading surveys in cookieless mode without consent.");let t=this.wo.getExtensions();if(!t)return void this.Bc("PostHog Extensions not found.");if(x(this.Lc)&&!e.advancedEnableSurveys)return;let i=this.Lc||e.advancedEnableSurveys;this.Mc=!0,this.Ec=!1;try{let s=t.generateSurveys;if(s)return this.zc(s,i),void(this.Mc=!1);let n=t.loadExternalDependency;if(!n)return this.Bc(_r),void(this.Mc=!1);n(r=>{try{if(this.To)return;let o=this.wo.getExtensions();r||!(o!=null&&o.generateSurveys)?this.Bc("Could not load surveys script",r):this.zc(o.generateSurveys,i)}finally{this.Mc=!1}})}catch(s){throw this.Mc=!1,this.Bc("Error initializing surveys",s),s}}zc(e,t){var i,s;if(this.To)return;this._surveyManager=e(t),this._surveyEventReceiver=this.wo.createEventReceiver(this.Dc);let n=(i=(s=this.bo)!==null&&s!==void 0?s:this.Ic)===null||i===void 0?void 0:i.kv.get(mi);n&&this.Hc(n),q.info("Surveys loaded successfully"),this.Uc(),this.Dc(),this.Wc({isLoaded:!0})}Bc(e,t){this.Ec=!0,q.error(e,t),this.Dc({isLoaded:!1,error:e}),this.Wc({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Pc.push(e),this._surveyManager&&this.Wc({isLoaded:!0}),()=>{this.Pc=this.Pc.filter(t=>t!==e)}}getSurveys(e,t=!1){var i;let s=(i=this.bo)!==null&&i!==void 0?i:this.Ic;if(!s||this.To)return;if(this.Mr.disableSurveys)return q.info(ya),e([]);let n=s.kv.get(mi);if(n&&!t)return e(n,{isLoaded:!0}),void(this.Vc()&&this.getSurveys(()=>{},!0));if(this.Ac)return void this.Ac.then(({surveys:a,context:l})=>{this.To||e(a,l)}).catch(a=>q.error("Error in survey callback",a));let r=this.Gc("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(a=>{try{return this.Qc(s,a)}catch(l){return q.error("Error processing surveys response",l),this.Qc(s,{statusCode:0,error:l})}},a=>this.Qc(s,{statusCode:0,error:a}));this.Ac=r;let o=()=>{this.Ac===r&&(this.Ac=null)};r.then(a=>{o(),this.To||(this.Dc(a.context),e(a.surveys,a.context))},o).catch(a=>q.error("Error in survey callback",a))}Gc(e,t){let i=this.bo;return i?i.sendRequest(e,t):new Promise(s=>s({statusCode:0,error:new Error(jt)}))}Qc(e,t){if(this.To)return{surveys:[],context:{isLoaded:!1,error:jt}};let i=t.statusCode;if(i!==200||!t.json){let n=`Surveys API could not be loaded, status: ${i}`;return i!==0?q.error(n):t.error||q.warn(n),this.Fc=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Fc=null;let s=t.json.surveys||[];return e.kv.set({[mi]:s,[ms]:Date.now()}),this.Hc(s),{surveys:s,context:{isLoaded:!0}}}Hc(e){var t;let i=e.filter(s=>(function(n){return!(!n.start_date||n.end_date)})(s)&&(Kc(s)||(function(n){var r;return!!(!((r=n.conditions)===null||r===void 0||(r=r.actions)===null||r===void 0||(r=r.values)===null||r===void 0)&&r.length)})(s)));(t=this._surveyEventReceiver)===null||t===void 0||t.replace(i)}Vc(){return this.Zc()&&!this.Ac&&!this.Jc()}Zc(){var e,t;let i=(e=(t=this.bo)!==null&&t!==void 0?t:this.Ic)===null||e===void 0?void 0:e.kv.get(ms);return oe(i)&&Date.now()-i>3e5}Jc(){return oe(this.Fc)&&3e5>Date.now()-this.Fc}markSurveyAsSeen(e,t){var i;let s={id:e,current_iteration:(i=t==null?void 0:t.iteration)!==null&&i!==void 0?i:null};tu(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Dc()}Wc(e){for(let t of this.Pc)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(i){q.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t=!1){if(!L(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);q.warn("init was not called")}onActiveMatchingSurveysChanged(e){var t,i;if(this.To)return()=>{};let s={callback:e,active:!0,revision:0};this.Rc.push(s),this.Uc();let n=(t=(i=this.bo)!==null&&i!==void 0?i:this.Ic)===null||t===void 0?void 0:t.kv.get(mi);return this.Mr.disableSurveys||!this._surveyManager&&this.Ec&&!this.Mc||!n&&!L(this.Fc)&&!this.Ac?this.Nc(s,{isLoaded:!1}):this._surveyManager&&this.Nc(s),()=>{var r;s.active=!1,this.Rc=this.Rc.filter(o=>o!==s),this.Rc.length===0&&((r=this.jc)===null||r===void 0||r.call(this),this.jc=void 0)}}Uc(){var e,t,i;this._surveyManager&&this.Rc.length>0&&((e=this.jc)!==null&&e!==void 0||(this.jc=(t=(i=this.wo).onMatchingConditionsChanged)===null||t===void 0?void 0:t.call(i,this.Dc)))}Nc(e,t){if(this.To||!e.active)return;let i=++e.revision,s=n=>{if(!this.To&&e.active&&i===e.revision)try{let r=t!=null?t:{isLoaded:!0},o=JSON.stringify([n,r]);if(o===e.lastResult)return;e.lastResult=o,e.callback(n,r)}catch(r){q.error("Error in active matching surveys callback",r)}};try{t&&!t.isLoaded?s([]):this.getActiveMatchingSurveys(s)}catch(n){q.error("Error in active matching surveys callback",n)}}Kc(e){let t=null;return this.getSurveys(i=>{var s;t=(s=i.find(n=>n.id===e))!==null&&s!==void 0?s:null}),t}Xc(e){if(L(this._surveyManager))return{eligible:!1,reason:jt};let t=typeof e=="string"?this.Kc(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Yc(e){if(!this.wo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(L(this._surveyManager))return{eligible:!1,reason:jt};let t=typeof e=="string"?this.Kc(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(L(this._surveyManager))return q.warn("init was not called"),{visible:!1,disabledReason:jt};let t=this.Yc(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return L(this._surveyManager)?(q.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:jt})):new Promise(i=>{this.getSurveys(s=>{var n;let r=(n=s.find(o=>o.id===e))!==null&&n!==void 0?n:null;if(r){let o=this.Yc(r);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(!this.wo.isCapturing())return;if(L(this._surveyManager))return void q.warn("init was not called");let n=typeof e=="string"?this.Kc(e):e;if(!(n!=null&&n.id))return void q.warn("Survey not found");if(!Jp.includes(n.type))return void q.warn(`Surveys of type ${n.type} cannot be rendered in the app`);let r=E==null?void 0:E.querySelector(t);if(r){if(!((s=n.appearance)===null||s===void 0)&&s.surveyPopupDelaySeconds){q.info(`Rendering survey ${n.id} with delay of ${n.appearance.surveyPopupDelaySeconds} seconds`);let o=setTimeout(()=>{var a,l;this.Oc.delete(o),!this.To&&this.wo.isCapturing()&&(q.info(`Rendering survey ${n.id} with delay of ${(a=n.appearance)===null||a===void 0?void 0:a.surveyPopupDelaySeconds} seconds`),(l=this._surveyManager)===null||l===void 0||l.renderSurvey(n,r,i),q.info(`Survey ${n.id} rendered`))},1e3*n.appearance.surveyPopupDelaySeconds);return void this.Oc.add(o)}this._surveyManager.renderSurvey(n,r,i)}else q.warn("Survey element not found")}displaySurvey(e,t){var i;if(!this.wo.isCapturing())return;if(L(this._surveyManager))return void q.warn("init was not called");let s=this.Kc(e);if(!s)return void q.warn("Survey not found");let n=s;if(!((i=s.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=f(f({},s),{},{appearance:f(f({},s.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==Xn.Popover&&t.initialResponses&&q.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){let r=this.Xc(s);if(!r.eligible)return void q.warn("Survey is not eligible to be displayed: ",r.reason)}t.displayType!==Xn.Inline?this._surveyManager.handlePopoverSurvey(n,t):this.renderSurvey(n,t.selector,t.properties)}cancelPendingSurvey(e){L(this._surveyManager)?q.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.handlePageUnload)===null||t===void 0||t.call(e)}};function Vt(e,t,i){if(L(e))return!1;switch(i){case"exact":return e===t;case"contains":{let s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(e)}case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var Sf=class{constructor(e){this._instance=e,this.th=new Set,this.eh=new Set,this.ih=new Es,this.nh=(t,i)=>this.sh(t,i)&&this.rh(t,i)&&this.oh(t,i)&&this.ah(t,i),this.sh=(t,i)=>!(i!=null&&i.event)||(t==null?void 0:t.event)===(i==null?void 0:i.event)}init(){var e,t;x((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)||(this.uh=(t=this._instance)===null||t===void 0?void 0:t._addCaptureHook((i,s)=>{this.on(i,s)}))}dispose(){var e,t;(e=this.uh)===null||e===void 0||e.call(this),this.uh=void 0,(t=this._instance)===null||t===void 0||(t=t.autocapture)===null||t===void 0||t.setElementSelectors(new Set,this),this.ih=new Es}register(e){var t,i;if(!x((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(s=>{var n;this.th.add(s),(n=s.steps)===null||n===void 0||n.forEach(r=>{this.eh.add((r==null?void 0:r.event)||"")})}),(i=this._instance)===null||i===void 0?void 0:i.autocapture)){let s=new Set;this.th.forEach(n=>{var r;(r=n.steps)===null||r===void 0||r.forEach(o=>{o!=null&&o.selector&&s.add(o.selector)})}),this._instance.autocapture.setElementSelectors(s,this)}}replace(e){this.th.clear(),this.eh.clear(),this.register(e)}on(e,t){t!=null&&e.length!=0&&(this.eh.has(e)||this.eh.has(t.event))&&this.th.forEach(i=>{this.hh(t,i)&&this.ih.emit("actionCaptured",i.name)})}dh(e){this.onAction("actionCaptured",t=>e(t))}hh(e,t){if((t==null?void 0:t.steps)==null)return!1;for(let i of t.steps)if(this.nh(e,i))return!0;return!1}onAction(e,t){return this.ih.on(e,t)}rh(e,t){if(t!=null&&t.url){var i;let s=e==null||(i=e.properties)===null||i===void 0?void 0:i.$current_url;if(!s||typeof s!="string"||!Vt(s,t.url,t.url_matching||"contains"))return!1}return!0}oh(e,t){return!!this.fh(e,t)&&!!this.ph(e,t)&&!!this.gh(e,t)}fh(e,t){var i;if(!(t!=null&&t.href))return!0;let s=this.mh(e);if(s.length>0)return s.some(r=>Vt(r.href,t.href,t.href_matching||"exact"));let n=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";return!!n&&Vt((function(r){let o=r.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(n),t.href,t.href_matching||"exact")}ph(e,t){var i;if(!(t!=null&&t.text))return!0;let s=this.mh(e);if(s.length>0)return s.some(l=>Vt(l.text,t.text,t.text_matching||"exact")||Vt(l.$el_text,t.text,t.text_matching||"exact"));let n=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";return!!n&&(r=(function(l){let c=[],u=/(?::|")text="(.*?)"/g,d;for(;!L(d=u.exec(l));)c.includes(d[1])||c.push(d[1]);return c})(n),o=t.text,a=t.text_matching||"exact",r.some(l=>Vt(l,o,a)));var r,o,a}gh(e,t){var i,s;if(!(t!=null&&t.selector))return!0;let n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$element_selectors;if(n!=null&&n.includes(t.selector))return!0;let r=(e==null||(s=e.properties)===null||s===void 0?void 0:s.$elements_chain)||"";if(t.selector_regex&&r)try{return new RegExp(t.selector_regex).test(r)}catch{return!1}return!1}mh(e){var t;return(e==null||(t=e.properties)===null||t===void 0?void 0:t.$elements)==null?[]:e==null?void 0:e.properties.$elements}ah(e,t){return!(t!=null&&t.properties)||t.properties.length===0||eu(t.properties.reduce((i,s)=>{let n=O(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return i[s.key]={values:n,operator:s.operator||"exact"},i},{}),e==null?void 0:e.properties)}},Ef=class{constructor(e,t){var i,s;this.yh=[],this._instance=e,this.bh=t,this._h=new Map,this.wh=new Map,this.kh=new Map,this.Sh=(i=this._instance)===null||i===void 0||(s=i.onSessionId)===null||s===void 0?void 0:s.call(i,n=>this.xh(n))}$h(e){return!1}Ch(){return null}Th(e){}Ih(){}Mh(e,t){return!!e&&eu(e.propertyFilters,t==null?void 0:t.properties)}Eh(e,t){let i=new Map;return e.forEach(s=>{var n;(n=s.conditions)===null||n===void 0||(n=n[t])===null||n===void 0||(n=n.values)===null||n===void 0||n.forEach(r=>{if(r!=null&&r.name){let o=i.get(r.name)||[];o.push(s.id),i.set(r.name,o)}})}),i}Ph(e,t,i){let s=(i===pi.Activation?this._h:this.wh).get(e),n=[];return this.Rh(r=>{n=r.filter(o=>s==null?void 0:s.includes(o.id))}),n.filter(r=>{var o;let a=(o=r.conditions)===null||o===void 0||(o=o[i])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(l=>l.name===e);return this.Mh(a,t)})}register(e){this.Ah(e,!1)}replace(e){this.Ah(e,!0)}Ah(e,t){var i;x((i=this._instance)===null||i===void 0?void 0:i._addCaptureHook)||(this.Fh(e,t),this.Oh(e,t))}Oh(e,t){let i=e.filter(r=>{var o;return(o=r.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var s;if(t&&this.kh.clear(),i.length===0)return void(t&&((s=this.Dh)===null||s===void 0||s.replace([])));this.Dh||(this.Dh=new Sf(this._instance),this.Dh.init(),this.Dh.dh(r=>this.onAction(r)));let n=[];i.forEach(r=>{var o;(o=r.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(a=>{if(n.push(a),a.name){var l;let c=(l=this.kh.get(a.name))!==null&&l!==void 0?l:[];c.includes(r.id)||c.push(r.id),this.kh.set(a.name,c)}})}),t?this.Dh.replace(n):this.Dh.register(n)}Lh(e,t){t.forEach((i,s)=>{var n;let r=(n=e.get(s))!==null&&n!==void 0?n:[];i.forEach(o=>{r.includes(o)||r.push(o)}),e.set(s,r)})}Fh(e,t){var i,s;let n=e.filter(l=>{var c,u;return((c=l.conditions)===null||c===void 0?void 0:c.events)&&((u=l.conditions)===null||u===void 0||(u=u.events)===null||u===void 0||(u=u.values)===null||u===void 0?void 0:u.length)>0}),r=e.filter(l=>{var c,u;return((c=l.conditions)===null||c===void 0?void 0:c.cancelEvents)&&((u=l.conditions)===null||u===void 0||(u=u.cancelEvents)===null||u===void 0||(u=u.values)===null||u===void 0?void 0:u.length)>0}),o=this.Eh(e,pi.Activation),a=this.Eh(e,pi.Cancellation);t?(this._h=o,this.wh=a):(this.Lh(this._h,o),this.Lh(this.wh,a)),(n.length!==0||r.length!==0||e.some(l=>{var c;return(c=l.conditions)===null||c===void 0||(c=c.actions)===null||c===void 0||(c=c.values)===null||c===void 0?void 0:c.length}))&&((i=this.uh)!==null&&i!==void 0||(this.uh=(s=this._instance)===null||s===void 0?void 0:s._addCaptureHook((l,c)=>{this.onEvent(l,c)})))}onEvent(e,t){var i,s;let n=this.Nh(),r=(t==null||(i=t.properties)===null||i===void 0?void 0:i.$survey_id)||(t==null||(s=t.properties)===null||s===void 0?void 0:s.$product_tour_id);if(r&&this.getActivatedIds().includes(r)){let a=this.qh(e,r,t);if(a==="consume")return n.info("event consumed activated item, removing it",{event:e,itemId:r}),void this.jh([r]);if(a==="persist")return n.info("shown item promoted to persisted activation",{event:e,itemId:r}),this.Bh(r),void this.zh([r])}if(this.wh.has(e)){let a=this.Ph(e,t,pi.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(l=>l.id)}),this.jh(a.map(l=>l.id)),a.forEach(l=>this.Hh(l.id)))}if(!this._h.has(e))return;n.info("event name matched",{event:e,eventPayload:t,items:this._h.get(e)});let o=this.Ph(e,t,pi.Activation);this.Uh(o.map(a=>a.id))}onAction(e){this.kh.has(e)&&this.Uh(this.kh.get(e)||[])}Uh(e){var t,i;if(e.length===0)return;let s=!!(!((t=this._instance)===null||t===void 0||(i=t.get_session_id)===null||i===void 0)&&i.call(t)),n=[];for(let r of e)s&&this.$h(r)?this.Bh(r)&&this.Wh(r):n.push(r);n.length>0&&(this.yh=[...new Set([...this.yh,...n])]),this.Nh().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Vh()}Bh(e){this.yh=this.yh.filter(i=>i!==e);let t=this.Gh();return!t.includes(e)&&(this.Qh([...t,e]),this.Zh(),!0)}jh(e){let t=new Set(e);this.yh=this.yh.filter(n=>!t.has(n));let i=this.Jh(),s=i.filter(n=>!t.has(n));s.length!==i.length&&(this.Qh(s),s.length===0&&this.Kh()),this.zh(e),this.Vh()}Vh(){try{var e;(e=this.bh)===null||e===void 0||e.call(this)}catch(t){this.Nh().error("Error while handling activated items change",t)}}Xh(){var e;let t=this.Ch();if(!t)return{};let i=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[t];return i&&typeof i=="object"?i:{}}Wh(e){if(!this.Ch())return;let t=this.Xh();this.Th(f(f({},t),{},{[e]:Date.now()}))}zh(e){if(!this.Ch())return;let t=this.Xh(),i={},s=!1;for(let[n,r]of Object.entries(t))e.includes(n)?s=!0:i[n]=r;s&&(Me(i)?this.Ih():this.Th(i))}Yh(){this.Ch()&&this.Ih()}getActivationTimestamp(e){if(!this.Gh().includes(e))return;let t=this.Xh()[e];return oe(t)?t:void 0}Jh(){var e;let t=this.td();return((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[t])||[]}Gh(){var e,t,i;let s=this.Jh();if(s.length===0)return[];let n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.ed()],r=(t=this._instance)===null||t===void 0||(i=t.get_session_id)===null||i===void 0?void 0:i.call(t);return r&&n===r?s:[]}Zh(){var e,t;let i=(e=this._instance)===null||e===void 0||(t=e.get_session_id)===null||t===void 0?void 0:t.call(e);i&&this.nd(i)}Kh(){this.sd()}xh(e){var t;let i=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.ed()];if(i&&i!==e){let s=this.Jh(),n=this.Xh();s.length>0&&(this.Qh([]),s.filter(r=>oe(n[r])).forEach(r=>this.Hh(r))),this.Kh(),this.Yh(),s.length>0&&this.Vh()}}getActivatedIds(){return[...new Set([...this.Gh(),...this.yh])].filter(e=>!this.rd(e))}dispose(){var e,t,i;(e=this.Sh)===null||e===void 0||e.call(this),this.Sh=void 0,(t=this.uh)===null||t===void 0||t.call(this),this.uh=void 0,(i=this.Dh)===null||i===void 0||i.dispose(),this.Dh=void 0}reset(){this.yh=[],this.Jh().length>0&&this.Qh([]),this.Kh(),this.Yh(),this.Vh()}getEventToItemsMap(){return this._h}od(){return this.Dh}},$f=class extends Ef{constructor(e,t){super(e,t)}td(){return Gl}ed(){return ql}Ch(){return Zl}Th(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated_timestamps:e})}Ih(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_timestamps")}$h(e){var t;let i;this.Rh(n=>{i=n.find(r=>r.id===e)});let s=i==null||(t=i.appearance)===null||t===void 0?void 0:t.surveyPopupDelaySeconds;return oe(s)&&s>0}ad(){return Ie.SHOWN}Rh(e){var t;(t=this._instance)===null||t===void 0||t.getSurveys(e)}Hh(e){var t;(t=this._instance)===null||t===void 0||t.cancelPendingSurvey(e)}Nh(){return q}Qh(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated:e})}nd(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated_session:e})}sd(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_session")}rd(){return!1}qh(e,t,i){var s;if(e===Ie.SENT&&(i==null||(s=i.properties)===null||s===void 0?void 0:s.$survey_completed)===!1)return"ignore";let n;return this.Rh(r=>{n=r.find(o=>o.id===t)}),!n||(function(r){var o;return Kc(r)&&!!(!((o=r.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||r.schedule==="always"})(n)?e===Ie.SHOWN?"consume":"ignore":e===Ie.SHOWN?"persist":e===Ie.DISMISSED||e===Ie.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Pf=class{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);let t={};for(let i of e){let s=this._instance.get_property(i);x(s)||(t[i]=s)}return t}set(e,t){this._instance.register(typeof e=="string"?{[e]:t}:e)}remove(e){typeof e!="string"?e.forEach(t=>this._instance.unregister(t)):this._instance.unregister(e)}},Mf=class{constructor(e){this._instance=e}get(){let e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){let e=F==null?void 0:F.__PosthogExtensions__;if(!e)return;let{generateSurveys:t,loadExternalDependency:i}=e;return{generateSurveys:t?s=>t(this._instance,s):void 0,loadExternalDependency:i?s=>i(this._instance,"surveys",s):void 0}}createEventReceiver(e){return new $f(this._instance,e)}onMatchingConditionsChanged(e){let t=this._instance._addCaptureHook(r=>{r!=="$pageview"&&r!==Ie.SHOWN&&r!==Ie.DISMISSED&&r!==Ie.SENT||e()}),i=()=>e();G(b,"PHSurveyShown",i);let s=!1,n=this._instance.onFeatureFlags(()=>{s&&e()});return s=!0,()=>{s=!1,t(),n(),b==null||b.removeEventListener("PHSurveyShown",i)}}},Tf=b!=null&&b.location?ws(b.location.hash,"__posthog")||ws(location.hash,"state"):null,ba="_postHogToolbarParams",wa=re("[Toolbar]"),xa=re("[FeatureFlags]"),Et=re("[FeatureFlags]",{debugEnabled:!0}),Sn=`" failed. Feature flags didn't load in time.`,If=[502,504],ka=["click","keydown","wheel","touchstart","pointerdown"],Sa="connection_error",Ea=e=>{let t={};for(let i=0;e.length>i;i++)t[e[i]]=!0;return t},$a=e=>{let t={};for(let[i,s]of rs(e||{}))s&&(t[i]=s);return t},Cf=class{constructor(e){this.name="featureFlags",this.ld=!1,this.featureFlagEventHandlers=[],this.A=xa,this.ud={},this.hd={},this.dd=[],this.vd=new Set,this.fd=new Set,this.pd=!1,this.gd=!1,this.md=0,this.yd=!1,this.bd=!1,this._d=!1,this.wd=!1,this.kd=0,this.Sd=!1,this.rn=()=>{let t=this.xd();this.kd=0,t&&this.reloadFeatureFlags()},this.$d=()=>{var t,i;let s=this.Cd,n=(t=this.Td)!==null&&t!==void 0?t:s;x(s)||x(n)||this.Mr.remoteRequestsDisabled||!this.Id||this.Id.visibilityState==="hidden"||Date.now()-((i=this.Md)!==null&&i!==void 0?i:0)<n||(this.Td=this.Sd||!this.Mr.idleRefreshBackoff?s:Math.min(2*n,36e5),this.Sd=!1,this.reloadFeatureFlags(),this.Ed())},this.Pd=()=>{this.Sd&&this.Td===this.Cd||this.Rd()},this.sn=()=>{var t;((t=this.Id)===null||t===void 0?void 0:t.visibilityState)==="visible"&&this.Rd()},this.wo=e}get Ad(){}Fd(){this.bo&&this.Od()}setup(e){try{this.Dd=typeof window>"u"?void 0:window,this.Id=typeof document>"u"?void 0:document}catch{this.Dd=void 0,this.Id=void 0}return this.qc=e,this.A=e.logger.createLogger("[FeatureFlags]"),nu(e.kv.initialize(),()=>{this.qc===e&&(this.qc=void 0,this.bo=e,this.Ld(e))})}Ld(e){var t;if(this.bo===e)return this.Dd&&G(this.Dd,"online",this.rn),this.Od(),this.Nd=e.registerDynamicEventProperties(()=>this.qd()?this.ud:this.hd),this.jd=(t=this.Ad)===null||t===void 0?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Bd(),this.zd(),this.Hd()}),this.zd(),this.initialize()}Rd(){this.Sd=!0,this.Td=this.Cd,this.$d()}Od(){var e;let t=this.Mr.refreshIntervalMs,i=!this.Mr.remoteRequestsDisabled&&this.Id&&!x(t)&&t>0?t:void 0;this.Mr.idleRefreshBackoff||(this.Td=i),i!==this.Cd&&(this.Ud(),x(i)||(this.Cd=i,this.Td=i,this.Ed(),!((e=this.Id)===null||e===void 0)&&e.addEventListener&&(G(this.Id,Oi,this.sn),Bt(ka,s=>{G(this.Id,s,this.Pd,{capture:!0})}))))}Ed(){x(this.Cd)||(x(this.Wd)||clearInterval(this.Wd),this.Md=Date.now(),this.Wd=setInterval(this.$d,this.Cd))}Ud(){var e,t;x(this.Wd)||(clearInterval(this.Wd),this.Wd=void 0,(e=this.Id)===null||e===void 0||(t=e.removeEventListener)===null||t===void 0||t.call(e,"visibilitychange",this.sn),Bt(ka,i=>{var s,n;(s=this.Id)===null||s===void 0||(n=s.removeEventListener)===null||n===void 0||n.call(s,i,this.Pd,{capture:!0})})),this.Cd=void 0,this.Td=void 0,this.Sd=!1,this.Md=void 0}destroy(){this.Vd()}dispose(){this.Vd()}Vd(){var e,t,i;this.Ud(),this.md++,this.bd=!1,this.qc=void 0,this.Gd(this.vd,"cancelled"),this.Gd(this.fd,"cancelled"),this.bo&&(this.Qd(),(e=this.Nd)===null||e===void 0||e.dispose(),this.Nd=void 0,(t=this.jd)===null||t===void 0||t.call(this),this.jd=void 0,this.dd=[],(i=this.Dd)===null||i===void 0||i.removeEventListener("online",this.rn),this.bo=void 0)}get Mr(){return this.wo.get()}Zd(e){var t;return this.Jd&&e in this.Jd?this.Jd[e]:(t=this.bo)===null||t===void 0?void 0:t.kv.get(e)}Bd(){return!!this.Jd&&(this.Jd=void 0,!0)}Kd(){var e;return!x((e=this.bo)===null||e===void 0?void 0:e.kv.get("$enabled_feature_flags"))&&this.Bd()}$t(e){this.Xd(()=>{var t;return(t=this.bo)===null||t===void 0?void 0:t.kv.set(e)})}Yd(e,t,i){if(!this.Ad||!e.$enabled_feature_flags)return;let s=this.Zd("$enabled_feature_flags")||{},n=e.$enabled_feature_flags||{},r=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(([,g])=>!(g!=null&&g.failed)).map(([g])=>g):[],a=!!t.errorsWhileComputingFlags&&!!t.flags,l=a?o:i&&!O(r)?Object.keys(r||{}):Array.from(new Set([...Object.keys(s),...Object.keys(n)])),c=this.Zd("$feature_flag_payloads")||{},u=e.$feature_flag_payloads||{},d=a||i?l:Array.from(new Set([...Object.keys(c),...Object.keys(u)])),h=!a&&!i,p=!!h||l,v=!!h||d,_={[tt]:p,[Ve]:p,[_t]:v};e.$feature_flag_details&&(_[It]=p);for(let g of[Ct,mt,xi])x(e[g])||(_[g]=!0);this.Ad.markCrossTabFeatureFlagChanges(_)}Pt(e){this.Xd(()=>{var t;return(t=this.bo)===null||t===void 0?void 0:t.kv.remove(e)})}Xd(e){try{e()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}zd(){let e={};for(let s of[tt,_t,Ct,Ze]){let n=this.Zd(s);x(n)||(e[s]=n)}this.ud=e;let t=f({},e),i=this.Zd(Ve);if(i)for(let[s,n]of Object.entries(i))t[`$feature/${s}`]=n;this.hd=t}qd(){let e=this.Mr.cacheTtlMs;if(!e||0>=e)return!1;let t=this.Zd(mt);return typeof t!="number"||Date.now()-t>e}tv(){return!!this.qd()&&(this.wd||this.gd||(this.wd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}ev(){let e=this.Mr.evaluationContexts;return e!=null&&e.length?e.filter(t=>{let i=t&&typeof t=="string"&&t.trim().length>0;return i||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),i}):[]}iv(){let e=this.Mr.flagKeys;if(!x(e))return e.filter(t=>{let i=t&&typeof t=="string"&&t.trim().length>0;return i||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),i})}initialize(){var e,t;let i=this.Mr,s=(e=(t=i.bootstrap)===null||t===void 0?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(s).length){var n,r;let o=(n=(r=i.bootstrap)===null||r===void 0?void 0:r.featureFlagPayloads)!==null&&n!==void 0?n:{},a=Object.keys(s).filter(c=>!x(s[c])).reduce((c,u)=>(c[u]=s[u],c),{}),l=Object.keys(o).filter(c=>a[c]).reduce((c,u)=>(c[u]=o[u],c),{});return this.nv({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(e,t,i){var s,n;let r=i!=null&&i.merge&&(s=this.Zd("$enabled_feature_flags"))!==null&&s!==void 0?s:{},o=i!=null&&i.merge&&(n=this.Zd("$feature_flag_payloads"))!==null&&n!==void 0?n:{},a=f(f({},r),e),l=f(f({},o),t),c={};for(let[u,d]of Object.entries(a))c[u]={key:u,enabled:go(d),variant:_o(d),reason:void 0,metadata:x(l==null?void 0:l[u])?void 0:{id:0,version:void 0,description:void 0,payload:l[u]}};this.nv({flags:c})}get hasLoadedFlags(){return this.pd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){let e=this.Zd(It),t=this.Zd(Ze),i=this.Zd(Mt);if(!i&&!t)return e||{};let s=Q({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(let a of n){var r,o;let l=s[a],c=t==null?void 0:t[a],u=x(c)?(r=l==null?void 0:l.enabled)!==null&&r!==void 0&&r:!!c,d=x(c)?l==null?void 0:l.variant:typeof c=="string"?c:void 0,h=i==null?void 0:i[a],p=f(f({},l),{},{enabled:u,variant:u?d!=null?d:l==null?void 0:l.variant:void 0});u!==(l==null?void 0:l.enabled)&&(p.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(p.original_variant=l==null?void 0:l.variant),h&&(p.metadata=f(f({},l==null?void 0:l.metadata),{},{payload:h,original_payload:l==null||(o=l.metadata)===null||o===void 0?void 0:o.payload})),s[a]=p}return this.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ld=!0),s}getAllFeatureFlags(){let e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{let s=e[i];return{key:i,enabled:go(s),variant:_o(s),payload:vo(t[i])}})}getFlagVariants(){let e=this.Zd(Ve),t=this.Zd(Ze);if(!t)return e||{};let i=Q({},e||{}),s=Object.keys(t);for(let n=0;s.length>n;n++)i[s[n]]=t[s[n]];return this.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ld=!0),i}getFlagPayloads(){let e=this.Zd(_t),t=this.Zd(Mt);if(!t)return e||{};let i=Q({},e||{}),s=Object.keys(t);for(let n=0;s.length>n;n++)i[s[n]]=t[s[n]];return this.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ld=!0),i}reloadFeatureFlags(){this.yd||this.Mr.featureFlagsDisabled||this.xd()||(this.gd&&(this.bd=!0),this.sv||(this.dd.slice().forEach(e=>{try{e()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.sv=setTimeout(()=>{this.rv()},5)))}reloadFeatureFlagsAsync(){return!this.bo||this.yd||this.Mr.featureFlagsDisabled||this.Mr.remoteRequestsDisabled||this.xd()?Promise.resolve({status:"skipped"}):new Promise(e=>{this.vd.add(e),this.reloadFeatureFlags()})}Gd(e,t){e.forEach(i=>i({status:t})),e.clear()}Qd(){clearTimeout(this.sv),this.sv=void 0}onReloading(e){return this.dd.push(e),()=>{this.dd=this.dd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.pd||this.gd||this.sv||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.yd=e}resetFlagCallReported(){this.Pt(gt)}rv(e){var t;this.Qd();let i=this.bo;if(!i||this.Mr.remoteRequestsDisabled||this.xd())return void this.Gd(this.vd,"skipped");if(this.gd)return void(this.bd=!0);let s={token:i.projectToken,distinct_id:i.distinctId,groups:i.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:f(f(f({},i.initialPersonProperties),this.Zd("$stored_person_properties")||{}),{},{$lib:i.library.name,$lib_version:i.library.version}),group_properties:this.Zd(ft),timezone:xc()};x(i.deviceId)||(s.$device_id=i.deviceId),(e!=null&&e.disableFlags||this.Mr.featureFlagsDisabled)&&(s.disable_flags=!0);let n=this.ev();n.length&&(s.evaluation_contexts=n);let r=this.iv();x(r)||(s.flag_keys=r);let o=this.Mr.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.md,c=this.vd;this.vd=new Set,this.fd=c,this.gd=!0;let u=()=>{this.bd&&(this.bd=!1,this.rv())},d=g=>{var y,m;let w=(y=g.json)!==null&&y!==void 0?y:{},M=g.statusCode!==200;if(this.gd=!1,l!==this.md)return void u();if(this.ov(g.statusCode),M||this.bd||(this.$anon_distinct_id=void 0),s.disable_flags&&!this.bd)return void this.Gd(c,"skipped");this._d=!M;let P=[];g.error?P.push(g.error instanceof Error&&g.error.name==="AbortError"?"timeout":g.error instanceof Error?Sa:"unknown_error"):g.statusCode!==200&&P.push(`api_error_${g.statusCode}`),w.errorsWhileComputingFlags&&P.push("errors_while_computing_flags");let k=!!(!((m=w.quotaLimited)===null||m===void 0)&&m.includes("feature_flags"));k&&P.push("quota_limited"),this.$t({[Ai]:P}),k?this.A.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."):s.disable_flags||this.nv(w,M,{partialResponse:o}),this.Gd(c,s.disable_flags?"skipped":P.length||!w.flags&&!w.featureFlags?"error":"loaded"),u()},h=g=>{this.gd=!1,l===this.md&&(this.$t({[Ai]:[Sa]}),this.A.error("Feature flag request failed",g),this.Kd()&&this.Hd(!0),this.Gd(c,"error")),u()},p=(t=this.Mr.requestMaxRetries)!==null&&t!==void 0?t:1,v=()=>p>0&&l===this.md,_=()=>{if(l!==this.md||!this.bo||this.Mr.remoteRequestsDisabled)return this.gd=!1,this.Gd(c,"skipped"),void u();try{i.sendRequest(a,{target:"flags",method:"POST",body:s,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(g=>{if((y=>If.includes(y.statusCode)||(m=>m.statusCode===0&&m.error instanceof Error&&m.error.name==="AbortError")(y))(g)&&v())return p--,void setTimeout(_,500);d(g)}).catch(h)}catch(g){h(g)}};_()}xd(){return Sc(this.kd,3)}ov(e){this.kd=Ec(e,this.kd,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t={}){var i;if(t.fresh&&!this._d)return;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+e+Sn);if(this.tv())return;let s=this.getFeatureFlagResult(e,t);return(i=s==null?void 0:s.variant)!==null&&i!==void 0?i:s==null?void 0:s.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){let t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t={}){if(t.fresh&&!this._d)return;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+e+Sn);if(this.tv())return;let i=this.getFlagVariants(),s=e in i,n=i[e],r=this.getFlagPayloads()[e],o=String(n),a=this.Zd("$feature_flag_request_id")||void 0,l=this.Zd("$feature_flag_evaluated_at")||void 0,c,u=this.Zd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){var d;let $=(d=this.bo)===null||d===void 0?void 0:d.session.sessionId,D=this.Zd(_i);$&&$!==D&&(u={},c=$)}if(!t.send_event&&"send_event"in t)c&&this.$t({[gt]:u,[_i]:c});else if(e in u&&u[e].includes(o))c&&this.$t({[gt]:u,[_i]:c});else{var h,p,v,_,g,y,m,w,M,P,k,I,S;O(u[e])?u[e].push(o):u[e]=[o],this.$t(f({[gt]:u},c?{[_i]:c}:{}));let $=this.getFeatureFlagDetails(e),D=[...(h=this.Zd("$feature_flag_errors"))!==null&&h!==void 0?h:[]];x(n)&&D.push("flag_missing");let R={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:r!=null?r:null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(p=(v=this.Mr.bootstrap)===null||v===void 0||(v=v.featureFlags)===null||v===void 0?void 0:v[e])!==null&&p!==void 0?p:null,$feature_flag_bootstrapped_payload:(_=(g=this.Mr.bootstrap)===null||g===void 0||(g=g.featureFlagPayloads)===null||g===void 0?void 0:g[e])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this._d};x($==null||(y=$.metadata)===null||y===void 0?void 0:y.has_experiment)||(R.$feature_flag_has_experiment=$.metadata.has_experiment),x($==null||(m=$.metadata)===null||m===void 0?void 0:m.version)||(R.$feature_flag_version=$.metadata.version);let N=(w=$==null||(M=$.reason)===null||M===void 0?void 0:M.description)!==null&&w!==void 0?w:$==null||(P=$.reason)===null||P===void 0?void 0:P.code;N&&(R.$feature_flag_reason=N),!($==null||(k=$.metadata)===null||k===void 0)&&k.id&&(R.$feature_flag_id=$.metadata.id),x($==null?void 0:$.original_variant)&&x($==null?void 0:$.original_enabled)||(R.$feature_flag_original_response=x($.original_variant)?$.original_enabled:$.original_variant),!($==null||(I=$.metadata)===null||I===void 0)&&I.original_payload&&(R.$feature_flag_original_payload=$==null||(S=$.metadata)===null||S===void 0?void 0:S.original_payload),D.length&&(R.$feature_flag_error=D.join(",")),this.av(R)}return s?{key:e,enabled:!!n,variant:typeof n=="string"?n:void 0,payload:vo(r)}:void 0}av(e){try{var t;(t=this.bo)===null||t===void 0||t.capture("$feature_flag_called",e)}catch(i){this.A.error("Failed to capture feature flag call",i)}}getRemoteConfigPayload(e,t){this.lv(e,t)}lv(e,t){var i=this;return ee(function*(){let s=i.bo;if(!s)return;let n={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},r=i.ev();r.length&&(n.evaluation_contexts=r);let o=i.iv(),a;x(o)||(n.flag_keys=o);try{var l;let c=(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Mr.compression,sentAt:"body",timeoutMs:i.Mr.requestTimeoutMs})).json)===null||l===void 0?void 0:l.featureFlagPayloads;a=(c==null?void 0:c[e])||void 0}catch(c){return void i.A.error("Remote config feature flag request failed",c)}try{t(a)}catch(c){i.A.error("Remote config feature flag callback failed",c)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this._d)return t.defaultValue;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+Sn),t.defaultValue;let i=this.getFeatureFlag(e,t);return x(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.nv(e,t,i)}nv(e,t,i){if(!this.bo)return;this.pd=!0;let s=((n,r={},o={},a={},l,c=xa)=>{let u=((w,M)=>{let P=w.flags;if(P){let k=Object.fromEntries(Object.keys(P).map(S=>{var $;return[S,($=P[S].variant)!==null&&$!==void 0?$:P[S].enabled]})),I=Object.fromEntries(Object.keys(P).filter(S=>P[S].enabled).filter(S=>{var $;return!x(($=P[S].metadata)===null||$===void 0?void 0:$.payload)}).map(S=>{var $;return[S,($=P[S].metadata)===null||$===void 0?void 0:$.payload]}));return f(f({},w),{},{featureFlags:k,featureFlagPayloads:I})}return w.featureFlags&&M.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),w})(n,c),d=u.flags,h=u.featureFlags,p=u.featureFlagPayloads;if(!h)return;let v=n.requestId,_=n.evaluatedAt;if(O(h)){c.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");let w={};if(h)for(let M=0;h.length>M;M++)w[h[M]]=!0;return{[tt]:h,[Ve]:w,[xi]:!1}}let g=h,y=p,m=d;if(l!=null&&l.partialResponse){let w=Object.keys(g),M=y||{};g=f(f({},r),g),y=f(f({},o),M),w.forEach(P=>{P in M||y==null||delete y[P]}),m=f(f({},a),m)}else if(n.errorsWhileComputingFlags)if(d){let w=new Set(Object.keys(d).filter(P=>{var k;return!(!((k=d[P])===null||k===void 0)&&k.failed)}));g=f(f({},r),Object.fromEntries(Object.entries(g).filter(([P])=>w.has(P))));let M=Object.fromEntries(Object.entries(y||{}).filter(([P])=>w.has(P)));y=f(f({},o),M),w.forEach(P=>{P in M||y==null||delete y[P]}),m=f(f({},a),Object.fromEntries(Object.entries(m||{}).filter(([P])=>w.has(P))))}else g=f(f({},r),g),y=f(f({},o),y),m=f(f({},a),m);return f(f({[tt]:Object.keys($a(g)),[Ve]:g||{},[_t]:y||{},[It]:m||{},[xi]:n.minimalFlagCalledEvents===!0},v?{[Ct]:v}:{}),_?{[mt]:_}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(s)if((i==null?void 0:i.persist)===!1){let n=!x(this.bo.kv.get(Ve));this.Jd=s,n||this.$t(s)}else this.Bd(),this.Yd(s,e,!!(i!=null&&i.partialResponse)),this.$t(s);else t&&this.Kd();t||(this.wd=!1),this.Hd(t)}override(e,t=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.uv(e)}uv(e){if(this.bo){if(e===!1)return this.Pt([Ze,Mt]),this.Hd(),void Et.info("All overrides cleared");if(O(e))return this.$t({[Ze]:Ea(e)}),this.Hd(),void Et.info("Flag overrides set",{flags:e});if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t;let i=e;this.ld=!!((t=i.suppressWarning)!==null&&t!==void 0&&t);let s={},n=i.flags,r=i.payloads;return n&&(s[Ze]=O(n)?Ea(n):n),r&&(s[Mt]=r),Object.keys(s).length&&this.$t(s),n===!1&&r===!1?this.Pt([Ze,Mt]):n===!1?this.Pt(Ze):r===!1&&this.Pt(Mt),this.Hd(),n===!1?Et.info("Flag overrides cleared"):n&&Et.info("Flag overrides set",{flags:n}),void(r===!1?Et.info("Payload overrides cleared"):r&&Et.info("Payload overrides set",{payloads:r}))}if(e&&typeof e=="object")return this.$t({[Ze]:e}),this.Hd(),void Et.info("Flag overrides set",{flags:e});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.pd){let{flags:t,flagVariants:i}=this.hv();try{e(t,i)}catch(s){this.A.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;let n=(this.Zd("$early_access_features")||[]).find(c=>c.flagKey===e),r={[`$feature_enrollment/${e}`]:t},o={$feature_flag:e,$feature_enrollment:t,$set:r};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i);let a=f(f({},this.getFlagVariants()),{},{[e]:t});(s=this.Ad)===null||s===void 0||s.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(r)}),this.$t({[tt]:Object.keys($a(a)),[Ve]:a,[vt]:f(f({},this.Zd("$stored_person_properties")||{}),r)}),this.Hd();try{var l;(l=this.bo)===null||l===void 0||l.capture("$feature_enrollment_update",o)}catch(c){this.A.error("Failed to capture early access feature enrollment",c)}}getEarlyAccessFeatures(e,t=!1,i){let s=this.Zd(Dn);!s||t?this.dv(e,i):e(s)}dv(e,t){var i=this;return ee(function*(){let s=i.bo;if(!s)return;let n=t?`&${t.map(o=>`stage=${o}`).join("&")}`:"",r;try{let o=yield s.sendRequest(`/api/early_access_features/?token=${s.projectToken}${n}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;r=o.json.earlyAccessFeatures,i.$t({[Dn]:r})}catch(o){return void i.A.error("Early access feature request failed",o)}try{e(r)}catch(o){i.A.error("Early access feature callback failed",o)}})()}hv(){let e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,s)=>(i[s]=t[s],i),{})}}Hd(e){this.zd();let{flags:t,flagVariants:i}=this.hv();this.featureFlagEventHandlers.forEach(s=>{try{s(t,i,{errorsLoading:e})}catch(n){this.A.error("Error while running feature flags callback",n)}})}setPersonPropertiesForFlags(e,t=!0){this.vv(e,t)}vv(e,t=!0){let i=this.Zd("$stored_person_properties")||{},s=(e==null?void 0:e.$set)||(e!=null&&e.$set_once?{}:e),n=e==null?void 0:e.$set_once,r={};if(n)for(let o in n)({}).hasOwnProperty.call(n,o)&&(o in i||(r[o]=n[o]));this.$t({[vt]:f(f(f({},i),r),s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){let i=f({},this.Zd("$stored_person_properties")||{});e.forEach(s=>{delete i[s]}),this.$t({[vt]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Pt(vt),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){let i=this.Zd("$stored_group_properties")||{},s=f({},i);for(let n of Object.keys(e))s[n]=f(f({},i[n]),e[n]);this.$t({[ft]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){let t=this.Zd("$stored_group_properties")||{};this.$t({[ft]:f(f({},t),{},{[e]:{}})})}else this.Pt(ft)}reset(){this.md++,this.Gd(this.vd,"cancelled"),this.Gd(this.fd,"cancelled"),this.bd=!1,this.ud={},this.hd={},this.Jd=void 0,this.pd=!1,this.yd=!1,this._d=!1,this.$anon_distinct_id=void 0,this.Qd(),this.ld=!1,this.kd=0}},Pa=re("[FeatureFlags]"),Ff=class{constructor(e,t=!1){this.fv=!1,this.update(e,t)}update(e,t){this.pv=((i,s)=>{var n,r,o,a,l,c,u,d;return{bootstrap:{featureFlags:(n=(r=i.bootstrap)===null||r===void 0?void 0:r.featureFlags)!==null&&n!==void 0?n:void 0,featureFlagPayloads:(o=(a=i.bootstrap)===null||a===void 0?void 0:a.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:s,featureFlagsDisabled:!!i.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!i.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!i.advanced_feature_flags_dedup_per_session,cacheTtlMs:i.feature_flag_cache_ttl_ms,refreshIntervalMs:(l=i.remote_config_refresh_interval_ms)!==null&&l!==void 0?l:3e5,idleRefreshBackoff:x(i.remote_config_refresh_interval_ms),requestTimeoutMs:i.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(c=i.feature_flag_request_max_retries)!==null&&c!==void 0?c:1),compression:i.disable_compression?void 0:"best-available",evaluationContexts:(u=(d=i.evaluation_contexts)!==null&&d!==void 0?d:i.evaluation_environments)!==null&&u!==void 0?u:[],flagKeys:O(i.flag_keys)?i.flag_keys:void 0}})(e,t),!e.evaluation_environments||e.evaluation_contexts||this.fv||(Pa.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.fv=!0),x(e.flag_keys)||O(e.flag_keys)||Pa.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.pv}},Ma=e=>ii(e)&&(e.name==="RangeError"&&e.message.indexOf("Maximum call stack size exceeded")===0||e.name==="InternalError"&&e.message==="too much recursion"),Ne=re("[Error tracking]"),ir="webkit-masked-url:",Af=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],Of=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",ir],Rf=["__firefox__","__gCrWeb"],Ta="Refusing to render web experiment since the viewer is a likely bot",Lf={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>$s(t,e),not_regex:(e,t)=>!$s(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},Le=re("[Conversations]"),$t="Conversations not available yet.";function Ia(e,t){var i,s,n,r,o,a,l;let c=(i=e==null?void 0:e.flushIntervalMs)!==null&&i!==void 0?i:3e3,u=(s=e==null?void 0:e.maxBufferSize)!==null&&s!==void 0?s:100,d=t!=null&&t.consoleCapture?void 0:(n=e==null?void 0:e.maxLogsPerInterval)!==null&&n!==void 0?n:1e3,h=x(d)?Math.max(u,2048):Math.max(u,d),p=f(f({},(function(){let v="",_="";try{let g=pe==null?void 0:pe.userAgent;g&&([v,_]=pl(g))}catch{}return(function(g,y){let m=(function(w){if(w)return{}.hasOwnProperty.call(ko,w)?ko[w]:w})(g);return f(f({},m?{"os.name":m}:{}),y?{"os.version":y}:{})})(v,_)})()),e==null?void 0:e.resourceAttributes);return{serviceName:(r=(o=p==null?void 0:p["service.name"])!==null&&o!==void 0?o:e==null?void 0:e.serviceName)!==null&&r!==void 0?r:t==null?void 0:t.serviceNameDefault,serviceVersion:(a=p==null?void 0:p["service.version"])!==null&&a!==void 0?a:e==null?void 0:e.serviceVersion,environment:(l=p==null?void 0:p["deployment.environment"])!==null&&l!==void 0?l:e==null?void 0:e.environment,resourceAttributes:p,beforeSend:e==null?void 0:e.beforeSend,flushIntervalMs:c,maxBufferSize:u,maxQueueSize:h,maxBatchRecordsPerPost:100,rateCapWindowMs:c,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Df=["debug","log","warn","error","info"],Nf=e=>{for(;e!=null&&e.__rrweb_original__;)e=e.__rrweb_original__;return e},Ca="console",ru="__posthogHandledLogsRequestError",En=(e,t)=>{let i=e instanceof Error?e:new Error(t);return i[ru]=!0,i},Fa=e=>!!e&&typeof e=="object"&&e[ru]===!0,Ps=re("[NetworkMetrics]"),Pr=()=>{var e;return!(b==null||(e=b.performance)===null||e===void 0)&&e.now?b.performance.now():Date.now()},jf={"http:":80,"https:":443},Vf=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),ou=(e,t)=>{var i;let s=String(t);return{method:String(e).toUpperCase(),url:((i=nt(s))===null||i===void 0?void 0:i.href)||s}},sr=(e,t,i,s,n,r,o=!1)=>{try{var a,l;let c=n();if(!c)return;let u=i||void 0,d=Pr()-s,h=nt(t.url);if(h&&h.protocol!=="http:"&&h.protocol!=="https:")return;let p={url:(h==null?void 0:h.href)||t.url,method:t.method},v=le(c.name)?c.name(p):V(c.name)?c.name:"http.client.request.duration";if(!v)return;let _=o&&!u?void 0:((y,m)=>y?400>y?void 0:String(y):(m==null?void 0:m.name)||"_OTHER")(u,r),g=f(f(f(f(f({},(y=>{let m=Vf.has(y)?y:"_OTHER";return f({"http.request.method":m},m==="_OTHER"&&y!==m?{"http.request.method_original":y}:{})})(p.method)),h?(y=>{return{"server.address":y.hostname.startsWith("[")&&y.hostname.endsWith("]")?y.hostname.slice(1,-1):y.hostname,"server.port":Number(y.port)||jf[y.protocol],"url.scheme":y.protocol.slice(0,-1),"url.template":(m=y.pathname,m.split("/").map(w=>(M=>/^\d+$/.test(M)||M.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(M))(w)?":id":w).join("/"))};var m})(h):{}),u?{"http.response.status_code":u}:{}),_?{"error.type":_}:{}),(a=c.attributes)===null||a===void 0?void 0:a.call(c,p,{status:u,durationMs:d}));(l=e.metrics)===null||l===void 0||l.histogram(v,d,{unit:"ms",attributes:g})}catch(c){Ps.error("Failed to record network metric",c)}},au=()=>{},Hf=(e,t)=>le(b==null?void 0:b.fetch)?ti(b,"fetch",i=>function(...s){let n=Pr(),r=i.apply(this,s);if(!t())return r;try{var o,a,l;let[c,u]=s,d=ou((o=(a=u==null?void 0:u.method)!==null&&a!==void 0?a:c==null?void 0:c.method)!==null&&o!==void 0?o:"GET",(l=c==null?void 0:c.url)!==null&&l!==void 0?l:c);return r.then(h=>(sr(e,d,h==null?void 0:h.status,n,t,void 0,!0),h),h=>{throw sr(e,d,void 0,n,t,h),h})}catch(c){return Ps.error("Failed to observe fetch",c),r}}):au,Wf=(e,t)=>{var i;let s=b==null||(i=b.XMLHttpRequest)===null||i===void 0?void 0:i.prototype;if(!s)return au;let n=new WeakMap,r=ti(s,"open",a=>function(...l){try{jc.has(this)||n.set(this,ou(l[0],l[1]))}catch(c){Ps.error("Failed to observe XHR open",c)}return a.apply(this,l)}),o=ti(s,"send",a=>function(...l){let c;try{let u=n.get(this);if(u&&t()){let d=Pr();c=()=>{this.removeEventListener("loadend",c),sr(e,u,this.status,d,t)},G(this,"loadend",c)}}catch(u){Ps.error("Failed to observe XHR send",u)}try{return a.apply(this,l)}catch(u){throw c&&this.removeEventListener("loadend",c),u}});return()=>{r(),o()}},Aa=new WeakMap,Bf={maxStringLength:2048,truncationSuffix:"..."};function Oa(e){if(e)return e===!0?{intent:!0,model:!0}:{intent:e.intent!==!1,model:e.model!==!1}}function ht(e,t){return{}.hasOwnProperty.call(e,t)}function $n(e,t){let i=Object.create(e);return t&&Object.defineProperty(i,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:t}),i}function Ra(e,t,i=!1){if(!V(e))return;let s=e.trim();return s?(i?xh(s,Bf):s).slice(0,t):void 0}function La(e){try{return j(e)&&e.isError===!0}catch{return!1}}var Cs={featureFlags:class extends Cf{constructor(e){let t=new Ff(e.config,e.il());super(t),this.name="featureFlags",this._instance=e,this.gv=t}get Ad(){return this._instance.persistence}updateConfig(e,t){this.gv.update(e,t),this.Fd()}}},Uf={sessionRecording:class{get Mr(){return this._instance.config}get Il(){return this._instance.persistence}get started(){var e;return!!(!((e=this.mv)===null||e===void 0)&&e.isStarted)}get status(){var e,t;return this.yv==="awaiting_config"||this.yv==="missing_config"?this.yv:(e=(t=this.mv)===null||t===void 0?void 0:t.status)!==null&&e!==void 0?e:this.yv}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.yv=wn,this.bv=void 0,this._v=!1,this.Je=(()=>{var t,i;if(!(E!=null&&E.visibilityState)||E.visibilityState==="visible")return!0;let s=b==null||(t=b.performance)===null||t===void 0||(i=t.getEntriesByType)===null||i===void 0?void 0:i.call(t,"visibility-state");return!(s!=null&&s.length)||s.some(n=>n.name==="visible")})(),this.sn=()=>{var t,i;(E==null?void 0:E.visibilityState)==="visible"&&(this.Je=!0,(t=this.mv)===null||t===void 0||(i=t.setDocumentWasEverVisible)===null||i===void 0||i.call(t,!0))},!this._instance.sessionManager)throw Ke.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Mr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');E!=null&&E.addEventListener&&G(E,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this._v=!0,E==null||(t=E.removeEventListener)===null||t===void 0||t.call(E,"visibilitychange",this.sn),e?this.wv(!0):this.stopRecording()}get Sv(){var e;let t=!!(!((e=this._instance.get_property("$session_recording_remote_config"))===null||e===void 0)&&e.enabled),i=!this.Mr.disable_session_recording,s=this.Mr.disable_session_recording||this._instance.consent.isOptedOut();return b&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(this._v||this.Sv&&(!((t=this.mv)===null||t===void 0)&&t.isStarted))return;let i=!x(Object.assign)&&!x(Array.from);this.Sv&&i?(this.xv(e),Ke.info("starting")):(this.yv=wn,this.stopRecording())}xv(e){var t,i;if(this.Sv)if(this.yv!=="awaiting_config"&&this.yv!=="missing_config"&&(this.yv=_a),(F==null||(t=F.__PosthogExtensions__)===null||t===void 0||(t=t.rrweb)===null||t===void 0?void 0:t.record)&&((i=F.__PosthogExtensions__)===null||i===void 0?void 0:i.initSessionRecording))this.$v(e);else{var s,n;let r=this._instance.sessionManager;(s=F.__PosthogExtensions__)===null||s===void 0||(n=s.loadExternalDependency)===null||n===void 0||n.call(s,this._instance,this.Cv,o=>{if(!this._v&&this.Sv&&this._instance.sessionManager===r)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),Ke.error("could not load recorder",o)):void this.$v(e);this.yv="disabled"})}}stopRecording(){var e,t;(e=this.bv)===null||e===void 0||e.call(this),this.bv=void 0,(t=this.mv)===null||t===void 0||t.stop()}wv(e=!1){var t,i;(t=this.bv)===null||t===void 0||t.call(this),this.bv=void 0,(i=this.mv)===null||i===void 0||i.discard({discardProducerEvents:e})}Tv(){var e,t;(e=this.Il)===null||e===void 0||e.unregister("$session_is_sampled"),(t=this.Il)===null||t===void 0||t.unregister("$replay_sample_rate")}Iv(e,t){if(L(e))return null;let i=oe(e)?e:parseFloat(e);return typeof(s=i)!="number"||!Number.isFinite(s)||0>s||s>1?(Ke.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):i;var s}Mv(e){if(this.Il){var t,i;let s=this.Il,n=()=>{var r;let o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.Iv((r=this.Mr.session_recording)===null||r===void 0?void 0:r.sampleRate,"session_recording.sampleRate"),l=this.Iv(o==null?void 0:o.sampleRate,"remote config sampleRate"),c=a!=null?a:l;L(c)&&this.Tv();let u=o==null?void 0:o.minimumDurationMilliseconds;s.register({[Si]:f(f({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:f({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:c,minimumDurationMilliseconds:x(u)?null:u,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};n(),(t=this.bv)===null||t===void 0||t.call(this),this.bv=(i=this._instance.sessionManager)===null||i===void 0?void 0:i.onSessionId(n)}}onRemoteConfig(e){let t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?t.sessionRecording===!1?(this.Mv(t),void this.wv()):(this.Mv(t),void this.startIfEnabledOrStop()):(this.yv==="awaiting_config"&&(this.yv="missing_config",this._instance.register_for_session({[gr]:!0}),Ke.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var i;!((i=this.mv)===null||i===void 0)&&i.log?this.mv.log(e,t):Ke.warn("log called before recorder was ready")}get Cv(){var e,t;let i=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.get_property(Si);return(i==null||(t=i.scriptConfig)===null||t===void 0?void 0:t.script)||"lazy-recorder"}Ev(){let e=this._instance.get_property(Si);if(!e)return!1;let t;try{t=typeof e=="object"?e:JSON.parse(e)}catch(i){return Ke.warn("persisted remote config for session recording is invalid and will be ignored",i),!1}return!L(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}$v(e){var t,i,s;if(!this._v&&this.Sv&&this._instance.sessionManager){if(!(!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.initSessionRecording))return Ke.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[vr]:!0});var n;if(this.mv||(this.mv=(n=F.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording(this._instance,this.Je),this.mv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ev())return this.yv==="missing_config"||this.yv==="awaiting_config"?void 0:(this.yv="awaiting_config",Ke.info("persisted remote config is stale, requesting fresh config before starting"),void new Oc(this._instance).load());this.yv=_a,(i=(s=this.mv).setDocumentWasEverVisible)===null||i===void 0||i.call(s,this.Je),this.mv.start(e)}else this.yv=wn}onRRwebEmit(e){var t,i;(t=this.mv)===null||t===void 0||(i=t.onRRwebEmit)===null||i===void 0||i.call(t,e)}overrideLinkedFlag(){var e,t;this.mv||(t=this.Il)===null||t===void 0||t.register({$replay_override_linked_flag:!0}),(e=this.mv)===null||e===void 0||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.mv||(t=this.Il)===null||t===void 0||t.register({$replay_override_sampling:!0}),(e=this.mv)===null||e===void 0||e.overrideSampling()}overrideTrigger(e){var t,i;this.mv||(i=this.Il)===null||i===void 0||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.mv)===null||t===void 0||t.overrideTrigger(e)}get sdkDebugProperties(){var e;let t={};for(let s of bf){var i;let n=(i=this._instance.sessionPersistence)===null||i===void 0?void 0:i.get_property(s);x(n)||(t[s]=n)}return f(f({},t),((e=this.mv)===null||e===void 0?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(e,t){var i;return!!(!((i=this.mv)===null||i===void 0)&&i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;(e=this.mv)===null||e===void 0||(t=e.flushBeforeIdentityReset)===null||t===void 0||t.call(e)}}},zf={autocapture:class extends vf{constructor(e){super(new gf(e)),this.instance=e}},historyAutocapture:class{constructor(e){this.Pv=!1,this._instance=e,this.Rv=this.Av()}initialize(){this.startIfEnabled()}get isEnabled(){let e=this.Fv();return!!(e.path||e.search||this.Ov(e))}startIfEnabled(){this.isEnabled&&(T.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Rv=this.Av(),this.startIfEnabled()}stop(){this.Dv&&this.Dv(),this.Dv=void 0,this.Lv&&this.Lv(),this.Lv=void 0,T.info("History API monitoring stopped")}monitorHistoryChanges(){b&&b.history&&(this.Nv("pushState"),this.Nv("replaceState"),this.qv(),this.Ov()&&this.jv())}Nv(e){var t;if(!b||!((t=b.history[e])===null||t===void 0)&&t.__posthog_wrapped__)return;let i=this;ti(b.history,e,s=>function(n,r,o){var a;i.Bv(o)&&i.zv(),s.call(this,n,r,o),i.Hv(e,!i.Pv&&(b==null||(a=b.event)===null||a===void 0?void 0:a.type)!=="popstate")})}Av(){let e=b==null?void 0:b.location;if(e!=null&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Fv(){let e=this._instance.config.capture_pageview;return e==="history_change"?{path:!0}:j(e)?e:{}}Ov(e=this.Fv()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}Uv(e){let t=this.Fv(),i=this.Rv;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.Ov(t)&&e.hash!==i.hash))}Hv(e,t=!1){try{t||this.zv();let i=this.Av();if(!i)return;if(this.Uv(i)){let s=()=>this._instance.capture(mr,{navigation_type:e});t?(this.Wv=s,Promise.resolve().then(()=>this.zv())):s()}this.Rv=i}catch(i){T.error(`Error capturing ${e} pageview`,i)}}Bv(e){var t,i;return!(L(e)||!b)&&((t=nt(String(e)))===null||t===void 0?void 0:t.href)!==((i=b.location)===null||i===void 0?void 0:i.href)}zv(){let e=this.Wv;if(e){this.Wv=void 0,this.Pv=!0;try{e()}catch(t){T.error("Error capturing deferred pageview",t)}finally{this.Pv=!1}this.Rv=this.Av()}}qv(){if(this.Dv)return;let e=()=>{this.Hv("popstate")};G(b,"popstate",e),this.Dv=()=>{b&&b.removeEventListener("popstate",e)}}jv(){if(this.Lv)return;let e=()=>{this.Hv("hashchange")};G(b,"hashchange",e),this.Lv=()=>{b&&b.removeEventListener("hashchange",e)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(e){var t;this.Vv=!1,this.ko=!1,this.Gv=null,this.instance=e,this.Vv=!!(!((t=this.instance.persistence)===null||t===void 0)&&t.props[jn]),this.rageclicks=new su(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return j(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Mr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return L(this.Mr.capture_heatmaps)?L(this.Mr.enable_heatmaps)?this.Vv:this.Mr.enable_heatmaps:this.Mr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ko)return;wf.info("starting..."),this.Qv(),this.sn()}else{var e;clearInterval((e=this.Gv)!==null&&e!==void 0?e:void 0),this.Zv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("heatmaps"in t))return;let i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[jn]:i}),this.Vv=i,this.startIfEnabled()}getAndClearBuffer(){let e=this.Rt;return this.Rt=void 0,e}Jv(e){xn(e.originalEvent)&&this.Ir(e.originalEvent,"deadclick")}sn(){this.Gv&&clearInterval(this.Gv),this.Gv=(E==null?void 0:E.visibilityState)==="visible"?setInterval(this.fl.bind(this),this.flushIntervalMilliseconds):null}Qv(){b&&E&&(this.Kv=this.fl.bind(this),G(b,ys,this.Kv),this.Xv=e=>this.Ir(e||(b==null?void 0:b.event)),G(E,"click",this.Xv,{capture:!0}),this.Yv=e=>this.tf(e||(b==null?void 0:b.event)),G(E,"mousemove",this.Yv,{capture:!0}),this.ef=new zo(this.instance,yp,this.Jv.bind(this)),this.ef.startIfEnabledOrStop(),this.if=this.sn.bind(this),G(E,Oi,this.if),this.ko=!0)}Zv(){var e;b&&E&&(this.Kv&&b.removeEventListener(ys,this.Kv),this.Xv&&E.removeEventListener("click",this.Xv,{capture:!0}),this.Yv&&E.removeEventListener("mousemove",this.Yv,{capture:!0}),this.if&&E.removeEventListener(Oi,this.if),clearTimeout(this.nf),(e=this.ef)===null||e===void 0||e.stop(),this.ko=!1)}sf(e,t){let i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),r=(function(o,a,l){let c=o;for(;c&&We(c)&&!_e(c,"body");){if(c===l)return!1;let p;try{var u,d,h;p=(u=(d=(h=c.ownerDocument)===null||h===void 0?void 0:h.defaultView)!==null&&d!==void 0?d:b)===null||u===void 0?void 0:u.getComputedStyle(c).position}catch{return!1}if(A(a,p))return!0;c=vc(c)}return!1})($i(e),["fixed","sticky"],n);return{x:e.clientX+(r?0:s),y:e.clientY+(r?0:i),target_fixed:r,type:t}}Ir(e,t="click"){var i;if(Oo(e.target)||!xn(e))return;let s=this.sf(e,t);!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&_c($i(e),this.instance.config.rageclick)&&this.Qs(f(f({},s),{},{type:"rageclick"})),this.Qs(s)}tf(e){!Oo(e.target)&&xn(e)&&(clearTimeout(this.nf),this.nf=setTimeout(()=>{this.Qs(this.sf(e,"mousemove"))},500))}Qs(e){if(!b)return;let t=this.Mr.disable_capture_url_hashes?yt(b.location.href):b.location.href,i=this.Mr.custom_personal_data_properties,s=this.Mr.mask_personal_data_properties?[...Qt,...i||[]]:[],n=Li(t,s,Di);this.Rt=this.Rt||{},this.Rt[n]||(this.Rt[n]=[]),this.Rt[n].push(e)}fl(){this.Rt&&!Me(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:zo,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.Vv=!1,this.ko=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rf=()=>{clearTimeout(this.af),this.af=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",f({$current_url:this.Rt.url},this.Rt.metrics.reduce((i,s)=>f(f({},i),{},{[`$web_vitals_${s.name}_event`]:f({},s),[`$web_vitals_${s.name}_value`]:s.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.lf=i=>{var s;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},L(i==null?void 0:i.name)||L(i==null?void 0:i.value))return void St.error("Invalid metric received",i);let n=typeof i.navigationURL=="string"?i.navigationURL:void 0,r=this.uf(n);if(x(r))return;let o=oe(i.navigationId)||typeof i.navigationId=="string"?`navigation:${i.navigationId}`:`url:${r}`;if(this.cf&&i.value>=this.cf)return void St.error("Ignoring metric with value >= "+this.cf,i);this.Rt.navigationKey!==o&&(this.rf(),this.af=setTimeout(this.rf,this.flushToCaptureTimeoutMs)),x(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=r),this.Rt.firstMetricTimestamp=x(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;let a=(s=this._instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0),l=f(f(f({},i),n?{navigationURL:r}:{}),{},{$current_url:r,timestamp:Date.now()});if(delete l.entries,j(i.attribution)&&this.attributionMetrics.indexOf(i.name)>-1){let c={};for(let u of yf){let d=u==="url"&&typeof i.attribution[u]=="string"?this.uf(i.attribution[u]):i.attribution[u];x(d)||(c[u]=d)}l.attribution=c}else delete l.attribution;x(a)||(l.$session_id=a.sessionId,l.$window_id=a.windowId),this.Rt.metrics.push(l),this.Rt.metrics.length===this.allowedMetrics.length&&this.rf()},this.hf=()=>{if(this.ko)return;let i,s,n,r,o=!1,a=F.__PosthogExtensions__,l=a==null?void 0:a.postHogWebVitalsCallbacksByFlavor,c=(l==null?void 0:l[this.df])||(this.df==="web-vitals"&&x(l)?a==null?void 0:a.postHogWebVitalsCallbacks:void 0);if(!x(c)){let h=c.withoutAttribution,p=this.attributionMetrics;o=!x(h),i=p.indexOf("LCP")>-1?c.onLCP:(h==null?void 0:h.onLCP)||c.onLCP,s=p.indexOf("CLS")>-1?c.onCLS:(h==null?void 0:h.onCLS)||c.onCLS,n=p.indexOf("FCP")>-1?c.onFCP:(h==null?void 0:h.onFCP)||c.onFCP,r=p.indexOf("INP")>-1?c.onINP:(h==null?void 0:h.onINP)||c.onINP}if(!(i&&s&&n&&r))return void St.error("web vitals callbacks not loaded - not starting");let u={reportSoftNavs:this.useSoftNavs},d=o&&this.attributionMetrics.indexOf("INP")>-1?f(f({},u),{},{includeProcessedEventEntries:!1}):u;this.allowedMetrics.indexOf("LCP")>-1&&i(this.lf.bind(this),u),this.allowedMetrics.indexOf("CLS")>-1&&s(this.lf.bind(this),u),this.allowedMetrics.indexOf("FCP")>-1&&n(this.lf.bind(this),u),this.allowedMetrics.indexOf("INP")>-1&&r(this.lf.bind(this),d),this.ko=!0},this.Vv=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[Wn]),this.startIfEnabled()}get vf(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;let i=j(this.vf)?(e=this.vf)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return L(i)?((t=this._instance.persistence)===null||t===void 0?void 0:t.props.$web_vitals_allowed_metrics)||ga:i}get flushToCaptureTimeoutMs(){return(j(this.vf)?this.vf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){let e=j(this.vf)?this.vf.web_vitals_attribution:void 0;return Se(e)?e?ga:[]:O(e)?e:mf}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){let e=j(this.vf)?this.vf.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get cf(){let e=j(this.vf)&&oe(this.vf.__web_vitals_max_value)?this.vf.__web_vitals_max_value:va;return e>0&&6e4>=e?va:e}get isEnabled(){let e=K==null?void 0:K.protocol;if(e!=="http:"&&e!=="https:")return St.info("Web Vitals are disabled on non-http/https protocols"),!1;let t=j(this.vf)?this.vf.web_vitals:Se(this.vf)?this.vf:void 0;return Se(t)?t:this.Vv}startIfEnabled(){this.isEnabled&&!this.ko&&(St.info("enabled, starting..."),this.zo(this.hf))}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("capturePerformance"in t))return;let i=j(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=j(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Wn]:i}),this._instance.persistence.register({[Bl]:s})),this.Vv=i,this.startIfEnabled()}get df(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}zo(e){var t;let i=F.__PosthogExtensions__,s=this.df,n=i==null?void 0:i.postHogWebVitalsCallbacksByFlavor;n!=null&&n[s]||s==="web-vitals"&&x(n)&&(i!=null&&i.postHogWebVitalsCallbacks)?e():i==null||(t=i.loadExternalDependency)===null||t===void 0||t.call(i,this._instance,s,r=>{r?St.error("failed to load script",r):e()})}uf(e){let t=e||(b==null?void 0:b.location.href);if(!t)return void St.error("Could not determine current URL");let i=this._instance.config.disable_capture_url_hashes?yt(t):t,s=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Qt,...s||[]]:[];return Li(i,n,Di)}}},Gf={exceptionObserver:class{constructor(e){var t;this.hf=()=>{var i;if(!b||!this.isEnabled||!(!((i=F.__PosthogExtensions__)===null||i===void 0)&&i.errorWrappingFunctions))return;let s=F.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=F.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=F.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ff&&this.Mr.capture_unhandled_errors&&(this.ff=s(this.captureException.bind(this))),!this.pf&&this.Mr.capture_unhandled_rejections&&(this.pf=n(this.captureException.bind(this))),!this.gf&&this.Mr.capture_console_errors&&(this.gf=r(this.captureException.bind(this)))}catch(o){gi.error("failed to start",o),this.mf()}},this._instance=e,this.yf=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[Vn]),this.wt=new dd(f(f({},(function(i={}){var s,n,r,o;return{refillRate:(s=(n=i.exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:i.__exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:1,bucketSize:(r=(o=i.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:i.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:gi})),this.Mr=this.bf(),this.startIfEnabledOrStop()}bf(){let e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return j(e)?t=f(f({},t),e):(x(e)?this.yf:e)&&(t=f(f({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(gi.info("enabled"),this.mf(),this.zo(this.hf)):this.mf()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.errorWrappingFunctions?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"exception-autocapture",n=>{if(n)return gi.error("failed to load script",n);e()})}mf(){var e,t,i;(e=this.ff)===null||e===void 0||e.call(this),this.ff=void 0,(t=this.pf)===null||t===void 0||t.call(this),this.pf=void 0,(i=this.gf)===null||i===void 0||i.call(this),this.gf=void 0}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"autocaptureExceptions"in t&&(this.yf=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Vn]:this.yf}),this.Mr=this.bf(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.bf()}captureException(e){try{var t,i,s;let n=(t=e==null||(i=e.$exception_list)===null||i===void 0||(i=i[0])===null||i===void 0?void 0:i.type)!==null&&t!==void 0?t:"Exception";if(this.wt.consumeRateLimit(n))return void gi.info("Skipping exception capture because of client rate limiting.",{exception:n});(s=this._instance.exceptions)===null||s===void 0||s.sendExceptionEvent(e)}catch{}}},exceptions:class{constructor(e){var t,i;this._f=[],this.wf=new kd([new Nd,new qd,new Vd,new jd,new zd,new Ud,new Wd,new Gd],(function(s,...n){return(r,o=0)=>{let a=[],l=r.split(`
3
- `),c=Math.min(l.length,o+1e3),u=[];for(let p=o;c>p;p++){let v=l[p];if(v.length>1024)continue;let _=fo.test(v)?v.replace(fo,"$1"):v;if(!_.match(/\S*Error: /)){for(let g of n){let y=g(_,s);if(y){a.push(y);let m=Od(a);if(m){for(let w=u.length-1;w>=0;w--){let M=u[w];if(m.start>=M.start+M.length)break;u.pop()}u.push(m)}break}}if(Ld(a,u)>=50)break}}let d=[...u].sort((p,v)=>v.start-p.start),h=d[d.length-1];if(h){let p=wl(a,h);a.splice(h.start-p,p);for(let v of d)v.start-=p}for(let p of d)Rd(a,p);return u.some(p=>p.start===0&&a.length===p.length)&&(function(p){let v=p.map(g=>`${g.function}|${g.filename}|${g.lineno}|${g.colno}|${g.module}`),_=0;for(let g=1;v.length>g;g++)Dd(v,g,_)&&(_=g);p.push(...p.splice(0,_))})(a),(function(p){if(!p.length)return[];let v=Array.from(p);return v.reverse(),v.slice(0,50).map(_=>{return f(f({},_),{},{filename:_.filename||(g=v,g[g.length-1]||{}).filename,function:_.function||"?"});var g})})(a)}})("web:javascript",Id,Ad)),this._instance=e,this._f=(t=(i=this._instance.persistence)===null||i===void 0?void 0:i.get_property("$error_tracking_suppression_rules"))!==null&&t!==void 0?t:[],this.kf=fs(this.Sf()),this.xf=new Yd(this.kf)}onConfigChange(){this.kf=fs(this.Sf()),this.xf.setConfig(this.kf)}onRemoteConfig(e){var t,i,s;if(!e.ok)return;let n=e.config;if(!("errorTracking"in n))return;let r=(t=(i=n.errorTracking)===null||i===void 0?void 0:i.suppressionRules)!==null&&t!==void 0?t:[],o=(s=n.errorTracking)===null||s===void 0?void 0:s.captureExtensionExceptions;this._f=r,this._instance.persistence&&this._instance.persistence.register({[Hl]:this._f,[Hn]:o})}get $f(){var e;let t=!!this._instance.get_property(Hn),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i!=null?i:t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.wf.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}addExceptionStep(e,t){if(this.kf.enabled)try{if(!V(e)||e.trim().length===0)return void Ne.warn("Ignoring exception step because message must be a non-empty string");let{sanitizedProperties:i,droppedKeys:s}=(function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};let r=[];return{sanitizedProperties:Object.keys(n).reduce((o,a)=>Zd.has(a)?(r.push(a),o):(o[a]=n[a],o),{}),droppedKeys:r}})(this.Cf(t));s.length>0&&Ne.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.xf.add(f({[hs]:e,[ps]:new Date().toISOString()},i))}catch(i){Ne.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(e){try{let t=e.$exception_list;if(this.Tf(t)){if(this.If(t))return this.Mf("Exception dropped: matched a suppression rule"),void Ne.info("Skipping exception capture because a suppression rule matched");if(!this.$f&&this.Ef(t))return this.Mf("Exception dropped: thrown by a browser extension"),void Ne.info("Skipping exception capture because it was thrown by an extension");if(!this.$f&&this.Pf(t))return this.Mf("Exception dropped: thrown by an injected browser script"),void Ne.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Rf(t))return this.Mf("Exception dropped: thrown by the PostHog SDK"),void Ne.info("Skipping exception capture because it was thrown by the PostHog SDK")}let i=this.kf.enabled&&L(e.$exception_steps)?this.Af(e):e,s=(function(){let n=globalThis._posthogReleaseId;return typeof n=="string"&&n.length>0?n:void 0})();s&&(i.$release_id=s);try{let n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",fc:!0});return n&&this.xf.clear(),n}catch(n){return Ma(n)||Ne.error("Failed to capture exception event. Dropping this exception.",n),void this.xf.clear()}}catch(t){return void(Ma(t)||Ne.error("Failed to process exception event. Ignoring this exception.",t))}}Af(e){try{let t=this.xf.getAttachable();return t.length===0?e:f(f({},e),{},{$exception_steps:t})}catch(t){return Ne.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Mf(e){this.kf.enabled&&this.xf.add({[hs]:e,[ps]:new Date().toISOString()})}Cf(e){return j(e)?f({},e):{}}Sf(){var e,t;return(e=(t=this._instance.config.error_tracking)===null||t===void 0?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}If(e){if(e.length===0)return!1;try{let t=e.reduce((i,{type:s,value:n})=>(V(s)&&s.length>0&&i.$exception_types.push(s),V(n)&&n.length>0&&i.$exception_values.push(n),i),{$exception_types:[],$exception_values:[]});return this._f.some(i=>{let s=i.values.map(n=>{let r=Qc[n.operator],o=t[n.key];if(!r||!o)return!1;let a=O(n.value)?n.value:[n.value];return a.length>0&&r(a,o)});return i.type==="OR"?s.some(Boolean):s.every(Boolean)})}catch(t){return Ne.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Ef(e){let t=e.flatMap(s=>{var n,r;return(n=(r=s.stacktrace)===null||r===void 0?void 0:r.frames)!==null&&n!==void 0?n:[]}),i=t.filter(({filename:s})=>!!s&&Of.some(n=>s.startsWith(n)));return i.length!==0&&(!i.every(({filename:s})=>!!s&&s.startsWith(ir))||e.some(({type:s,value:n})=>s==="NoResponse"||V(n)&&Af.some(({value:r,exact:o})=>o?n===r:n.includes(r)))&&!t.some(({in_app:s,filename:n})=>s&&!(n!=null&&n.startsWith(ir))))}Pf(e){return e.some(({value:t})=>V(t)&&Rf.some(i=>t.includes(i)))}Rf(e){if(e.length>0){var t,i,s,n;let r=(t=(i=e[0].stacktrace)===null||i===void 0?void 0:i.frames)!==null&&t!==void 0?t:[],o=r[r.length-1];return(s=o==null||(n=o.filename)===null||n===void 0?void 0:n.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Tf(e){return!L(e)&&O(e)}}},qf=f({productTours:class{get Il(){return this._instance.persistence}constructor(e){this.Ff=null,this.Of=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if("productTours"in t){var i,s;if(this.Il&&this.Il.register({[pr]:!!t.productTours}),!kn(this._instance))return!this.Ff&&L((i=this.Il)===null||i===void 0?void 0:i.props.ph_product_tours)||Qi.info("product tours disabled; stopping and clearing cached tours"),(s=this.Ff)===null||s===void 0||s.stop(),this.Ff=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Ff&&kn(this._instance)&&this.zo(()=>this.Df())}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"product-tours",n=>{n?Qi.error("Could not load product tours script",n):e()})}Df(){var e;!this.Ff&&(!((e=F.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours)&&(this.Ff=F.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(O(this.Of)&&!t)return void e(this.Of,{isLoaded:!0});let i=this.Il;if(i){let s=i.props[Bn];if(O(s)&&!t)return this.Of=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:s=>{if(!kn(this._instance))return void e([],{isLoaded:!0});let n=s.statusCode;if(n!==200||!s.json){let o=`Product Tours API could not be loaded, status: ${n}`;return n===0?s.error||Qi.warn(o):Qi.error(o),void e([],{isLoaded:!1,error:o})}let r=O(s.json.product_tours)?s.json.product_tours:[];this.Of=r,i&&i.register({[Bn]:r}),e(r,{isLoaded:!0})}})}getActiveProductTours(e){L(this.Ff)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ff.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ff)===null||t===void 0||t.showTourById(e)}previewTour(e){this.Ff?this.Ff.previewTour(e):this.zo(()=>{var t;this.Df(),(t=this.Ff)===null||t===void 0||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Ff)===null||e===void 0||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ff)===null||e===void 0||e.nextStep()}previousStep(){var e;(e=this.Ff)===null||e===void 0||e.previousStep()}clearCache(){var e;this.Of=null,(e=this.Il)===null||e===void 0||e.unregister("ph_product_tours")}resetTour(e){var t;(t=this.Ff)===null||t===void 0||t.resetTour(e)}resetAllTours(){var e;(e=this.Ff)===null||e===void 0||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ff)===null||t===void 0||t.cancelPendingTour(e)}}},Cs),Zf={siteApps:class{constructor(e){this._instance=e,this.Lf=0,this.Nf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qf(e,t){if(!t)return;let i=this.globalsForEvent(t);this.Nf.push(i),this.Nf.length>1e3&&(this.Nf=this.Nf.slice(10))}get siteAppLoaders(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.siteApps}initialize(){if(this.isEnabled){let e=this._instance._addCaptureHook(this.qf.bind(this));this.jf=()=>{e(),this.Nf=[],this.jf=void 0}}}globalsForEvent(e){var t,i,s,n,r,o,a;if(!e)throw new Error("Event payload is required");let l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(let[p,v]of Object.entries(u))l[p]={id:c[p],type:p,properties:v};let{$set_once:d,$set:h}=e;return{event:f(f({},El(e,xf)),{},{properties:f(f(f({},e.properties),h?{$set:f(f({},(t=(i=e.properties)===null||i===void 0?void 0:i.$set)!==null&&t!==void 0?t:{}),h)}:{}),d?{$set_once:f(f({},(s=(n=e.properties)===null||n===void 0?void 0:n.$set_once)!==null&&s!==void 0?s:{}),d)}:{}),elements_chain:(r=(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&r!==void 0?r:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Bf(e){var t;let i=(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase();return i==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(qe.error("prepare_external_dependency_stylesheet returned null"),null):i==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(qe.error("prepare_external_dependency_script returned null"),null):e}zf(){var e,t,i,s,n,r,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};let l=E==null?void 0:E.defaultView,c=l==null||(e=l.Node)===null||e===void 0?void 0:e.prototype;if(!l||!c)return()=>{};if(this.Lf++,this.Hf)return this.Uf();let u=[],d=this,h=new WeakSet,p=(g,y,m)=>{if(!(g!=null&&g[y]))return;let w=g[y];g[y]=m(w),u.push(()=>{g[y]=w})},v=g=>{if(h.has(g))return g;let y=d.Bf(g);return y&&h.add(y),y},_=g=>g.map(y=>typeof y=="string"?y:v(y)).filter(y=>!ne(y));return p(c,"appendChild",g=>function(y){let m=v(y);return m?g.call(this,m):y}),p(c,"insertBefore",g=>function(y,m){let w=v(y);return w?g.call(this,w,m):y}),p(c,"replaceChild",g=>function(y,m){let w=v(y);return w?g.call(this,w,m):m}),[(t=l.Element)===null||t===void 0?void 0:t.prototype,(i=l.Document)===null||i===void 0?void 0:i.prototype,(s=l.DocumentFragment)===null||s===void 0?void 0:s.prototype].forEach(g=>{p(g,"append",y=>function(...m){return y.apply(this,_(m))}),p(g,"prepend",y=>function(...m){return y.apply(this,_(m))})}),[(n=l.Element)===null||n===void 0?void 0:n.prototype,(r=l.CharacterData)===null||r===void 0?void 0:r.prototype,(o=l.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(g=>{p(g,"before",y=>function(...m){return y.apply(this,_(m))}),p(g,"after",y=>function(...m){return y.apply(this,_(m))}),p(g,"replaceWith",y=>function(...m){let w=_(m);return m.length&&!w.length?void 0:y.apply(this,w)})}),p((a=l.Element)===null||a===void 0?void 0:a.prototype,"insertAdjacentElement",g=>function(y,m){let w=v(m);return w?g.call(this,y,w):null}),this.Hf=()=>{u.forEach(g=>g()),this.Hf=void 0},this.Uf()}Uf(){let e=!1;return()=>{var t;e||(e=!0,this.Lf--,this.Lf===0&&((t=this.Hf)===null||t===void 0||t.call(this)))}}Wf(e,t=!0){let i=this.zf();try{let s=e(i);return t&&i(),s}catch(s){throw i(),s}}setupSiteApp(e){let t=this.apps[e.id],i=()=>{var r;!t.errored&&this.Nf.length&&(qe.info(`Processing ${this.Nf.length} events for site app with id ${e.id}`),this.Nf.forEach(o=>this.Wf(()=>{var a;return(a=t.processEvent)===null||a===void 0?void 0:a.call(t,o)})),t.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((r=this.jf)===null||r===void 0||r.call(this))},s=!1,n=r=>{t.errored=!r,t.loaded=!0,qe.info(`Site app with id ${e.id} ${r?"loaded":"errored"}`),s&&i()};try{let{processEvent:r}=this.Wf(o=>e.init({posthog:this._instance,callback(a){o(),n(a)}}),!1);r&&(t.processEvent=r),s=!0}catch(r){qe.error(ma+e.id,r),n(!1)}if(s&&t.loaded)try{i()}catch(r){qe.error(`Error while processing buffered events PostHog app with config id ${e.id}`,r),t.errored=!0}}Vf(){let e=this.siteAppLoaders||[];for(let t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(let t of e)this.setupSiteApp(t)}Gf(e){if(Object.keys(this.apps).length===0)return;let t=this.globalsForEvent(e);for(let i of Object.values(this.apps))try{this.Wf(()=>{var s;return(s=i.processEvent)===null||s===void 0?void 0:s.call(i,t)})}catch(s){qe.error(`Error while processing event ${e.event} for site app ${i.id}`,s)}}onRemoteConfig(e){var t,i,s;if(!((t=this.siteAppLoaders)===null||t===void 0)&&t.length)return this.isEnabled?(this.Vf(),void this._instance.on("eventCaptured",a=>this.Gf(a))):void qe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.jf)===null||i===void 0||i.call(this),!e.ok)return;let n=e.config;if(!((s=n.siteApps)===null||s===void 0)&&s.length)if(this.isEnabled)for(let{id:a,url:l}of n.siteApps){var r,o;F[`__$$ph_site_app_${a}`]=this._instance,(r=F.__PosthogExtensions__)===null||r===void 0||(o=r.loadSiteApp)===null||o===void 0||o.call(r,this._instance,l,c=>{if(c)return qe.error(ma+a,c)})}else qe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Yf={tracingHeaders:class{constructor(e){this._instance=e,this.Qf=void 0,this.Zf=void 0,this.Jf=void 0,this.hf=()=>{let t=this.Kf();var i,s;t?(x(this.Qf)&&(this.Qf=(i=F.__PosthogExtensions__)===null||i===void 0||(i=i.tracingHeadersPatchFns)===null||i===void 0?void 0:i._patchXHR(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),x(this.Zf)&&(this.Zf=(s=F.__PosthogExtensions__)===null||s===void 0||(s=s.tracingHeadersPatchFns)===null||s===void 0?void 0:s._patchFetch(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.mf()}}initialize(){this.startIfEnabledOrStop()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.tracingHeadersPatchFns?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"tracing-headers",n=>{if(n)return _f.error("failed to load script",n);e()})}Xf(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}Kf(){let e=this.Xf();return O(e)?(O(this.Jf)?this.Jf.splice(0,this.Jf.length,...e):this.Jf=[...e],e.length>0?this.Jf:void 0):(O(this.Jf)&&this.Jf.splice(0),this.Jf=e||void 0,this.Jf)}mf(){var e,t;(e=this.Qf)===null||e===void 0||e.call(this),(t=this.Zf)===null||t===void 0||t.call(this),this.Qf=void 0,this.Zf=void 0}startIfEnabledOrStop(){this.Kf()?this.zo(this.hf):this.mf()}}},Xf=f({surveys:class extends kf{constructor(e){var t;super(new Mf(e),(t=e,{get projectToken(){return t.config.token},kv:new Pf(t)})),this._instance=e}Gc(e,t){let i=t.query?ji(e,t.query):e;return new Promise(s=>{var n;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor((n=t.target)!==null&&n!==void 0?n:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:s})})}}},Cs),Jf={toolbar:class{constructor(e){this.instance=e}Yf(e){F.ph_toolbar_state=e}tp(){var e;return(e=F.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e=void 0,t=void 0,i=void 0){var s,n;if(zn(this.instance.config)||!b||!E)return!1;e=(s=e)!==null&&s!==void 0?s:b.location,i=(n=i)!==null&&n!==void 0?n:b.history;try{if(!t){try{b.localStorage.setItem("test","test"),b.localStorage.removeItem("test")}catch{return!1}t=b==null?void 0:b.localStorage}let r=Tf||ws(e.hash,"__posthog")||ws(e.hash,"state"),o,a=r?co(()=>JSON.parse(atob(decodeURIComponent(r))))||co(()=>JSON.parse(decodeURIComponent(r))):null;return a&&a.action==="ph_authorize"?(o=a,o.source="url",o&&Object.keys(o).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):(o=JSON.parse(t.getItem(ba)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}ep(e){let t=F.ph_load_toolbar||F.ph_load_editor;!L(t)&&le(t)?t(e,this.instance):wa.warn("No toolbar load function found")}loadToolbar(e){let t=!!(E!=null&&E.getElementById("__POSTHOG_TOOLBAR__"));if(!b||t)return!1;let i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=f(f({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(b.localStorage.setItem(ba,JSON.stringify(f(f({},s),{},{source:void 0}))),this.tp()===2)this.ep(s);else if(this.tp()===0){var n,r;this.Yf(1),(n=F.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"toolbar",o=>{if(o)return wa.error("[Toolbar] Failed to load",o),void this.Yf(0);this.Yf(2),this.ep(s)}),G(b,"turbolinks:load",()=>{this.Yf(0),this.loadToolbar(s)})}return!0}np(e){return this.loadToolbar(e)}maybeLoadEditor(e=void 0,t=void 0,i=void 0){return this.maybeLoadToolbar(e,t,i)}}},Kf=f({experiments:class we{get Mr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(i=!1)=>{this.getWebExperiments(s=>{we.sp("retrieved web experiments from the server"),this.rp=new Map,s.forEach(n=>{if(n.feature_flag_key){var r;this.rp&&(we.sp("setting flag key ",n.feature_flag_key," to web experiment ",n),(r=this.rp)===null||r===void 0||r.set(n.feature_flag_key,n));let o=this._instance.getFeatureFlag(n.feature_flag_key);V(o)&&n.variants[o]&&this.op(n.name,o,n.variants[o].transforms)}else if(n.variants)for(let o in n.variants){let a=n.variants[o];we.ap(a,this._instance)&&this.op(n.name,o,a.transforms)}})},i)},this._instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}initialize(){}onFeatureFlags(t){if(this._is_bot())we.sp(Ta);else if(!this.Mr.disable_web_experiments){if(L(this.rp))return this.rp=new Map,this.loadIfEnabled(),void this.previewWebExperiment();we.sp("applying feature flags",t),t.forEach(i=>{var s;if(this.rp&&(!((s=this.rp)===null||s===void 0)&&s.has(i))){var n;let r=this._instance.getFeatureFlag(i),o=(n=this.rp)===null||n===void 0?void 0:n.get(i);r&&(o!=null&&o.variants[r])&&this.op(o.name,r,o.variants[r].transforms)}})}}previewWebExperiment(){let t=we.getWindowLocation();if(t!=null&&t.search){let i=Kt(t==null?void 0:t.search,"__experiment_id"),s=Kt(t==null?void 0:t.search,"__experiment_variant");i&&s&&(we.sp(`previewing web experiments ${i} && ${s}`),this.getWebExperiments(n=>{this.lp(parseInt(i),s,n)},!1,!0))}}loadIfEnabled(){this.Mr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,i,s){if(this.Mr.disable_web_experiments&&!s)return t([]);let n=this._instance.get_property("$web_experiments");if(n&&!i)return t(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Mr.token}`),method:"GET",timestampMode:"query",callback:r=>t(r.statusCode===200&&r.json&&r.json.experiments||[])})}lp(t,i,s){let n=s.filter(r=>r.id===t);n&&n.length>0&&(we.sp(`Previewing web experiment [${n[0].name}] with variant [${i}]`),this.op(n[0].name,i,n[0].variants[i].transforms))}static ap(t,i){return!L(t.conditions)&&we.up(t,i)&&we.cp(t)}static up(t,i){var s;if(L(t.conditions)||L((s=t.conditions)===null||s===void 0?void 0:s.url))return!0;let n=we.getWindowLocation();if(n){var r,o,a;let l=hc(i,n.href);return!(!((r=t.conditions)===null||r===void 0)&&r.url)||Lf[(o=(a=t.conditions)===null||a===void 0?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l)}return!1}static getWindowLocation(){return b==null?void 0:b.location}static cp(t){var i;if(L(t.conditions)||L((i=t.conditions)===null||i===void 0?void 0:i.utm))return!0;let s=$c();if(s.utm_source){var n,r,o,a,l,c,u,d;let h=!(!((n=t.conditions)===null||n===void 0||(n=n.utm)===null||n===void 0)&&n.utm_campaign)||((r=t.conditions)===null||r===void 0||(r=r.utm)===null||r===void 0?void 0:r.utm_campaign)==s.utm_campaign,p=!(!((o=t.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((a=t.conditions)===null||a===void 0||(a=a.utm)===null||a===void 0?void 0:a.utm_source)==s.utm_source,v=!(!((l=t.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0)&&l.utm_medium)||((c=t.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0?void 0:c.utm_medium)==s.utm_medium,_=!(!((u=t.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_term)||((d=t.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_term)==s.utm_term;return h&&v&&_&&p}return!1}static sp(t,...i){T.info(`[WebExperiments] ${t}`,i)}op(t,i,s){this._is_bot()?we.sp(Ta):i!=="control"?s.forEach(n=>{if(n.selector){var r;we.sp(`applying transform of variant ${i} for experiment ${t} `,n);let o=(r=document)===null||r===void 0?void 0:r.querySelectorAll(n.selector);o==null||o.forEach(a=>{let l=a;n.html&&(l.innerHTML=n.html),n.css&&l.setAttribute("style",n.css)})}}):we.sp("Control variants leave the page unmodified.")}_is_bot(){return pe&&this._instance?Xc(pe,this.Mr.custom_blocked_useragents):void 0}}},Cs),Qf={conversations:class{constructor(e){this._instance=e,this.hp=void 0,this._conversationsManager=null,this.dp=!1,this.ne=null,this.vp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations||(this.fp=e.ok,!e.ok))return;let t=e.config.conversations;L(t)||(Se(t)?this.hp=t:(this.hp=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;(e=this._conversationsManager)===null||e===void 0||e.reset(),this._conversationsManager=null,this.hp=void 0,this.ne=null,this.fp=void 0,this.vp=!1}loadIfEnabled(){if(this._conversationsManager||this.dp||this._instance.config.disable_conversations||zn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;let e=F==null?void 0:F.__PosthogExtensions__;if(e&&!x(this.hp)&&this.hp)if(this.ne&&this.ne.token){this.dp=!0;try{let t=e.initConversations;if(t)return this.pp(t),void(this.dp=!1);let i=e.loadExternalDependency;if(!i)return void this.gp(_r);i(this._instance,"conversations",s=>{s||!e.initConversations?this.gp("Could not load conversations script",s):this.pp(e.initConversations),this.dp=!1})}catch(t){this.gp("Error initializing conversations",t),this.dp=!1}}else Le.error("Conversations enabled but missing token in remote config.")}pp(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.vp=!1,Le.info("Conversations loaded successfully")}catch(t){this.gp("Error completing conversations initialization",t)}else Le.error("Cannot complete initialization: remote config is null")}gp(e,t){Le.error(e,t),this._conversationsManager=null,this.dp=!1,this.vp=!0}show(){this._conversationsManager?this._conversationsManager.show():Le.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.hp===!0&&!ne(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":zn(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.fp===!1?"remote_config_failed":x(this.hp)?this.fp?"disabled_in_project":"remote_config_pending":this.hp?L(this.ne)||!this.ne.token?"missing_token":F!=null&&F.__PosthogExtensions__?this.dp?"initializing":this.vp?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,i){var s=this;return ee(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(Le.warn($t),null)})()}getMessages(e,t){var i=this;return ee(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(Le.warn($t),null)})()}markAsRead(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Le.warn($t),null)})()}getTickets(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Le.warn($t),null)})()}requestRestoreLink(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Le.warn($t),null)})()}restoreFromToken(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Le.warn($t),null)})()}restoreFromUrlToken(){var e=this;return ee(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Le.warn($t),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}xc(){var e;(e=this._conversationsManager)===null||e===void 0||e.setIdentity()}$c(){var e;(e=this._conversationsManager)===null||e===void 0||e.clearIdentity()}}},ev={logs:class{constructor(e){var t;this._instance=e,this.name="logs",this.mp=!1,this.yp=!1,this.bp=!1,this.A=re("[logs]"),this._p=f(f({},this.A),{},{error:(...i)=>{i.some(Fa)||this.A.error(...i)}}),this.ol=[],this.wp=[],this.kd=0,this.To=!1,this.kp=[],this.Sp=[],this.xp=!1,this.$p=!1,this.Cp=()=>{var i,s;this.To||(this.kd=0,(i=this.Tp)===null||i===void 0||i.onReconnect(),(s=this.Ip)===null||s===void 0||s.onReconnect())},this._instance&&(!((t=this._instance.config.logs)===null||t===void 0)&&t.captureConsoleLogs)&&(this.mp=!0),b&&G(b,"online",this.Cp)}Mp(e,t,i,s){var n;let r=Ia((n=this._instance)===null||n===void 0||(n=n.config)===null||n===void 0?void 0:n.logs,i);return[new Ch(this.Ep(e,t),r,this._p,()=>this.Pp(),o=>o(),void 0,s),r]}Rp(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var i;return this.Tp&&this.Ap===t||((i=this.Tp)===null||i===void 0||i.reset(),this.Ap=t,[this.Tp,this.Fp]=this.Mp(()=>this.ol,s=>{this.ol=s})),this.Tp}Op(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var i;return this.Ip&&this.Dp===t||((i=this.Ip)===null||i===void 0||i.reset(),this.Dp=t,[this.Ip,this.Lp]=this.Mp(()=>this.wp,s=>{this.wp=s},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Ca)),this.Ip}setup(e){var t;if(this.To)return;this.bo=e,!((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0||(t=t.logs)===null||t===void 0)&&t.captureConsoleLogs&&(this.mp=!0),(this.mp||this.Np()&&this.qp())&&this.jp();let i=!1,s=e.onRemoteConfig(n=>{var r;i=n.ok&&((r=n.config.logs)===null||r===void 0?void 0:r.captureConsoleLogs)===!0,this.onRemoteConfig(n)});this.To?s.dispose():(this.Eo=s,i||this.loadIfEnabled())}dispose(){var e,t,i,s;this.To||(this.To=!0,this.Bp(),(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.bo=void 0,this.bp=!1,b==null||b.removeEventListener("online",this.Cp),(t=this.zp)===null||t===void 0||t.call(this),this.zp=void 0,(i=this.Tp)===null||i===void 0||i.reset(),(s=this.Ip)===null||s===void 0||s.reset())}onRemoteConfig(e){var t,i;if(this.To)return;let s=e.ok?(t=e.config.logs)===null||t===void 0?void 0:t.captureConsoleLogs:void 0;L(s)?this.Hp():((i=this._instance)===null||i===void 0||(i=i.persistence)===null||i===void 0||i.register({$logs_capture_enabled_server_side:!!s}),s?(this.mp=!0,this.yp||this.jp(),this.loadIfEnabled()):this.Hp())}reset(){var e,t,i,s;this.Bp(),(e=this.Tp)===null||e===void 0||e.clearQueue(),this.ol=[],(t=this.Tp)===null||t===void 0||t.reset(),(i=this.Ip)===null||i===void 0||i.clearQueue(),this.wp=[],(s=this.Ip)===null||s===void 0||s.reset(),this.kd=0}captureLog(e){this.To||this.Rp().captureLog(e)}captureConsoleLog(e){this.To||this.Op().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.To||this.Op().captureLog(e,{context:t,occurredAtMs:i})}qp(){var e;return!!(!((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e[Wl])}Np(){var e,t,i;return!(!((e=this._instance)===null||e===void 0||(t=e.il)===null||t===void 0)&&t.call(e))||!!(!((i=F._POSTHOG_REMOTE_CONFIG)===null||i===void 0||(i=i[this._instance.config.token])===null||i===void 0)&&i.config)}Tc(){var e;this.Bp(),(e=this.Ip)===null||e===void 0||e.clearQueue(),this.wp=[]}Hp(){this.mp||this.Bp()}jp(){var e;if(this.xp||!(F!=null&&F.console))return;let t=Ia((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs).maxBufferSize,i=!0;this.Sp.push(()=>{i=!1});for(let s of Df){let n;try{n=Nf(F.console[s])}catch{continue}n&&this.Sp.push(ti(F.console,s,r=>{let o=(...a)=>{try{i&&this.Up(s,a,t)}catch{}return r.apply(F.console,a)};return o.__rrweb_original__=n,o}))}this.xp=!0,this.Wp=setTimeout(()=>{this.Bp()},3e4)}Up(e,t,i){var s;if(this.xp&&!this.$p&&t.length!==0)if(!((s=this._instance)===null||s===void 0)&&s.is_capturing()){if(i>this.kp.length){this.$p=!0;try{this.kp.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Pp()})}finally{this.$p=!1}}}else this.Bp()}Bp(){if(this.kp=[],this.xp){this.xp=!1,this.Wp&&(clearTimeout(this.Wp),this.Wp=void 0);for(let e of this.Sp)e();this.Sp=[]}}Vp(){let e=this.kp;return this.Bp(),e}get logger(){return this.Gp||(this.Gp={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Gp}flushLogs(e){e?this.Qp(e):(this.Tp&&this.Tp.flush().catch(t=>this.Zp(t)),this.Ip&&this.Ip.flush().catch(t=>this.Zp(t)))}Zp(e){Fa(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.To||!this.mp||this.yp||this.bp)return;let e=F==null?void 0:F.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.Bp();let t=e.loadExternalDependency;if(!t)return this.A.error(_r),void this.Bp();this.bp=!0;try{t(this._instance,"logs",i=>{if(this.bp=!1,this.To||!this.mp)return;let s=e.logs;if(i||!(s!=null&&s.initializeLogs))this.A.error("Could not load logs script",i),this.Bp();else{var n;let a=this.Vp();var r,o;this.zp=s.initializeLogs((n=this.bo)!==null&&n!==void 0?n:this._instance),this.yp=!0,a.length>0&&((r=s.replayConsoleBuffer)===null||r===void 0||r.call(s,(o=this.bo)!==null&&o!==void 0?o:this._instance,a))}})}catch(i){throw this.bp=!1,i}}Ep(e,t){let i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:s=>s===Ye.LogsQueue?e():void 0,setPersistedProperty(s,n){var r;s===Ye.LogsQueue&&t((r=n)!==null&&r!==void 0?r:[])},js:s=>this.js(s),getLibraryId:()=>ue.LIB_NAME,getLibraryVersion:()=>ue.LIB_VERSION}}js(e){return new Promise(t=>{if(Sc(this.kd,3))return void t({kind:"fatal",error:En(void 0,"logs endpoint is unreachable, dropping batch")});let i=!1,s=r=>{i||(i=!0,clearTimeout(n),t(r))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:En(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Jp(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:r=>{let o=r.statusCode;if(this.Kp(o),o>=200&&300>o)s({kind:"ok"});else if(o===413)s({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)s({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var a;o===0?(r.error||this.A.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:En(r.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:(a=r.error)!==null&&a!==void 0?a:new Error(`logs request failed with status ${o}`)})}}})})}Kp(e){(e!==0||this._instance.__loaded)&&(this.kd=Ec(e,this.kd,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Qp(e){this.ol.length>0&&this.Xp(e,this.ol,this.Fp,ue.LIB_NAME,t=>{this.ol=t}),this.wp.length>0&&this.Xp(e,this.wp,this.Lp,Ca,t=>{this.wp=t})}Xp(e,t,i,s,n){if(t.length===0)return;let r=t.map(a=>a.record);n([]);let o=Rl(r,Ol(i,ue.LIB_NAME,ue.LIB_VERSION),s,ue.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Jp(),data:o,compression:"best-available",batchKey:"logs",transport:e})}Jp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Pp(){var e;let t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){let{sessionId:i,windowId:s,sessionStartTimestamp:n,lastActivityTimestamp:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i,t.windowId=s,L(n)||(t.sessionStartTimestamp=n),L(r)||(t.lastActivityTimestamp=r)}if(!(F==null||(e=F.location)===null||e===void 0)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?yt(F.location.href):F.location.href),this._instance.featureFlags){let i=this._instance.featureFlags.getFlags();i&&i.length>0&&(t.activeFeatureFlags=i)}return t}}},tv={metrics:class{constructor(e){this._instance=e,this.A=re("[metrics]"),this.To=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.To)return;let t=!!(!((e=this._instance.config.metrics)===null||e===void 0)&&e.network);t&&!this.Yp?this.Yp=(i=>{let s=!0,n=()=>s?(a=>{var l;let c=(l=a.config.metrics)===null||l===void 0?void 0:l.network;return c===!0?{}:c||void 0})(i):void 0,r=Hf(i,n),o=Wf(i,n);return()=>{s=!1,r(),o()}})(this._instance):!t&&this.Yp&&(this.Yp(),this.Yp=void 0)}Rp(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.metrics;var i;return this.Tp&&this.Ap===t||((i=this.Tp)===null||i===void 0||i.reset(),this.Ap=t,this.Tp=new Fh(this.Ep(),(function(s){var n,r,o,a,l;let c=s==null?void 0:s.resourceAttributes;return{serviceName:(n=c==null?void 0:c["service.name"])!==null&&n!==void 0?n:s==null?void 0:s.serviceName,serviceVersion:(r=c==null?void 0:c["service.version"])!==null&&r!==void 0?r:s==null?void 0:s.serviceVersion,environment:(o=c==null?void 0:c["deployment.environment"])!==null&&o!==void 0?o:s==null?void 0:s.environment,resourceAttributes:c,beforeSend:s==null?void 0:s.beforeSend,flushIntervalMs:(a=s==null?void 0:s.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(l=s==null?void 0:s.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}})(t),this.A)),this.Tp}count(e,t=1,i){this.Rp().count(e,t,i)}gauge(e,t,i){this.Rp().gauge(e,t,i)}histogram(e,t,i){this.Rp().histogram(e,t,i)}flush(e){if(!this.Tp)return Promise.resolve();if(e){let t=this.Tp.drainWindow();return t&&this.Ys(t,e),Promise.resolve()}return this.Tp.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var e;(e=this.Tp)===null||e===void 0||e.reset()}dispose(){var e,t;this.To=!0,(e=this.Yp)===null||e===void 0||e.call(this),this.Yp=void 0,(t=this.Tp)===null||t===void 0||t.reset()}Ep(){let e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ys:i=>t.Ys(i),getLibraryId:()=>ue.LIB_NAME,getLibraryVersion:()=>ue.LIB_VERSION}}Ys(e,t){return new Promise(i=>{let s=!1,n=o=>{s||(s=!0,clearTimeout(r),i(o))},r=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(f(f({method:"POST",url:this.tg(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(o){let a=o.statusCode;if(a>=200&&300>a)n({kind:"ok"});else if(a===413)n({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)n({kind:"fatal",error:new Error(`metrics request failed with status ${a}`)});else{var l;n({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error(`metrics request failed with status ${a}`)})}}}))})}tg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},iv={webMCP:class{constructor(e){this._instance=e,this.eg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.eg)return;let e=E==null?void 0:E.modelContext;if(!e||!le(e.registerTool))return;let t=Aa.get(e);if(t)return t.instances.add(this._instance),void(this.eg=!0);let i={instances:new Set([this._instance])},s=e.registerTool,n=this;ti(e,"registerTool",r=>{let o=r;return function(a,...l){let c=a;try{c=n.ig(a,i)}catch{return o.call(this,a,...l)}return o.call(this,c,...l)}}),e.registerTool!==s&&(Aa.set(e,i),this.eg=!0)}ig(e,t){if(!e||!le(e.execute))return e;let i=e.execute,s=this,{tool:n,injected:r}=(function(o,a){let l={intent:!1,model:!1},c=o.inputSchema;if(c&&(ht(c,"$ref")||ht(c,"oneOf")||ht(c,"anyOf")||ht(c,"allOf")||c.additionalProperties===!0||j(c.additionalProperties)||c.type&&c.type!=="object"||c.properties&&!j(c.properties)||c.required&&!O(c.required))||!x(c)&&!j(c))return{tool:$n(o),injected:l};let u=(c==null?void 0:c.properties)||{};if(l.intent=a.intent&&!ht(u,"context"),l.model=a.model&&!ht(u,"llm_model"),!l.intent&&!l.model)return{tool:$n(o),injected:l};let d=f({},u),h=O(c==null?void 0:c.required)?[...c.required]:[];return l.intent&&(d.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},h.includes("context")||h.push("context")),l.model&&(d.llm_model={type:"string",description:'The exact model identifier you are running as, taken from your system prompt or environment. Pass "unknown" if you do not know it. Never guess.'},h.includes("llm_model")||h.push("llm_model")),{tool:$n(o,f(f({},c),{},{type:(c==null?void 0:c.type)||"object",properties:d,required:h})),injected:l}})(e,(function(o){let a={intent:!1,model:!1};for(let l of o.instances){let c=Oa(l.config.capture_webmcp);a.intent||(a.intent=(c==null?void 0:c.intent)===!0),a.model||(a.model=(c==null?void 0:c.model)===!0)}return a})(t));return Object.defineProperty(n,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){let a=new Date,l=(function(h,p){if(!j(h))return{};try{let v=p.intent?Ra(h.context,2048,!0):void 0,_=p.model?Ra(h.llm_model,256):void 0;return f(f({},v&&v!=="{}"?{intent:v}:{}),_&&_.toLowerCase()!=="unknown"?{model:_}:{})}catch{return{}}})(o[0],r),c=(function(h,p){let v=h[0];if(!j(v))return h;try{let _=p.intent&&ht(v,"context"),g=p.model&&ht(v,"llm_model");if(!_&&!g)return h;let y=f({},v);return _&&delete y.context,g&&delete y.llm_model,[y,...h.slice(1)]}catch{return h}})(o,r),u;try{u=i.apply(this===n?e:this,c)}catch(h){throw s.ng(t,n,a,!0,l),h}return(d=u)&&typeof d.then=="function"?Promise.resolve(u).then(h=>(s.ng(t,n,a,La(h),l),h),h=>{throw s.ng(t,n,a,!0,l),h}):(s.ng(t,n,a,La(u),l),u);var d}}),n}ng(e,t,i,s,n){let r=Date.now()-i.getTime();for(let o of e.instances){let a=Oa(o.config.capture_webmcp);if(a)try{o.capture("$mcp_tool_call",f(f({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:K==null?void 0:K.hostname,$mcp_duration_ms:r,$mcp_is_error:s},a.intent&&n.intent?{$mcp_intent:n.intent,$mcp_intent_source:"context_parameter"}:{}),a.model&&n.model?{$mcp_llm_model:n.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:i})}catch{continue}}}}};Ii.__defaultExtensionClasses=f({},f(f(f(f(f(f(f(f(f(f(f(f(f(f({},Cs),Uf),zf),Gf),qf),Zf),Xf),Yf),Jf),Kf),Qf),ev),tv),iv));var sv=(function(){ue.SDK_DIST_CHANNEL="npm";let e=Mi[yi]=new Ii;return(function(){function t(){t.done||(t.done=!0,Zc=!1,Z(Mi,function(i){i._dom_loaded()}))}E!=null&&E.addEventListener?E.readyState==="complete"?t():G(E,"DOMContentLoaded",t,{capture:!1}):b&&T.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),e})(),Ae=sv;var wu="5.3.0";function nv(e,t){for(let i=0,s=e.length;i<s;++i)if(e[i]===t)return!0;return!1}function rv(e,t){return!nv(e,t)}function Ar(e){return parseInt(e)}function Be(e){return parseFloat(e)}function rt(e,t){return typeof e=="number"&&isNaN(e)?t:e}function ve(e){return e.reduce((t,i)=>t+(i?1:0),0)}function xu(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{let i=1/t;return Math.round(e*i)/i}}function ov(e){var t,i;let s=`Unexpected syntax '${e}'`,n=/^\s*([a-z-]*)(.*)$/i.exec(e),r=n[1]||void 0,o={},a=/([.:#][\w-]+|\[.+?\])/gi,l=(c,u)=>{o[c]=o[c]||[],o[c].push(u)};for(;;){let c=a.exec(n[2]);if(!c)break;let u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":{let d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(d)l(d[1],(i=(t=d[4])!==null&&t!==void 0?t:d[5])!==null&&i!==void 0?i:"");else throw new Error(s);break}default:throw new Error(s)}}return[r,o]}function av(e){let t=new Uint8Array(e.length);for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(s>127)return new TextEncoder().encode(e);t[i]=s}return t}function lv(e){var t;return{name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
4
- `),...e}}function cv(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function ku(){let e=window,t=navigator;return ve(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function uv(){let e=window,t=navigator;return ve(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!ku()}function oi(){let e=window,t=navigator;return ve(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Ue(){let e=window,t=navigator;return ve(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function Or(){let e=window,{HTMLElement:t,Document:i}=e;return ve(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),i&&"pointerLockElement"in i.prototype])>=4}function Hi(){let e=window;return cv(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Wi(){var e,t;let i=window;return ve(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in i,"mozInnerScreenX"in i,"CSSMozDocumentRule"in i,"CanvasCaptureMediaStream"in i])>=4}function dv(){let e=window,t=navigator,{CSS:i}=e;return ve(["userActivation"in t,i.supports("color","light-dark(#000, #fff)"),i.supports("height","1lh"),"globalPrivacyControl"in t])>=3}function Su(){let{CSS:e}=window;return ve([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function hv(){let e=window;return ve([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,`${e.Intl}`=="[object Intl]",`${e.Reflect}`=="[object Reflect]"])>=3}function pv(){let e=window,{URLPattern:t}=e;return ve(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function fv(){let e=window,t=document,{CSS:i,Promise:s,AudioContext:n}=e;return ve([s&&"try"in s,"caretPositionFromPoint"in t,n&&"onerror"in n.prototype,i.supports("ruby-align","space-around")])>=3}function vv(){let e=window;return ve(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Bi(){let e=window,t=navigator,{CSS:i,HTMLButtonElement:s}=e;return ve([!("getStorageUpdates"in t),s&&"popover"in s.prototype,"CSSCounterStyleRule"in e,i.supports("font-size-adjust: ex-height 0.5"),i.supports("text-transform: full-width")])>=4}function gv(){if(navigator.platform==="iPad")return!0;let e=screen,t=e.width/e.height;return ve(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function _v(){let e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function mv(){let e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ls(){var e,t;let i=oi(),s=Wi(),n=window,r=navigator;return i?ve([bv(),"HTMLInputElement"in n&&"capture"in HTMLInputElement.prototype,"NetworkInformation"in n&&"ontypechange"in((t=(e=n.NetworkInformation)===null||e===void 0?void 0:e.prototype)!==null&&t!==void 0?t:{}),!("sinkId"in new Audio)])>=2:s?ve(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function yv(){let e=navigator,t=window,i=Audio.prototype,{visualViewport:s}=t;return ve(["srLatency"in i,"srChannelCount"in i,"devicePosture"in e,s&&"segments"in s,"getTextInformation"in Image.prototype])>=3}function bv(){var e,t;try{return!!(!((t=(e=window.Intl)===null||e===void 0?void 0:e.supportedValuesOf)===null||t===void 0)&&t.call(e,"collation").includes("dict"))}catch{return!1}}var wv="$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score";function xv(e){let t=kv(e),i=Sv(t);return{score:t,comment:wv.replace(/\$/g,`${i}`)}}function kv(e){if(Ls())return .4;if(Ue())return Or()&&!(Bi()&&Hi())?.5:.3;let t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Sv(e){return xu(.99+.01*e,1e-4)}function Rs(e,t){return new Promise(i=>setTimeout(i,e,t))}function Ev(){return new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function $v(e,t=1/0){let{requestIdleCallback:i}=window;return i?new Promise(s=>i.call(window,()=>s(),{timeout:t})):Rs(Math.min(e,t))}function Eu(e){return!!e&&typeof e.then=="function"}function lu(e,t){try{let i=e();Eu(i)?i.then(s=>t(!0,s),s=>t(!1,s)):t(!0,i)}catch(i){t(!1,i)}}async function cu(e,t,i=16){let s=Array(e.length),n=Date.now();for(let r=0;r<e.length;++r){s[r]=t(e[r],r);let o=Date.now();o>=n+i&&(n=o,await Ev())}return s}function Vi(e){return e.then(void 0,()=>{}),e}function Pv(e){return typeof e!="function"}function Mv(e,t){let i=Vi(new Promise(s=>{let n=Date.now();lu(e.bind(null,t),(...r)=>{let o=Date.now()-n;if(!r[0])return s(()=>({error:r[1],duration:o}));let a=r[1];if(Pv(a))return s(()=>({value:a,duration:o}));s(()=>new Promise(l=>{let c=Date.now();lu(a,(...u)=>{let d=o+Date.now()-c;if(!u[0])return l({error:u[1],duration:d});l({value:u[1],duration:d})})}))})}));return function(){return i.then(n=>n())}}function Tv(e,t,i,s){let n=Object.keys(e).filter(o=>rv(i,o)),r=Vi(cu(n,o=>Mv(e[o],t),s));return async function(){let a=await r,l=await cu(a,d=>Vi(d()),s),c=await Promise.all(l),u={};for(let d=0;d<n.length;++d)u[n[d]]=c[d];return u}}async function $u(e,t,i=50){var s,n,r;let o=document;for(;!o.body;)await Rs(i);let a=o.createElement("iframe");try{for(await new Promise((l,c)=>{let u=!1,d=()=>{u=!0,l()},h=_=>{u=!0,c(_)};a.onload=d,a.onerror=h;let{style:p}=a;p.setProperty("display","block","important"),p.position="absolute",p.top="0",p.left="0",p.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",o.body.appendChild(a);let v=()=>{var _,g;u||(((g=(_=a.contentWindow)===null||_===void 0?void 0:_.document)===null||g===void 0?void 0:g.readyState)==="complete"?d():setTimeout(v,10))};v()});!(!((n=(s=a.contentWindow)===null||s===void 0?void 0:s.document)===null||n===void 0)&&n.body);)await Rs(i);return await e(a,a.contentWindow)}finally{(r=a.parentNode)===null||r===void 0||r.removeChild(a)}}function Iv(e){let[t,i]=ov(e),s=document.createElement(t!=null?t:"div");for(let n of Object.keys(i)){let r=i[n].join(" ");n==="style"?Cv(s.style,r):s.setAttribute(n,r)}return s}function Cv(e,t){for(let i of t.split(";")){let s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);if(s){let[,n,r,,o]=s;e.setProperty(n,r,o||"")}}}function Fv(){let e=window;for(;;){let t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(i){if(i instanceof Error&&i.name==="SecurityError")return!0;throw i}e=t}}function Av(){let{ApplePaySession:e}=window;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(Ov())return-3;try{return e.canMakePayments()?1:0}catch(t){return Rv(t)}}var Ov=Fv;function Rv(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function Lv(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Dv(){return Vv()?-4:Nv()}function Nv(){let e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(jv())return-1;let i=4500,s=5e3,n=new t(1,s,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;let o=n.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,r.connect(o),o.connect(n.destination),r.start(0);let[a,l]=Hv(n),c=Vi(a.then(u=>Wv(u.getChannelData(0).subarray(i)),u=>{if(u.name==="timeout"||u.name==="suspended")return-3;throw u}));return()=>(l(),c)}function jv(){return Ue()&&!Or()&&!vv()}function Vv(){return Ue()&&Bi()&&Hi()||oi()&&yv()&&pv()}function Hv(e){let r=()=>{};return[new Promise((a,l)=>{let c=!1,u=0,d=0;e.oncomplete=v=>a(v.renderedBuffer);let h=()=>{setTimeout(()=>l(uu("timeout")),Math.min(500,d+5e3-Date.now()))},p=()=>{try{let v=e.startRendering();switch(Eu(v)&&Vi(v),e.state){case"running":d=Date.now(),c&&h();break;case"suspended":document.hidden||u++,c&&u>=3?l(uu("suspended")):setTimeout(p,500);break}}catch(v){l(v)}};p(),r=()=>{c||(c=!0,d>0&&h())}}),r]}function Wv(e){let t=0;for(let i=0;i<e.length;++i)t+=Math.abs(e[i]);return t}function uu(e){let t=new Error(e);return t.name=e,t}function Bv(){if(!(Ls()||Ue()))return-2;if(!window.AudioContext)return-1;let t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function Uv(){return zv(Kv())}function zv(e){let t=!1,i,s,[n,r]=Gv();return qv(n,r)?(t=Zv(r),e?i=s="skipped":[i,s]=Yv(n,r)):i=s="unsupported",{winding:t,geometry:i,text:s}}function Gv(){let e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function qv(e,t){return!!(t&&e.toDataURL)}function Zv(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function Yv(e,t){Xv(e,t);let i=Mr(e),s=Mr(e);return i!==s?["unstable","unstable"]:(Jv(e,t),[Mr(e),i])}function Xv(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';let i="Cwm fjordbank gly \u{1F603}";t.fillText(i,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(i,4,45)}function Jv(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(let[i,s,n]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=i,t.beginPath(),t.arc(s,n,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Mr(e){return e.toDataURL()}function Kv(){let e=Ue()&&Bi()&&Hi(),t=Wi()&&dv();return e||t}function Qv(){return window.screen.colorDepth}function eg(){for(let e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function tg(){if(si("no-preference"))return 0;if(si("high")||si("more"))return 1;if(si("low")||si("less"))return-1;if(si("forced"))return 10}function si(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function ig(){let e=document;try{e.cookie="cookietest=1; SameSite=Strict;";let t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function sg(){return navigator.cpuClass}function ng(){if(!window.Intl)return-1;let e=window.Intl.DateTimeFormat;if(!e)return-2;let t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}function rg(){return rt(Be(navigator.deviceMemory),void 0)}function og(){let e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}async function ag({debug:e}={}){if(!lg())return;let t=og(),i=Object.keys(t),s=[].concat(...i.map(o=>t[o])),n=await cg(s);e&&ug(t,n);let r=i.filter(o=>{let a=t[o];return ve(a.map(c=>n[c]))>a.length*.6});return r.sort(),r}function lg(){return Ue()||Ls()}async function cg(e){var t;let i=document,s=i.createElement("div"),n=new Array(e.length),r={};du(s);for(let o=0;o<e.length;++o){let a=Iv(e[o]);a.tagName==="DIALOG"&&a.show();let l=i.createElement("div");du(l),l.appendChild(a),s.appendChild(l),n[o]=a}for(;!i.body;)await Rs(50);i.body.appendChild(s);try{for(let o=0;o<e.length;++o)n[o].offsetParent||(r[e[o]]=!0)}finally{(t=s.parentNode)===null||t===void 0||t.removeChild(s)}return r}function du(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function ug(e,t){let i="DOM blockers debug:\n```";for(let s of Object.keys(e)){i+=`
1
+ (()=>{var b="u">typeof window?window:void 0,be="u">typeof globalThis?globalThis:b,pe=be==null?void 0:be.navigator,E=be==null?void 0:be.document,K=be==null?void 0:be.location,Ci=be==null?void 0:be.fetch,nr=be!=null&&be.XMLHttpRequest&&"withCredentials"in new be.XMLHttpRequest?be.XMLHttpRequest:void 0,to=be==null?void 0:be.AbortController,od=be==null?void 0:be.CompressionStream,xe=pe==null?void 0:pe.userAgent,li=typeof globalThis!="undefined"?globalThis:b;li&&typeof self=="undefined"&&(li.self=li),li&&typeof File=="undefined"&&(li.File=function(){});var F=b!=null?b:{},io="0.9.2",st={DEBUG:!1,LIB_VERSION:io,LIB_NAME:"browser-common",JS_SDK_VERSION:io},Ye=(function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({}),Pn=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),ad=["$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"],ld=["token"];function A(e,t){return e.indexOf(t)!==-1}var Zt=function(e){return e.trim()},Mn=function(e){return e.replace(/^\$/,"")};function Da(e){var t;let i=[];return(t=JSON.stringify(e,function(s,n){if(typeof n=="bigint")return n.toString();if(typeof n!="function"&&typeof n!="symbol"){if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n=="object"){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(n))return"[Circular]";i.push(n)}return n}}))!==null&&t!==void 0?t:"null"}var Na=Object.prototype,rr=Na.hasOwnProperty,Ms=Na.toString,O=Array.isArray||function(e){return Ms.call(e)==="[object Array]"},le=e=>typeof e=="function",j=e=>e===Object(e)&&!O(e),Me=e=>{if(j(e)){for(let t in e)if(rr.call(e,t))return!1;return!0}return!1},x=e=>e===void 0,V=e=>Ms.call(e)=="[object String]",bi=e=>V(e)&&e.trim().length===0,ne=e=>e===null,L=e=>x(e)||ne(e),oe=e=>Ms.call(e)=="[object Number]"&&e==e,Qe=e=>oe(e)&&e>0,Se=e=>Ms.call(e)==="[object Boolean]",cd=e=>A(ad,e),ud=e=>A(ld,e);function ja(e){return e===null||typeof e!="object"}function ls(e,t){return{}.toString.call(e)===`[object ${t}]`}function ii(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Va(e,Error)}}function or(e){return"u">typeof Event&&Va(e,Event)}function Va(e,t){try{return e instanceof t}catch{return!1}}var dd=[!0,"true",1,"1","yes"],Vs=e=>A(dd,e),hd=[!1,"false",0,"0","no"];function so(e,t,i,s,n,r,o){try{var a=e[r](o),l=a.value}catch(c){return void i(c)}a.done?t(l):Promise.resolve(l).then(s,n)}function ee(e){return function(){var t=this,i=arguments;return new Promise(function(s,n){var r=e.apply(t,i);function o(l){so(r,s,n,o,a,"next",l)}function a(l){so(r,s,n,o,a,"throw",l)}o(void 0)})}}var pd=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],zi=new Map,no=function(e,t=[]){if(!e)return!1;let i=(function(o,a){let l="";for(let c=0;a.length>c;c++){let u=a[c];l+=u.length+":"+u}return o.length+":"+o+"|"+a.length+":"+l})(e,t),s=zi.get(i);if(s!==void 0)return s;let n=e.toLowerCase(),r=pd.concat(t).some(o=>n.indexOf(o.toLowerCase())!==-1);return 256>zi.size||zi.clear(),zi.set(i,r),r};function Xe(e,t,i,s,n){return t>i&&(s.warn("min cannot be greater than max."),t=i),oe(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),Xe(n!=null?n:i,t,i,s))}var fd=class{constructor(e){this.C={},this.I=e.I,this.R=Xe(e.bucketSize,0,100,e.A),this.$=Xe(e.refillRate,0,this.R,e.A),this.O=Xe(e.refillInterval,0,864e5,e.A)}F(e,t){let i=Math.floor((t-e.lastAccess)/this.O);i>0&&(e.tokens=Math.min(e.tokens+i*this.$,this.R),e.lastAccess=e.lastAccess+i*this.O)}consumeRateLimit(e){var t;let i=Date.now(),s=String(e),n=this.C[s];return n?this.F(n,i):(n={tokens:this.R,lastAccess:i},this.C[s]=n),n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.I)===null||t===void 0||t.call(this,e)),n.tokens===0)}stop(){this.C={}}},Yt="Mobile",Fi="Android",cs="Tablet",Ha="Android Tablet",Ba="iPad",Wa="Apple Watch",es="Safari",Ts="BlackBerry",Ua="Samsung Internet",ts="Chrome",za="Chrome iOS",Ga="Internet Explorer",qa="Internet Explorer Mobile",Za="Opera",Ya="Microsoft Edge",is="Firefox",Xa="Firefox iOS",us="Nintendo",ds="PlayStation",Is="Xbox",Ja="Android Mobile",Ka="Mobile Safari",Hs="Windows",Qa="Windows Phone",ro="Nokia",Tn="Ouya",vd="Generic "+Yt.toLowerCase(),el="Generic "+cs.toLowerCase(),In="Konqueror",tl="Oculus Browser",il="Vivaldi",sl="Yandex",nl="Whale",rl="DuckDuckGo",ol="Pale Moon",al="Waterfox",Cn="Brave",ll="Claude",cl="Codex",ul="ChatGPT",dl="Google Search App",Bs=new RegExp("Version/(\\d+(\\.\\d+)?)"),Ws=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),gd=new RegExp(Is,"i"),_d=new RegExp("PlayStation \\w+","i"),md=new RegExp("Nintendo \\w+","i"),ar=new RegExp("BlackBerry|PlayBook|BB10","i"),yd={"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"},hl=function(e,t,i,s){return t=t||"",(function(r){return r!=null&&r.brave?Cn:null})(i)||(s!=null&&s.detectGoogleSearchApp&&A(e,"GSA/")?dl:A(e," OPR/")&&A(e,"Mini")?"Opera Mini":A(e," OPR/")?Za:ar.test(e)?Ts:A(e,"IEMobile")||A(e,"WPDesktop")?qa:A(e,"OculusBrowser")?tl:A(e,"SamsungBrowser")?Ua:A(e,"Edge")||A(e,"Edg/")?Ya:A(e,"Vivaldi/")?il:A(e,"YaBrowser/")?sl:A(e,"Whale/")?nl:A(e,"DuckDuckGo/")||A(e,"Ddg/")?rl:A(e,"Claude/")?ll:A(e,"Codex/")?cl:A(e,"ChatGPT/")?ul:A(e,"FBIOS")?"Facebook Mobile":A(e,"UCWEB")||A(e,"UCBrowser")?"UC Browser":A(e,"CriOS")?za:A(e,"CrMo")||A(e,ts)?ts:A(e,Fi)&&A(e,es)?Ja:A(e,"FxiOS")?Xa:A(e.toLowerCase(),In.toLowerCase())?In:A(e,"Brave/")?Cn:((r,o)=>o&&A(o,"Apple")||(function(a){return A(a,es)&&!A(a,ts)&&!A(a,Fi)})(r))(e,t)?A(e,Yt)?Ka:es:A(e,"PaleMoon/")?ol:A(e,"Waterfox/")?al:A(e,is)?is:A(e,"MSIE")||A(e,"Trident/")?Ga:A(e,"Gecko")?is:"")},bd={[qa]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[Ya]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ts]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[za]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[es]:[Bs],[Ka]:[Bs],[Za]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[is]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[Xa]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[In]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Ts]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Bs],[Ja]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[Ua]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[tl]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[il]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[sl]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[nl]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Cn]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[ll]:[Ws],[cl]:[Ws],[ul]:[Ws],[rl]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[ol]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[al]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[dl]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[Ga]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},wd=function(e,t,i,s){let n=hl(e,t,i,s),r=bd[n];if(x(r))return null;for(let o=0;r.length>o;o++){let a=e.match(r[o]);if(a)return parseFloat(a[a.length-2])}return null},oo=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[Is,e&&e[1]||""]],[new RegExp(us,"i"),[us,""]],[new RegExp(ds,"i"),[ds,""]],[ar,[Ts,""]],[new RegExp(Hs,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Qa,""];if(new RegExp(Yt).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];let i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){let s=yd[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[Hs,s]}return[Hs,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=x(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[Fi,[e[2],e[3],e[4]||"0"].join(".")]:[Fi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],pl=function(e){for(let t=0;oo.length>t;t++){let[i,s]=oo[t],n=i.exec(e),r=n&&(le(s)?s(n,e):s);if(r)return r}return["",""]},fl=function(e){return md.test(e)?us:_d.test(e)?ds:gd.test(e)?Is:new RegExp(Tn,"i").test(e)?Tn:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?Qa:/iPad/.test(e)?Ba:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Wa:ar.test(e)?Ts:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ro,"i").test(e)?ro:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Yt).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Fi:Ha:new RegExp("(pda|Mobile)","i").test(e)?vd:new RegExp(cs,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?el:""},xd=function(e,t){var i;let s=fl(e);return s===Ba||s===Ha||s==="Kobo"||s==="Kindle Fire"||s===el?cs:s===us||s===Is||s===ds||s===Tn?"Console":s===Wa?"Wearable":s?Yt:(t==null?void 0:t.userAgentDataPlatform)==="Android"&&((i=t==null?void 0:t.maxTouchPoints)!==null&&i!==void 0?i:0)>0?600>Math.min((n=t==null?void 0:t.screenWidth)!==null&&n!==void 0?n:0,(r=t==null?void 0:t.screenHeight)!==null&&r!==void 0?r:0)/((o=t==null?void 0:t.devicePixelRatio)!==null&&o!==void 0?o:1)?Yt:cs:"Desktop";var n,r,o},Us=/\bFBAV\/(\d+(?:\.\d+)*)/i,ao=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Us],[/\bFBAN\/EMA\b/i,"Facebook Lite",Us],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Us],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Fn="[Truncated]",Ni="[Unserializable]";function zt(e){let t="";for(let i=0;e.length>i;i++){let s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"\uFFFD";else{let n=e.charCodeAt(i+1);56320>n||n>57343?t+="\uFFFD":(t+=e[i]+e[i+1],i++)}}return t}function vl(e,t){if(!t)return e;let i=[];try{i=Object.keys(t)}catch{i=[]}for(let s of i){let n;try{n=t[s]}catch{n=Ni}Object.defineProperty(e,s,{value:n,enumerable:!0,writable:!0,configurable:!0})}return e}var ss=3e5,gl=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;let t=this.isOpen(),i=Date.now(),s=Math.min(e.retryAfterMs,ss);if(!t)return this.ts=i,void(this.es=i+s);this.es=Math.max(this.es,Math.min(i+s,this.ts+ss))}remainingMs(){let e=Date.now();if(this.ts-5e3>e)return this.reset(),0;let t=Math.min(ss,Math.max(0,this.es-e));return t===0&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}},kd=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function lo(e,t){return typeof(i=e)=="string"&&kd.test(i)?e:t();var i}function _l(e,t){let i=new Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}return i}function yt(e){return e&&e.split("#")[0]}function co(e){try{return e()}catch{return}}function ml(e,t){let i=setTimeout(e,t);return i!=null&&i.unref&&(i==null||i.unref()),i}function uo(e,t,i){return yl.apply(this,arguments)}function yl(){return(yl=ee(function*(e,t,i){let s;try{return yield Promise.race([e,new Promise((n,r)=>{s=ml(()=>{try{i==null||i(),n()}catch(o){r(o)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var Gi,ho,zs;function Sd(e){let t=globalThis._posthogChunkIds;if(!t)return;let i=Object.keys(t);return zs&&i.length===ho||(ho=i.length,zs=i.reduce((s,n)=>{Gi||(Gi={});let r=Gi[n];if(r)s[r[0]]=r[1];else{let o=e(n);for(let a=o.length-1;a>=0;a--){let l=o[a],c=l==null?void 0:l.filename,u=t[n];if(c&&u){s[c]=u,Gi[n]=[c,u];break}}}return s},{})),zs}function wi(e){return wi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wi(e)}function Ed(e,t,i){return(t=(function(s){var n=(function(r){if(wi(r)!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var a=o.call(r,"string");if(wi(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)})(s);return wi(n)=="symbol"?n:n+""})(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function po(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,s)}return i}function f(e){for(var t=1;arguments.length>t;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?po(Object(i),!0).forEach(function(s){Ed(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):po(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}var $d=class{constructor(e,t,i=[]){this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t={}){let i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(t),r=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(r,i),$exception_level:"error"}}modifyFrames(e){var t=this;return ee(function*(){for(let i of e)i.stacktrace&&i.stacktrace.frames&&O(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)===null||t===void 0?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i;let s,n;if(e.cause!=null&&(s=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null)try{n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch{}return f(f({},e),{},{cause:s,stack:n,errors:(i=e.errors)===null||i===void 0?void 0:i.map(r=>this.parseStacktrace(r,t))})}applyChunkIds(e,t){return e.map(i=>(i.filename&&t&&(i.chunk_id=t[i.filename]),i))}applyCoercers(e,t){for(let i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return ee(function*(){let i=e;for(let s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){let i=[],s=(n,r,o)=>{var a;let l=i.length,c=r===void 0?f(f({type:typeof t.type=="string"&&t.type.length>0?t.type:"generic"},typeof t.handled=="boolean"?{handled:t.handled}:t.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof t.synthetic=="boolean"?t.synthetic:n.synthetic,exception_id:l}):{type:"chained",source:o,synthetic:n.synthetic,exception_id:l,parent_id:r},u={type:n.type,value:n.value,mechanism:c};n.stack&&(u.stacktrace={type:"raw",frames:n.stack}),i.push(u),n.cause&&s(n.cause,l,"cause");for(let d of(a=n.errors)!==null&&a!==void 0?a:[])s(d,l,"member")};return s(e),i}buildParsingContext(e){var t;return{chunkIdMap:Sd(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}getAggregateErrors(e){try{if(ii(e)){let i=Object.getPrototypeOf(e);for(let s=0;i&&100>s;s++){var t;let n=(t=Object.getOwnPropertyDescriptor(i,"constructor"))===null||t===void 0?void 0:t.value;if(typeof n=="function"&&n.name==="AggregateError"){let r=e.errors;return O(r)?r:void 0}i=Object.getPrototypeOf(i)}}}catch{}}buildCoercingContext(e,t,i=0){let s=0,n=0,r=!1,o=new Set,a=[],l={},c=(h,p,v=0)=>{let _=u(p,v),g=_.apply;if(_.apply=k=>{a.push(h);try{return g(k)}finally{a.pop()}},v>4||v>0&&a.indexOf(h)!==-1)return this.coerceFallback(_);let y=typeof h=="object"&&h!==null||typeof h=="function";if(v===0&&s>=50||y&&o.has(h))return;y&&o.add(h),v===0&&s++;let m=this.getAggregateErrors(h),w,M;r||(r=!!m);try{if(w=this.applyCoercers(h,_),!w)throw l}catch(k){if(k===l)return void(v===0&&s--);if(!r)throw k;w=this.coerceFallback(_)}if(!m||s>=50)return w;try{M=m.length}catch{return w}if(!Number.isInteger(M)||0>M||M>4294967295)return w;let P=[];for(let k=0;50>s&&1e3>n&&M>k;k++){let I;n++;try{I=_.next(m[k])}catch{s++,I=this.coerceFallback(u(p+1))}I&&P.push(I)}return f(f({},w),{},{errors:P})},u=(h,p=0)=>f(f({},t),{},{syntheticException:h==0?t.syntheticException:void 0,mechanism:h==0?e:{},apply(v){let _=c(v,h,p+1);if(!_)throw l;return _},next:v=>c(v,h+1)}),d=u(i);return f(f({},d),{},{apply:h=>{var p;return(p=c(h,i))!==null&&p!==void 0?p:this.coerceFallback(d)}})}},Pd=/^([a-z][a-z0-9.+-]+):/i,Md=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Td(e){if(!e||e==="<anonymous>")return!1;let t=Pd.exec(e);return!t||Md.includes(t[1].toLowerCase())}function An(e,t,i,s,n){let r={platform:e,filename:t,function:i==="<anonymous>"?"?":i,in_app:Td(t)};return x(s)||(r.lineno=s),x(n)||(r.colno=n),r}var bl=(e,t)=>{let i=e.indexOf("safari-extension")!==-1,s=e.indexOf("safari-web-extension")!==-1;return i||s?[e.indexOf("@")!==-1?e.split("@")[0]:"?",i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Id=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Cd=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Fd=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ad=(e,t)=>{let i=Id.exec(e);if(i){let[,n,r,o]=i;return An(t,n,"?",+r,+o)}let s=Cd.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){let o=Fd.exec(s[2]);o&&(s[2]=o[1],s[3]=o[2],s[4]=o[3])}let[n,r]=bl(s[1]||"?",s[2]);return An(t,r,n,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Od=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ld=(e,t)=>{let i=Od.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){let r=Rd.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}let s=i[3],n=i[1]||"?";return[n,s]=bl(n,s),An(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},fo=/\(error: (.*)\)/;function lr(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function Dd(e){for(let t=1;10>=t;t++){let i=e.length-2*t;if(0>i)break;let s=!0;for(let n=0;t>n;n++)if(!lr(e[i+n],e[i+t+n])){s=!1;break}if(s){for(let n=0;t>n;n++)e[i+n]=e[i+t+n];return e.length=i+t,{start:i,length:t}}}}function Nd(e,t){let i=t.start+t.length,s=xl(e,t);s&&e.splice(i+s===e.length?i:t.start,s)}function wl(e,t){let i=t.start;for(;i>0&&lr(e[i-1],e[i-1+t.length]);)i--;return t.start-i}function xl(e,t){let i=t.start+t.length,s=i;for(;e.length>s&&lr(e[s],e[s-t.length]);)s++;return s-i}function jd(e,t){let i=t[0],s=e.length-(i?wl(e,i):0);for(let n of t)s-=xl(e,n);return s}function Vd(e,t,i){for(let s=0;e.length>s;s++){let n=e[(t+s)%e.length],r=e[(i+s)%e.length];if(n!==r)return r>n}return!1}var Hd=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let i=V(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return ls(e,"DOMException")}isDOMError(e){return ls(e,"DOMError")}},Bd=class{match(e){return ii(e)}coerce(e,t){var i;let s=this.getStack(e),n=s===void 0?(i=t.syntheticException)===null||i===void 0?void 0:i.stack:void 0,r=!!n;return{type:this.getType(e),value:this.getMessage(e,t),stack:s!=null?s:n,cause:e.cause?t.next(e.cause):void 0,synthetic:r}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let i=e.message;return String(i.error&&typeof i.error.message=="string"?i.error.message:i)}getStack(e){try{let t=e.stacktrace;if(typeof t=="string"&&t.length>0)return t;let i=e.stack;return typeof i=="string"&&i.length>0?i:void 0}catch{return}}},Wd=class{match(e){return!!ls(e,"ErrorEvent")&&(e.error!=null||this.ar(e))}coerce(e,t){var i;if(e.error!=null)return t.apply(e.error);let s=t.apply(e.message);return f(f({},s),{},{stack:(i=this.lr(e))!==null&&i!==void 0?i:s.stack,synthetic:!0})}ar(e){return V(e.message)&&e.message.length>0}lr(e){var t,i;let s=e,n=(t=s.lineno)!==null&&t!==void 0?t:0,r=(i=s.colno)!==null&&i!==void 0?i:0;if(V(s.filename)&&s.filename.length!==0&&n!==0)return`Error
2
+ at ${s.filename}:${n}:${r}`}},Ud=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,zd=class{match(e){return typeof e=="string"}coerce(e,t){var i;let[s,n]=this.getInfos(e);return{type:s!=null?s:"Error",value:n!=null?n:e,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}getInfos(e){let t="Error",i=e,s=e.match(Ud);return s&&(t=s[1],i=s[2]),[t,i]}},Gd=["fatal","error","warning","log","info","debug"];function kl(e,t=40){let i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(let s=i.length;s>0;s--){let n=i.slice(0,s).join(", ");if(t>=n.length)return s===i.length?n:n.length>t?`${n.slice(0,t)}...`:n}return""}var qd=class{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var i,s;let n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(i=this.getStack(e))!==null&&i!==void 0?i:(s=t.syntheticException)===null||s===void 0?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(or(e))return e.constructor.name;let t="name"in e?e.name:void 0;return V(t)&&!bi(t)?t:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let i=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(i+=` with message: '${e.message}'`),i}if("message"in e&&typeof e.message=="string")return e.message;let t=this.getObjectClassName(e);return`${t&&t!=="Object"?`'${t}'`:"Object"} captured as exception with keys: ${kl(e)}`}isSeverityLevel(e){return V(e)&&!bi(e)&&Gd.indexOf(e)>=0}getStack(e){try{return V(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:V(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(let t in e)if({}.hasOwnProperty.call(e,t)){let i=e[t];if(ii(i))return i}}getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Zd=class{match(e){return or(e)}coerce(e,t){var i;let s=e.constructor.name;return{type:s,value:`${s} captured as exception with keys: ${kl(e)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}},Yd=class{match(e){return ja(e)}coerce(e,t){var i;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}},Xd=class{match(e){return ls(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!or(e))return!1;try{let t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var i;let s=this.getUnhandledRejectionReason(e);return ja(s)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`,stack:(i=t.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}:t.apply(s)}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}},hs="$message",ps="$timestamp",Jd=new Set([hs,ps]),Gs={enabled:!0,max_bytes:32768};function fs(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:Gs.enabled,max_bytes:Qd(e.max_bytes,Gs.max_bytes)}:f({},Gs)}var Kd=class{constructor(e){this.ns=[],this.ss=0,this.Mr=fs(e)}setConfig(e){this.Mr=fs(e),this.rs()}add(e){let t=(function(s){let n;try{n=Da(s)}catch{return}try{let r=JSON.parse(n);if(!j(r))return;let o=r,a=o[hs],l=o[ps];return!V(a)||a.trim().length===0||!V(l)&&!oe(l)?void 0:{step:o,json:n}}catch{return}})(e);if(!t)return;let i=(function(s){if("u">typeof TextEncoder)return new TextEncoder().encode(s).length;let n=encodeURIComponent(s),r=0;for(let o=0;n.length>o;o++)n[o]==="%"?(r+=1,o+=2):r+=1;return r})(t.json);i>this.Mr.max_bytes||(this.ns.push({step:t.step,bytes:i}),this.ss+=i,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Mr.max_bytes&&this.ns.length>0;){let e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function Qd(e,t){if(!oe(e)||e===1/0||e===-1/0)return t;let i=Math.floor(e);return 0>i?t:i}var vo=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function go(e){return typeof e=="string"||e}function _o(e){return typeof e=="string"?e:void 0}var eh=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server","$react_native_version"],Sl="NativeGzipValidationError",On=e=>e.length>=2&&e[0]===31&&e[1]===139,mo=(e,t)=>e===Pn.GZipJS||t===Pn.GZipJS||t==="gzip",yo=e=>!(!e||typeof e!="object")&&("name"in e?String(e.name):"")==="NotReadableError",ci,qi=e=>{throw _l(Sl,`Native gzip produced invalid output: ${e}`)},th=(bo=ee(function*(e,t){18>e.size&&qi("too-short");let i=new Uint8Array(yield e.slice(0,10).arrayBuffer());On(i)&&i[2]===8||qi("invalid-header");let s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(r=>{let o=(()=>{if(ci)return ci;ci=[];for(let l=0;256>l;l++){let c=l;for(let u=0;8>u;u++)c=1&c?3988292384^c>>>1:c>>>1;ci[l]=c>>>0}return ci})(),a=4294967295;for(let l=0;r.length>l;l++)a=o[255&(a^r[l])]^a>>>8;return(4294967295^a)>>>0})(t)&&qi("invalid-crc");let n=t.length>>>0;s.getUint32(4,!0)!==n&&qi("invalid-size")}),function(e,t){return bo.apply(this,arguments)}),bo;function Rn(){return Rn=ee(function*(e,t=!0,i){try{let n=new TextEncoder().encode(e),r=new globalThis.CompressionStream("gzip"),o=r.writable.getWriter(),a=o.write(n).then(()=>o.close()).catch((s=ee(function*(u){try{yield o.abort(u)}catch{}throw u}),function(u){return s.apply(this,arguments)})),l=new Response(r.readable).blob(),[c]=yield Promise.all([l,a]);return yield th(c,n),c}catch(n){if(i!=null&&i.rethrow)throw n;return t&&console.error("Failed to gzip compress data",n),null}var s}),Rn.apply(this,arguments)}function El(e,t){if(e==null)return{};var i,s,n=(function(o,a){if(o==null)return{};var l={};for(var c in o)if({}.hasOwnProperty.call(o,c)){if(a.includes(c))continue;l[c]=o[c]}return l})(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;r.length>s;s++)t.includes(i=r[s])||{}.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var ye="[redacted]",ih=/^[A-Za-z0-9+/\n\r]+=*$/,sh=/^[A-Za-z0-9_-]+={0,2}$/,nh=/[-_]/,rh=/^data:[^,\s]*;base64,/i,oh=/^[A-Za-z0-9+/_-]+={0,2}$/,ah=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,lh=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,$l=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,ch=/[\s<>"]/,Pl=new RegExp($l.source,"i"),Ml=/[a-z][a-z0-9+.-]{0,63}:\/\//i,uh=new RegExp(`^${Ml.source}`,"i"),dh=new RegExp(Ml.source,"gi"),hh=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,ph=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,fh=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,vh=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,gh=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,_h=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,mh=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,yh=/\b\d(?:[ ./-]?\d){12,}\b/g,wo=/\d+/g,bh=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,wh=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function Ln(e){return(function(t){return lh.test(t)})(e)||hh.test(e)||ph.test(e)}function qs(e){return e.split("&",129).length>128}function xh(e,t,i){return Ln(e)||t.includes(";")&&(function(s){return s.split(";").some(n=>Ln(n.split("=",1)[0]))})(t)?ye:Pl.test(t)?i?cr(t,{allowNestedUrls:!1,stripPunctuation:!0}):ye:t}function Tl(e,t){let i=new URLSearchParams,s=!1,n=!1;for(let[r,o]of new URLSearchParams(e)){let a=xh(r,o,t);s||(s=a!==o),n=Ln(r)||a!==o,i.append(r,a)}return{changed:s,lastFieldSensitive:n,serialized:i.toString()}}function xo(e,t){if(!e.includes("="))return{value:kh(e,t),lastFieldSensitive:!1};let i=Tl(e,t);return{value:i.changed?i.serialized:e,lastFieldSensitive:i.lastFieldSensitive}}function kh(e,t){return t?cr(e,{allowNestedUrls:!1,stripPunctuation:!0}):Pl.test(e)?ye:e}function Sh(e,t,i){return e==="#"?!t.fragment&&(t.fragment=!0):e==="?"&&(t.fragment?i!=="="&&!t.fragmentQuery&&(t.fragmentQuery=!0):!t.query&&(t.query=!0))}function Zs(e,t){var i;if(e.length>8192&&uh.test(e))return ye;let{address:s,suffix:n}=t.stripPunctuation?(function(g){let y=g.length;for(;y>0&&".,;:!?)]}'".includes(g[y-1]);)y--;return{address:g.slice(0,y),suffix:g.slice(y)}})(e):{address:e,suffix:""},r;try{r=new URL(s)}catch{return ye+n}let o=r.search.slice(1),a=r.hash!=="",l=(function(g){let y=g.slice(1),m=y.indexOf("?");return 0>m?{head:y,tail:null}:{head:y.slice(0,m),tail:y.slice(m+1)}})(r.hash);if(qs(o)||qs(l.head)||qs((i=l.tail)!==null&&i!==void 0?i:""))return ye+n;let c=!1;(r.username||r.password)&&(r.username=ye,r.password="",c=!0);let u=Tl(o,t.allowNestedUrls);u.changed&&(r.search=u.serialized,c=!0);let d=xo(l.head,t.allowNestedUrls),h=l.tail===null?null:(p=l.tail,d.lastFieldSensitive?{value:p===""?"":ye,lastFieldSensitive:!0}:xo(p,t.allowNestedUrls));var p;let v=h===null?d.value:`${d.value}?${h.value}`;v!==r.hash.slice(1)&&(r.hash=v,c=!0);let _=a?h!=null?h:d:u;return(c?r.toString():s)+(_.lastFieldSensitive?"":n)}function cr(e,t){return e.replace($l,i=>(function(s,n){let r=(function(l){if(!l.includes("://"))return[];let c=[...l.matchAll(dh)].map(_=>_.index),u=[],d={query:!1,fragment:!1,fragmentQuery:!1},h=0,p=!1,v="";for(let _=0;l.length>_&&c.length>h;_++){c[h]===_&&(_>0&&v!=="="&&u.push(_),h++);let g=l[_];Sh(g,d,v)?(v=g,p=!0):p&&"=&".includes(g)&&(v=g)}return u})(s);if(r.length===0)return Zs(s,n);let o="",a=0;for(let l of r)o+=Zs(s.slice(a,l),f(f({},n),{},{stripPunctuation:!1})),a=l;return o+Zs(s.slice(a),n)})(i,f(f({},t),{},{stripPunctuation:t.stripPunctuation&&i.length!==e.length})))}function Eh(e,t){return(function(i){return i.length>=10240&&(ih.test(i)||(function(s){let n=rh.exec(s);if(!n)return!1;let r;try{r=decodeURIComponent(s.slice(n[0].length))}catch{return!1}return oh.test(r.replace(/[\r\n]/g,""))})(i)||nh.test(i)&&sh.test(i))})(e)?"[binary data redacted - not supported by PostHog MCP analytics]":(function(i,s,n){let r=4*n.maxStringLength;if(i.length>r){let o=s(i.slice(0,(function(a,l){let c=l;for(;c>0&&!ch.test(a[c-1]);)c--;return c})(i,r)));if(o.length>=2*n.maxStringLength)return o+n.truncationSuffix}return s(i)})(e,i=>(function(s){return cr(s,{allowNestedUrls:!0,stripPunctuation:!0})})((function(s){let n=s.replace(fh," ");return n=n.replace(vh,ye),n=n.replace(gh,ye),n=n.replace(_h,`$1${ye}`),n=n.replace(yh,Ph),n=n.replace(mh,ye),n=n.replace(bh,`$1${ye}`),n=n.replace(wh,`$1${ye}`),n})((function(s){return s.replace(ah,ye)})(i))),t)}function $h(e){let t=0,i=!1;for(let s=e.length-1;s>=0;s--){let n=e.charCodeAt(s)-48;if(0>n||n>9)return!1;i&&(n*=2,n>9&&(n-=9)),t+=n,i=!i}return t%10==0}function Ph(e){let t=[];for(let r=wo.exec(e);r!==null;r=wo.exec(e))t.push({digits:r[0],start:r.index,end:r.index+r[0].length});let i="",s=0,n=0;for(;t.length>n;){let r="",o=-1;for(let a=n;t.length>a&&(r+=t[a].digits,19>=r.length);a++)r.length>=13&&$h(r)&&(o=a);0>o?n++:(i+=e.slice(s,t[n].start)+ye,s=t[o].end,n=o+1)}return i+e.slice(s)}var Mh={}.propertyIsEnumerable;function vs(e,t){try{return Il(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function ur(e,t,i,s){if(0>=i.remainingNodes)return{stringValue:Fn};if(i.remainingNodes--,Se(e))return{boolValue:e};if(typeof e=="bigint")return(function(n,r){let o=n.toString(),a=BigInt("9223372036854775808");return n>=a||-a>n?(r==null||r.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};let n=BigInt(e).toString();return e>=9223372036854776e3||-9223372036854776e3>e?(t==null||t.debug(`Attribute ${n} is outside the int64 range; encoding it as a string`),{stringValue:n}):{intValue:n}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:zt(e)};if(typeof e=="function")return{stringValue:"[Function]"};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(i.ancestors.has(e))return{stringValue:"[Circular]"};if(s>=20)return{stringValue:Fn};if(e instanceof Date){let n=e.getTime(),r=Number.isFinite(n)?e.toISOString():String(e);return{stringValue:typeof r=="string"?zt(r):String(r)}}i.ancestors.add(e);try{try{let n=e.toJSON;if(typeof n=="function")return ur(n.call(e),t,i,s+1)}catch{}return O(e)?{arrayValue:{values:Th(e,t,i,s+1)}}:{kvlistValue:{values:Il(e,t,i,s+1)}}}finally{i.ancestors.delete(e)}}return{stringValue:zt(String(e))}}function Th(e,t,i,s){let n=[],r=Math.min(e.length,1e3),o=0;for(;r>o&&i.remainingNodes>0;o++)try{let a=o in e?e[o]:void 0;if(L(a))continue;n.push(ur(a,t,i,s))}catch{n.push({stringValue:Ni})}return e.length>o&&n.push({stringValue:Fn}),n}function Il(e,t,i,s){let n=[];for(let r in e)if(Mh.call(e,r)){if(!r){t==null||t.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){t==null||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let o=e[r];if(ne(o)||x(o))continue;n.push({key:zt(r),value:ur(o,t,i,s)})}catch{n.push({key:zt(r),value:{stringValue:Ni}})}}return n}function Cl(e,t,i){return f(f(f(f({},vl({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}var Ih=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Fl(e,t){let i=vl({},e),s={};for(let n of Ih)({}).hasOwnProperty.call(i,n)&&(s[n]=i[n],delete i[n]);return[...vs(i,t),...vs(s,t)]}var ko={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},Al={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}},Ch=Al.info;function Fh(e){try{return zt(String(e))}catch{return Ni}}function Ah(e,t,i,s){let n=e.level||"info",{text:r,number:o}=Al[n]||Ch,a=(function(h=Date.now()){return String(h)+"000000"})(oe(s)?s:void 0),l={};t.distinctId&&(l.posthogDistinctId=t.distinctId),t.sessionId&&(l.sessionId=t.sessionId),t.windowId&&(l["window.id"]=t.windowId),L(t.sessionStartTimestamp)||(l.sessionStartTimestamp=String(t.sessionStartTimestamp)),L(t.lastActivityTimestamp)||(l.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(l["url.full"]=t.currentUrl),t.screenName&&(l["screen.name"]=t.screenName),t.appState&&(l["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(l.feature_flags=t.activeFeatureFlags);let c=f({},l),u=e.attributes;if(u){let h=[];try{h=Object.keys(u)}catch{h=[]}for(let p of h){let v;try{v=u[p]}catch{v=Ni}Object.defineProperty(c,p,{value:v,enumerable:!0,writable:!0,configurable:!0})}}let d={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:o,severityText:r,body:{stringValue:Fh(e.body)},attributes:vs(c,i)};return e.trace_id&&(d.traceId=e.trace_id),e.span_id&&(d.spanId=e.span_id),x(e.trace_flags)||(d.flags=e.trace_flags),d}function Ol(e,t,i){return Cl(e,t,i)}function Rl(e,t,i,s){return{resourceLogs:[{resource:{attributes:Fl(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}var Ll=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.cs}arm(e){this.clear(),this.us=Date.now()+e,this.cs=ml(()=>{this.cs=void 0,this.ls()},e)}armNoEarlierThan(e){this.cs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function Dl(){return .75+.5*Math.random()}function Nl(e,t,i,s){let n=Math.min(Math.max(0,t-1),6),r=e*Math.pow(2,n);return Math.round((s===void 0?r:Math.min(r,Math.max(s,e)))*i)}var Oh=class{constructor(e,t,i,s,n,r=()=>Promise.resolve(),o){var a;this._instance=e,this.Mr=t,this.A=i,this.hs=s,this.ds=n,this.vs=r,this.fs=o,this.ps=new Ll(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new gl,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=t.maxBufferSize,this.Is=Math.max((a=t.maxQueueSize)!==null&&a!==void 0?a:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Ye.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,t){var i;if(this._instance.isDisabled||this._instance.optedOut||!(e!=null&&e.body))return;let s=this.Os(e);if(s===null)return;if(!s.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;let n={record:Ah(s,(i=t==null?void 0:t.context)!==null&&i!==void 0?i:this.hs(),this.A,t==null?void 0:t.occurredAtMs)};this.ds(()=>this.Ls(n))}Os(e){let t=this.Mr.beforeSend;if(!t)return e;let i=O(t)?t:[t],s=e;for(let n of i)try{let r=n(s);if(!r)return this.A.info("Log was rejected in beforeSend function"),null;s=r}catch(r){return this.A.error("Error in beforeSend function for log:",r),null}return s}Ds(){if(this.Rs===void 0)return!0;let e=Date.now(),t=e-this.xs;return this.Ps>t&&t>=0||(this.xs=e,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.Cs=!0),!1)}flush(){var e=this;return ee(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return ee(function*(){var t;e.ps.clear();let i=(t=e._instance.getPersistedProperty(Ye.LogsQueue))!==null&&t!==void 0?t:[];if(i.length===0)return;let s=i.length,n=0;for(;i.length>0&&s>n;){var r,o;let a=e._s;e.bs=0;let l=Math.min(i.length,e.Es),c=i.slice(0,l),u=Rl(c.map(h=>h.record),e.qs(),(r=e.fs)!==null&&r!==void 0?r:e._instance.getLibraryId(),e._instance.getLibraryVersion()),d=yield e._instance.js(u);if(e._s!==a)return;if(d.kind==="too-large"&&c.length>1)e.Es=Math.max(1,Math.floor(c.length/2)),e.A.warn(`Logs batch of size ${c.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(d),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),d.kind==="retry-later"||(d.kind==="too-large"?e.A.warn("Dropping a single log record with batch size 1 \u2014 the record is larger than the server cap and cannot be split further."):d.kind==="ok"&&e.Mr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Mr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(c.length),i=(o=e._instance.getPersistedProperty(Ye.LogsQueue))!==null&&o!==void 0?o:[],n+=c.length,d.kind==="fatal"))throw d.error}})()}Bs(e){var t=this;return ee(function*(){var i;let s=Math.max(0,e-t.bs),n=(i=t._instance.getPersistedProperty(Ye.LogsQueue))!==null&&i!==void 0?i:[];t._instance.setPersistedProperty(Ye.LogsQueue,n.slice(s)),yield t.vs()})()}qs(){return Ol(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;let i=(t=this._instance.getPersistedProperty(Ye.LogsQueue))!==null&&t!==void 0?t:[];this.Is>i.length||(i.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(Ye.LogsQueue,i),this.Ts>i.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(Nl(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){let e=this._instance.getPersistedProperty(Ye.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return ee(function*(){t.ps.clear();let i=t.flush().catch(()=>{});e!==void 0?yield uo(i,e):yield i})()}flushWithTimeout(e){var t=this;return ee(function*(){let i=t.flush();yield uo(i,e,()=>{i.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=Dl(),this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.zs())})}},Ys=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function So(e){return String(e)+"000000"}function Eo(e,t,i,s){let n="";return s&&(n=Object.keys(s).sort().map(r=>`${JSON.stringify(r)}:${JSON.stringify(s[r])}`).join(",")),`${e}\0${t}\0${i!=null?i:""}\0${n}`}var Rh=class{constructor(e,t,i){this._instance=e,this.Mr=t,this.A=i,this.Hs=new Map,this.ps=new Ll(()=>this.flush().catch(s=>{this.A.error("Metrics flush failed:",s)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new gl,this.ks=0,this.Ss=1,this.Gs=0}count(e,t=1,i){this.Qs({name:e,type:"count",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}gauge(e,t,i){this.Qs({name:e,type:"gauge",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}histogram(e,t,i){this.Qs({name:e,type:"histogram",value:t,unit:i==null?void 0:i.unit,attributes:i==null?void 0:i.attributes})}flush(){var e=this;let t=this.ys,i=(function(){var s=ee(function*(){t&&(yield t.catch(()=>{})),yield e.Zs()});return function(){return s.apply(this,arguments)}})()().finally(()=>{this.ys===i&&(this.ys=null)});return this.ys=i,i}drainWindow(){if(this.Hs.size===0)return null;let e=this.Hs;return this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.Hs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Qs(e){if(this._instance.isDisabled||this._instance.optedOut)return;let t=this.Os(e);if(t===null)return;if(!t.name||typeof t.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof t.value!="number"||!Number.isFinite(t.value))return void this.A.warn(`Dropping metric '${t.name}': value must be a finite number`);if(t.type==="count"&&0>t.value)return void this.A.warn(`Dropping count '${t.name}': counters are monotonic, value must be >= 0`);let i,s;try{i=t.attributes?f({},t.attributes):void 0,s=Eo(t.type,t.name,t.unit,i)}catch(o){return void this.A.warn(`Dropping metric '${t.name}': attributes could not be serialized`,o)}let n=this.Hs.get(s);if(!n){if(!this.Ks())return;n={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Hs.set(s,n)}let r=this.Ws.get(t.name);r===void 0?this.Ws.set(t.name,t.type):r===t.type||this.Vs.has(t.name)||(this.Vs.add(t.name),this.A.warn(`Metric name '${t.name}' is already used as a ${r}; recording it as a ${t.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(n,t.value),this.Fs()}Ks(){return this.Mr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,t){switch(e.type){case"count":var i;e.total=((i=e.total)!==null&&i!==void 0?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(Ys.length+1).fill(0)});let s=e.hist;s.count+=1,s.sum+=t,s.min=Math.min(s.min,t),s.max=Math.max(s.max,t),s.bucketCounts[(function(n,r){for(let o=0;r.length>o;o++)if(r[o]>=n)return o;return r.length})(t,Ys)]+=1;break}}}Os(e){let t=this.Mr.beforeSend;if(!t)return e;let i=O(t)?t:[t],s=e;for(let n of i)try{let r=n(s);if(!r)return this.A.info("Metric was rejected in beforeSend function"),null;s=r}catch(r){return this.A.error("Error in beforeSend function for metric:",r),null}return s}Fs(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(Nl(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Zs(){var e=this;return ee(function*(){if(e.ps.clear(),e.Hs.size===0)return;let t=e.Hs;e.Hs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;let i=e.Gs,s=yield e._instance.Ys(e.Js(t));if(i===e.Gs)switch(e.ws.record(s),s.kind==="retry-later"?(e.ks++,e.Ss=Dl()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.zs()),s.kind){case"ok":return;case"retry-later":return e.co(t),void e.ps.armNoEarlierThan(e.zs());case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",s.error)}})()}Js(e){return t=this.ho(e),i=(function(r,o,a){return Cl(r,o,a)})(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Fl(i)},scopeMetrics:[{scope:{name:s,version:n},metrics:t}]}]};var t,i,s,n}ho(e){let t=So(Date.now()),i=new Map;for(let o of e.values()){var s;let a=Eo(o.type,o.name,o.unit,void 0),l=i.get(a);l||(l=f({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},i.set(a,l));let c=vs((s=o.attributes)!==null&&s!==void 0?s:{},this.A),u=So(o.windowStartMs);if(o.type==="count"){var n;let d={attributes:c,startTimeUnixNano:u,timeUnixNano:t,asDouble:(n=o.total)!==null&&n!==void 0?n:0};l.sum.dataPoints.push(d)}else if(o.type==="gauge"){var r;let d={attributes:c,timeUnixNano:t,asDouble:(r=o.last)!==null&&r!==void 0?r:0};l.gauge.dataPoints.push(d)}else o.hist&&l.histogram.dataPoints.push({attributes:c,startTimeUnixNano:u,timeUnixNano:t,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:Ys})}return Array.from(i.values())}co(e){for(let[s,n]of e){let r=this.Hs.get(s);if(r)switch(r.windowStartMs=Math.min(r.windowStartMs,n.windowStartMs),r.type){case"count":var t,i;r.total=((t=r.total)!==null&&t!==void 0?t:0)+((i=n.total)!==null&&i!==void 0?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(r.hist){r.hist.count+=n.hist.count,r.hist.sum+=n.hist.sum,r.hist.min=Math.min(r.hist.min,n.hist.min),r.hist.max=Math.max(r.hist.max,n.hist.max);for(let o=0;r.hist.bucketCounts.length>o;o++)r.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else r.hist=n.hist}else this.Ks()&&this.Hs.set(s,n)}}},jl=(e,{debugEnabled:t}={})=>{let i={N(s,...n){let r;try{r=typeof window>"u"?void 0:window}catch{return}r&&(st.DEBUG||r.POSTHOG_DEBUG||t)&&!x(r.console)&&r.console&&("__rrweb_original__"in r.console[s]?r.console[s].__rrweb_original__:r.console[s])(e,...n)},debug(...s){i.N("debug",...s)},info(...s){i.N("log",...s)},warn(...s){i.N("warn",...s)},error(...s){i.N("error",...s)},critical(...s){console.error(e,...s)},uninitializedWarning(s){i.error(`You must initialize PostHog before calling ${s}`)},createLogger:(s,n)=>jl(`${e} ${s}`,n)};return i},T=jl("[PostHog.js]"),re=T.createLogger,Lh=re("[ExternalScriptsLoader]"),gs=e=>{let t=E==null?void 0:E.querySelectorAll("script");if(t){for(let i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},Pt=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return Lh.warn(`${t} was requested but loading of external scripts is disabled.`),i("Loading of external scripts is disabled");let s=gs(t);if(s){if(s.__posthog_loading_callback_fired)return i();let r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",o=>{s.__posthog_loading_callback_fired=!0,i(void 0,o)}),void s.addEventListener("error",o=>{s.__posthog_loading_error=o,i(o)}))}let n=()=>{if(!E)return i("document not found");if(gs(t))return Pt(e,t,i);let r=E.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=a=>{r.__posthog_loading_callback_fired=!0,i(void 0,a)},r.onerror=a=>{r.__posthog_loading_error=a,i(a)},e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")E.head.appendChild(r);else{let a=E.querySelectorAll("body > script");var o;a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(r,a[0]):E.body.appendChild(r)}};E!=null&&E.body?n():E==null||E.addEventListener("DOMContentLoaded",n)},Xs={},$o=(e,t)=>{let i=`/static/${t}.js?v=${e.version}`;return t==="toolbar"&&(i=`${i}&t=${Math.floor(Date.now()/3e5)*3e5}`),e.requestRouter.endpointFor("assets",i)};F.__PosthogExtensions__=F.__PosthogExtensions__||{},F.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if(t==="remote-config"){let n=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void Pt(e,n,i)}let s=e.config.strict_script_versioning;if(s){let n=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),r=Xs[n];if(s==="fallback"&&r){if(gs(r))return void Pt(e,r,i);delete Xs[n]}return void Pt(e,n,s==="fallback"?(o,a)=>{if(o)if(typeof o=="string")i(o);else{var l;let c=$o(e,t);Xs[n]=c;let u=gs(n);u==null||(l=u.parentNode)===null||l===void 0||l.removeChild(u),Pt(e,c,i)}else i(void 0,a)}:i)}Pt(e,$o(e,t),i)},F.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{let s=e.requestRouter.endpointFor("api",t);Pt(e,s,i)},st.DEBUG=!1,st.LIB_VERSION="1.438.2",st.LIB_NAME="web";var ue=st,Dn="$early_access_features",tt="$active_feature_flags",It="$feature_flag_details",Ai="$feature_flag_errors",mt="$feature_flag_evaluated_at",Ct="$feature_flag_request_id",xi="$minimal_flag_called_events",Ve="$enabled_feature_flags",ft="$stored_group_properties",vt="$stored_person_properties",gt="$flag_call_reported",_i="$flag_call_reported_session_id",_t="$feature_flag_payloads",Ze="$override_feature_flags",Mt="$override_feature_flag_payloads",Oi="visibilitychange",Dh="$people_distinct_id",je="distinct_id",dr="$device_id",Js="$device_model",_s="__alias",Nh="__cmpns",Po="$fbc",Gt="$fbc_persistence",Mo="$fbp",ki="$fbp_persistence",Nn="__timers",Vl="$autocapture_disabled_server_side",jn="$heatmaps_enabled_server_side",Vn="$exception_capture_enabled_server_side",Hl="$error_tracking_suppression_rules",Hn="$error_tracking_capture_extension_exceptions",Bn="$web_vitals_enabled_server_side",hr="$dead_clicks_enabled_server_side",pr="$product_tours_enabled_server_side",Bl="$logs_capture_enabled_server_side",Wl="$web_vitals_allowed_metrics",Si="$session_recording_remote_config",jh="$session_recording_enabled_server_side",Vh="$replay_sample_rate",Hh="$replay_override_sampling",Bh="$replay_override_linked_flag",Wh="$replay_override_url_trigger",Uh="$replay_override_event_trigger",Ht="$sesid",Ul="$session_is_sampled",zh="$session_past_minimum_duration",Gh="$session_recording_url_trigger_activated_session",qh="$session_recording_event_trigger_activated_session",Zh="$debug_first_full_snapshot_timestamp",Yh="$sess_rec_flush_size",zl="$groups",mi="$surveys",ms="$surveys_loaded_at",Gl="$surveys_activated",ql="$surveys_activated_session",Zl="$surveys_activated_timestamps",Wn="ph_product_tours",Xh="$product_tours_activated",Jh="$product_tours_activated_session",Kh="$conversations_widget_session_id",Qh="$conversations_ticket_id",ep="$conversations_widget_state",tp="$conversations_user_traits",ke="$user_state",Un="$client_session_props",ip="$capture_rate_limit",Yl="$initial_campaign_params",Xl="$initial_referrer_info",Bt="$initial_person_info",fr="$epp",Ks="$posthog_cookieless",Jl="$cookieless_mode",Kl="$sdk_debug_extensions_init_method",Ql="$sdk_debug_extensions_init_time_ms",vr="$sdk_debug_recording_script_not_loaded",gr="$sdk_debug_replay_stale_config",ec="$sdk_debug_replay_event_trigger_status",tc="$sdk_debug_replay_linked_flag_trigger_status",ic="$sdk_debug_replay_matched_recording_trigger_groups",sc="$sdk_debug_replay_pending_trigger_conditions",nc="$sdk_debug_replay_remote_trigger_matching_config",rc="$sdk_debug_replay_trigger_groups_count",oc="$sdk_debug_replay_url_trigger_status",sp="$session_recording_start_reason",_r="PostHog loadExternalDependency extension not found.",it="anonymous",ns="identified",ac="identified_only",ys="beforeunload",mr="$pageview",To="$pageleave",lc="$identify",Io="$groupidentify";function Wt(e,t){O(e)&&e.forEach(t)}function Z(e,t){if(!L(e))if(O(e))e.forEach(t);else if((i=>i instanceof FormData)(e))e.forEach((i,s)=>t(i,s));else for(let i in e)rr.call(e,i)&&t(e[i],i)}var Q=function(e,...t){for(let i of t)for(let s in i)i[s]!==void 0&&(e[s]=i[s]);return e};function rs(e){let t=Object.keys(e),i=t.length,s=new Array(i);for(;i--;)s[i]=[t[i],e[t[i]]];return s}var np=function(e){return function(...t){try{return e.apply(this,t)}catch(i){T.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),T.critical(i)}}},yr=function(e){let t={};return Z(e,function(i,s){(V(i)&&i.length>0||oe(i))&&(t[s]=i)}),t};function cc(e){let t=f({},e);for(let i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch{}return t}var rp=["herokuapp.com","vercel.app","netlify.app"];function op(e){let t=e==null?void 0:e.hostname;if(!V(t))return!1;let i=t.split(".").slice(-2).join(".");for(let s of rp)if(i===s)return!1;return!0}function G(e,t,i,s){let{capture:n=!1,passive:r=!0}=s!=null?s:{};e==null||e.addEventListener(t,i,{capture:n,passive:r})}function zn(e){return e.name==="ph_toolbar_internal"}var Ei=e=>{if(E){try{let t=e+"=",i=E.cookie.split(";").filter(s=>s.length);for(let s=0;i.length>s;s++){let n=i[s];for(;n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(t)===0)return decodeURIComponent(n.substring(t.length,n.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return oe(e)&&isFinite(e)&&Math.floor(e)===e});var ap=class Gn{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,i,s,n){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(n)||0>t||0>i||0>s||0>n||t>0xffffffffffff||i>4095||s>1073741823||n>4294967295)throw new RangeError("invalid field value");let r=new Uint8Array(16);return r[0]=t/Math.pow(2,40),r[1]=t/Math.pow(2,32),r[2]=t/Math.pow(2,24),r[3]=t/Math.pow(2,16),r[4]=t/256,r[5]=t,r[6]=112|i>>>8,r[7]=i,r[8]=128|s>>>24,r[9]=s>>>16,r[10]=s>>>8,r[11]=s,r[12]=n>>>24,r[13]=n>>>16,r[14]=n>>>8,r[15]=n,new Gn(r)}toString(){let t="";for(let i=0;this.bytes.length>i;i++)t=t+(this.bytes[i]>>>4).toString(16)+(15&this.bytes[i]).toString(16),i!==3&&i!==5&&i!==7&&i!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Gn(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let i=0;16>i;i++){let s=this.bytes[i]-t.bytes[i];if(s!==0)return Math.sign(s)}return 0}},lp=class{generate(){let e=this.generateOrAbort();if(!x(e))return e;{this.Ct=0;let t=this.generateOrAbort();if(x(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){let e=(()=>{let t=Date.now();return oe(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.It();else{if(this.Ct>=e+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Ct++,this.It())}return ap.fromFieldsV7(this.Ct,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new cp}},uc=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};b&&!x(b.crypto)&&crypto.getRandomValues&&(uc=e=>crypto.getRandomValues(e));var cp=class{nextUint32(){return this.Rt.length>this.Et||(uc(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}},Co,He=()=>up().toString(),up=()=>(Co||(Co=new lp)).generate(),ui="",dp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Ot=null,se={At(){if(!ne(Ot))return Ot;if(Ot=!1,E)try{let e=`__ph_cookie_support_${He()}`;se.$t(e,"xyz"),Ot=Ei(e)==='"xyz"',se.Pt(e)}catch{Ot=!1}return Ot},Dt(e){T.error("cookieStore error: "+e)},Ot:Ei,Lt(e){let t;try{t=JSON.parse(se.Ot(e))||{}}catch{}return t},$t(e,t,i,s,n){if(!E)return!1;try{let r="",o="",a=(function(c,u){if(u){let d=(function(h,p=E){if(ui)return ui;if(!p||["localhost","127.0.0.1"].includes(h))return"";let v=h.split("."),_=Math.min(v.length,8),g="dmn_chk_"+He();for(;!ui&&_--;){let y=v.slice(_).join("."),m=g+"=1;domain=."+y+";path=/";p.cookie=m+";max-age=3",p.cookie.includes(g)&&(p.cookie=m+";max-age=0",ui=y)}return ui})(c);if(!d){let h=(p=>{let v=p.match(dp);return v?v[0]:""})(c);h!==d&&T.info("Warning: cookie subdomain discovery mismatch",h,d),d=h}return d?"; domain=."+d:""}return""})(E.location.hostname,s);if(i){let c=new Date;c.setTime(c.getTime()+864e5*i),r="; expires="+c.toUTCString()}n&&(o="; secure");let l=e+"="+encodeURIComponent(JSON.stringify(t))+r+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&T.warn("cookieStore warning: large cookie, len="+l.length),E.cookie=l,!0}catch{return!1}},Pt(e,t){if(E!=null&&E.cookie&&(!t||!ne(Ei(e))))try{se.$t(e,"",-1,t)}catch{return}}},Qs=null,U={At(){if(!ne(Qs))return Qs;let e=!0;if(x(b))e=!1;else try{let t="__mplssupport__";U.$t(t,"xyz"),U.Ot(t)!=='"xyz"'&&(e=!1),U.Pt(t)}catch{e=!1}return e||T.error("localStorage unsupported; falling back to cookie store"),Qs=e,e},Dt(e){T.error("localStorage error: "+e)},Ot(e){try{return b==null?void 0:b.localStorage.getItem(e)}catch(t){U.Dt(t)}return null},Lt(e){try{return JSON.parse(U.Ot(e))||{}}catch{}return null},$t(e,t){try{return b==null||b.localStorage.setItem(e,JSON.stringify(t)),!0}catch(i){U.Dt(i)}return!1},Pt(e){try{b==null||b.localStorage.removeItem(e)}catch(t){U.Dt(t)}}},en=[vt,tt,Ve,It,_t,Ct,mt,Ai,gt],Tt=[dr,je,Ht,Ul,fr,Bt,Gt,ke],bs=e=>e+"_cpm",hp=["__proto__","constructor","prototype"],tn=e=>{if(!j(e))return{};let t={};return Object.keys(e).forEach(i=>{hp.indexOf(i)===-1&&(t[i]=e[i])}),t},sn=(e,t=[])=>{let i={};return[...Tt,...t].forEach(s=>{let n=e[s];x(n)||ne(n)||n===""||(i[s]=n)}),i},dc=e=>{let t=5381,i=2166136261;for(let s=0;e.length>s;s++){let n=e.charCodeAt(s);t=33*t^n,i=Math.imul(i^n,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},Fo=(e,t)=>({p:t,f:dc(JSON.stringify(e))}),Ao=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{let i=se.Lt(bs(e)),s=(i==null?void 0:i.f)===dc(t)&&O(i.p);return{properties:s?i.p:[],isValid:s}}catch{return{properties:[],isValid:!1}}},nn=(e,t)=>t+"|"+(se.Ot(bs(e))||""),Rt={},qn={At:()=>!0,Dt(e){T.error("memoryStorage error: "+e)},Ot:e=>e in Rt?Rt[e]:null,Lt:e=>e in Rt?Rt[e]:null,$t:(e,t)=>(Rt[e]=t,!0),Pt(e){delete Rt[e]}},xt=null,J={At(){if(!ne(xt))return xt;if(xt=!0,x(b))xt=!1;else try{let e="__support__";J.$t(e,"xyz"),J.Ot(e)!=='"xyz"'&&(xt=!1),J.Pt(e)}catch{xt=!1}return xt},Dt(e){T.error("sessionStorage error: ",e)},Ot(e){try{return b==null?void 0:b.sessionStorage.getItem(e)}catch(t){J.Dt(t)}return null},Lt(e){try{return JSON.parse(J.Ot(e))||null}catch{}return null},$t(e,t){try{return b==null||b.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(i){J.Dt(i)}return!1},Pt(e){try{b==null||b.sessionStorage.removeItem(e)}catch(t){J.Dt(t)}}},pp=class{constructor(e){this._instance=e}get Mr(){return this._instance.config}get consent(){return this.Do()?0:this.Lo}isOptedOut(){return this.Mr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Mr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Mr.opt_out_capturing_by_default}optInOut(e){this.No.$t(this.qo,e?1:0,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.No.Pt(this.qo,this.Mr.cross_subdomain_cookie)}get qo(){let{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get Lo(){let e=this.No.Ot(this.qo);return Vs(e)?1:A(hd,e)?0:-1}get No(){let e=this.Mr.opt_out_capturing_persistence_type,t=e==="localStorage"?U:se,i=t.At()?t:qn;if(!this.jo||this.jo!==i){this.jo=i;let s=e==="localStorage"?se:U;s.Ot(this.qo)&&(this.jo.Ot(this.qo)||this.optInOut(Vs(s.Ot(this.qo))),s.Pt(this.qo,this.Mr.cross_subdomain_cookie))}return this.jo}Do(){return!!this.Mr.respect_dnt&&[pe==null?void 0:pe.doNotTrack,pe==null?void 0:pe.msDoNotTrack,F.doNotTrack,pe==null?void 0:pe.globalPrivacyControl].some(e=>Vs(e))}};function hc(e,t){var i;let s=e==null||(i=e.config)===null||i===void 0?void 0:i.get_current_url;if(!le(s))return t;try{let n=s(t);return V(n)&&n?n:t}catch(n){return T.error("Error in get_current_url, falling back to window.location.href",n),t}}function Oo(e){var t;return e instanceof Element&&(e.id==="__POSTHOG_TOOLBAR__"||!!(!((t=e.closest)===null||t===void 0)&&t.call(e,".toolbar-global-fade-container")))}function Be(e){return!!e&&e.nodeType===1}function _e(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function pc(e){return!!e&&e.nodeType===3}function br(e){return!!e&&e.nodeType===11&&Be(e.host)}function wr(e){return e?Zt(e).split(/\s+/):[]}function Ro(e,t){let i=(function(s){var n;let r=b==null||(n=b.location)===null||n===void 0?void 0:n.href;return x(r)?void 0:hc(s,r)})(t);return!!(i&&e&&e.some(s=>i.match(s)))}function Xt(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return wr(t)}function fc(e){return L(e)?null:Zt(e).split(/(\s+)/).filter(t=>qt(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ri(e){let t="";return Ft(e)&&!Jt(e)&&e.childNodes&&e.childNodes.length&&Z(e.childNodes,function(i){var s;pc(i)&&i.textContent&&(t+=(s=fc(i.textContent))!==null&&s!==void 0?s:"")}),Zt(t)}function $i(e){var t;return x(e.target)?e.srcElement||null:!((t=e.target)===null||t===void 0)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var xr=["a","button","form","input","select","textarea","label"];function Zn(e,t){let i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch{return!1}}function Yn(e,t){if(x(t))return!0;for(let i of e)if(t.some(s=>Zn(i,s)))return!0;return!1}function vc(e){let t=e.parentNode;return!(!t||!Be(t))&&t}var rn=[".ph-no-autocapture","[data-ph-no-autocapture]"],gc=["next","previous","prev",">","<","\u2192","\u2190","\u203A","\u2039","\xBB","\xAB","\u25B6","\u25C0","\u276F","\u276E"],kr=[...gc,"+","-","\u2212","\u2013"],Lo=kr.length+10,fp=["button","a","input","select","textarea","label"],vp=["button","link","tab","menuitem","option"],Do=(e,t)=>/[a-z0-9]/i.test(t)?A(kr,t)?new RegExp(`\\b${t}\\b`).test(e):e.includes(t):e===t,gp=e=>A(fp,e.tagName.toLowerCase())||A(vp,(e.getAttribute("role")||"").toLowerCase());function on(e){let t="",i="",s=o=>{Be(o)&&Ft(o)&&!Jt(o)&&(t+=` ${Ri(o)}`,i=i||o.getAttribute("aria-label")||"",Z(o.childNodes,s))};s(e),t=Zt(t.replace(/\s+/g," "));let n=(qt(t)?t:"").toLowerCase(),r=e.getAttribute("aria-label")||(n?"":i);return{safeText:n,ariaLabel:Zt(r).toLowerCase()}}var No=[".ph-no-rageclick",".ph-no-capture"],_p=["","text","search","email","password","url","tel","number"];function _c(e,t){if(!b||Sr(e))return!1;let i,s,n;var r,o;if(Se(t)?(i=!!t&&No,s=void 0,n=!1):(i=(r=t==null?void 0:t.css_selector_ignorelist)!==null&&r!==void 0?r:No,s=t==null?void 0:t.content_ignorelist,n=(o=t==null?void 0:t.ignore_text_selection)!==null&&o!==void 0&&o),i===!1||n&&(function(l){return!(!l||!Be(l))&&(!!_e(l,"textarea")||(_e(l,"input")?A(_p,(l.getAttribute("type")||"").toLowerCase()):(function(c){var u;if(c.isContentEditable)return!0;let d=(u=c.getAttribute)===null||u===void 0?void 0:u.call(c,"contenteditable");return d==="true"||d===""})(l)))})(e))return!1;let{targetElementList:a}=mc(e,!1);return!(s&&(function(l,{safeText:c,ariaLabel:u}){let d;if(l===!0)d=gc;else{if(!O(l))return!1;if(l.length>Lo)return T.error(`[PostHog] content_ignorelist array cannot exceed ${Lo} items. Use css_selector_ignorelist for more complex matching.`),!1;d=l.map(h=>h.toLowerCase())}return d.some(h=>Do(c,h)||Do(u,h))})(s,(function(l,c){for(let u of c)if(gp(u))return on(u);for(let u of c){try{if((b==null?void 0:b.getComputedStyle(u).getPropertyValue("cursor"))!=="pointer")break}catch{break}let d=on(u);if(d.safeText||d.ariaLabel)return d}return on(l)})(e,a))||Yn(a,i))}var Sr=e=>!e||_e(e,"html")||!Be(e),mc=(e,t)=>{if(!b||Sr(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1,s=[e],n=e;for(;n.parentNode&&!_e(n,"body");){if(br(n.parentNode)){s.push(n.parentNode.host),n=n.parentNode.host;continue}let r=vc(n);if(!r)break;if(t||xr.indexOf(r.tagName.toLowerCase())>-1)i=!0;else try{let o=b.getComputedStyle(r);o&&o.getPropertyValue("cursor")==="pointer"&&(i=!0)}catch{}s.push(r),n=r}return{parentIsUsefulElement:i,targetElementList:s}};function Ft(e){let t=new Set,i=0;for(let r=e;r.parentNode&&!_e(r,"body");r=r.parentNode){if(i++>=1e3||t.has(r))return!1;t.add(r);let o=Xt(r);if(A(o,"ph-sensitive")||A(o,"ph-no-capture"))return!1}if(A(Xt(e),"ph-include"))return!0;let s=e.type||"";if(V(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}let n=e.name||e.id||"";return!V(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function Jt(e){return!!(_e(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||_e(e,"select")||_e(e,"textarea")||e.getAttribute("contenteditable")==="true")}var jo=new RegExp("^(?:(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})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),Vo=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,mp=[16,15,14,13],yp=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ho=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Bo=/[0-9A-Za-z_]/;function bp(e){let t=0,i=!1;for(let s=e.length-1;s>=0;s--){let n=e.charCodeAt(s)-48;i&&(n*=2,n>9&&(n-=9)),t+=n,i=!i}return t%10==0}function qt(e,t=!0){return!(L(e)||V(e)&&(e=Zt(e),(t?jo.test((e||"").replace(/[- ]/g,"")):(function(i){let s;for(Vo.lastIndex=0;s=Vo.exec(i);){let n=s[2];if(!n)continue;let r=n.replace(/[- ]/g,"");for(let o=0;r.length>o;o++)for(let a of mp){let l=o+a;if(r.length>=l){let c=r.slice(o,l);if(jo.test(c)&&bp(c))return!0}}}return!1})(e))||(t?yp.test(e):(function(i){let s;for(Ho.lastIndex=0;s=Ho.exec(i);){let n=s[1],r=s[3];if(!(n&&r&&Bo.test(n)&&Bo.test(r)))return!0}return!1})(e))))}function Wo(e){let t=Ri(e);return t=`${t} ${yc(e)}`.trim(),qt(t)?t:""}function yc(e){let t="";return e&&e.childNodes&&e.childNodes.length&&Z(e.childNodes,function(i){var s;if(i&&((s=i.tagName)===null||s===void 0?void 0:s.toLowerCase())==="span")try{let n=Ri(i);t=`${t} ${n}`.trim(),i.childNodes&&i.childNodes.length&&(t=`${t} ${yc(i)}`.trim())}catch(n){T.error("[AutoCapture]",n)}}),t}function Uo(e){return e.replace(/"|\\"/g,'\\"')}function wp(e){let t=e.attr__class;if(t)return O(t)?t:wr(t)}var Zi=re("[Dead Clicks]"),xp=()=>!0,kp=e=>{var t;let i=!!(!((t=e.instance.persistence)===null||t===void 0)&&t.get_property(hr)),s=e.instance.config.capture_dead_clicks;return Se(s)?s:!!j(s)||i},zo=class{get lazyLoadedDeadClicksAutocapture(){return this.Bo}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[hr]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Ho()}):this.stop()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this.instance,"dead-clicks-autocapture",n=>{n?Zi.error("failed to load script",n):e()})}Ho(){var e;if(E){if(!this.Bo&&(!((e=F.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){let t=j(this.instance.config.capture_dead_clicks)?f({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Bo=F.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Bo.start(E),Zi.info("starting...")}}else Zi.error("`document` not found. Cannot start.")}stop(){this.Bo&&(this.Bo.stop(),this.Bo=void 0,Zi.info("stopping..."))}},di=re("[SegmentIntegration]");function Go(e,t,i=!0){let s=e.config.segment;if(!s)return t();let{analytics:n,filterProperties:r}=(a=>le(a.register))(o=s)?{analytics:o}:o;var o;(function(a,l,c,u){let d=p=>{let v=()=>p.anonymousId()||He();a.config.get_device_id=v,u&&p.id()&&(a.register({distinct_id:p.id(),$device_id:v()}),a.persistence.set_property(ke,ns)),c(u?void 0:p.anonymousId()||void 0)},h=l.user();"then"in h&&le(h.then)?h.then(d):d(h)})(e,n,a=>{n.register(((l,c,{filterProperties:u}={})=>{typeof Promise!="undefined"&&Promise.resolve||di.warn("This browser does not have Promise support, and can not use the segment integration");let d=(h,p)=>{if(!p)return h;let v=!!c&&h.event.anonymousId===c&&!h.event.userId;v||h.event.userId||h.event.anonymousId===l.get_distinct_id()||(di.info("No userId set, resetting PostHog"),l.reset()),v||(c=void 0),h.event.userId&&h.event.userId!==l.get_distinct_id()&&(di.info("UserId set, identifying with PostHog"),l.identify(h.event.userId));let _=l.calculateEventProperties(p,h.event.properties);if(!L(u)){let g=h.event.properties||{},y={};for(let w of Object.keys(_))rr.call(g,w)||(y[w]=_[w]);let m=((w,M)=>{let P=O(w)?w:[w],k=f({},M);for(let I of P)try{if(k=I(k),L(k))return null}catch(S){return di.error("Error in Segment filterProperties:",S),null}return k})(u,y);if(L(m))return h;_=m}return h.event.properties=Object.assign({},_,h.event.properties),h};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(h){return d(h,h.event.event)},page(h){return d(h,mr)},identify(h){return d(h,lc)},screen(h){return d(h,"$screen")}}})(e,a,{filterProperties:r})).then(()=>{t()},l=>{di.error("Failed to register the Segment integration",l),t()})},i)}var bc="posthog-js";function wc(e,{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:r=!0}={}){return o=>{var a,l,c,u,d;if(n!=="*"&&!n.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});let h=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));let p=((a=o.exception)===null||a===void 0?void 0:a.values)||[],v=p.map(y=>f(f({},y),{},{stacktrace:y.stacktrace?f(f({},y.stacktrace),{},{type:"raw",frames:(y.stacktrace.frames||[]).map(m=>f(f({},m),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((l=p[0])===null||l===void 0?void 0:l.value)||o.message,$exception_type:(c=p[0])===null||c===void 0?void 0:c.type,$exception_level:o.level,$exception_list:v,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((u=p[0])===null||u===void 0?void 0:u.value)||o.message,$sentry_exception_type:(d=p[0])===null||d===void 0?void 0:d.type,$sentry_tags:o.tags};var g;return t&&i&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),r&&((g=e.exceptions)===null||g===void 0||g.sendExceptionEvent(_)),o}}var Sp=class{constructor(e,t,i,s,n,r){this.name=bc,this.setupOnce=function(o){o(wc(e,{organization:t,projectId:i,prefix:s,severityAllowList:n,sendExceptionsToPostHog:r==null||r}))}}},qo=class{constructor(e){this.Uo=(t,i,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(T.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:s}),this.Wo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Vo()}Vo(){var e;this.Go=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.Uo)}destroy(){var e;(e=this.Go)===null||e===void 0||e.call(this),this.Go=void 0}doPageView(e,t){var i;let s=this.Qo(e,t);return this.Wo={pathname:(i=b==null?void 0:b.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Qo(e,(t=this.Wo)===null||t===void 0?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Wo)===null||e===void 0?void 0:e.pageViewId}}Qo(e,t){let i=this.Wo;if(!i)return{$pageview_id:t};let s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:r,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=n;if(!(x(r)||x(o)||x(a)||x(l)||x(c)||x(u))){r=Math.ceil(r),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);let d=r>1?Xe(o/r,0,1,T):1,h=r>1?Xe(a/r,0,1,T):1,p=l>1?Xe(c/l,0,1,T):1,v=l>1?Xe(u/l,0,1,T):1;s=Q(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}},hi=["flags","surveys"],Ep={[Dh]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[Nh]:{exposure:"hidden"},[Nn]:{exposure:"hidden"},[Gt]:{exposure:"hidden"},[ki]:{exposure:"hidden"},[Vl]:{exposure:"event"},[jn]:{exposure:"hidden"},[Bl]:{exposure:"hidden"},[Vn]:{exposure:"event"},[Hl]:{exposure:"hidden"},[Hn]:{exposure:"event"},[Bn]:{exposure:"event"},[hr]:{exposure:"event"},[pr]:{exposure:"hidden"},[Wl]:{exposure:"event"},[Si]:{exposure:"hidden"},[jh]:{exposure:"hidden"},[Ht]:{exposure:"hidden"},[Ul]:{exposure:"event"},[Vh]:{exposure:"event",shouldSkipFromEventProperties:e=>ne(e)},[zh]:{exposure:"event"},[Gh]:{exposure:"event"},[qh]:{exposure:"event"},[Zh]:{exposure:"event"},[Yh]:{exposure:"hidden"},[Ve]:{exposure:"hidden",storageGroup:"flags"},[tt]:{exposure:"hidden",storageGroup:"flags"},[Dn]:{exposure:"hidden"},[It]:{exposure:"hidden",storageGroup:"flags"},[_t]:{exposure:"hidden",storageGroup:"flags"},[Ct]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xi]:{exposure:"hidden",storageGroup:"flags"},[Ze]:{exposure:"hidden"},[Mt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ft]:{exposure:"hidden"},[mi]:{exposure:"hidden",storageGroup:"surveys"},[ms]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Gl]:{exposure:"event"},[ql]:{exposure:"hidden"},[Zl]:{exposure:"hidden"},[Wn]:{exposure:"hidden"},[Xh]:{exposure:"hidden"},[Jh]:{exposure:"hidden"},[Kh]:{exposure:"event"},[Qh]:{exposure:"event"},[ep]:{exposure:"event"},[tp]:{exposure:"event"},[gt]:{exposure:"hidden"},[_i]:{exposure:"hidden"},[zl]:{exposure:"event"},[Ai]:{exposure:"hidden"},[mt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ke]:{exposure:"hidden"},[Un]:{exposure:"hidden"},[ip]:{exposure:"hidden"},[Yl]:{exposure:"hidden"},[Xl]:{exposure:"hidden"},[Bt]:{exposure:"hidden"},[fr]:{exposure:"hidden"},[Hh]:{exposure:"event"},[Bh]:{exposure:"event"},[Wh]:{exposure:"event"},[Uh]:{exposure:"event"},[Kl]:{exposure:"event"},[Ql]:{exposure:"event"},[vr]:{exposure:"hidden"},[gr]:{exposure:"hidden"},[ec]:{exposure:"hidden"},[tc]:{exposure:"hidden"},[ic]:{exposure:"hidden"},[sc]:{exposure:"hidden"},[nc]:{exposure:"hidden"},[rc]:{exposure:"hidden"},[oc]:{exposure:"hidden"},[sp]:{exposure:"event"}},$p=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],fe=e=>{let t=Ep[e];if(t)return t;for(let[i,s]of $p)if(e.indexOf(i)===0)return s};function xc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}var kc=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},Sc=(e,t)=>e>=t&&kc(),Ec=(e,t,i,s)=>{if(e===0){if(kc()){let n=t+1;return n===i&&s(),n}return t}return 0},Ut=(e,t)=>{try{let i;return JSON.stringify(e,(s,n)=>{var r;return ii(n)?((r=i)!==null&&r!==void 0||(i=new WeakMap),i.has(n)||i.set(n,cc(n)),i.get(n)):typeof n=="bigint"?n.toString():n},t)}catch{return Da(e)}},nt=e=>{let t=E==null?void 0:E.createElement("a");return x(t)?null:(t.href=e,t)},Kt=function(e,t){let i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s;for(let n=0;i.length>n;n++){let r=i[n].split("=");if(r[0]===t){s=r;break}}if(!O(s)||2>s.length)return"";{let n=s[1];try{n=decodeURIComponent(n)}catch{T.error("Skipping decoding for malformed query param: "+n)}return n.replace(/\+/g," ")}},Li=function(e,t,i){if(!e||!t||!t.length)return e;let s=e.split("#"),n=s[1],r=(s[0]||"").split("?"),o=r[1],a=r[0],l=(o||"").split("&"),c=[];for(let d=0;l.length>d;d++){let h=l[d].split("=");O(h)&&(t.includes(h[0])?c.push(h[0]+"="+i):c.push(l[d]))}let u=a;return o!=null&&(u+="?"+c.join("&")),n!=null&&(u+="#"+n),u},ws=function(e,t){let i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},Qt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],Pp=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qt],Di="<masked>",Mp=["li_fat_id"];function $c(e,t,i){if(!E)return{};let s=t?[...Qt,...i||[]]:[],n=Pc(Li(E.URL,s,Di),e),r=(function(){let o={};return Z(Mp,function(a){let l=Ei(a);o[a]=l||null}),o})();return Q(r,n)}function Pc(e,t){let i=Pp.concat(t||[]),s={};return Z(i,function(n){let r=Kt(e,n);s[n]=r||null}),s}function Mc(e){let t=(function(n){return n?n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(e),i=t!="yahoo"?"q":"p",s={};if(!ne(t)){s.$search_engine=t;let n=E?Kt(E.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Tc(){return navigator.language||navigator.userLanguage}function Tp(){let e=Tc();return typeof e=="string"?e.split("-")[0]:void 0}var xs="$direct";function Ic(){return(E==null?void 0:E.referrer)||xs}function Cc(e,t,i=!1){let s=e?[...Qt,...t||[]]:[],n=i?yt(K==null?void 0:K.href):K==null?void 0:K.href,r=n==null?void 0:n.substring(0,1e3);return{r:Ic().substring(0,1e3),u:r?Li(r,s,Di):void 0}}function Fc(e,t=!1){var i;let{r:s,u:n}=e,r=t?yt(n):n,o={$referrer:s,$referring_domain:s==null?void 0:s==xs?xs:(i=nt(s))===null||i===void 0?void 0:i.host};if(r){o.$current_url=r;let a=nt(r);o.$host=a==null?void 0:a.host,o.$pathname=a==null?void 0:a.pathname;let l=Pc(r);Q(o,l)}if(s){let a=Mc(s);Q(o,a)}return o}function Ip(){try{return new Date().getTimezoneOffset()}catch{return}}var Cp={flags:mt,surveys:ms},Fp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Yi=e=>`${e}_cookie_identity_change_pending`,Xi=e=>{let t="",i=0;for(let s of e){let n=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+n>1e3)break;t+=s,i+=n}return t},ce="main",et=[Ve,tt,It,_t,Ct,mt,xi,vt],an=e=>et.indexOf(e)!==-1,Ac=[Gt,ki],Zo=e=>Ac.indexOf(e)!==-1,ut=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}},Lt=e=>{if(!e)return{};let t=JSON.parse(e);return j(t)?t:{}},Yo=(e,t)=>{Z(e,(i,s)=>{let n=fe(s);n&&n.exposure!=="event"||{}.hasOwnProperty.call(t,s)||delete e[s]})},ln=class{constructor(e,t,i=!0,s=!e.cookieless_mode){if(this.Zo={},this.Jo=!1,this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=new Map,this.ia=!1,this.na=!1,this.sa=!1,this.ra=new Set,this.oa=new Set,this.Mr=e,this.aa=i,this.props={},this.la=void 0,this.ua=(n=>{let r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.hi=e.disable_persistence||!!t,this.No=this.ca(e),this.Xo=this.ha(e),this.load(s),this.da(),e.debug&&T.info("Persistence loaded",e.persistence,f({},this.props)),this.update_config(e,e,t),this.save(),b){let n=()=>this.flush();G(b,"beforeunload",n,{capture:!1}),G(b,"pagehide",n,{capture:!1}),this.va=r=>{if(this.Jo&&(!r.storageArea||r.storageArea===(b==null?void 0:b.localStorage))&&r.key)if(r.key!==this.ua){if(this.Xo){let o=hi.find(a=>r.key===this.fa(a));o&&this.pa(r.key,o)}}else this.pa(r.key,ce)},G(b,"storage",this.va)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([t,i])=>{let s=this.ea.get(t);if(!an(t)||s===!0)return;if(i===!0)return void this.ga(t,!0);let n=new Set(s||[]);i.forEach(r=>n.add(r)),n.size&&this.ga(t,n)})}onCrossTabFeatureFlagChange(e){return this.oa.add(e),()=>this.oa.delete(e)}destroy(){this.va&&b&&(b.removeEventListener("storage",this.va),this.va=void 0),this.oa.clear()}pa(e,t,i=!0){if(this.hi)return!1;let s,n;try{if(n=U.Ot(e),ne(n)){let a=this.ma(t);return a.storageValue=null,t!==ce&&(a.persisted=!1),!1}s=Lt(n)}catch{return!1}let r=t===ce?s:U.Lt(this.ua);if(r&&this.ya(r))return!1;let o=this.ba(s,t,i);return t===ce&&this.Xo&&!ut(this._a().main,s)||this.wa(s,t,!0,n),o}ya(e){let t=this.props[je],i=e[je];return!x(t)&&!x(i)&&t!==i}wa(e,t,i,s){let n=this.ma(t);n.storageValue=s,t!==ce&&(n.persisted=i);try{n.fingerprint=this.ka(e,t)}catch{n.fingerprint=void 0}}ba(e,t,i){let s=!1;return et.forEach(n=>{var r;let o=(r=fe(n))===null||r===void 0?void 0:r.storageGroup;if(t===ce&&this.Xo&&o||t!==ce&&o!==t)return;let a=n in e,l=this.Sa(n,a?e[n]:void 0),c=this.ea.has(n)?n in this.props:a;c===n in this.props&&ut(l,this.props[n])||(c?this.xa(n,l,!1):this.$a(n,!1),s=!0)}),s&&i&&this.oa.forEach(n=>n()),s}Ca(){if(!this.Jo)return!1;try{this.sa=!1;let e=U.Ot(this.ua),t=this.ma(ce),i,s=!1,n=!1;if(e!==t.storageValue)if(ne(e))t.storageValue=null;else{if(i=Lt(e),this.sa=!this.na&&this.ya(i),this.sa)return!1;n=this.ba(i,ce,!1),!this.Xo||ut(this._a().main,i)?this.wa(i,ce,!0,e):t.storageValue=e,s=!0}return this.Xo&&hi.forEach(r=>{let o=U.Ot(this.fa(r)),a=this.ma(r),l=i||{},c=s&&et.some(d=>{var h;return((h=fe(d))===null||h===void 0?void 0:h.storageGroup)===r&&d in l});if(o===a.storageValue&&!c)return;if(ne(o))return a.storageValue=null,a.persisted=!1,void(c&&(n=this.ba(l,r,!1)||n));let u=Lt(o);n=this.ba(u,r,!1)||n,this.wa(u,r,!0,o)}),n}catch{return!1}}ga(e,t){this.ea.set(e,t);let i=fe(e);i!=null&&i.volatile||(this.ma((this.Xo?i==null?void 0:i.storageGroup:void 0)||ce).fingerprint=void 0,this.Ta(e))}Ia(){et.forEach(e=>this.ea.set(e,!0))}da(){if(this.Jo)try{let e=U.Ot(this.ua),t=Lt(e);this.ma(ce).storageValue=e,et.forEach(i=>{var s;let n=this.Xo?(s=fe(i))===null||s===void 0?void 0:s.storageGroup:void 0,r=n?U.Ot(this.fa(n)):null;if(n){let a=this.ma(n);a.storageValue=r,a.persisted=!ne(r)}let o=n&&!ne(r)?Lt(r):t;i in this.props?this.Ma(i,o[i],this.props[i]):i in o&&this.ga(i,!0)})}catch{}}Sa(e,t){let i=this.ea.get(e);if(!i)return t;if(i===!0)return this.props[e];if(e==="$active_feature_flags"){let r=new Set(O(t)?t:[]),o=new Set(O(this.props[e])?this.props[e]:[]);return i.forEach(a=>o.has(a)?r.add(a):r.delete(a)),Array.from(r)}let s=j(t)?f({},t):{},n=j(this.props[e])?this.props[e]:{};return i.forEach(r=>{r in n?s[r]=n[r]:delete s[r]}),s}Ma(e,t,i){if(!an(e))return;let s=this.ea.get(e);if(s===!0)return;let n=t;if(this.Jo)try{var r;let a=this.Xo?(r=fe(e))===null||r===void 0?void 0:r.storageGroup:void 0,l=a?this.fa(a):this.ua;n=Lt(U.Ot(l))[e]}catch{}let o=new Set(s||[]);if(e==="$active_feature_flags"){if(!x(t)&&!O(t)||!x(n)&&!O(n)||!O(i))return void this.ga(e,!0);let a=new Set(t||[]),l=new Set(n||[]),c=new Set(i);new Set([...a,...c]).forEach(u=>{a.has(u)!==c.has(u)&&o.add(u)}),o.forEach(u=>{l.has(u)===c.has(u)&&o.delete(u)})}else{if(!j(i))return void(ut(n,i)?this.ea.delete(e):this.ga(e,!0));{if(!x(t)&&!j(t)||x(t)&&Me(i)&&x(n))return void this.ga(e,!0);let a=j(t)?t:{},l=j(n)?n:{};new Set([...Object.keys(a),...Object.keys(i)]).forEach(c=>{c in a==c in i&&ut(a[c],i[c])||o.add(c)}),o.forEach(c=>{c in l==c in i&&ut(l[c],i[c])&&o.delete(c)})}}o.size?this.ga(e,o):this.ea.delete(e)}Ea(){var e;let t=(e=this.Mr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return oe(t)&&t>0?t:0}Pa(e){if(this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie")if(e)try{let t=sn(e,this.Mr.cookie_persisted_properties||[]),i=Fo(t,this.Mr.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),n=se.Ot(this.ua)||void 0;n&&nn(this.ua,n)===s&&(this.Ra=s,this.Aa=n)}catch{}else try{let t=se.Ot(this.ua)||void 0;this.Ra=t?nn(this.ua,t):void 0,this.Aa=t}catch{}}syncCookieProperties(){return this.Fa(this.Mr)}Fa(e,t=!1){if(this.hi&&!t||this.ta||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;let i;try{i=se.Ot(this.ua)||void 0}catch{}if(!i||i===this.Aa)return!1;let s=nn(this.ua,i),n;try{n=tn(JSON.parse(i))}catch{return!1}if((se.Ot(this.ua)||void 0)!==i)return!1;this.Ra=s,this.Aa=i;let r=Ao(this.ua,i),o=[...Tt,...r.properties],a={};if(Object.keys(n).forEach(_=>{let g=n[_];(x(g)||ne(g)||g===""||_==="$user_state"&&g!=="anonymous"&&g!=="identified")&&(a[_]=!0,delete n[_])}),Me(n))return!1;let l="distinct_id"in n||n.$user_state==="anonymous"||n.$user_state==="identified",c=this.props,u=c[je],d=c[ke],h=Q({},c);[...Tt,...e.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in n)&&!a[_]&&(l||_!=="distinct_id"&&_!=="$user_state")){let g=h[_];(r.isValid||Tt.indexOf(_)===-1||g!==!1&&g!==0)&&delete h[_]}}),this.props=Q(h,n),et.forEach(_=>{let g=_ in this.props;_ in c===g&&ut(c[_],this.props[_])||(g?this.Ma(_,c[_],this.props[_]):this.ga(_,!0))}),!l||"$user_state"in n||"$user_state"in this.props||this.xa(ke,it);let p=this.props[je],v=this.props[ke];return!l||p===u&&v===d||(this.na=!0,this.Yo=!0,J.$t(Yi(this.ua),!0),this.$a(vt),this.$a(tt),this.$a(Ve),this.$a(It),this.$a(_t),this.$a(Ct),this.$a(mt),this.$a(Ai),this.$a(gt),v!=="anonymous"||d!=="identified"&&n.$user_state!=="anonymous"&&(x(u)||p===u)||(Yo(this.props,n),this.$a(ft)),v==="identified"?this.props.$user_id=p:delete this.props.$user_id,this.$a(_s)),!0}consumeCookieIdentityChange(){let e=Yi(this.ua),t=this.Yo||!!J.Ot(e);return this.Yo=!1,t&&J.Pt(e),t}Oa(e=!1){return!(this.ta||this.hi&&!e||!this.Mr.cookieWinsOnConflict||this.Mr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ta=!0,0))}Da(){this.ta&&(x(this.La)||(clearTimeout(this.La),this.La=void 0),delete this.Zo[ce],this.Na(!0))}qa(e=!0){if(this.ta)try{e?this.Da():x(this.La)||(clearTimeout(this.La),this.La=void 0)}finally{this.ta=!1}}isDisabled(){return!!this.hi}ca(e){Fp.indexOf(e.persistence.toLowerCase())===-1&&(T.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");let t=((o=[],a=!1,l=()=>!1)=>{let c=[...Tt,...o];return f(f({},U),{},{Lt(u){try{let h,p={};try{h=se.Ot(u)||void 0,p=h?tn(JSON.parse(h)):{}}catch{}let v=JSON.parse(U.Ot(u)||"{}"),_;if(a){let g=Ao(u,h),y=[...Tt,...g.properties],m={};Object.keys(p).forEach(M=>{let P=p[M];ne(P)||P===""||M==="$user_state"&&P!=="anonymous"&&P!=="identified"||(m[M]=P)});let w="distinct_id"in m||m.$user_state==="anonymous"||m.$user_state==="identified";if(Object.keys(m).length>0){var d;let M=v[je],P=(d=v.$user_state)!==null&&d!==void 0?d:it;c.forEach(k=>{if(y.indexOf(k)!==-1&&!(k in p)&&(w||k!=="distinct_id"&&k!=="$user_state")){let I=v[k];(g.isValid||Tt.indexOf(k)===-1||I!==!1&&I!==0)&&delete v[k]}}),!w||"$user_state"in p||"$user_state"in v||(v[ke]=it),!w||("distinct_id"in m?m[je]:v[je])===M&&("$user_state"in m?m[ke]:v[ke])===P||(en.forEach(k=>delete v[k]),m.$user_state==="identified"&&"distinct_id"in m?v.$user_id=m[je]:delete v.$user_id,m.$user_state!=="identified"&&(delete v[zl],delete v[ft]),delete v.__alias)}_=Q(v,m)}else _=Q(p,v);return l()||U.$t(u,_),_}catch{}return null},$t(u,d,h,p,v,_){let g=U.$t(u,d,void 0,void 0,_);try{let y=sn(d,o);if(Object.keys(y).length){if(a){let m=bs(u),w=Fo(y,o);if(se.$t(m,w,h,p,v,_),se.Ot(m)!==JSON.stringify(w)){se.Pt(m,p);let M=sn(d);return se.$t(u,M,h,p,v,_),g}}se.$t(u,y,h,p,v,_)}}catch(y){U.Dt(y)}return g},Pt(u,d){try{b==null||b.localStorage.removeItem(u),se.Pt(u,d),se.Pt(bs(u),d)}catch(h){U.Dt(h)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict,()=>!!this.hi),i,s=!1,n=!1,r=e.persistence.toLowerCase();return r==="localstorage"&&U.At()?(i=U,n=!0):r==="localstorage+cookie"&&t.At()?(i=t,n=!0,s=!0):r==="sessionstorage"&&J.At()?i=J:r==="memory"?i=qn:r==="cookie"&&se.At()?(i=se,s=!0):t.At()?(i=t,n=!0,s=!0):se.At()?(i=se,s=!0):i=qn,this.Jo=n,this.Ko=s,i}fa(e){return`${this.ua}__${e}`}ha(e){return this.Jo&&!!e.split_storage}properties(){let e={};return Z(this.props,(t,i)=>{let s=fe(i);if(!s||s.exposure==="event"){var n;if(!(s==null||(n=s.shouldSkipFromEventProperties)===null||n===void 0)&&n.call(s,t))return;e[i]=t}}),e}load(e=!1){if(this.hi&&!e)return;let t=this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie",i=t?U.Lt(this.ua):null,s={};if(t)try{s=tn(se.Lt(this.ua)),Z(s,(a,l)=>{(x(a)||ne(a)||a==="")&&delete s[l]})}catch{}let n=this.No.Lt(this.ua);if(n&&(this.props=Q({},n)),this.Xo&&this.ja(),t&&n){var r,o;let a=i==null?void 0:i[je],l=(r=i==null?void 0:i.$user_state)!==null&&r!==void 0?r:it,c=n[je],u=(o=n.$user_state)!==null&&o!==void 0?o:it;if(c!==a||u!==l){this.Yo=!0,this.hi||J.$t(Yi(this.ua),!0);let d=Q({},this.props);en.forEach(p=>delete d[p]),u!=="anonymous"||l!=="identified"&&s.$user_state!=="anonymous"&&(x(a)||c===a)||(Yo(d,s),delete d[ft]),this.props=d;let h=new Set;en.forEach(p=>{var v;let _=(v=fe(p))===null||v===void 0?void 0:v.storageGroup;_&&h.add(_)}),h.forEach(p=>{if(this.hi)return;let v={};Z(this.props,(_,g)=>{var y;((y=fe(g))===null||y===void 0?void 0:y.storageGroup)===p&&(v[g]=_)}),Me(v)?(U.Pt(this.fa(p)),this.Zo[p]={}):U.$t(this.fa(p),v)&&(this.Zo[p]={persisted:!0,fingerprint:this.ka(v,p)})})}}J.Ot(Yi(this.ua))&&(this.Yo=!0)}ja(){for(let e of hi){let t=U.Lt(this.fa(e));if(t&&!Me(t)){let i=this.ma(e);i.persisted=!0,this.Ba(e)||(i.fingerprint=this.ka(t,e)),this.za(e,t)||Q(this.props,t)}}}Ba(e){return Object.keys(this.props).some(t=>{var i;return((i=fe(t))===null||i===void 0?void 0:i.storageGroup)===e})}za(e,t){let i=Cp[e];if(!i)return!1;let s=t[i],n=this.props[i];return oe(s)&&oe(n)&&n>s}refreshKey(e){var t;if(this.hi||this.ra.has(e))return;let i=this.Xo?(t=fe(e))===null||t===void 0?void 0:t.storageGroup:void 0,s=i?U.Lt(this.fa(i)):this.No.Lt(this.ua);if(s&&e in s)this.xa(e,s[e],!1);else{if(i){let n=this.No.Lt(this.ua);if(n&&e in n)return void this.xa(e,n[e],!1)}this.$a(e,!1)}}save(){if(this.hi)return;let e=this.Ea();e>0?x(this.La)&&(this.La=setTimeout(()=>{this.La=void 0,this.Na()},e)):this.Na()}flush(){x(this.La)||(clearTimeout(this.La),this.La=void 0,this.Na())}Na(e=!1){if(this.hi||this.ta&&!e)return;e||(this.syncCookieProperties(),this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie"||Ac.forEach(n=>this.refreshKey(n)));let t=!e&&!this.ia;t||(this.sa=!1);let i=!!t&&this.Ca();if(this.sa)return void(this.Mr.debug&&T.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Xo)return this.Ha(),void(i&&this.oa.forEach(n=>n()));let s=this.Ua(this.No,this.ua,this.props,ce);s==="written"&&this.Pa(this.props),s!=="failed"&&(this.ea.clear(),this.na=!1,this.ra.clear()),i&&this.oa.forEach(n=>n())}Ha(){let{main:e,groups:t}=this._a(),i=this.Ua(this.No,this.ua,e,ce);i==="written"&&this.Pa(e),i!=="failed"&&(this.na=!1,this.ra.clear(),et.forEach(n=>{var r;!((r=fe(n))===null||r===void 0)&&r.storageGroup||this.ea.delete(n)}));for(let n of hi){var s;let r=t[n];if(Me(r)&&!(!((s=this.Zo[n])===null||s===void 0)&&s.persisted)){et.forEach(a=>{var l;((l=fe(a))===null||l===void 0?void 0:l.storageGroup)===n&&this.ea.delete(a)});continue}let o=this.Ua(U,this.fa(n),r,n);o!=="failed"&&et.forEach(a=>{let l=fe(a);(l==null?void 0:l.storageGroup)!==n||o!=="written"&&l.volatile||this.ea.delete(a)})}}_a(){let e={},t={flags:{},surveys:{}};return Z(this.props,(i,s)=>{var n;let r=(n=fe(s))===null||n===void 0?void 0:n.storageGroup;r?t[r][s]=i:e[s]=i}),{main:e,groups:t}}ka(e,t){if(t===ce)return JSON.stringify(e)+"|"+this.Wa+"|"+this.Va+"|"+this.Ga;let i={};return Z(e,(s,n)=>{var r;i[n]=!((r=fe(n))===null||r===void 0)&&r.volatile?"__volatile__":s}),JSON.stringify(i)}Ua(e,t,i,s){let n=this.ma(s);if(s!==ce&&!n.dirty&&!x(n.fingerprint))return"skipped";let r;try{if(r=this.ka(i,s),r===n.fingerprint)return n.dirty=!1,"skipped"}catch{r=void 0}return e.$t(t,i,this.Wa,this.Va,this.Ga,this.Mr.debug)?(n.dirty=!1,s!==ce&&(n.persisted=!0),x(r)||(n.fingerprint=r),this.Jo&&(n.storageValue=U.Ot(t)),"written"):(this.Mr.debug&&T.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ia(),x(this.La)||(clearTimeout(this.La),this.La=void 0),this.No.Pt(this.ua,!1),this.No.Pt(this.ua,!0),!e&&this.aa)for(let t of hi)U.Pt(this.fa(t));e?delete this.Zo[ce]:this.Zo={},this.Ra=void 0,this.Aa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(j(e)){this.syncCookieProperties(),x(t)&&(t="None"),this.Wa=x(i)?this.Qa:i;let s=!1;if(Z(e,(n,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.xa(r,n),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(j(e)){this.syncCookieProperties(),this.Wa=x(t)?this.Qa:t;let i=!1;if(Z(e,(s,n)=>{e.hasOwnProperty(n)&&(this.props[n]!==s||j(s)||O(s))&&(this.xa(n,s),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();let t=typeof e=="string"?[e]:e,i=!1;for(let s of t)s in this.props&&(this.$a(s),i=!0);i&&this.save()}update_campaign_params(){let e=E==null?void 0:E.URL;if(e===this.la)return;let t=$c(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),i=!Me(yr(t));return i&&this.register(t),this.la=e,i?t:void 0}update_search_keyword(){this.register((function(){let e=E==null?void 0:E.referrer;return e?Mc(e):{}})())}update_referrer_info(){var e;this.register_once({$referrer:Ic(),$referring_domain:(E==null?void 0:E.referrer)&&((e=nt(E.referrer))===null||e===void 0?void 0:e.host)||xs},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;let e=Cc(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[Bt]:this.Ko?{r:Xi(e.r),u:e.u?Xi(e.u):void 0}:e},void 0)}get_initial_props(){let e={};Z([Xl,Yl],i=>{let s=this.props[i];s&&Z(s,function(n,r){e["$initial_"+Mn(r)]=n})});let t=this.props[Bt];if(t){let i=(function(s,n=!1){let r=Fc(s,n),o={};return Z(r,function(a,l){o[`$initial_${Mn(l)}`]=a}),o})(t,this.Mr.disable_capture_url_hashes);Q(e,i)}return e}safe_merge(e){return Z(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){let s=e.persistence!==t.persistence,n=!((p,v)=>{if(p.length!==v.length)return!1;let _=[...p].sort(),g=[...v].sort();return _.every((y,m)=>y===g[m])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),r=s||n,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.hi&&!a;a||this.Fa(t,l),this.Mr=e,!a&&(s||n||o)&&(this.Ra=void 0,this.Aa=void 0,this.Fa(f(f({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),l));let c=r||o?this.ca(e):this.No;this.Za();let u=this.ha(e),d=r||u!==this.Xo,h=!a&&(d||e.cross_subdomain_cookie!==this.Va||e.secure_cookie!==this.Ga)&&this.Oa(l);this.ia=d;try{if(this.Qa=this.Wa=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),d){let p=this.props;this.clear(),this.No=c,this.Xo=u,this.props=p,this.save()}else o&&(this.No=c,a||(delete this.Zo[ce],this.Na()))}finally{this.ia=!1,h&&this.qa()}}Za(){let e=this.props[Bt];if(!this.Ko||!j(e)||typeof e.r!="string")return;let t=Xi(e.r),i=typeof e.u=="string"?Xi(e.u):e.u;t===e.r&&i===e.u||this.xa(Bt,f(f({},e),{},{r:t,u:i}))}set_disabled(e){this.hi=e,this.hi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Va&&(this.Va=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ga&&(this.Ga=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){let i=this.props.__timers||{};i[e]=t,this.xa(Nn,i),this.save()}remove_event_timer(e){let t=this.props.__timers||{},i=t[e];return x(i)||(delete t[e],this.xa(Nn,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.xa(e,t),this.save()}xa(e,t,i=!0){var s;let n=this.props[e];this.props[e]=t,i&&(e!=="distinct_id"&&e!=="$user_state"||n===t||(this.na=!0),Zo(e)&&!ut(n,t)&&this.ra.add(e),this.Ma(e,n,t),!((s=fe(e))===null||s===void 0)&&s.volatile||this.Ta(e))}$a(e,t=!0){delete this.props[e],t&&(an(e)&&this.ga(e,!0),Zo(e)&&this.ra.add(e),this.Ta(e))}Ta(e){var t;let i=(t=fe(e))===null||t===void 0?void 0:t.storageGroup;i&&(this.ma(i).dirty=!0)}ma(e){return this.Zo[e]||(this.Zo[e]={})}},Ce={GZipJS:"gzip-js",Base64:"base64"},pi={Activation:"events",Cancellation:"cancelEvents"};var cn={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"};var Ie={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},un={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Xn={Popover:"popover",Inline:"inline"};function Ji(e){let t=!0;return{dispose(){if(t){t=!1;let i=e();i&&le(i.then)&&i.then(void 0,()=>{})}}}}var Ap={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Xo={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Jo=re("[RateLimiter]"),Op=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{let i=t.text;if(i&&i.length)try{(JSON.parse(i).quota_limited||[]).forEach(s=>{Jo.info(`${s||"events"} is quota limited.`),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void Jo.warn(`could not rate limit - continuing. Error: "${s==null?void 0:s.message}"`,{text:i})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var t,i,s;let{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,o=new Date().getTime(),a=(t=(i=this.instance.persistence)===null||i===void 0?void 0:i.get_property("$capture_rate_limit"))!==null&&t!==void 0?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*r,a.last=o,a.tokens>n&&(a.tokens=n);let l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){let c=(oe(a.dropped)?a.dropped:0)+1;a.dropped=c,!this.lastEventRateLimited&&this.Ja(c)&&(a.dropped=0)}return this.lastEventRateLimited=l,(s=this.instance.persistence)===null||s===void 0||s.set_property("$capture_rate_limit",a),{isRateLimited:l,remainingTokens:a.tokens}}Ka(e){let t=this.instance.config.property_denylist;return!O(t)||!t.includes(e)}Xa(){var e;if(this.Ka("$current_url")&&this.Ka("$pathname")&&(K!=null&&K.pathname))return`${(e=K.origin)!==null&&e!==void 0?e:""}${K.pathname}`}Ja(e){var t,i;let{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,r=this.Xa(),o=this.Ka("$session_id")?(t=(i=this.instance).get_session_id)===null||t===void 0?void 0:t.call(i):void 0,a=[`${e} event(s) dropped since the last warning`,r?`triggered on ${r}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${a}. Config is set to ${n} events per second and ${s} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){let t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},dt=re("[RemoteConfig]"),Oc=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.config}Ya(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.loadExternalDependency?(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}tl(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return dt.info("Using preloaded remote config",this.remoteConfig),void this.el(this.remoteConfig);if(this._instance.il())return void dt.warn("Remote config is disabled. Falling back to local config.");this.Ya(e=>{if(!e)return dt.info("No config found after loading remote JS config. Falling back to JSON."),void this.tl(t=>{this.el(t.json,t)});this.el(e)})}catch(e){dt.error("Error loading remote config",e),this.el()}}el(e,t){!e&&t&&(t.statusCode===0?t.error||dt.warn("Failed to fetch remote config from PostHog."):dt.error("Failed to fetch remote config from PostHog."));try{this._instance.el(e?{ok:!0,config:e}:{ok:!1})}catch(s){dt.error("Error applying remote config",s)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;(i=this._instance.featureFlags)===null||i===void 0||i.ensureFlagsLoaded()}catch(s){dt.error("Error loading feature flags",s)}}};var Fe=Uint8Array,Ee=Uint16Array,ei=Uint32Array,Er=new Fe([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]),$r=new Fe([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]),Ko=new Fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rc=function(e,t){for(var i=new Ee(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var n=new ei(i[30]);for(s=1;30>s;++s)for(var r=i[s];i[s+1]>r;++r)n[r]=r-i[s]<<5|s;return[i,n]},Lc=Rc(Er,2),Jn=Lc[1];Lc[0][28]=258,Jn[258]=28;for(Kn=Rc($r,0)[1],ks=new Ee(32768),te=0;32768>te;++te)kt=(43690&te)>>>1|(21845&te)<<1,ks[te]=((65280&(kt=(61680&(kt=(52428&kt)>>>2|(13107&kt)<<2))>>>4|(3855&kt)<<4))>>>8|(255&kt)<<8)>>>1;var kt,Kn,ks,te,Pi=function(e,t,i){for(var s=e.length,n=0,r=new Ee(t);s>n;++n)++r[e[n]-1];var o,a=new Ee(t);for(n=0;t>n;++n)a[n]=a[n-1]+r[n-1]<<1;if(i){o=new Ee(1<<t);var l=15-t;for(n=0;s>n;++n)if(e[n])for(var c=n<<4|e[n],u=t-e[n],d=a[e[n]-1]++<<u,h=d|(1<<u)-1;h>=d;++d)o[ks[d]>>>l]=c}else for(o=new Ee(s),n=0;s>n;++n)o[n]=ks[a[e[n]-1]++]>>>15-e[n];return o},At=new Fe(288);for(te=0;144>te;++te)At[te]=8;for(te=144;256>te;++te)At[te]=9;for(te=256;280>te;++te)At[te]=7;for(te=280;288>te;++te)At[te]=8;var Ss=new Fe(32);for(te=0;32>te;++te)Ss[te]=5;var Rp=Pi(At,9,0),Lp=Pi(Ss,5,0),Dc=function(e){return(e/8|0)+(7&e&&1)},Nc=function(e,t,i){(t==null||0>t)&&(t=0),(i==null||i>e.length)&&(i=e.length);var s=new(e instanceof Ee?Ee:e instanceof ei?ei:Fe)(i-t);return s.set(e.subarray(t,i)),s},Je=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},fi=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},dn=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s,f:e[s]});var n=i.length,r=i.slice();if(!n)return[new Fe(0),0];if(n==1){var o=new Fe(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(P,k){return P.f-k.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=n-1;)a=i[i[d].f>i[c].f?c++:d++],l=i[c!=u&&i[d].f>i[c].f?c++:d++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=r[0].s;for(s=1;n>s;++s)r[s].s>h&&(h=r[s].s);var p=new Ee(h+1),v=Qn(i[u-1],p,0);if(v>t){s=0;var _=0,g=v-t,y=1<<g;for(r.sort(function(P,k){return p[k.s]-p[P.s]||P.f-k.f});n>s;++s){var m=r[s].s;if(t>=p[m])break;_+=y-(1<<v-p[m]),p[m]=t}for(_>>>=g;_>0;){var w=r[s].s;t>p[w]?_-=1<<t-p[w]++-1:++s}for(;s>=0&&_;--s){var M=r[s].s;p[M]==t&&(--p[M],++_)}v=t}return[new Fe(p),v]},Qn=function(e,t,i){return e.s==-1?Math.max(Qn(e.l,t,i+1),Qn(e.r,t,i+1)):t[e.s]=i},Qo=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Ee(++t),s=0,n=e[0],r=1,o=function(l){i[s++]=l},a=1;t>=a;++a)if(e[a]==n&&a!=t)++r;else{if(!n&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(n),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(n);r=1,n=e[a]}return[i.subarray(0,s),t]},vi=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},os=function(e,t,i){var s=i.length,n=Dc(t+2);e[n]=255&s,e[n+1]=s>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var r=0;s>r;++r)e[n+r+4]=i[r];return 8*(n+4+s)},ea=function(e,t,i,s,n,r,o,a,l,c,u){Je(t,u++,i),++n[256];for(var d=dn(n,15),h=d[0],p=d[1],v=dn(r,15),_=v[0],g=v[1],y=Qo(h),m=y[0],w=y[1],M=Qo(_),P=M[0],k=M[1],I=new Ee(19),S=0;m.length>S;++S)I[31&m[S]]++;for(S=0;P.length>S;++S)I[31&P[S]]++;for(var $=dn(I,7),D=$[0],R=$[1],N=19;N>4&&!D[Ko[N-1]];--N);var B,C,H,W,Y=c+5<<3,z=vi(n,At)+vi(r,Ss)+o,ie=vi(n,h)+vi(r,_)+o+14+3*N+vi(I,D)+(2*I[16]+3*I[17]+7*I[18]);if(z>=Y&&ie>=Y)return os(t,u,e.subarray(l,l+c));if(Je(t,u,1+(z>ie)),u+=2,z>ie){B=Pi(h,p,0),C=h,H=Pi(_,g,0),W=_;var ge=Pi(D,R,0);for(Je(t,u,w-257),Je(t,u+5,k-1),Je(t,u+10,N-4),u+=14,S=0;N>S;++S)Je(t,u+3*S,D[Ko[S]]);u+=3*N;for(var de=[m,P],me=0;2>me;++me){var Te=de[me];for(S=0;Te.length>S;++S)Je(t,u,ge[he=31&Te[S]]),u+=D[he],he>15&&(Je(t,u,Te[S]>>>5&127),u+=Te[S]>>>12)}}else B=Rp,C=At,H=Lp,W=Ss;for(S=0;a>S;++S)if(s[S]>255){var he;fi(t,u,B[257+(he=s[S]>>>18&31)]),u+=C[he+257],he>7&&(Je(t,u,s[S]>>>23&31),u+=Er[he]);var Re=31&s[S];fi(t,u,H[Re]),u+=W[Re],Re>3&&(fi(t,u,s[S]>>>5&8191),u+=$r[Re])}else fi(t,u,B[s[S]]),u+=C[s[S]];return fi(t,u,B[256]),u+C[256]},Dp=new ei([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Np=new Fe(0),jp=(function(){for(var e=new ei(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e})(),hn=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Vp(e,t){t===void 0&&(t={});var i=(function(){var h=4294967295;return{p(p){for(var v=h,_=0;p.length>_;++_)v=jp[255&v^p[_]]^v>>>8;h=v},d(){return 4294967295^h}}})(),s=e.length;i.p(e);var n,r,o,a,l,c,u=(a=10+((n=t).filename&&n.filename.length+1||0),l=8,(function(h,p,v,_,g,y){var m=h.length,w=new Fe(_+m+5*(1+Math.floor(m/7e3))+g),M=w.subarray(_,w.length-g),P=0;if(!p||8>m)for(var k=0;m>=k;k+=65535){var I=k+65535;m>I?P=os(M,P,h.subarray(k,I)):(M[k]=y,P=os(M,P,h.subarray(k,m)))}else{for(var S=Dp[p-1],$=S>>>13,D=8191&S,R=(1<<v)-1,N=new Ee(32768),B=new Ee(R+1),C=Math.ceil(v/3),H=2*C,W=function(js){return(h[js]^h[js+1]<<C^h[js+2]<<H)&R},Y=new ei(25e3),z=new Ee(288),ie=new Ee(32),ge=0,de=0,me=(k=0,0),Te=0,he=0;m>k;++k){var Re=W(k),ot=32767&k,at=B[Re];if(N[ot]=at,B[Re]=ot,k>=Te){var wt=m-k;if((ge>7e3||me>24576)&&wt>423){P=ea(h,M,0,Y,z,ie,de,me,he,k-he,P),me=ge=de=0,he=k;for(var Pe=0;286>Pe;++Pe)z[Pe]=0;for(Pe=0;30>Pe;++Pe)ie[Pe]=0}var Ge=2,Ui=0,td=D,lt=ot-at&32767;if(wt>2&&Re==W(k-lt))for(var id=Math.min($,wt)-1,sd=Math.min(32767,k),nd=Math.min(258,wt);sd>=lt&&--td&&ot!=at;){if(h[k+Ge]==h[k+Ge-lt]){for(var ct=0;nd>ct&&h[k+ct]==h[k+ct-lt];++ct);if(ct>Ge){if(Ge=ct,Ui=lt,ct>id)break;var rd=Math.min(lt,ct-2),Jr=0;for(Pe=0;rd>Pe;++Pe){var Ns=k-lt+Pe+32768&32767,Kr=Ns-N[Ns]+32768&32767;Kr>Jr&&(Jr=Kr,at=Ns)}}}lt+=(ot=at)-(at=N[ot])+32768&32767}if(Ui){Y[me++]=268435456|Jn[Ge]<<18|Kn[Ui];var Qr=31&Jn[Ge],eo=31&Kn[Ui];de+=Er[Qr]+$r[eo],++z[257+Qr],++ie[eo],Te=k+Ge,++ge}else Y[me++]=h[k],++z[h[k]]}}P=ea(h,M,y,Y,z,ie,de,me,he,k-he,P),y||(P=os(M,P,Np))}return Nc(w,0,_+Dc(P)+g)})(r=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,a,l,!c)),d=u.length;return(function(h,p){var v=p.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>p.level?4:p.level==9?2:0,h[9]=3,p.mtime!=0&&hn(h,4,Math.floor(new Date(p.mtime||Date.now())/1e3)),v){h[3]=8;for(var _=0;v.length>=_;++_)h[_+10]=v.charCodeAt(_)}})(u,t),hn(u,d-8,i.d()),hn(u,d-4,s),u}var Hp=!!nr||!!Ci,jc=new WeakMap,Vc="text/plain",pn=0,as=!1,Hc=(e,t)=>{let[i,s]=e.split("#"),[n,r]=i.split("?");if(!r)return e;let o=r.split("&").filter(a=>a.split("=")[0]!==t).join("&");return`${n}${o?`?${o}`:""}${s?`#${s}`:""}`},ji=(e,t,i=!0)=>{var s;let[n,r]=e.split("?"),o=f({},t),a=(s=r==null?void 0:r.split("&").map(c=>{var u;let[d,h]=c.split("="),p=i&&(u=o[d])!==null&&u!==void 0?u:h;return delete o[d],`${d}=${p}`}))!==null&&s!==void 0?s:[],l=(function(c,u="&"){let d,h,p=[];return Z(c,function(v,_){x(v)||x(_)||_==="undefined"||(d=encodeURIComponent((g=>g instanceof File)(v)?v.name:v.toString()),h=encodeURIComponent(_),p[p.length]=h+"="+d)}),p.join(u)})(o);return l&&a.push(l),a.length>0?`${n}?${a.join("&")}`:n},fn=e=>{if(e.nl)return e.nl;let{data:t,compression:i}=e;if(!t)return;if(i===Ce.GZipJS){let n=Vp((function(r){var o=r.length;if(typeof TextEncoder!="undefined")return new TextEncoder().encode(r);for(var a=new Fe(r.length+(r.length>>>1)),l=0,c=function(p){a[l++]=p},u=0;o>u;++u){if(l+5>a.length){var d=new Fe(l+8+(o-u<<1));d.set(a),a=d}var h=r.charCodeAt(u);128>h?c(h):2048>h?(c(192|h>>>6),c(128|63&h)):h>55295&&57344>h?(c(240|(h=65536+(1047552&h)|1023&r.charCodeAt(++u))>>>18),c(128|h>>>12&63),c(128|h>>>6&63),c(128|63&h)):(c(224|h>>>12),c(128|h>>>6&63),c(128|63&h))}return Nc(a,0,l)})(Ut(t)),{mtime:0});return{contentType:Vc,body:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),estimatedSize:n.byteLength}}if(i===Ce.Base64){let n=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(a,l)=>String.fromCharCode(parseInt(l,16))))})(Ut(t)),r=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Ut(o)))(n);return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}let s=Ut(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}},Bc=e=>{let t=()=>e.transport==="sendBeacon"?{url:ji(e.url,{compression:Ce.Base64}),encodedBody:fn(f(f({},e),{},{compression:Ce.Base64,nl:void 0}))}:{url:Hc(e.url,"compression"),encodedBody:fn(f(f({},e),{},{compression:void 0,nl:void 0}))},i;try{i=fn(e)}catch(n){if(mo(e.compression,Kt(e.url,"compression")))return T.error("Failed to gzip request body, sending uncompressed payload",n),t();throw n}return i&&mo(e.compression,Kt(e.url,"compression"))&&!((s=i.body)instanceof ArrayBuffer?On(new Uint8Array(s)):ArrayBuffer.isView(s)&&On(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)))?(as=!0,t()):{url:e.url,encodedBody:i};var s},Wc=e=>{try{return Bc(e)}catch(i){var t;return T.error(i),void((t=e.callback)===null||t===void 0||t.call(e,{statusCode:0,error:i}))}},Bp=(function(){var e=ee(function*(t){let i=yield(function(n){return Rn.apply(this,arguments)})(Ut(t.data),ue.DEBUG,{rethrow:!0});if(!i)return t;let s=yield i.arrayBuffer();return f(f({},t),{},{nl:{contentType:Vc,body:s,estimatedSize:s.byteLength}})});return function(t){return e.apply(this,arguments)}})(),Wp=/Failed to fetch|NetworkError|Load failed/i,Uc=e=>(e==null?void 0:e.name)==="TypeError"&&Wp.test((e==null?void 0:e.message)||""),zc=e=>{try{let t=(function(i,s=Date.now()){if(typeof i!="string"||!i)return;let n=i.trim(),r=/^\d+\s*,/.test(n)?n.slice(0,n.indexOf(",")).trim():n;if(/^\d+$/.test(r)){let l=1e3*Math.min(Number(r),300);return l>0?l:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(r))return;let o=/^\w{3} \w{3} /.test(r)?r+" GMT":r,a=Date.parse(o)-s;return Number.isFinite(a)&&a>0?Math.min(a,ss):void 0})(e());return x(t)?void 0:Math.min(t,3e4)}catch{return}},Gc=e=>{let t=Wc(e);if(!t)return;let i=new nr;jc.set(i,!0);let{url:s,encodedBody:n}=t;i.open(e.method||"GET",s,!0);let{contentType:r,body:o}=n!=null?n:{};Z(e.headers,function(a,l){i.setRequestHeader(l,a)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(i.readyState===4){var a;let l={statusCode:i.status,text:i.responseText};if(i.status===200)try{l.json=JSON.parse(i.responseText)}catch{}(a=e.callback)===null||a===void 0||a.call(e,l,zc(()=>i.getResponseHeader("Retry-After")))}},i.send(o)},qc=e=>{let t=Wc(e);if(!t)return;let{url:i,encodedBody:s}=t,{contentType:n,body:r,estimatedSize:o}=s!=null?s:{},a=new Headers;Z(e.headers,function(v,_){a.append(_,v)}),n&&a.append("Content-Type",n);let l=null,c=!1;if(to){let v=new to;l={signal:v.signal,timeout:setTimeout(()=>{c=!0;try{v.abort(_l("AbortError","PostHog request timed out"+((_=e.timeout)?` after ${_}ms`:"")))}catch(g){d(g)}var _},e.timeout)}}let u=!1,d=v=>{var _;u||(u=!0,c&&(v==null?void 0:v.name)==="AbortError"||Uc(v)?T.warn(v):T.error(v),(_=e.callback)===null||_===void 0||_.call(e,{statusCode:0,error:v}))},h=0,p=()=>{pn-=h,h=0,l&&clearTimeout(l.timeout)};try{let v=f({method:(e==null?void 0:e.method)||"GET",headers:a,referrerPolicy:"strict-origin",body:r,signal:l==null?void 0:l.signal},e.fetchOptions),_=o!=null?o:x(r)?0:void 0;v.keepalive=v.method==="POST"&&!e.sl&&v.keepalive!==!1&&v.body===r&&!x(_)&&_>=0&&52428.8>pn+_,v.keepalive&&(h=_,pn+=h),Ci(i,v).then(g=>g.text().then(y=>{var m;if(u)return;let w={statusCode:g.status,text:y};if(g.status===200)try{w.json=JSON.parse(y)}catch(M){T.error(M)}u=!0,p(),(m=e.callback)===null||m===void 0||m.call(e,w,zc(()=>g.headers.get("Retry-After")))})).catch(g=>{p(),d(g)}).finally(p)}catch(v){p(),d(v)}},er=e=>{try{var t;let{url:i,encodedBody:s}=Bc(e),{contentType:n,body:r,estimatedSize:o}=s!=null?s:{};if(!r)return;let a=r instanceof Blob?r:new Blob([r],{type:n});if(pe.sendBeacon(i,a))return;let l=O(e.data)?e.data:(t=e.data)===null||t===void 0?void 0:t.batch;if(O(l)&&l.length>1&&(o!=null?o:0)>16384){let c=Math.ceil(l.length/2),u=d=>O(e.data)?d:f(f({},e.data),{},{batch:d});return er(f(f({},e),{},{data:u(l.slice(0,c))})),void er(f(f({},e),{},{data:u(l.slice(c))}))}T.warn(`Beacon of ~${o!=null?o:0} bytes was rejected by the browser, falling back to ${Ci?"fetch":"XHR"}`),Ci?qc(f(f({},e),{},{sl:!0})):Gc(e)}catch(i){T.warn("Beacon send failed",i)}},ta=(e,t,i,s)=>{let n=s==="query"?t==="POST"?"sent_at":"_":void 0;return ji(i===Ce.GZipJS?Hc(e,"compression"):e,f(f({},n?{[n]:Date.now().toString()}:{}),i===Ce.GZipJS?{}:{compression:i}))},Up=(()=>{let e=[];return Ci&&e.push({transport:"fetch",method:qc}),nr&&e.push({transport:"XHR",method:Gc}),pe!=null&&pe.sendBeacon&&e.push({transport:"sendBeacon",method:er}),e})(),Zc=!Hp&&(xe==null?void 0:xe.indexOf("MSIE"))===-1&&(xe==null?void 0:xe.indexOf("Mozilla"))===-1;function Yc(e,t,i){var s,n,r;i&&(t=f(f({},t),{},{callback:o=>i(o)})),e.__loaded?Zc?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&((n=t.callback)===null||n===void 0||n.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=f(f({},e.config.request_headers),t.headers),t.compression=t.compression==="best-available"?(s=e.compression)!==null&&s!==void 0?s:t.compressionFallback:t.compression,(x(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,((o,a)=>{var l,c,u;let d=f(f({},o),{},{callback:a!=null?a:g=>{var y;return(y=o.callback)===null||y===void 0?void 0:y.call(o,g)}});d.timeout=d.timeout||6e4;let h=(l=d.transport)!==null&&l!==void 0?l:"fetch";h==="sendBeacon"&&x(d.compression)&&d.data&&(d.compression=Ce.Base64),d.method==="POST"&&d.data&&(d.timestampMode==="capture-body"?d.data=(g=>{var y,m;let w=(O(g)?g:[g]).map(P=>f(f({},P),P.timestamp instanceof Date&&!isNaN(P.timestamp.getTime())?{timestamp:P.timestamp.toISOString()}:{})),M=w[0];return{api_key:(y=M==null||(m=M.properties)===null||m===void 0?void 0:m.token)!==null&&y!==void 0?y:M==null?void 0:M.token,batch:w,sent_at:new Date().toISOString()}})(d.data):d.timestampMode==="body"&&(d.data=((g,y=new Date().toISOString())=>O(g)?g.map(m=>f(f({},m),{},{sent_at:y})):f(f({},g),{},{sent_at:y}))(d.data))),d.url=ta(d.url,d.method,d.compression,d.timestampMode);let p=Up.filter(g=>!d.disableTransport||!g.transport||!d.disableTransport.includes(g.transport)),v=(c=(u=(function(g,y){for(let m=0;g.length>m;m++)if(y(g[m]))return g[m]})(p,g=>g.transport===h))===null||u===void 0?void 0:u.method)!==null&&c!==void 0?c:p[0].method;if(!v)throw new Error("No available transport method");let _=g=>{try{v(g)}catch(m){var y;Uc(m)?T.warn(m):T.error(m),(y=d.callback)===null||y===void 0||y.call(d,{statusCode:0,error:m})}};h!=="sendBeacon"&&!d.preferSyncCompression&&d.data&&d.compression===Ce.GZipJS&&od&&typeof Promise!="undefined"&&!as?Bp(d).then(g=>{_(g)}).catch(g=>{if(yo(g))return as=!0,void _(f(f({},d),{},{compression:void 0,url:ta(o.url,o.method,void 0,o.timestampMode)}));(y=>{if(!y||typeof y!="object")return!1;let m="name"in y?String(y.name):"";return yo(y)||m===Sl})(g)&&(as=!0),_(d)}):_(d)})(t,(o,a)=>{var l,c,u;e.rateLimiter.checkForLimiting(o),400>o.statusCode||(l=(c=e.config).on_request_error)===null||l===void 0||l.call(c,o),i?i(o,a):(u=t.callback)===null||u===void 0||u.call(t,o)})):t.fireCallbackOnDrop&&((r=t.callback)===null||r===void 0||r.call(t,{statusCode:0}))}var zp=class{constructor(e,t){this.rl=!0,this.ol=[],this.al=Xe((t==null?void 0:t.flush_interval_ms)||3e3,250,5e3,T.createLogger("flush interval"),3e3),this.ll=e}enqueue(e){this.ol.push(e),this.ul||this.cl()}unload(){this.hl();let e=this.ol.length>0?this.dl():{},t=Object.values(e);[...t.filter(i=>i.url.indexOf("/e")===0),...t.filter(i=>i.url.indexOf("/e")!==0)].map(i=>{this.vl(f(f({},i),{},{callback:void 0}),"sendBeacon")})}enable(){this.rl=!1,this.cl()}cl(){this.rl||(this.ul=setTimeout(()=>{this.hl(),this.fl()},this.al))}fl(){if(this.ol.length>0){let e=this.dl();for(let t in e)this.vl(e[t])}}vl(e,t){try{this.ll(e,t)}catch(i){T.error(i)}}hl(){clearTimeout(this.ul),this.ul=void 0}dl(){let e={},t={};Z(this.ol,i=>{var s;let n=i,r=((n?n.batchKey:null)||n.url)+(n.batchGroup?`:${n.batchGroup}`:"");x(e[r])&&(e[r]=f(f({},n),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[r]=[]),(s=e[r].data)===null||s===void 0||s.push(n.data),n.callback&&t[r].push(n.callback)});for(let i in t){let s=t[i];s.length&&(e[i].callback=n=>{for(let r of s)r(n)})}return this.ol=[],e}},Gp=["retriesPerformedSoFar"],qp=class{constructor(e){this._instance=e,this.pl=!1,this.gl=3e3,this.ol=[],this.ol=[],this.ml=!0,this.resume()}resume(){if(!x(b)&&"onLine"in b.navigator){if(this.ml=b.navigator.onLine,this.yl)return;this.yl=()=>{this.ml=!0,this.fl()},this.bl=()=>{this.ml=!1},G(b,"online",this.yl),G(b,"offline",this.bl)}}get length(){return this.ol.length}retriableRequest(e,t){let{retriesPerformedSoFar:i}=e,s=El(e,Gp);Qe(i)&&(s.url=ji(s.url,{retry_count:i})),Yc(this._instance,t?f(f({},s),{},{transport:t}):s,(n,r)=>{var o;if(n.statusCode!==200&&(400>n.statusCode||n.statusCode>=500)){if((n.statusCode===0?3:10)>(i!=null?i:0))return void this.Ls(f({retriesPerformedSoFar:i},s),r);n.statusCode===0&&T.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${i!=null?i:0} retries.`)}(o=s.callback)===null||o===void 0||o.call(s,n)})}Ls(e,t){let i=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=i+1;let s=Math.max((function(o){let a=3e3*Math.pow(2,o),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(i),t!=null?t:0),n=Date.now()+s;this.ol.push({retryAt:n,requestOptions:e});let r=`Enqueued failed request for retry in ${s}`;navigator.onLine||(r+=" (Browser is offline)"),T.warn(r),this.pl||(this.pl=!0,this._l())}_l(){if(this.wl&&clearTimeout(this.wl),this.ol.length===0)return this.pl=!1,void(this.wl=void 0);this.wl=setTimeout(()=>{this.ml&&this.ol.length>0&&this.fl(),this._l()},this.gl)}fl(){let e=Date.now(),t=[],i=this.ol.filter(s=>e>s.retryAt||(t.push(s),!1));if(this.ol=t,i.length>0)for(let{requestOptions:s}of i)this.retriableRequest(s)}unload(){this.wl&&(clearTimeout(this.wl),this.wl=void 0),this.pl=!1,x(b)||(this.yl&&(b.removeEventListener("online",this.yl),this.yl=void 0),this.bl&&(b.removeEventListener("offline",this.bl),this.bl=void 0));for(let{requestOptions:e}of this.ol)try{this._instance._send_request(f(f({},e),{},{callback:O(e.data)?void 0:e.callback,transport:"sendBeacon"}))}catch(t){T.error(t)}this.ol=[]}},Zp=class{constructor(e){this._instance=e,this.kl=()=>{var t,i,s,n;this.Sl||(this.Sl={});let r=this.scrollElement(),o=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,l=o+((r==null?void 0:r.clientHeight)||0),c=(r==null?void 0:r.scrollHeight)||0;this.Sl.lastScrollY=Math.ceil(o),this.Sl.maxScrollY=Math.max(o,(t=this.Sl.maxScrollY)!==null&&t!==void 0?t:0),this.Sl.maxScrollHeight=Math.max(a,(i=this.Sl.maxScrollHeight)!==null&&i!==void 0?i:0),this.Sl.lastContentY=l,this.Sl.maxContentY=Math.max(l,(s=this.Sl.maxContentY)!==null&&s!==void 0?s:0),this.Sl.maxContentHeight=Math.max(c,(n=this.Sl.maxContentHeight)!==null&&n!==void 0?n:0)}}get xl(){return this._instance.config.scroll_root_selector}getContext(){return this.Sl}resetContext(){let e=this.Sl;return this.Sl=void 0,setTimeout(this.kl,0),e}startMeasuringScrollPosition(){G(b,"scroll",this.kl,{capture:!0}),G(b,"scrollend",this.kl,{capture:!0}),G(b,"resize",this.kl)}scrollElement(){if(this.xl){let i=O(this.xl)?this.xl:[this.xl];for(let s of i){var e;let n=b==null||(e=b.document)===null||e===void 0?void 0:e.querySelector(s);if(n)return n}return}var t;return b==null||(t=b.document)===null||t===void 0?void 0:t.documentElement}$l(e){var t,i;let s=e==="y"?"scrollTop":"scrollLeft";if(this.xl){let n=this.scrollElement();return n&&n[s]||0}return b?e==="y"?b.scrollY||b.pageYOffset||((t=b.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.scrollTop)||0:b.scrollX||b.pageXOffset||((i=b.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.scrollLeft)||0:0}scrollY(){return this.$l("y")}scrollX(){return this.$l("x")}},Yp=e=>Cc(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties,e==null?void 0:e.config.disable_capture_url_hashes),ia=class{constructor(e,t,i,s){this.qe=n=>{let r=this.Cl();if(r&&r.sessionId===n)return;let o={sessionId:n,props:this.Tl(this._instance)};this.Il.register({[Un]:o})},this._instance=e,this.Ml=t,this.Il=i,this.Tl=s||Yp,this.Ml.onSessionId(this.qe)}Cl(){return this.Il.props[Un]}getSetOnceProps(){var e;let t=(e=this.Cl())===null||e===void 0?void 0:e.props;return t?"r"in t?Fc(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){let e={};return Z(yr(this.getSetOnceProps()),(t,i)=>{i==="$current_url"&&(i="url"),e[`$session_entry_${Mn(i)}`]=t}),e}},Es=class{on(e,t){return this.El[e]||(this.El[e]=[]),this.El[e].push(t),()=>{this.El[e]=this.El[e].filter(i=>i!==t)}}emit(e,t){for(let i of this.El[e]||[])i(t);for(let i of this.El["*"]||[])i(e,t)}constructor(){this.El={}}},Dt=re("[SessionId]"),sa=864e5,na=class{on(e,t){return this.Pl.on(e,t)}constructor(e,t,i){var s;if(this.Rl=null,this.Al=null,this.Fl=[],this.Ol=void 0,this.Dl=!1,this.Pl=new Es,this.Ll=(r,o)=>!(!Qe(r)||!Qe(o))&&Math.abs(r-o)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Mr=e.config,this.Il=e.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Nl=void 0,this._sessionActivityTimestamp=null,this.ql=t||He,this.jl=i||He;let n=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*Xe(this.Mr.session_idle_timeout_seconds||1800,60,36e3,Dt.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Bl(),this.zl="ph_"+n+"_window_id",this.Hl="ph_"+n+"_primary_window_exists",this.Ul()){let r=J.Lt(this.zl),o=J.Lt(this.Hl);r&&!o?this.je=r:J.Pt(this.zl),J.$t(this.Hl,!0)}!((s=this.Mr.bootstrap)===null||s===void 0)&&s.sessionID&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Wl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return x(this.Fl)&&(this.Fl=[]),this.Fl.push(e),this.Xt&&e(this.Xt,this.je),()=>{this.Fl=this.Fl.filter(t=>t!==e)}}Ul(){return this.Mr.persistence!=="memory"&&!this.Il.hi&&J.At()}Vl(e){e!==this.je&&(this.je=e,this.Ul()&&J.$t(this.zl,e))}Gl(){return this.je?this.je:this.Ul()?J.Lt(this.zl):null}Ql(e){let t=this.Rl;return!ne(t)&&!ne(e)&&5e3>Math.abs(e-t)}Zl(e,t,i){let s=t!==this._sessionActivityTimestamp,n=!(e!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,n&&!s||n&&this.Ql(t)||(this.Rl=t,this.Il.register({[Ht]:[t,e,i]}))}Jl(){var e;let t=(e=this.Mr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return Qe(t)&&t>0}Kl(){this.Jl()?this.Il.refreshKey(Ht):(this.Il.flush(),this.Il.load())}Xl(){var e;if(ne(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Rl)return;this.Kl();let[,t,i]=this.Yl();t===this.Xt&&i===this._sessionStartTimestamp&&(this.Rl=this._sessionActivityTimestamp,this.Il.register({[Ht]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Il.flush())}tu(){let[e]=this.Yl(),t=Qe(e)?e:0,i=Qe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,i)}eu(e){return this.Kl(),this.Ll(e,this.tu())}Yl(){let e=this.Il.props[Ht];return O(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Rl=null,this.Nl=void 0,clearTimeout(this.iu),this.iu=void 0,this.Zl(null,null,null)}setBootstrapSessionId(e,t=!1){let i=((s,n=new Date().getTime())=>{try{let r=(o=>{let a=o.replace(/-/g,"");if(a.length!==32)throw new Error("Not a valid UUID");if(a[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(a.substring(0,12),16)})(s);return r>n+6e4?void Dt.error("Bootstrap sessionID cannot be in the future"):r}catch(r){return void Dt.error("Invalid sessionID in bootstrap",r)}})(e);return!x(i)&&(t?this.Nl={sessionId:e,sessionStartTimestamp:i}:this.Zl(e,new Date().getTime(),i),!0)}destroy(){this.Dl=!0,this.Xl(),clearTimeout(this.iu),this.iu=void 0,this.Ol&&b&&(b.removeEventListener(ys,this.Ol,{capture:!1}),this.Ol=void 0),this.Fl=[]}Wl(){this.Ol=()=>{this.Xl(),this.Ul()&&J.Pt(this.Hl)},G(b,ys,this.Ol,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,t=null,i=!1){if(this.Mr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');let s=t||new Date().getTime(),n=this.Xt;if(i)this.Al=s;else if(ne(this.Al)||this.Al>s||s-this.Al>=1e3){var r,o;(r=(o=this.Il).syncCookieProperties)===null||r===void 0||r.call(o),this.Al=s}let[,a,l]=this.Yl(),c=!x(n)&&a!==n,u=this.tu(),d=this.Gl(),h=this.Nl,p=!!h&&(h.sessionStartTimestamp>s+6e4||s-h.sessionStartTimestamp>sa),v=h?p:Qe(l)&&Math.abs(s-l)>sa,_=!1,g=c,y=!a||!!h,m=a,w=!y&&!e&&this.Ll(s,u);if(w&&(w=this.eu(s),w||Dt.info("cross-tab refresh kept the session alive",{sessionId:a}),[,a,l]=this.Yl(),w||(y=!a||!!h)),y||w||v){g=!1;let I=h&&!p;a=I?h.sessionId:this.ql(),d=this.jl(),Dt.info("new session ID assigned",{sessionId:a,windowId:d,bootstrapped:!!I,changeReason:{noSessionId:y,activityTimeout:w,sessionPastMaximumLength:v}}),l=I?h.sessionStartTimestamp:s,this.Nl=void 0,_=!0}else d||(d=this.jl(),_=!0),g=g||a!==m,g&&(Dt.info("adopted cross-tab session id",{sessionId:a,windowId:d}),_=!0);let M=Qe(u)&&e&&!v?u:s,P=Qe(l)?l:new Date().getTime();this.Vl(d),this.Zl(a,M,P),e||this.Bl();let k={noSessionId:y,activityTimeout:w,sessionPastMaximumLength:v,crossTabAdoption:g};return _&&this.Fl.forEach(I=>I(a,d,k)),{sessionId:a,windowId:d,sessionStartTimestamp:P,changeReason:_?k:void 0,lastActivityTimestamp:u}}Bl(){this.Dl||(clearTimeout(this.iu),this.iu=setTimeout(()=>{if(!this.Dl)if(this.eu(new Date().getTime())){let e=this.Xt;this.resetSessionId(),this.Pl.emit("forcedIdleReset",{idleSessionId:e})}else this.Bl()},1.1*this.sessionTimeoutMs))}},Xc=function(e,t){if(!e)return!1;let i=e.userAgent;if(i&&no(i,t))return!0;try{let s=e==null?void 0:e.userAgentData;if(s!=null&&s.brands&&s.brands.some(n=>no(n==null?void 0:n.brand,t)))return!0}catch{}return!!e.webdriver};function Jc(){return(Jc=ee(function*(){let e=pe==null?void 0:pe.userAgentData;if(e!=null&&e.getHighEntropyValues)try{let t=yield e.getHighEntropyValues(["model"]),i=t==null?void 0:t.model;return V(i)&&i.length>0?i:void 0}catch(t){return void T.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function Xp(e,t){let i=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(i=`$survey_${t}/${e.id}/${e.current_iteration}`),i}function Kc(e){var t;return!!(!((t=e.conditions)===null||t===void 0||(t=t.events)===null||t===void 0||(t=t.values)===null||t===void 0)&&t.length)}var $s=(e,t)=>{if(!(i=>{try{new RegExp(i)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},Ki=e=>e.toLowerCase(),Qc={exact:(e,t)=>t.some(i=>e.some(s=>i===s)),is_not:(e,t)=>t.every(i=>e.every(s=>i!==s)),regex:(e,t)=>t.some(i=>e.some(s=>$s(i,s))),not_regex:(e,t)=>t.every(i=>e.every(s=>!$s(i,s))),icontains:(e,t)=>t.map(Ki).some(i=>e.map(Ki).some(s=>i.includes(s))),not_icontains:(e,t)=>t.map(Ki).every(i=>e.map(Ki).every(s=>!i.includes(s))),gt:(e,t)=>t.some(i=>{let s=parseFloat(i);return!isNaN(s)&&e.some(n=>s>parseFloat(n))}),lt:(e,t)=>t.some(i=>{let s=parseFloat(i);return!isNaN(s)&&e.some(n=>s<parseFloat(n))})};function eu(e,t){return!e||Object.entries(e).every(([i,s])=>{let n=t==null?void 0:t[i];if(n==null)return!1;let r=Qc[s.operator];return!!r&&r(s.values.map(String),[String(n)])})}function vn(e,t,i){return Ut({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var tr="custom",ra="i.posthog.com",Jp=/^\/static\//,Kp=["/s/","/e/","/i/"],Qp=class{constructor(e){this.nu={},this.instance=e}get apiHost(){let e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){let e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${ra}`,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.nu[this.apiHost]||(this.nu[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":tr),this.nu[this.apiHost]}su(e){if(!Jp.test(e))return;let t=this.instance.config.asset_host;return typeof t=="string"&&t.trim().replace(/\/$/,"")||void 0}ru(e){let t=nt(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}ou(e,t,i){if(e==="ui")return i;let s=i,n=this.instance.config.rewriteRequestPath;if(n){var r;let o=((r=nt(i))===null||r===void 0?void 0:r.href)||i;s=n(new URL(o)).toString()}if(n&&e==="api"&&Kp.some(o=>t.indexOf(o)===0)){let o=this.ru(s);if(o){let a=this.apiHost,l=this.au;(l==null?void 0:l.apiHost)===a&&l.rewriteRequestPath===n||(l={apiHost:a,rewriteRequestPath:n,urls:new Set},this.au=l),l.urls.add(o)}}return s}isIngestionEndpoint(e){let t=this.au,i=this.ru(e);return(t==null?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t=""){if(t&&(t=t[0]==="/"?t:`/${t}`),e==="ui")return this.ou(e,t,this.uiHost+t);if(e==="flags")return this.ou(e,t,this.flagsApiHost+t);if(e==="assets"){let s=this.su(t);if(s)return this.ou(e,t,`${s}${t}`)}if(this.region===tr)return this.ou(e,t,this.apiHost+t);let i=ra+t;switch(e){case"assets":return this.ou(e,t,`https://${this.region}-assets.${i}`);case"api":return this.ou(e,t,`https://${this.region}.${i}`)}}},q=re("[Surveys]"),tu=e=>{try{let t=(i=>((s,n)=>`seenSurvey_${(function(r){return r.current_iteration&&r.current_iteration>0?`${r.id}_${r.current_iteration}`:r.id})(n)}`)(0,i))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(t){q.error("Failed to persist survey seen state",t)}},ef=[cn.Popover,cn.Widget,cn.API],tf={ignoreConditions:!1,ignoreDelay:!1,displayType:Xn.Popover},sf=re("[PostHog ExternalIntegrations]"),nf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},rf=class{constructor(e){this._instance=e}zo(e,t){var i,s;(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,e,n=>{if(n)return sf.error("failed to load script",n);t()})}startIfEnabledOrStop(){var e;for(let[n,r]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var t,i,s;r&&!(!((t=F.__PosthogExtensions__)===null||t===void 0||(t=t.integrations)===null||t===void 0)&&t[n])&&this.zo(nf[n],()=>{var o;(o=F.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[n])===null||o===void 0||o.start(this._instance)}),!r&&(!((i=F.__PosthogExtensions__)===null||i===void 0||(i=i.integrations)===null||i===void 0)&&i[n])&&((s=F.__PosthogExtensions__)===null||s===void 0||(s=s.integrations)===null||s===void 0||(s=s[n])===null||s===void 0||s.stop())}}},of=class{constructor(e,t){this.A=e,this.bo=t,this.lu=new Map,this.To=!1}add(e){var t=this;return ee(function*(){if(t.To)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.lu.has(e.name))throw new Error(`Browser extension "${e.name}" is already registered`);t.lu.set(e.name,e);try{let i=e.setup(t.bo);i&&(yield i)}catch(i){let s=t.lu.get(e.name)===e;s&&t.lu.delete(e.name),t.A.error(`Failed to set up browser extension "${e.name}"`,i),s&&t.uu(e)}})()}getExtension(e){return this.lu.get(e)}dispose(){if(this.To)return;this.To=!0;let e=Array.from(this.lu.values()).reverse();this.lu.clear();for(let t of e)this.uu(t)}uu(e){try{var t;let i=(t=e.dispose)===null||t===void 0?void 0:t.call(e);i&&le(i.then)&&i.then(void 0,s=>{this.A.error(`Failed to dispose browser extension "${e.name}"`,s)})}catch(i){this.A.error(`Failed to dispose browser extension "${e.name}"`,i)}}},af=class{constructor(e){this._instance=e}initialize(){}get(e){let t=this._instance.persistence;if(typeof e=="string")return t==null?void 0:t.get_property(e);let i={};for(let s of e){let n=t==null?void 0:t.get_property(s);x(n)||(i[s]=n)}return i}set(e,t){var i;(i=this._instance.persistence)===null||i===void 0||i.register(typeof e=="string"?{[e]:t}:e)}remove(e){var t;(t=this._instance.persistence)===null||t===void 0||t.unregister(e)}},oa="extensionsRemoteConfig",lf=class{constructor(e){this.instance=e,this.To=!1,this.A=T,this.cu=e.hu,this.kv=new af(e),this.onEvent=t=>Ji(this.instance.on("eventCaptured",i=>{try{t({event:i.event,properties:i.properties})}catch(s){this.A.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=t=>{if(this.To)return Ji(()=>{});let i=n=>{try{t(n)}catch(r){this.A.error("Browser extension remote config listener failed",r)}},s=this.instance.du.on(oa,i);return this.cu&&i(this.cu),Ji(s)},this.vu=new of(T.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){let e=this.instance.get_property(dr);return typeof e=="string"?e:void 0}get library(){return{name:ue.LIB_NAME,version:ue.LIB_VERSION}}get initialPersonProperties(){var e,t;return(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s;let n=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(t=n==null?void 0:n.sessionId)!==null&&t!==void 0?t:"",windowId:(i=n==null?void 0:n.windowId)!==null&&i!==void 0?i:"",sessionStartTimestamp:(s=n==null?void 0:n.sessionStartTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.vu.add(e)}getExtension(e){return this.vu.getExtension(e)}capture(e,t,i){i?this.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):this.instance.capture(e,t)}registerDynamicEventProperties(e){return Ji(this.instance.fu(e))}handleRemoteConfig(e){this.To||(this.cu=e,this.instance.du.emit(oa,e))}sendRequest(e){var t=this;return ee(function*(i,s={}){var n;let r=t.instance.requestRouter.endpointFor((n=s.target)!==null&&n!==void 0?n:"api",i),o={method:s.method,url:s.query?ji(r,s.query):r,data:s.body,headers:s.headers,timeout:s.timeoutMs,fireCallbackOnDrop:!0,transport:s.transport,compression:s.compression,compressionFallback:s.target==="flags"&&s.compression==="best-available"?Pn.Base64:void 0,timestampMode:s.sentAt};return s.transport==="sendBeacon"?(t.instance._send_request(o),{statusCode:202}):new Promise(a=>{o.callback=a,t.instance._send_request(o)})}).apply(this,arguments)}dispose(){this.To||(this.To=!0,this.vu.dispose())}},Mi={},gn=0,Ti=()=>{},aa='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Nt="Surveys module not available",la="sanitize_properties is deprecated. Use before_send instead",iu="Invalid value for property_denylist config: ",cf=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],uf=["$feature_flag_called","$$heatmap","$snapshot"],ca=e=>e.charAt(0)==="$"&&!A(uf,e),df=/^[A-Za-z0-9_-]{1,400}$/,ua=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,da=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,hf=["token","distinct_id",Jl],yi="posthog",pf=e=>{let t={};return e&&e!=="unset"&&("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0)),t},_n=e=>{var t;return f({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:op(E==null?void 0:E.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ti,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e!=null?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:K&&V(K==null?void 0:K.search)&&K.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,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(b==null||(t=b.location)===null||t===void 0?void 0:t.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,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(i){T.error("Bad HTTP status: "+i.statusCode+" "+i.text)},get_device_id:i=>i,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ac,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Ti},(i=>({rageclick:i&&i>="2026-05-30"?{content_ignorelist:kr,ignore_text_selection:!0}:!i||"2025-11-30">i||{content_ignorelist:!0},capture_pageview:!i||"2025-05-24">i||"history_change",session_recording:pf(i),external_scripts_inject_target:i&&i>="2026-01-30"?"head":"body",internal_or_test_user_hostname:i&&i>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:i&&i>="2026-05-30"?250:0,split_storage:!(!i||"2026-05-30">i),detect_google_search_app:!(!i||"2026-05-30">i),disable_capture_url_hashes:!(!i||"2026-06-25">i),cookieWinsOnConflict:!(!i||i==="unset"||"2026-08-29">i)}))(e))},ff=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],ha=e=>{let t={};for(let[n,r]of ff)x(e[n])||(t[r]=e[n]);let i=Q({},t,e),s=e.__preview_external_dependency_versioned_paths;return x(s)||(x(e.strict_script_versioning)&&(i.strict_script_versioning=!!s),V(s)&&x(e.asset_host)&&(i.asset_host=s)),O(e.property_blacklist)&&(x(e.property_denylist)?i.property_denylist=e.property_blacklist:O(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:T.error(iu+e.property_denylist)),i},vf=class{constructor(){this.__forceAllowLocalhost=!1}get pu(){return this.__forceAllowLocalhost}set pu(e){T.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Ii=class pt{gu(t){if(!t)return;let i=this.lu.indexOf(t);i!==-1&&this.lu.splice(i,1)}mu(t,i){var s;return this.gu(t),this.lu.push(i),(s=i.initialize)===null||s===void 0||s.call(i),i}yu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}bu(){if(this._u||this.config.reuseAnonymousId||this.config.segment||this.yu())return;let t=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!t&&!this.config.disable_persistence||this.wu)return;let i,s,n;t?(i=`persistence is set to '${this.config.persistence}'`,s=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(i="persistence is disabled (disable_persistence is true)",s="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._u=!0,console.warn("[PostHog.js]",`${i} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${s}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${n}`)}ku(){let t=this.persistence;if(!t||this.Su)return;if(this.yu())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.xu(),this.$u()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.Cu()||t.load(!0);let i=this.get_distinct_id();if(!i||i==="$posthog_cookieless"){let s=this.config.get_device_id(He());this.register({distinct_id:s,$device_id:s}),t.set_property(ke,it)}this.xu()}get decideEndpointWasHit(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.Tu=!1,this.Iu=!1,this.webPerformance=new vf,this.Mu=!1,this.version=ue.LIB_VERSION,this.Eu=new Set,this.Pu="",this.du=new Es,this.lu=[],this.Ru=[],this.Au=!1,this.wu=!1,this._u=!1,this.Su=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=_n(),this.SentryIntegration=Sp,this.sentryIntegration=s=>(function(n,r){let o=wc(n,r);return{name:bc,processEvent:a=>o(a)}})(this,s),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fu=!1,this.Ou=null,this.Du=null,this.Lu=null,this.scrollManager=new Zp(this),this.pageViewManager=new qo(this),this.rateLimiter=new Op(this),this.requestRouter=new Qp(this),this.consent=new pp(this),this.externalIntegrations=new rf(this);let i=(t=pt.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(s,n,r)=>{let o=V(s)?{[s]:n}:s;this.setPersonProperties(o),r==null||r({})},set_once:(s,n,r)=>{let o=V(s)?{[s]:n}:s;this.setPersonProperties(void 0,o),r==null||r({})}},this.on("eventCaptured",s=>T.info(`send "${s==null?void 0:s.event}"`,s))}init(t,i,s){if(s&&s!==yi){var n;let r=(n=Mi[s])!==null&&n!==void 0?n:new pt;return r._init(t,i,s),Mi[s]=r,Mi[yi][s]=r,r}return this._init(t,i,s)}_init(t,i={},s){var n,r,o;let a=V(t)?t.trim():"";if(!a)return T.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var l;if(this.__loaded)return a!==((l=this.config)===null||l===void 0?void 0:l.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=_n(i.defaults),i.debug=this.Nu(i.debug),this.qu=i,this.ju=[],i.person_profiles?this.Du=i.person_profiles:i.process_person&&(this.Du=i.process_person);let c=_n(i.defaults),u=ha(i),d=Q({},c,u,{name:s,token:a});j(c.rageclick)&&j(u.rageclick)&&(d.rageclick=Q({},c.rageclick,u.rageclick)),j(c.session_recording)&&j(u.session_recording)&&(d.session_recording=Q({},c.session_recording,u.session_recording)),this.set_config(d),this.config.on_xhr_error&&T.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Ce.GZipJS;let h=this.Cu(),p=!this.yu();if(this.persistence=new ln(this.config,h,!0,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ln(f(f({},this.config),{},{persistence:"sessionStorage"}),h,!1,p),this.Pu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!h&&J.At()){let m=J.Lt(this.Pu);O(m)&&m.forEach(w=>{V(w)&&this.Eu.add(w)})}else J.Pt(this.Pu);let v=f({},this.persistence.props),_=f({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Bu=new zp((m,w)=>this.zu(m,w),this.config.request_queue_config),this.Hu=new qp(this),this.__request_queue=[];let g=this.yu();g||(this.sessionManager=new na(this),this.sessionPropsManager=new ia(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((m,w,M)=>{(M!=null&&M.activityTimeout||M!=null&&M.sessionPastMaximumLength||M!=null&&M.crossTabAdoption)&&this.Uu()})),this.Wu(),this.config.__preview_deferred_init_extensions?(T.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Vu(g)},0)):(T.info("Initializing extensions synchronously"),this.Vu(g)),ue.DEBUG=ue.DEBUG||this.config.debug,ue.DEBUG&&T.info("Starting in debug mode",{this:this,config:i,thisC:f({},this.config),p:v,s:_}),this.config.identity_distinct_id&&!(!((n=i.bootstrap)===null||n===void 0)&&n.distinctID)&&(i.bootstrap=f(f({},i.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));let y=(r=i.bootstrap)===null||r===void 0?void 0:r.distinctID;if(this.wu=!!y&&!bi(y),(o=i.bootstrap)===null||o===void 0?void 0:o.distinctID){let m=i.bootstrap.distinctID,w=this.get_distinct_id(),M=this.persistence.get_property(ke);if(i.bootstrap.isIdentifiedID&&w!=null&&w!==m&&M==="anonymous")this.identify(m);else if(i.bootstrap.isIdentifiedID&&w!=null&&w!==m&&M==="identified")T.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{let P=this.config.get_device_id(He()),k=i.bootstrap.isIdentifiedID?P:m;this.persistence.set_property(ke,i.bootstrap.isIdentifiedID?ns:it),this.register({distinct_id:m,$device_id:k})}}if(g)this.register_once({distinct_id:Ks,$device_id:null},"");else if(!this.get_distinct_id()){let m=this.config.get_device_id(He());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(ke,it)}return G(b,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),G(b,"pageshow",()=>{var m;this.Tu=!1,this.Iu||(m=this.Hu)===null||m===void 0||m.resume()}),i.segment?Go(this,()=>this.Gu()):this.Gu(),le(this.config._onCapture)&&this.config._onCapture!==Ti&&(T.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",m=>this.config._onCapture(m.event,m))),this.config.ip&&T.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return Jc.apply(this,arguments)})().then(m=>{m&&this.register({[Js]:m})}).catch(Ti),this}Qu(t){let i=t;return V(i.name)&&le(i.setup)}Zu(t,i){this.Qu(t)?i.push(()=>{this.Ju().add(t).catch(()=>{var s;return(s=t.dispose)===null||s===void 0?void 0:s.call(t)}).catch(s=>{T.error(`Failed to dispose browser extension "${t.name}"`,s)})}):this.lu.push(t)}Wu(){var t,i,s;let n=(t=(i=this.config.__extensionClasses)===null||i===void 0?void 0:i.featureFlags)!==null&&t!==void 0?t:(s=pt.__defaultExtensionClasses)===null||s===void 0?void 0:s.featureFlags;var r,o,a;n&&(this.featureFlags&&this.featureFlags instanceof n||((r=this.Ku)===null||r===void 0||r.call(this),this.Ku=void 0,this.featureFlags=new n(this)),le(this.featureFlags.onReloading)&&le(this.featureFlags.setup)?this.Ku||(this.Ku=this.featureFlags.onReloading(()=>{this.du.emit("featureFlagsReloading",!0)}),this.Ju().add(this.featureFlags)):(o=(a=this.featureFlags).initialize)===null||o===void 0||o.call(a))}Vu(t){let i=performance.now(),s=f(f({},pt.__defaultExtensionClasses),this.config.__extensionClasses),n=[];var r,o,a,l,c,u,d,h;s.exceptions&&this.lu.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new s.exceptions(this)),s.historyAutocapture&&this.lu.push(this.historyAutocapture=new s.historyAutocapture(this)),s.tracingHeaders&&this.lu.push(this.tracingHeaders=new s.tracingHeaders(this)),s.siteApps&&this.lu.push(this.siteApps=new s.siteApps(this)),s.sessionRecording&&!t&&this.lu.push(this.sessionRecording=new s.sessionRecording(this)),this.config.disable_scroll_properties||n.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),s.autocapture&&this.Zu(this.autocapture=new s.autocapture(this),n),s.surveys&&this.Zu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new s.surveys(this),n),s.logs&&this.Zu(this.logs=(a=this.logs)!==null&&a!==void 0?a:new s.logs(this),n),s.metrics&&this.lu.push(this.metrics=(l=this.metrics)!==null&&l!==void 0?l:new s.metrics(this)),s.conversations&&this.lu.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new s.conversations(this)),s.productTours&&this.lu.push(this.productTours=new s.productTours(this)),s.heatmaps&&this.lu.push(this.heatmaps=new s.heatmaps(this)),s.webVitalsAutocapture&&this.lu.push(this.webVitalsAutocapture=new s.webVitalsAutocapture(this)),s.exceptionObserver&&this.lu.push(this.exceptionObserver=new s.exceptionObserver(this)),s.deadClicksAutocapture&&this.lu.push(this.deadClicksAutocapture=new s.deadClicksAutocapture(this,kp)),s.toolbar&&this.lu.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new s.toolbar(this)),s.experiments&&this.lu.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new s.experiments(this)),s.webMCP&&this.lu.push(this.webMCP=(h=this.webMCP)!==null&&h!==void 0?h:new s.webMCP(this)),this.lu.forEach(p=>{p.initialize&&n.push(()=>{var v;(v=p.initialize)===null||v===void 0||v.call(p)})}),n.push(()=>{if(this.Xu){let p=this.Xu;this.Xu=void 0,this.lu.forEach(v=>{var _;return(_=v.onRemoteConfig)===null||_===void 0?void 0:_.call(v,p)})}}),this.Yu(n,i)}Yu(t,i){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-i>=30&&t.length>0)return void setTimeout(()=>{this.Yu(t,i)},0);let n=t.shift();if(n)try{n()}catch(r){T.error("Error initializing extension:",r)}}let s=Math.round(performance.now()-i);this.register_for_session({[Kl]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ql]:s}),this.config.__preview_deferred_init_extensions&&T.info(`PostHog extensions initialized (${s}ms)`)}el(t){var i;if(!E||!E.body)return T.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.el(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Xu=t),this.hu=t,this.compression=void 0,t.ok){var s;let n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=A(n.supportedCompression,Ce.GZipJS)?Ce.GZipJS:A(n.supportedCompression,Ce.Base64)?Ce.Base64:void 0),!((s=n.analytics)===null||s===void 0)&&s.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Du?this.Du:ac}),(i=this.tc)===null||i===void 0||i.handleRemoteConfig(t),this.lu.forEach(n=>{var r;return(r=n.onRemoteConfig)===null||r===void 0?void 0:r.call(n,t)})}Gu(){try{this.config.loaded(this)}catch(t){T.critical("`loaded` function failed",t)}if(this.ec(),this.config.internal_or_test_user_hostname&&(K==null?void 0:K.hostname)){let t=K.hostname,i=this.config.internal_or_test_user_hostname;(typeof i=="string"?t===i:i.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.yu())&&this.nc()},1),this.sc=new Oc(this),this.sc.load()}ec(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Bu)===null||t===void 0||t.enable())}_dom_loaded(){this.is_capturing()&&Wt(this.__request_queue,t=>this.zu(t)),this.__request_queue=[],this.ec()}_handle_unload(){var t,i,s,n,r,o;this.Tu=!0,(t=this.surveys)===null||t===void 0||(i=t.handlePageUnload)===null||i===void 0||i.call(t),(s=this.metrics)===null||s===void 0||s.flush("sendBeacon"),this.config.request_batching?(this.rc()&&this.capture(To),(n=this.logs)===null||n===void 0||n.flushLogs("sendBeacon"),(r=this.Bu)===null||r===void 0||r.unload(),(o=this.Hu)===null||o===void 0||o.unload()):this.rc()&&this.capture(To,null,{transport:"sendBeacon"})}_send_request(t){Yc(this,t)}zu(t,i){this.Hu?this.Hu.retriableRequest(t,i):this._send_request(i?f(f({},t),{},{transport:i}):t)}_execute_array(t){gn++;try{let i,s=[],n=[],r=[];Wt(t,a=>{if(a)if(i=a[0],O(i))r.push(a);else if(le(a))try{a.call(this)}catch(l){T.error("Error executing queued PostHog call",a,l)}else O(a)&&i==="alias"?s.push(a):O(a)&&i.indexOf("capture")!==-1&&le(this[i])?r.push(a):n.push(a)});let o=function(a,l){Wt(a,function(c){try{if(O(c[0])){let u=l;Z(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else l[c[0]].apply(l,c.slice(1))}catch(u){T.error("Error executing queued PostHog call",c,u)}})};o(s,this),o(n,this),o(r,this)}finally{gn--}}push(t){if(gn>0&&O(t)&&V(t[0])){let i=pt.prototype[t[0]];return void(le(i)&&i.apply(this,t.slice(1)))}this._execute_array([t])}get oc(){return{property:Po,persistenceKey:Gt,cookieName:"_fbc",pattern:ua,register:(t,i)=>{var s;return(s=this.persistence)===null||s===void 0?void 0:s.register({[Gt]:{value:t,delivered:i}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(Gt)}}}get ac(){return{property:Mo,persistenceKey:ki,cookieName:"_fbp",pattern:da,register:(t,i)=>{var s;return(s=this.persistence)===null||s===void 0?void 0:s.register({[ki]:{value:t,delivered:i}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(ki)}}}lc(t){var i;let s=(i=this.persistence)===null||i===void 0?void 0:i.get_property(t.persistenceKey);return V(s)&&t.pattern.test(s)?{value:s,delivered:!1}:j(s)&&V(s.value)&&t.pattern.test(s.value)?{value:s.value,delivered:s.delivered===!0}:void 0}uc(t,i,s){return i===(s==null?void 0:s.value)?{value:i,pending:!s.delivered}:(t.register(i,!1),{value:i,pending:!0})}cc(t){if(!this.config.save_campaign_params||this.yu())return;let i=Ei(t.cookieName);return V(i)&&t.pattern.test(i)?i:void 0}hc(t,i,s,n){if(!this.persistence)return;let r=this.oc;this.persistence.refreshKey(r.persistenceKey);let o=this.lc(r);if(n)return void r.unregister();if(s)return V(i)&&ua.test(i)?this.uc(r,i,o):void r.unregister();let a=V(t)&&df.test(t)?t:void 0,l=this.cc(r);return l&&((c,u,d)=>{let h=c.split(".");if(u)return h[3]===u;if(!d)return!0;let p=d.value.split(".");return h[3]===p[3]||Number(h[2])>Number(p[2])})(l,a,o)?this.uc(r,l,o):a?(o==null?void 0:o.value.split(".")[3])===a?{value:o.value,pending:!o.delivered}:this.uc(r,`fb.1.${Date.now()}.${a}`,o):o?{value:o.value,pending:!o.delivered}:void 0}dc(t,i,s){if(!this.persistence)return;let n=this.ac;this.persistence.refreshKey(n.persistenceKey);let r=this.lc(n);if(s)return void n.unregister();if(i)return V(t)&&da.test(t)?this.uc(n,t,r):void n.unregister();let o=this.cc(n);return o?this.uc(n,o,r):r?{value:r.value,pending:!r.delivered}:void 0}vc(t,i){if(!this.persistence)return;this.persistence.refreshKey(t.persistenceKey);let s=this.lc(t);(s==null?void 0:s.value)!==i||s.delivered||t.register(i,!0)}capture(t,i,s){var n,r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Bu))return void T.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(x(t)||!V(t))return void T.error("No event name provided to posthog.capture");if(this.ku(),t==="$snapshot"&&this.yu())return;let o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;let a=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a!=null&&a.isRateLimited)return void T.critical("This capture call is ignored due to client rate limiting.");let l;i!=null&&i.$current_url&&!V(i==null?void 0:i.$current_url)&&(T.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),i==null||delete i.$current_url),t!=="$exception"||s!=null&&s.fc||T.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&&(l=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();let c=new Date,u=(s==null?void 0:s.timestamp)||c,d=lo(s==null?void 0:s.uuid,He),h={uuid:d,event:t,properties:this.calculateEventProperties(t,i||{},u,d)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),a&&(h.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens);let p=t==="$feature_flag_called"&&h.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;s!=null&&s.$set&&!p&&(h.$set=s==null?void 0:s.$set);let v=j(i==null?void 0:i.$set)?i.$set:void 0,_=O(i==null?void 0:i.$unset)?i.$unset:[],g=(s==null?void 0:s.$unset)||[],y=C=>{var H;let W=!!(s!=null&&s.$set)&&C in s.$set;return{hasProvided:W||!!v&&C in v,provided:W?s==null||(H=s.$set)===null||H===void 0?void 0:H[C]:v==null?void 0:v[C],unset:_.indexOf(C)!==-1||g.indexOf(C)!==-1}},m=y(Po),w=y(Mo),M=[{channel:this.oc,hasProvided:m.hasProvided,update:this.hc(l==null?void 0:l.fbclid,m.provided,m.hasProvided,m.unset)},{channel:this.ac,hasProvided:w.hasProvided,update:this.dc(w.provided,w.hasProvided,w.unset)}];for(let{channel:C,hasProvided:H,update:W}of M)W&&h.properties.$process_person_profile===!0&&W.pending&&!H&&!p&&(h.$set=f({[C.property]:W.value},h.$set));let P=s==null?void 0:s.$unset;P&&(h.$unset=P);let k=p?void 0:this.gc(s==null?void 0:s.$set_once,t!==Io,t===lc);if(k&&(h.$set_once=k),s!=null&&s._noTruncate||(I=this.config.properties_string_max_length,h=(function(C,H){let W=new Set;return(function Y(z,ie){if(z!==Object(z))return H?H(z):z;if(W.has(z))return;let ge;if(W.add(z),O(z))ge=[],Wt(z,de=>{ge.push(Y(de))});else{let de={};Z(ii(z)?cc(z):z,(me,Te)=>{W.has(me)||(de[Te]=Y(me,Te))}),ge=de}return ge})(C)})(h,C=>V(C)?C.slice(0,I):C)),h.timestamp=u,x(s==null?void 0:s.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=c),p&&(h.properties=((C,H=[])=>{let W={},Y=z=>{C[z]!==void 0&&(W[z]=C[z])};return eh.forEach(Y),H.forEach(Y),W})(h.properties,hf)),t===Ie.DISMISSED||t===Ie.SENT){let C=i==null?void 0:i[un.SURVEY_ID],H=i==null?void 0:i[un.SURVEY_ITERATION];tu({id:C,current_iteration:H}),h.$set=f(f({},h.$set),{},{[Xp({id:C,current_iteration:H},t===Ie.SENT?"responded":"dismissed")]:!0})}else t===Ie.SHOWN&&(h.$set=f(f({},h.$set),{},{[un.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var I;if(t===Ap.SHOWN){let C=i==null?void 0:i[Xo.TOUR_TYPE];C&&(h.$set=f(f({},h.$set),{},{[`${Xo.TOUR_LAST_SEEN_DATE}/${C}`]:new Date().toISOString()}))}let S=f(f({},h.properties.$set),h.$set);if(Me(S)||this.setPersonPropertiesForFlags(S),!L(this.config.before_send)){let C=this.Os(h);if(!C)return;h=C,h.uuid=lo(h.uuid,He)}this.sessionRecording&&!this.Au&&ca(t)&&(this.Au=!0,setTimeout(()=>this.Au=!1,3e4));let $=M.filter(({channel:C,update:H})=>{var W,Y,z;let ie=(W=(Y=h.$set)===null||Y===void 0?void 0:Y[C.property])!==null&&W!==void 0?W:j((z=h.properties)===null||z===void 0?void 0:z.$set)?h.properties.$set[C.property]:void 0;return(H==null?void 0:H.pending)&&ie===H.value});this.du.emit("eventCaptured",h);let D=(n=s==null?void 0:s._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),R=(s==null?void 0:s._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D),N=f(f(f({method:"POST",url:D,data:h,compression:"best-available",preferSyncCompression:s==null?void 0:s.send_instantly,timestampMode:R?"body":"capture-body",batchKey:s==null?void 0:s._batchKey},R&&(!((r=h.properties)===null||r===void 0)&&r.$session_id)?{batchGroup:h.properties.$session_id+(h.properties.$window_id?`-${h.properties.$window_id}`:"")}:{}),s!=null&&s.transport?{transport:s.transport}:{}),$.length?{fireCallbackOnDrop:!0,callback:C=>{if(C.statusCode>=200&&300>C.statusCode)for(let{channel:H,update:W}of $)this.vc(H,W.value)}}:{});if(!this.config.request_batching||s&&!(s!=null&&s._batchKey)||s!=null&&s.send_instantly){var B;let C;!N.transport&&!N.callback&&Me((B=this.config.request_headers)!==null&&B!==void 0?B:{})&&this.Tu&&(C="sendBeacon"),this.zu(N,C)}else this.Bu.enqueue(N);return h}_addCaptureHook(t){return this.on("eventCaptured",i=>t(i.event,i))}getExtension(t){var i;return(i=this.tc)===null||i===void 0?void 0:i.getExtension(t)}Ju(){var t;return(t=this.tc)!==null&&t!==void 0?t:this.tc=new lf(this)}fu(t){this.Ru.push(t);let i=!0;return()=>{if(!i)return;i=!1;let s=this.Ru.indexOf(t);s!==-1&&this.Ru.splice(s,1)}}mc(t=!0){var i,s,n;return!!(!((i=this.persistence)===null||i===void 0)&&i.consumeCookieIdentityChange())&&(this.Lu=null,this.persistence.get_property("$user_state")==="anonymous"&&((n=this.sessionPersistence)===null||n===void 0||n.clear(),this.Eu.clear(),this.yc()),(s=this.featureFlags)===null||s===void 0||s.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,i,s,n,r){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.ku(),this.persistence.syncCookieProperties(),this.mc();let o=r?void 0:this.persistence.remove_event_timer(t),a=f({},i);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.yu()&&(a[Jl]=!0),t==="$snapshot"){let m=f(f({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=m.distinct_id,(!V(a.distinct_id)&&!oe(a.distinct_id)||bi(a.distinct_id))&&T.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}let l=(function(m,w,M,P=!1){var k,I,S,$;if(!xe)return{};let D=m?[...Qt,...w||[]]:[],[R,N]=pl(xe),[B,C]=(function(he){for(let Re=0;ao.length>Re;Re++){let[ot,at,wt]=ao[Re],Pe=he.match(ot);if(Pe){let Ge=wt&&he.match(wt)||Pe;return[at,(Ge==null?void 0:Ge[1])||""]}}return["",""]})(xe),H=(function(){let he="u">typeof navigator?navigator:void 0;return he!=null&&he.brave?{brave:!0}:{}})(),W={};x(M)||(W.detectGoogleSearchApp=M);let Y={},z=(k=navigator)===null||k===void 0||(k=k.userAgentData)===null||k===void 0?void 0:k.platform,ie=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,ge=b==null||(S=b.screen)===null||S===void 0?void 0:S.width,de=b==null||($=b.screen)===null||$===void 0?void 0:$.height,me=b==null?void 0:b.devicePixelRatio;x(z)||(Y.userAgentDataPlatform=z),x(ie)||(Y.maxTouchPoints=ie),x(ge)||(Y.screenWidth=ge),x(de)||(Y.screenHeight=de),x(me)||(Y.devicePixelRatio=me);let Te=Q(yr({$os:R,$os_version:N,$browser:hl(xe,navigator.vendor,H,W),$webview_app:B,$webview_app_version:C,$device:fl(xe),$device_type:xd(xe,Y),$timezone:xc(),$timezone_offset:Ip()}),{$current_url:Li(P?yt(K==null?void 0:K.href):K==null?void 0:K.href,D,Di),$host:K==null?void 0:K.host,$pathname:K==null?void 0:K.pathname,$raw_user_agent:xe.length>1e3?xe.substring(0,997)+"...":xe,$browser_version:wd(xe,navigator.vendor,H,W),$browser_language:Tc(),$browser_language_prefix:Tp(),$screen_height:b==null?void 0:b.screen.height,$screen_width:b==null?void 0:b.screen.width,$viewport_height:b==null?void 0:b.innerHeight,$viewport_width:b==null?void 0:b.innerWidth,$lib:st.LIB_NAME,$lib_version:st.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return st.SDK_DIST_CHANNEL&&(Te.$sdk_dist_channel=st.SDK_DIST_CHANNEL),Te})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){let{sessionId:m,windowId:w}=this.sessionManager.checkAndGetSessionAndWindowId(r,s.getTime(),!0);a.$session_id=m,a.$window_id=w}this.sessionPropsManager&&Q(a,this.sessionPropsManager.getSessionProps());try{var c;if(this.sessionRecording){let m=this.sessionRecording.sdkDebugProperties,w=!this.Au&&ca(t);for(let M in m)(w||A(cf,M))&&(a[M]=m[M])}a.$sdk_debug_retry_queue_size=(c=this.Hu)===null||c===void 0?void 0:c.length}catch(m){a.$sdk_debug_error_capturing_properties=String(m)}let u;if(this.requestRouter.region===tr&&(a.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||r?t!=="$pageleave"||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,n),a=Q(a,u),t==="$pageview"&&E&&(a.title=E.title),!x(o)){let m=s.getTime()-o;a.$duration=parseFloat((m/1e3).toFixed(3))}xe&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");let d=this.persistence.properties(),h=this.sessionPersistence.properties(),p=a.$groups,v=d.$groups;j(p)&&!Me(p)&&(a.$groups=f(f({},j(v)?v:{}),p)),Z(["$referrer","$referring_domain"],m=>{m in d&&delete h[m]});let _={};if(this.Ru.length>0)for(let m of this.Ru.slice())try{Q(_,m())}catch(w){T.error("Failed to produce browser extension event properties",w)}a=Q({},l,d,h,f(f({},_),a)),a.$is_identified=this._isIdentified(),O(this.config.property_denylist)?Z(this.config.property_denylist,function(m){delete a[m]}):T.error(iu+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let g=this.config.sanitize_properties;g&&(T.error(la),a=g(a,t));let y=this.bc();return a.$process_person_profile=y,y&&!r&&this._c("_calculate_event_properties"),a}gc(t,i=!0,s=!1){var n;if(!this.persistence||!this.bc()||this.Mu&&!s)return t;let r=this.persistence.get_initial_props(),o=(n=this.sessionPropsManager)===null||n===void 0?void 0:n.getSetOnceProps(),a=Q({},r,o||{},t||{}),l=this.config.sanitize_properties;return l&&(T.error(la),a=l(a,"$set_once")),i&&(this.Mu=!0),Me(a)?void 0:a}register(t,i){var s;(s=this.persistence)===null||s===void 0||s.register(t,i)}register_once(t,i,s){var n;(n=this.persistence)===null||n===void 0||n.register_once(t,i,s)}register_for_session(t){var i,s;(i=this.persistence)===null||i===void 0||i.syncCookieProperties(),this.mc(),(s=this.sessionPersistence)===null||s===void 0||s.register(t),Object.keys(t).forEach(n=>this.Eu.add(n)),this.yc()}unregister(t){var i;(i=this.persistence)===null||i===void 0||i.unregister(t)}unregister_for_session(t){var i;(i=this.sessionPersistence)===null||i===void 0||i.unregister(t),this.Eu.delete(t),this.yc()}wc(t,i){this.register({[t]:i})}Uu(){this.Eu.forEach(t=>{var i;(i=this.sessionPersistence)===null||i===void 0||i.unregister(t)}),this.Eu.clear(),this.yc()}yc(){var t;if(!this.Pu)return;if(this.config.persistence==="memory"||!((t=this.sessionPersistence)===null||t===void 0)&&t.hi||!J.At())return void J.Pt(this.Pu);let i=[];this.Eu.forEach(s=>i.push(s)),i.length>0?J.$t(this.Pu,i):J.Pt(this.Pu)}getFeatureFlag(t,i){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getFeatureFlag(t,i)}getFeatureFlagPayload(t){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getFeatureFlagPayload(t)}getFeatureFlagResult(t,i){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getFeatureFlagResult(t,i)}getAllFeatureFlags(){var t,i;return(t=(i=this.featureFlags)===null||i===void 0?void 0:i.getAllFeatureFlags())!==null&&t!==void 0?t:[]}isFeatureEnabled(t,i){var s,n;return(s=(n=this.featureFlags)===null||n===void 0?void 0:n.isFeatureEnabled(t,i))!==null&&s!==void 0?s:i==null?void 0:i.defaultValue}reloadFeatureFlags(){var t;(t=this.featureFlags)===null||t===void 0||t.reloadFeatureFlags()}updateFlags(t,i,s){var n;(n=this.featureFlags)===null||n===void 0||n.updateFlags(t,i,s)}updateEarlyAccessFeatureEnrollment(t,i,s){var n;(n=this.featureFlags)===null||n===void 0||n.updateEarlyAccessFeatureEnrollment(t,i,s)}getEarlyAccessFeatures(t,i=!1,s){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getEarlyAccessFeatures(t,i,s)}on(t,i){return this.du.on(t,i)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Nt}),()=>{})}onSessionId(t){var i,s;return(i=(s=this.sessionManager)===null||s===void 0?void 0:s.onSessionId(t))!==null&&i!==void 0?i:()=>{}}getSurveys(t,i=!1){this.surveys?this.surveys.getSurveys(t,i):t([],{isLoaded:!1,error:Nt})}getActiveMatchingSurveys(t,i=!1){this.surveys?this.surveys.getActiveMatchingSurveys(t,i):t([],{isLoaded:!1,error:Nt})}onActiveMatchingSurveysChanged(t){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(t):(t([],{isLoaded:!1,error:Nt}),()=>{})}renderSurvey(t,i){var s;(s=this.surveys)===null||s===void 0||s.renderSurvey(t,i)}displaySurvey(t,i=tf){var s;(s=this.surveys)===null||s===void 0||s.displaySurvey(t,i)}cancelPendingSurvey(t){var i;(i=this.surveys)===null||i===void 0||i.cancelPendingSurvey(t)}canRenderSurvey(t){var i,s;return(i=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurvey(t))!==null&&i!==void 0?i:{visible:!1,disabledReason:Nt}}canRenderSurveyAsync(t,i=!1){var s,n;return(s=(n=this.surveys)===null||n===void 0?void 0:n.canRenderSurveyAsync(t,i))!==null&&s!==void 0?s:Promise.resolve({visible:!1,disabledReason:Nt})}kc(t){return!t||bi(t)?(T.critical("Unique user id has not been set in posthog.identify"),!1):t==="$posthog_cookieless"?(T.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(T.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(t,i,s){if(!this.__loaded||!this.persistence)return T.uninitializedWarning("posthog.identify");if(oe(t)&&(t=t.toString(),T.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.kc(t)||!this._c("posthog.identify"))return;this.ku();let n=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==n,o=this.mc(!1),a=this.persistence.Oa(),l=!1;try{let u=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),t!==u&&t!==this.get_property("__alias")&&(this.unregister(_s),this.register({distinct_id:t}));let d=(this.persistence.get_property("$user_state")||"anonymous")===it,h=t!==u,p=!h&&d;if(h&&d){var c;let v=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:u};this.persistence.set_property(ke,ns),this.setPersonPropertiesForFlags({$set:i||{},$set_once:s||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$identify",v,{$set:i||{},$set_once:s||{}})&&(this.Lu=vn(t,i,s)),(c=this.featureFlags)===null||c===void 0||c.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(p){this.persistence.set_property(ke,ns);let v=i||{},_=s||{};this.setPersonPropertiesForFlags({$set:v,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$set",{$set:v,$set_once:_})&&(this.Lu=vn(t,i,s))}else(i||s)&&this.setPersonProperties(i,s);h||r||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(gt)):p&&(i||s)&&this.reloadFeatureFlags(),l=!0}finally{a&&this.persistence.qa(l)}}setPersonProperties(t,i){if(!t&&!i||!this._c("posthog.setPersonProperties"))return;let s=vn(this.get_distinct_id(),t,i);this.Lu!==s?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!0),this.capture("$set",{$set:t||{},$set_once:i||{}})&&(this.Lu=s)):T.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(t){var i;let s=(O(t)?t:[t]).filter(n=>V(n)&&n.length>0);s.length!==0&&this._c("posthog.unsetPersonProperties")&&((i=this.featureFlags)===null||i===void 0||i.unsetPersonPropertiesForFlags(s,!0),this.capture("$set",{$unset:s}),this.Lu=null)}group(t,i,s){var n;if(!t||!i)return void T.error("posthog.group requires a group type and group key");(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.mc();let r=this.getGroups(),o=r[t]!==i;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:f(f({},r),{},{[t]:i})}),(o||s)&&this.bc()){let a={$group_type:t,$group_key:i};s&&(a.$group_set=s),this.capture(Io,a)}s&&this.setGroupPropertiesForFlags({[t]:s}),o&&!s&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,i=!0){var s;(s=this.featureFlags)===null||s===void 0||s.setPersonPropertiesForFlags(t,i)}resetPersonPropertiesForFlags(t=!0){var i;(i=this.featureFlags)===null||i===void 0||i.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,i=!0){var s;this._c("posthog.setGroupPropertiesForFlags")&&((s=this.featureFlags)===null||s===void 0||s.setGroupPropertiesForFlags(t,i))}resetGroupPropertiesForFlags(t){var i;(i=this.featureFlags)===null||i===void 0||i.resetGroupPropertiesForFlags(t)}reset(t){let i=Se(t)?t:t==null?void 0:t.resetDeviceID,s=Se(t)||t==null?void 0:t.bootstrap;this.Sc(i,!1,s)}Sc(t,i=!1,s){var n,r,o,a,l,c;if(T.info("reset"),!this.__loaded)return T.uninitializedWarning("posthog.reset");let u=s==null?void 0:s.sessionID;this.config.bootstrap=s||((n=this.qu)===null||n===void 0?void 0:n.bootstrap)||{},(r=this.featureFlags)===null||r===void 0||(o=r.updateConfig)===null||o===void 0||o.call(r,this.config,this.il());let d=this.get_property(dr),h=this.get_property(Js),p=this.get_property(Si);(a=this.sessionRecording)===null||a===void 0||a.flushBeforeIdentityReset();let v=this.is_capturing();i||this.consent.reset(),i||!v||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");let _=(l=this.persistence)===null||l===void 0||(c=l.Oa)===null||c===void 0?void 0:c.call(l),g=this.Su;this.Su=g||i;let y=!1;try{var m,w,M,P,k,I,S,$,D,R,N,B,C;if((m=this.persistence)===null||m===void 0||m.clear(),(w=this.sessionPersistence)===null||w===void 0||w.clear(),this.Eu.clear(),this.yc(),x(p)||(R=this.persistence)===null||R===void 0||R.register({$session_recording_remote_config:p}),(M=this.surveys)===null||M===void 0||M.reset(),(P=this.featureFlags)===null||P===void 0||P.reset(),(k=this.conversations)===null||k===void 0||k.reset(),(I=this.logs)===null||I===void 0||I.reset(),(S=this.metrics)===null||S===void 0||S.reset(),($=this.persistence)===null||$===void 0||$.set_property("$user_state","anonymous"),(D=this.sessionManager)===null||D===void 0||D.resetSessionId(),this.Lu=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Ks,$device_id:null},"");else{let Y=this.config.get_device_id(He());this.register_once({distinct_id:Y,$device_id:t?Y:d},""),t||x(h)||this.register({[Js]:h})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),s&&(s.distinctID&&!this.yu()&&((C=this.persistence)===null||C===void 0||C.set_property("$user_state",s.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.distinctID})),(N=this.featureFlags)===null||N===void 0||N.initialize(),!L(u)&&!(!((B=this.sessionManager)===null||B===void 0)&&B.setBootstrapSessionId(u,!0)))){let Y=f({},s);delete Y.sessionID,this.config.bootstrap=Y}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,y=!0}finally{var H,W;this.Su=g,_&&((H=this.persistence)===null||H===void 0||(W=H.qa)===null||W===void 0||W.call(H,y))}this.reloadFeatureFlags()}shutdown(t){var i=this;return ee(function*(){var s,n,r,o,a,l,c,u;if(i.__loaded){i.Iu=!0,i.Ju().dispose(),(s=i.sessionRecording)===null||s===void 0||s.dispose(),(n=i.logs)===null||n===void 0||n.flushLogs("sendBeacon"),(r=i.metrics)===null||r===void 0||r.flush("sendBeacon"),(o=i.metrics)===null||o===void 0||o.dispose(),(a=i.Bu)===null||a===void 0||a.unload(),(l=i.Hu)===null||l===void 0||l.unload();try{var d;(d=i.featureFlags)===null||d===void 0||d.destroy()}catch(h){T.error("Error while destroying feature flags",h)}(c=i.persistence)===null||c===void 0||c.destroy(),(u=i.sessionPersistence)===null||u===void 0||u.destroy()}else T.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,i){var s;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=i,this.alias(t),(s=this.conversations)===null||s===void 0||s.xc()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(t=this.conversations)===null||t===void 0||t.$c()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";let{sessionId:i,sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${i}`);if(t!=null&&t.withTimestamp&&s){var r;let o=(r=t.timestampLookBack)!==null&&r!==void 0?r:10;if(!s)return n;n+=`?t=${Math.max(Math.floor((new Date().getTime()-s)/1e3)-o,0)}`}return n}alias(t,i){return t===this.get_property("$people_distinct_id")?(T.critical("Attempting to create alias for existing People user - aborting."),-2):this._c("posthog.alias")?(x(i)&&(i=this.get_distinct_id()),t!==i?(this.wc(_s,t),this.capture("$create_alias",{alias:t,distinct_id:i})):(T.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){let i=f({},this.config);if(j(t)){var s,n,r,o,a,l,c,u,d,h,p,v,_,g;Q(this.config,ha(t));let P=this.Cu();if(this.persistence){let I=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var y,m;if(I&&this.sessionPersistence!==this.persistence&&((y=this.sessionPersistence)===null||y===void 0||y.remove(),(m=this.sessionPersistence)===null||m===void 0||m.destroy()),this.persistence.update_config(this.config,i,P),I)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new ln(f(f({},this.config),{},{persistence:"sessionStorage"}),P,!1);else{var w;(w=this.sessionPersistence)===null||w===void 0||w.update_config(f(f({},this.config),{},{persistence:"sessionStorage"}),f(f({},i),{},{persistence:"sessionStorage"}),P)}}let k=this.Nu(this.config.debug);var M;Se(k)&&(this.config.debug=k),Se(this.config.debug)&&(this.config.debug?(ue.DEBUG=!0,U.At()&&U.$t("ph_debug",!0),T.info("set_config",{config:t,oldConfig:i,newConfig:f({},this.config)})):(ue.DEBUG=!1,U.At()&&U.Pt("ph_debug"))),(s=this.featureFlags)===null||s===void 0||(n=s.updateConfig)===null||n===void 0||n.call(s,this.config,this.il()),(r=this.exceptionObserver)===null||r===void 0||r.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(a=this.metrics)===null||a===void 0||a.onConfigChange(),(l=this.webMCP)===null||l===void 0||l.startIfEnabled(),(c=this.sessionRecording)===null||c===void 0||c.startIfEnabledOrStop(),(u=this.tracingHeaders)===null||u===void 0||u.startIfEnabledOrStop(),(d=this.autocapture)===null||d===void 0||d.startIfEnabled(),(h=this.heatmaps)===null||h===void 0||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&((M=this.historyAutocapture)===null||M===void 0||M.startIfEnabledOrStop()),(p=this.exceptionObserver)===null||p===void 0||p.startIfEnabledOrStop(),(v=this.deadClicksAutocapture)===null||v===void 0||v.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.xu(),(g=this.externalIntegrations)===null||g===void 0||g.startIfEnabledOrStop(),!i.segment&&this.config.segment&&this.persistence&&Go(this,Ti,!1)}}_overrideSDKInfo(t,i){ue.LIB_NAME=t,ue.LIB_VERSION=i}startSessionRecording(t){let i=t===!0,s={sampling:i||!!(t!=null&&t.sampling),linked_flag:i||!!(t!=null&&t.linked_flag),url_trigger:i||!!(t!=null&&t.url_trigger),event_trigger:i||!!(t!=null&&t.event_trigger)};var n,r,o,a,l;Object.values(s).some(Boolean)&&((n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),s.sampling&&((r=this.sessionRecording)===null||r===void 0||r.overrideSampling()),s.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),s.url_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("url")),s.event_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!!(!((t=this.sessionRecording)===null||t===void 0)&&t.started)}captureException(t,i){try{if(!this.exceptions)return;let s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(f(f({},s),i))}catch{return}}addExceptionStep(t,i){var s;(s=this.exceptions)===null||s===void 0||s.addExceptionStep(t,i)}captureLog(t){var i;(i=this.logs)===null||i===void 0||i.captureLog(t)}get logger(){var t,i;return(t=(i=this.logs)===null||i===void 0?void 0:i.logger)!==null&&t!==void 0?t:pt.Cc}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var i,s;return(i=(s=this.toolbar)===null||s===void 0?void 0:s.loadToolbar(t))!==null&&i!==void 0&&i}get_property(t){var i;return(i=this.persistence)===null||i===void 0?void 0:i.props[t]}getSessionProperty(t){var i;return(i=this.sessionPersistence)===null||i===void 0?void 0:i.props[t]}toString(){var t;let i=(t=this.config.name)!==null&&t!==void 0?t:yi;return i!==yi&&(i="posthog."+i),i}_isIdentified(){var t,i;return((t=this.persistence)===null||t===void 0?void 0:t.get_property("$user_state"))==="identified"||((i=this.sessionPersistence)===null||i===void 0?void 0:i.get_property("$user_state"))==="identified"}bc(){var t,i;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Me(this.getGroups())&&!(!((t=this.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t.__alias)&&!(!((i=this.persistence)===null||i===void 0||(i=i.props)===null||i===void 0)&&i.$epp))}rc(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.bc()||this._c("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._c("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_c(t){return this.config.person_profiles==="never"?(T.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.bu(),this.wc(fr,!0),!0)}Cu(){if(this.config.cookieless_mode==="always")return!0;let t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}xu(){var t,i;let s=this.Cu();var n,r,o;return this.is_capturing()||(n=this.logs)===null||n===void 0||n.Tc(),((t=this.persistence)===null||t===void 0?void 0:t.hi)!==s&&((r=this.persistence)===null||r===void 0||r.set_disabled(s)),((i=this.sessionPersistence)===null||i===void 0?void 0:i.hi)!==s&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(s)),this.yc(),s}opt_in_capturing(t){var i;if(this.config.cookieless_mode!=="always"){if(this.yu()){var s,n,r,o,a,l;(s=this.sessionRecording)===null||s===void 0||s.dispose({discardBufferedEvents:!0}),this.Sc(!0,!0),(n=this.sessionManager)===null||n===void 0||n.destroy(),(r=this.pageViewManager)===null||r===void 0||r.destroy(),this.sessionManager=new na(this),this.pageViewManager=new qo(this),this.persistence&&(this.sessionPropsManager=new ia(this,this.sessionManager,this.persistence));let p=(o=(a=this.config.__extensionClasses)===null||a===void 0?void 0:a.sessionRecording)!==null&&o!==void 0?o:(l=pt.__defaultExtensionClasses)===null||l===void 0?void 0:l.sessionRecording;var c,u;p&&(this.sessionRecording=this.mu(this.sessionRecording,new p(this)),this.hu&&((c=this.sessionRecording)===null||c===void 0||(u=c.onRemoteConfig)===null||u===void 0||u.call(c,this.hu)))}var d,h;this.consent.optInOut(!0),this.xu(),this.ec(),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((d=this.surveys)===null||d===void 0||d.loadIfEnabled()),(x(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((h=t==null?void 0:t.captureEventName)!==null&&h!==void 0?h:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.nc()}else T.warn(aa)}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.xu(),this.config.cookieless_mode==="on_reject"&&this.$u()):T.warn(aa)}$u(){var t,i;let s=this.sessionRecording;s==null||s.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.Sc(!0,!0),this.register({distinct_id:Ks,$device_id:null}),this.gu(s),this.sessionRecording=void 0,(t=this.sessionManager)===null||t===void 0||t.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.nc(),this.ec()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){let t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return!this.Su&&(this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.xu()}_is_bot(){return pe?Xc(pe,this.config.custom_blocked_useragents):void 0}nc(){E&&(E.visibilityState==="visible"?this.Fu||(this.Fu=!0,this.capture(mr,{title:E.title},{send_instantly:!0}),this.Ou&&(E.removeEventListener(Oi,this.Ou),this.Ou=null)):this.Ou||(this.Ou=this.nc.bind(this),G(E,Oi,this.Ou)))}debug(t){t===!1?(b==null||b.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(b==null||b.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}))}il(){let t=this.qu||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(T.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(i,s,n,r,o){let a=s in i&&!L(i[s]),l=n in i&&!L(i[n]);return a?i[s]:!!l&&(o&&o.warn(`Config field '${n}' is deprecated. Please use '${s}' instead. The old field will be removed in a future major version.`),i[n])})(t,"advanced_disable_flags","advanced_disable_decide",0,T)}Os(t){var i;if(L(this.config.before_send))return t;let s=Object.keys((i=t.properties)!==null&&i!==void 0?i:{}).filter(ud),n=O(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(let o of n)try{if(r=o(r),L(r)){let a=`Event '${t.event}' was rejected in beforeSend function`;return cd(t.event)?T.warn(`${a}. This can cause unexpected behavior.`):T.info(a),null}r.properties&&!Me(r.properties)||T.warn(`Event '${t.event}' has no properties after beforeSend function, this is likely an error.`)}catch(a){return T.error(`Error in beforeSend function for event '${t.event}':`,a),null}for(let o of s)if(r.properties&&L(r.properties[o]))return T.warn(`Event '${t.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){var t;return(t=this.pageViewManager.Wo)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,i){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:i})}captureTraceMetric(t,i,s){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:i,$ai_metric_value:String(s)})}Nu(t){let i=Se(t)&&!t,s=U.At()&&U.Ot("ph_debug")==="true";return!i&&(!!s||t)}};Ii.__defaultExtensionClasses={},Ii.Cc=(()=>{let e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),(function(e,t){for(let i=0;t.length>i;i++)e.prototype[t[i]]=np(e.prototype[t[i]])})(Ii,["identify"]);var su=class{constructor(e){this.disabled=e===!1;let t=j(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,i){if(this.disabled)return!1;let s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&this.timeoutMs>i-s.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}},mn="$copy_autocapture",yn=re("[AutoCapture]");function bn(e,t){return t.length>e?t.slice(0,e)+"...":t}function gf(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!Be(t));return t}function _f(e,{e:t,maskAllElementAttributes:i,maskAllText:s,elementAttributeIgnoreList:n,elementsChainAsString:r,disableCaptureUrlHashes:o}){var a,l;if(!Be(e))return{props:{}};let c=[e],u=new Set([e]),d=e;for(;d.parentNode&&!_e(d,"body")&&1e3>c.length;){if(br(d.parentNode)){let k=d.parentNode.host;if(u.has(k))break;u.add(k),c.push(k),d=k;continue}if(!Be(d.parentNode)||u.has(d.parentNode))break;u.add(d.parentNode),c.push(d.parentNode),d=d.parentNode}let h=t.type==="click"&&e.namespaceURI==="http://www.w3.org/2000/svg"?c.findIndex(k=>_e(k,"button")||_e(k,"a")):-1;h>0&&(s=s||c.slice(0,h+1).some(k=>!Ft(k)||Jt(k)));let p=[],v={},_,g=!1,y=!1;if(Z(c,k=>{let I=Ft(k);if(_e(k,"a")&&!i&&!(n!=null&&n.includes("href"))){let S=k.getAttribute("href");g=!!(I&&S&&qt(S))&&(o?yt(S):S)}A(Xt(k),"ph-no-capture")&&(y=!0),p.push((function(S,$,D,R,N=!1){let B=S.tagName.toLowerCase(),C={tag_name:B};xr.indexOf(B)>-1&&!D&&(C.$el_text=B.toLowerCase()==="a"||B.toLowerCase()==="button"?bn(1024,Wo(S)):bn(1024,Ri(S)));let H=Xt(S);$||R!=null&&R.includes("class")||0>=H.length||(C.classes=H.filter(function(ie){return ie!==""})),Z(S.attributes,function(ie){var ge;if((!Jt(S)||["name","id","class","aria-label"].indexOf(ie.name)!==-1)&&!(R!=null&&R.includes(ie.name))&&!$&&qt(ie.value)&&(!V(ge=ie.name)||ge.substring(0,10)!=="_ngcontent"&&ge.substring(0,7)!=="_nghost")){let de=ie.value;ie.name==="class"&&(de=wr(de).join(" ")),C["attr__"+ie.name]=bn(1024,ie.name==="href"&&N?yt(de):de)}});let W=1,Y=1,z=S;for(;z=gf(z);)W++,z.tagName===S.tagName&&Y++;return C.nth_child=W,C.nth_of_type=Y,C})(k,i,s,n,o)),Z((function(S){if(!Ft(S))return{};let $={};return Z(S.attributes,function(D){if(D.name&&D.name.indexOf("data-ph-capture-attribute")===0){let R=D.name.replace("data-ph-capture-attribute-",""),N=D.value;R&&N&&qt(N)&&($[R]=N)}}),$})(k),(S,$)=>{({}).hasOwnProperty.call(v,$)||(v[$]=S)})}),y)return{props:{},explicitNoCapture:y};if(h>0&&(e=c[h],p.splice(0,h)),s||(p[0].$el_text=_e(e,"a")||_e(e,"button")?Wo(e):Ri(e)),g){var m,w;p[0].attr__href=g;let k=(m=nt(g))===null||m===void 0?void 0:m.host,I=b==null||(w=b.location)===null||w===void 0?void 0:w.host;k&&I&&k!==I&&(_=g)}return{props:Q((P=t.type,{$event_type:P,$ce_version:1}),r?{}:{$elements:p},{$elements_chain:(M=p,O(M)?(function(k){return k.map(I=>{var S,$;let D="";if(I.tag_name&&(D+=I.tag_name),I.attr_class){I.attr_class.sort();for(let B of I.attr_class)D+=`.${B.replace(/"/g,"")}`}let R=f(f(f(f({},I.text?{text:I.text}:{}),{},{"nth-child":(S=I.nth_child)!==null&&S!==void 0?S:0,"nth-of-type":($=I.nth_of_type)!==null&&$!==void 0?$:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),N={};return rs(R).sort(([B],[C])=>(function(H,W){return W>H?-1:H>W?1:0})(B,C)).forEach(([B,C])=>N[Uo(B.toString())]=Uo(C.toString())),D+=":",D+=rs(N).map(([B,C])=>`${B}="${C}"`).join(""),D}).join(";")})((function(k){return k.map(I=>{var S,$;let D={text:(S=I.$el_text)===null||S===void 0?void 0:S.slice(0,400),tag_name:I.tag_name,href:($=I.attr__href)===null||$===void 0?void 0:$.slice(0,2048),attr_class:wp(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return rs(I).filter(([R])=>R.indexOf("attr__")===0).forEach(([R,N])=>D.attributes[R]=N),D})})(M)):"")},!((a=p[0])===null||a===void 0)&&a.$el_text?{$el_text:(l=p[0])===null||l===void 0?void 0:l.$el_text}:{},_&&t.type==="click"?{$external_click_url:_}:{},v),target:e};var M,P}var mf=class{do(){this.vo=void 0,clearTimeout(this.fo),this.fo=void 0}po(e){var t;if(!Ft(e))return!0;let i=(t=this.mo().css_selector_ignorelist)!==null&&t!==void 0?t:rn,s=new Set,n=e;for(;n;){if(s.size>=1e3||s.has(n))return!0;s.add(n);let r=n,o=Xt(r);if(A(o,"ph-no-capture")||A(o,"ph-sensitive")||Jt(r)||i.some(l=>Zn(r,l)))return!0;let a=n.parentNode;n=br(a)?a.host:a&&Be(a)?a:null}return!1}yo(e){if(!this.isEnabled||e.type==="pointercancel")return void this.do();if(e.type==="pointerdown"){this.do();let s=$i(e);var t;return void(e.isPrimary&&e.button===0&&!e.ctrlKey&&s&&Be(s)&&(this.vo={target:s,excluded:this.po(s),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(t=this.bo)===null||t===void 0?void 0:t.distinctId}))}let i=this.vo;i&&(e.pointerId!==i.id||Math.abs(e.clientX-i.x)>5||Math.abs(e.clientY-i.y)>5?this.do():e.type==="pointerup"&&(i.released=!0,this.fo=setTimeout(()=>this.do(),0)))}_o(e){var t;let i=this.vo;this.do();let s=$i(e);if(i!=null&&i.released&&i.target.isConnected&&i.distinctId===((t=this.bo)===null||t===void 0?void 0:t.distinctId)&&e.pointerId===i.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-i.x)&&5>=Math.abs(e.clientY-i.y)&&s&&(_e(s,"html")||_e(s,"body"))){var n;if(i.excluded)return null;let r=(n=this.mo().css_selector_ignorelist)!==null&&n!==void 0?n:rn;return[s,E==null?void 0:E.documentElement,E==null?void 0:E.body].some(o=>{if(!o)return!1;let a=Xt(o);return A(a,"ph-no-capture")||A(a,"ph-sensitive")||!Ft(o)||Jt(o)||r.some(l=>Zn(o,l))})?null:i.target}}constructor(e){this.wo=e,this.name="autocapture",this.ko=!1,this.So=null,this.xo=!1,this.$o=new Map,this.Co=!1,this.Mr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.To=!1,this.wo.refresh(this.Mr),this.rageclicks=new su(this.Mr.rageclick),this.Io=null}setup(e){this.Mo(),this.bo=e;let t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.To?t.dispose():(this.Eo=t,this.startIfEnabled())}dispose(){var e;this.To||(this.To=!0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.$o.clear(),this.Io=null,this.Po())}mo(){return this.wo.refresh(this.Mr),this.Mr}Mo(){var e,t;return this.mo(),this.Mr.url_allowlist=(e=this.Mr.url_allowlist)===null||e===void 0?void 0:e.map(i=>new RegExp(i)),this.Mr.url_ignorelist=(t=this.Mr.url_ignorelist)===null||t===void 0?void 0:t.map(i=>new RegExp(i)),this.Mr}Ro(){if(!this.isBrowserSupported())return void yn.info("Disabling Automatic Event Collection because this browser is not supported");if(!b||!E)return;let e=this.Ao=t=>{t=t||(b==null?void 0:b.event);try{if(t.type==="blur")return void this.do();if(t.type.indexOf("pointer")===0)return void this.yo(t);let i=t.type==="click"?this._o(t):void 0;if(ne(i))return;this.Fo(t,"$autocapture",i)}catch(i){yn.error("Failed to capture event",i)}};if(G(b,"blur",e),G(E,"submit",e,{capture:!0}),G(E,"change",e,{capture:!0}),G(E,"click",e,{capture:!0}),Z(["pointerdown","pointermove","pointerup","pointercancel"],t=>{G(E,t,e,{capture:!0})}),this.mo().capture_copied_text){let t=this.Oo=i=>{i=i||(b==null?void 0:b.event);try{this.Fo(i,mn)}catch(s){yn.error("Failed to capture clipboard event",s)}};G(E,"copy",t,{capture:!0}),G(E,"cut",t,{capture:!0}),G(E,"paste",t,{capture:!0})}}Po(){this.do(),this.Ao&&(b==null||b.removeEventListener("blur",this.Ao),Z(["pointerdown","pointermove","pointerup","pointercancel"],e=>{E==null||E.removeEventListener(e,this.Ao,!0)}),E==null||E.removeEventListener("submit",this.Ao,!0),E==null||E.removeEventListener("change",this.Ao,!0),E==null||E.removeEventListener("click",this.Ao,!0),this.Ao=void 0),this.Oo&&(E==null||E.removeEventListener("copy",this.Oo,!0),E==null||E.removeEventListener("cut",this.Oo,!0),E==null||E.removeEventListener("paste",this.Oo,!0),this.Oo=void 0),this.ko=!1}startIfEnabled(){this.isEnabled||this.do(),!this.To&&this.bo&&this.isEnabled&&!this.ko&&(this.Ro(),this.ko=!0)}onRemoteConfig(e){if(this.To)return;if(this.xo=!0,!e.ok)return void this.startIfEnabled();let t=e.config;t.elementsChainAsString&&(this.Co=t.elementsChainAsString);let i=t.autocapture_opt_out;var s;Se(i)&&((s=this.bo)===null||s===void 0||s.kv.set("$autocapture_disabled_server_side",i),this.So=i),this.startIfEnabled()}setElementSelectors(e,t=this){if(this.To)return;e.size?this.$o.set(t,new Set(e)):this.$o.delete(t);let i=new Set;this.$o.forEach(s=>{s.forEach(n=>i.add(n))}),this.Io=i}getElementSelectors(e,t){var i;let s=[];return(i=this.Io)===null||i===void 0||i.forEach(n=>{let r=E==null?void 0:E.querySelectorAll(n);r==null||r.forEach(o=>{e!==o&&t!==o||A(s,n)||s.push(n)})}),s}get isEnabled(){var e,t;if(this.To)return!1;let i=(e=this.bo)===null||e===void 0?void 0:e.kv.get(Vl),s=this.So,n=this.mo();if(!n.remoteRequestsDisabled&&!this.xo)return!1;let r=n.remoteRequestsDisabled&&!this.xo;if(ne(s)&&!Se(i)&&!r)return!1;let o=(t=this.So)!==null&&t!==void 0?t:!!i;return!!n.enabled&&!o}Fo(e,t="$autocapture",i){if(!this.isEnabled)return void this.do();let s=i||$i(e);pc(s)&&(s=s.parentNode||null);let n=this.Mo();var r;t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&n.rageclick&&(!((r=this.rageclicks)===null||r===void 0)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime()))&&_c(s,n.rageclick)&&this.Fo(e,"$rageclick",i);let o=t===mn,a=o?f(f({},n),{},{dom_event_allowlist:void 0}):n;if(s&&(function(d,h,p,v,_,g){var y;if(!b||Sr(d)||p!=null&&p.url_allowlist&&!Ro(p.url_allowlist,g)||p!=null&&p.url_ignorelist&&Ro(p.url_ignorelist,g))return!1;if(p!=null&&p.dom_event_allowlist){let P=p.dom_event_allowlist;if(P&&!P.some(k=>h.type===k))return!1}let{parentIsUsefulElement:m,targetElementList:w}=mc(d,v);if(!(function(P,k){let I=k==null?void 0:k.element_allowlist;if(x(I))return!0;for(let S of P)if(I.some($=>S.tagName.toLowerCase()===$))return!0;return!1})(w,p)||!Yn(w,p==null?void 0:p.css_selector_allowlist)||Yn(w,(y=p==null?void 0:p.css_selector_ignorelist)!==null&&y!==void 0?y:rn))return!1;try{let P=b.getComputedStyle(d);if(P&&P.getPropertyValue("cursor")==="pointer"&&h.type==="click")return!0}catch{}let M=d.tagName.toLowerCase();switch(M){case"html":return!1;case"form":return(_||["submit"]).indexOf(h.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(h.type)>=0;default:return m?(_||["click"]).indexOf(h.type)>=0:(_||["click"]).indexOf(h.type)>=0&&(xr.indexOf(M)>-1||d.getAttribute("contenteditable")==="true")}})(s,e,a,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:n.getCurrentUrl}})){var l;let{props:d,explicitNoCapture:h,target:p}=_f(s,{e,maskAllElementAttributes:n.maskAllElementAttributes,maskAllText:n.maskAllText,elementAttributeIgnoreList:n.element_attribute_ignorelist,elementsChainAsString:this.Co,disableCaptureUrlHashes:n.disableCaptureUrlHashes});if(h)return!1;let v=this.getElementSelectors(s,p);if(v&&v.length>0&&(d.$element_selectors=v),t===mn){let _=e.type||"clipboard";if(_!=="paste"){var c,u;let g=b==null||(c=b.getSelection())===null||c===void 0?void 0:c.toString(),y=fc(g);if(!y)return!1;d.$selected_content=y,d.$clipboard_text_length=(u=g==null?void 0:g.length)!==null&&u!==void 0?u:0}d.$copy_type=_}return(l=this.bo)===null||l===void 0||l.capture(t,d),!0}}isBrowserSupported(){return le(E==null?void 0:E.querySelectorAll)}},yf=class{constructor(e){this._instance=e}refresh(e){let t=this._instance.config,i=j(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.il(),e.url_allowlist=i==null?void 0:i.url_allowlist,e.url_ignorelist=i==null?void 0:i.url_ignorelist,e.dom_event_allowlist=i==null?void 0:i.dom_event_allowlist,e.element_allowlist=i==null?void 0:i.element_allowlist,e.css_selector_allowlist=i==null?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=i==null?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=i==null?void 0:i.element_attribute_ignorelist,e.capture_copied_text=i==null?void 0:i.capture_copied_text}},gi=re("[ExceptionAutocapture]"),pa=()=>{},fa=e=>{var t;if(le(e))return(t=e.__posthog_layer__)!==null&&t!==void 0?t:e.__rrweb_layer__};function ti(e,t,i){try{if(!(t in e))return pa;let s={next:e[t]},n=i(function(...r){return s.next.apply(this,r)});return le(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=n,()=>{if(e[t]===n)return void(e[t]=s.next);let r=e[t],o=fa(r);for(;o;){if(o.next===n)return void(o.next=s.next);r=o.next,o=fa(r)}}}catch{return pa}}var bf=re("[TracingHeaders]"),St=re("[Web Vitals]"),va=9e5,ga=["CLS","FCP","INP","LCP"],wf=["INP","LCP"],xf=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],wn="disabled",_a="lazy_loading",Ke=re("[SessionRecording]"),kf=[vr,gr,ec,tc,ic,sc,nc,rc,oc],Sf=re("[Heatmaps]");function xn(e){return j(e)&&"clientX"in e&&"clientY"in e&&oe(e.clientX)&&oe(e.clientY)}var Qi=re("[Product Tours]"),kn=e=>{var t;return!e.config.disable_product_tours&&!!(!((t=e.persistence)===null||t===void 0)&&t.get_property(pr))},Ef=["$set_once","$set"],qe=re("[SiteApps]"),ma="Error while initializing PostHog app with config id ",nu=(e,t)=>e!=null&&e.then?e.then(t):t(e),jt="SDK is not enabled or survey functionality is not yet loaded",ya="Disabled. Not loading surveys.",$f=class{constructor(e,t){this.wo=e,this.Ic=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Mc=!1,this.Ec=!1,this.Pc=[],this.Rc=[],this.Ac=null,this.Fc=null,this.To=!1,this.Oc=new Set,this.onRemoteConfig=i=>{if(this.To||this.Mr.disableSurveys)return;if(!i.ok)return this.Ec=!0,this.Dc({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),q.warn("Remote config unavailable. Not loading surveys.");let s=i.config.surveys;if(L(s))return q.warn("Flags not loaded yet. Not loading surveys.");this.Lc=Se(s)?s:s.length>0,q.info(`flags response received, isSurveysEnabled: ${this.Lc}`),this.loadIfEnabled()},this.Dc=i=>{this.Rc.slice().forEach(s=>this.Nc(s,i))}}setup(e){if(!this.To)return this.qc=e,nu(e.kv.initialize(),()=>{if(this.qc!==e||this.To)return;this.qc=void 0,this.bo=e;let t=e.onRemoteConfig(this.onRemoteConfig);this.To?t.dispose():(this.Eo=t,this.loadIfEnabled())})}dispose(){var e,t,i,s,n;this.To||(this.To=!0,this.qc=void 0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,(t=this._surveyEventReceiver)===null||t===void 0||t.dispose(),this._surveyEventReceiver=null,(i=this._surveyManager)===null||i===void 0||(s=i.dispose)===null||s===void 0||s.call(i),this._surveyManager=null,this.Pc=[],this.Rc.forEach(r=>{r.active=!1}),this.Rc=[],(n=this.jc)===null||n===void 0||n.call(this),this.jc=void 0,this.Ac=null,this.Oc.forEach(r=>clearTimeout(r)),this.Oc.clear())}get Mr(){return this.wo.get()}initialize(){this.loadIfEnabled()}reset(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.clearInMemoryInProgressSurveyState)===null||t===void 0||t.call(e);try{var i;(i=this._surveyEventReceiver)===null||i===void 0||i.reset(),localStorage.removeItem("lastSeenSurveyDate");let s=[];for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);(r!=null&&r.startsWith("seenSurvey_")||r!=null&&r.startsWith("inProgressSurvey_"))&&s.push(r)}s.forEach(n=>localStorage.removeItem(n))}catch{}this.Dc()}loadIfEnabled(){if(this.To||!this.bo)return;let e=this.Mr;if(this._surveyManager)return;if(this.Mc)return void q.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void q.info(ya);if(e.cookielessMode&&this.wo.isOptedOut())return void q.info("Not loading surveys in cookieless mode without consent.");let t=this.wo.getExtensions();if(!t)return void this.Bc("PostHog Extensions not found.");if(x(this.Lc)&&!e.advancedEnableSurveys)return;let i=this.Lc||e.advancedEnableSurveys;this.Mc=!0,this.Ec=!1;try{let s=t.generateSurveys;if(s)return this.zc(s,i),void(this.Mc=!1);let n=t.loadExternalDependency;if(!n)return this.Bc(_r),void(this.Mc=!1);n(r=>{try{if(this.To)return;let o=this.wo.getExtensions();r||!(o!=null&&o.generateSurveys)?this.Bc("Could not load surveys script",r):this.zc(o.generateSurveys,i)}finally{this.Mc=!1}})}catch(s){throw this.Mc=!1,this.Bc("Error initializing surveys",s),s}}zc(e,t){var i,s;if(this.To)return;this._surveyManager=e(t),this._surveyEventReceiver=this.wo.createEventReceiver(this.Dc);let n=(i=(s=this.bo)!==null&&s!==void 0?s:this.Ic)===null||i===void 0?void 0:i.kv.get(mi);n&&this.Hc(n),q.info("Surveys loaded successfully"),this.Uc(),this.Dc(),this.Wc({isLoaded:!0})}Bc(e,t){this.Ec=!0,q.error(e,t),this.Dc({isLoaded:!1,error:e}),this.Wc({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Pc.push(e),this._surveyManager&&this.Wc({isLoaded:!0}),()=>{this.Pc=this.Pc.filter(t=>t!==e)}}getSurveys(e,t=!1){var i;let s=(i=this.bo)!==null&&i!==void 0?i:this.Ic;if(!s||this.To)return;if(this.Mr.disableSurveys)return q.info(ya),e([]);let n=s.kv.get(mi);if(n&&!t)return e(n,{isLoaded:!0}),void(this.Vc()&&this.getSurveys(()=>{},!0));if(this.Ac)return void this.Ac.then(({surveys:a,context:l})=>{this.To||e(a,l)}).catch(a=>q.error("Error in survey callback",a));let r=this.Gc("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(a=>{try{return this.Qc(s,a)}catch(l){return q.error("Error processing surveys response",l),this.Qc(s,{statusCode:0,error:l})}},a=>this.Qc(s,{statusCode:0,error:a}));this.Ac=r;let o=()=>{this.Ac===r&&(this.Ac=null)};r.then(a=>{o(),this.To||(this.Dc(a.context),e(a.surveys,a.context))},o).catch(a=>q.error("Error in survey callback",a))}Gc(e,t){let i=this.bo;return i?i.sendRequest(e,t):new Promise(s=>s({statusCode:0,error:new Error(jt)}))}Qc(e,t){if(this.To)return{surveys:[],context:{isLoaded:!1,error:jt}};let i=t.statusCode;if(i!==200||!t.json){let n=`Surveys API could not be loaded, status: ${i}`;return i!==0?q.error(n):t.error||q.warn(n),this.Fc=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Fc=null;let s=t.json.surveys||[];return e.kv.set({[mi]:s,[ms]:Date.now()}),this.Hc(s),{surveys:s,context:{isLoaded:!0}}}Hc(e){var t;let i=e.filter(s=>(function(n){return!(!n.start_date||n.end_date)})(s)&&(Kc(s)||(function(n){var r;return!!(!((r=n.conditions)===null||r===void 0||(r=r.actions)===null||r===void 0||(r=r.values)===null||r===void 0)&&r.length)})(s)));(t=this._surveyEventReceiver)===null||t===void 0||t.replace(i)}Vc(){return this.Zc()&&!this.Ac&&!this.Jc()}Zc(){var e,t;let i=(e=(t=this.bo)!==null&&t!==void 0?t:this.Ic)===null||e===void 0?void 0:e.kv.get(ms);return oe(i)&&Date.now()-i>3e5}Jc(){return oe(this.Fc)&&3e5>Date.now()-this.Fc}markSurveyAsSeen(e,t){var i;let s={id:e,current_iteration:(i=t==null?void 0:t.iteration)!==null&&i!==void 0?i:null};tu(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Dc()}Wc(e){for(let t of this.Pc)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(i){q.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t=!1){if(!L(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);q.warn("init was not called")}onActiveMatchingSurveysChanged(e){var t,i;if(this.To)return()=>{};let s={callback:e,active:!0,revision:0};this.Rc.push(s),this.Uc();let n=(t=(i=this.bo)!==null&&i!==void 0?i:this.Ic)===null||t===void 0?void 0:t.kv.get(mi);return this.Mr.disableSurveys||!this._surveyManager&&this.Ec&&!this.Mc||!n&&!L(this.Fc)&&!this.Ac?this.Nc(s,{isLoaded:!1}):this._surveyManager&&this.Nc(s),()=>{var r;s.active=!1,this.Rc=this.Rc.filter(o=>o!==s),this.Rc.length===0&&((r=this.jc)===null||r===void 0||r.call(this),this.jc=void 0)}}Uc(){var e,t,i;this._surveyManager&&this.Rc.length>0&&((e=this.jc)!==null&&e!==void 0||(this.jc=(t=(i=this.wo).onMatchingConditionsChanged)===null||t===void 0?void 0:t.call(i,this.Dc)))}Nc(e,t){if(this.To||!e.active)return;let i=++e.revision,s=n=>{if(!this.To&&e.active&&i===e.revision)try{let r=t!=null?t:{isLoaded:!0},o=JSON.stringify([n,r]);if(o===e.lastResult)return;e.lastResult=o,e.callback(n,r)}catch(r){q.error("Error in active matching surveys callback",r)}};try{t&&!t.isLoaded?s([]):this.getActiveMatchingSurveys(s)}catch(n){q.error("Error in active matching surveys callback",n)}}Kc(e){let t=null;return this.getSurveys(i=>{var s;t=(s=i.find(n=>n.id===e))!==null&&s!==void 0?s:null}),t}Xc(e){if(L(this._surveyManager))return{eligible:!1,reason:jt};let t=typeof e=="string"?this.Kc(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Yc(e){if(!this.wo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(L(this._surveyManager))return{eligible:!1,reason:jt};let t=typeof e=="string"?this.Kc(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(L(this._surveyManager))return q.warn("init was not called"),{visible:!1,disabledReason:jt};let t=this.Yc(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return L(this._surveyManager)?(q.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:jt})):new Promise(i=>{this.getSurveys(s=>{var n;let r=(n=s.find(o=>o.id===e))!==null&&n!==void 0?n:null;if(r){let o=this.Yc(r);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(!this.wo.isCapturing())return;if(L(this._surveyManager))return void q.warn("init was not called");let n=typeof e=="string"?this.Kc(e):e;if(!(n!=null&&n.id))return void q.warn("Survey not found");if(!ef.includes(n.type))return void q.warn(`Surveys of type ${n.type} cannot be rendered in the app`);let r=E==null?void 0:E.querySelector(t);if(r){if(!((s=n.appearance)===null||s===void 0)&&s.surveyPopupDelaySeconds){q.info(`Rendering survey ${n.id} with delay of ${n.appearance.surveyPopupDelaySeconds} seconds`);let o=setTimeout(()=>{var a,l;this.Oc.delete(o),!this.To&&this.wo.isCapturing()&&(q.info(`Rendering survey ${n.id} with delay of ${(a=n.appearance)===null||a===void 0?void 0:a.surveyPopupDelaySeconds} seconds`),(l=this._surveyManager)===null||l===void 0||l.renderSurvey(n,r,i),q.info(`Survey ${n.id} rendered`))},1e3*n.appearance.surveyPopupDelaySeconds);return void this.Oc.add(o)}this._surveyManager.renderSurvey(n,r,i)}else q.warn("Survey element not found")}displaySurvey(e,t){var i;if(!this.wo.isCapturing())return;if(L(this._surveyManager))return void q.warn("init was not called");let s=this.Kc(e);if(!s)return void q.warn("Survey not found");let n=s;if(!((i=s.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=f(f({},s),{},{appearance:f(f({},s.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==Xn.Popover&&t.initialResponses&&q.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){let r=this.Xc(s);if(!r.eligible)return void q.warn("Survey is not eligible to be displayed: ",r.reason)}t.displayType!==Xn.Inline?this._surveyManager.handlePopoverSurvey(n,t):this.renderSurvey(n,t.selector,t.properties)}cancelPendingSurvey(e){L(this._surveyManager)?q.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.handlePageUnload)===null||t===void 0||t.call(e)}};function Vt(e,t,i){if(L(e))return!1;switch(i){case"exact":return e===t;case"contains":{let s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(e)}case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var Pf=class{constructor(e){this._instance=e,this.th=new Set,this.eh=new Set,this.ih=new Es,this.nh=(t,i)=>this.sh(t,i)&&this.rh(t,i)&&this.oh(t,i)&&this.ah(t,i),this.sh=(t,i)=>!(i!=null&&i.event)||(t==null?void 0:t.event)===(i==null?void 0:i.event)}init(){var e,t;x((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)||(this.uh=(t=this._instance)===null||t===void 0?void 0:t._addCaptureHook((i,s)=>{this.on(i,s)}))}dispose(){var e,t;(e=this.uh)===null||e===void 0||e.call(this),this.uh=void 0,(t=this._instance)===null||t===void 0||(t=t.autocapture)===null||t===void 0||t.setElementSelectors(new Set,this),this.ih=new Es}register(e){var t,i;if(!x((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(s=>{var n;this.th.add(s),(n=s.steps)===null||n===void 0||n.forEach(r=>{this.eh.add((r==null?void 0:r.event)||"")})}),(i=this._instance)===null||i===void 0?void 0:i.autocapture)){let s=new Set;this.th.forEach(n=>{var r;(r=n.steps)===null||r===void 0||r.forEach(o=>{o!=null&&o.selector&&s.add(o.selector)})}),this._instance.autocapture.setElementSelectors(s,this)}}replace(e){this.th.clear(),this.eh.clear(),this.register(e)}on(e,t){t!=null&&e.length!=0&&(this.eh.has(e)||this.eh.has(t.event))&&this.th.forEach(i=>{this.hh(t,i)&&this.ih.emit("actionCaptured",i.name)})}dh(e){this.onAction("actionCaptured",t=>e(t))}hh(e,t){if((t==null?void 0:t.steps)==null)return!1;for(let i of t.steps)if(this.nh(e,i))return!0;return!1}onAction(e,t){return this.ih.on(e,t)}rh(e,t){if(t!=null&&t.url){var i;let s=e==null||(i=e.properties)===null||i===void 0?void 0:i.$current_url;if(!s||typeof s!="string"||!Vt(s,t.url,t.url_matching||"contains"))return!1}return!0}oh(e,t){return!!this.fh(e,t)&&!!this.ph(e,t)&&!!this.gh(e,t)}fh(e,t){var i;if(!(t!=null&&t.href))return!0;let s=this.mh(e);if(s.length>0)return s.some(r=>Vt(r.href,t.href,t.href_matching||"exact"));let n=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";return!!n&&Vt((function(r){let o=r.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(n),t.href,t.href_matching||"exact")}ph(e,t){var i;if(!(t!=null&&t.text))return!0;let s=this.mh(e);if(s.length>0)return s.some(l=>Vt(l.text,t.text,t.text_matching||"exact")||Vt(l.$el_text,t.text,t.text_matching||"exact"));let n=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";return!!n&&(r=(function(l){let c=[],u=/(?::|")text="(.*?)"/g,d;for(;!L(d=u.exec(l));)c.includes(d[1])||c.push(d[1]);return c})(n),o=t.text,a=t.text_matching||"exact",r.some(l=>Vt(l,o,a)));var r,o,a}gh(e,t){var i,s;if(!(t!=null&&t.selector))return!0;let n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$element_selectors;if(n!=null&&n.includes(t.selector))return!0;let r=(e==null||(s=e.properties)===null||s===void 0?void 0:s.$elements_chain)||"";if(t.selector_regex&&r)try{return new RegExp(t.selector_regex).test(r)}catch{return!1}return!1}mh(e){var t;return(e==null||(t=e.properties)===null||t===void 0?void 0:t.$elements)==null?[]:e==null?void 0:e.properties.$elements}ah(e,t){return!(t!=null&&t.properties)||t.properties.length===0||eu(t.properties.reduce((i,s)=>{let n=O(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return i[s.key]={values:n,operator:s.operator||"exact"},i},{}),e==null?void 0:e.properties)}},Mf=class{constructor(e,t){var i,s;this.yh=[],this._instance=e,this.bh=t,this._h=new Map,this.wh=new Map,this.kh=new Map,this.Sh=(i=this._instance)===null||i===void 0||(s=i.onSessionId)===null||s===void 0?void 0:s.call(i,n=>this.xh(n))}$h(e){return!1}Ch(){return null}Th(e){}Ih(){}Mh(e,t){return!!e&&eu(e.propertyFilters,t==null?void 0:t.properties)}Eh(e,t){let i=new Map;return e.forEach(s=>{var n;(n=s.conditions)===null||n===void 0||(n=n[t])===null||n===void 0||(n=n.values)===null||n===void 0||n.forEach(r=>{if(r!=null&&r.name){let o=i.get(r.name)||[];o.push(s.id),i.set(r.name,o)}})}),i}Ph(e,t,i){let s=(i===pi.Activation?this._h:this.wh).get(e),n=[];return this.Rh(r=>{n=r.filter(o=>s==null?void 0:s.includes(o.id))}),n.filter(r=>{var o;let a=(o=r.conditions)===null||o===void 0||(o=o[i])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(l=>l.name===e);return this.Mh(a,t)})}register(e){this.Ah(e,!1)}replace(e){this.Ah(e,!0)}Ah(e,t){var i;x((i=this._instance)===null||i===void 0?void 0:i._addCaptureHook)||(this.Fh(e,t),this.Oh(e,t))}Oh(e,t){let i=e.filter(r=>{var o;return(o=r.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var s;if(t&&this.kh.clear(),i.length===0)return void(t&&((s=this.Dh)===null||s===void 0||s.replace([])));this.Dh||(this.Dh=new Pf(this._instance),this.Dh.init(),this.Dh.dh(r=>this.onAction(r)));let n=[];i.forEach(r=>{var o;(o=r.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(a=>{if(n.push(a),a.name){var l;let c=(l=this.kh.get(a.name))!==null&&l!==void 0?l:[];c.includes(r.id)||c.push(r.id),this.kh.set(a.name,c)}})}),t?this.Dh.replace(n):this.Dh.register(n)}Lh(e,t){t.forEach((i,s)=>{var n;let r=(n=e.get(s))!==null&&n!==void 0?n:[];i.forEach(o=>{r.includes(o)||r.push(o)}),e.set(s,r)})}Fh(e,t){var i,s;let n=e.filter(l=>{var c,u;return((c=l.conditions)===null||c===void 0?void 0:c.events)&&((u=l.conditions)===null||u===void 0||(u=u.events)===null||u===void 0||(u=u.values)===null||u===void 0?void 0:u.length)>0}),r=e.filter(l=>{var c,u;return((c=l.conditions)===null||c===void 0?void 0:c.cancelEvents)&&((u=l.conditions)===null||u===void 0||(u=u.cancelEvents)===null||u===void 0||(u=u.values)===null||u===void 0?void 0:u.length)>0}),o=this.Eh(e,pi.Activation),a=this.Eh(e,pi.Cancellation);t?(this._h=o,this.wh=a):(this.Lh(this._h,o),this.Lh(this.wh,a)),(n.length!==0||r.length!==0||e.some(l=>{var c;return(c=l.conditions)===null||c===void 0||(c=c.actions)===null||c===void 0||(c=c.values)===null||c===void 0?void 0:c.length}))&&((i=this.uh)!==null&&i!==void 0||(this.uh=(s=this._instance)===null||s===void 0?void 0:s._addCaptureHook((l,c)=>{this.onEvent(l,c)})))}onEvent(e,t){var i,s;let n=this.Nh(),r=(t==null||(i=t.properties)===null||i===void 0?void 0:i.$survey_id)||(t==null||(s=t.properties)===null||s===void 0?void 0:s.$product_tour_id);if(r&&this.getActivatedIds().includes(r)){let a=this.qh(e,r,t);if(a==="consume")return n.info("event consumed activated item, removing it",{event:e,itemId:r}),void this.jh([r]);if(a==="persist")return n.info("shown item promoted to persisted activation",{event:e,itemId:r}),this.Bh(r),void this.zh([r])}if(this.wh.has(e)){let a=this.Ph(e,t,pi.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(l=>l.id)}),this.jh(a.map(l=>l.id)),a.forEach(l=>this.Hh(l.id)))}if(!this._h.has(e))return;n.info("event name matched",{event:e,eventPayload:t,items:this._h.get(e)});let o=this.Ph(e,t,pi.Activation);this.Uh(o.map(a=>a.id))}onAction(e){this.kh.has(e)&&this.Uh(this.kh.get(e)||[])}Uh(e){var t,i;if(e.length===0)return;let s=!!(!((t=this._instance)===null||t===void 0||(i=t.get_session_id)===null||i===void 0)&&i.call(t)),n=[];for(let r of e)s&&this.$h(r)?this.Bh(r)&&this.Wh(r):n.push(r);n.length>0&&(this.yh=[...new Set([...this.yh,...n])]),this.Nh().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Vh()}Bh(e){this.yh=this.yh.filter(i=>i!==e);let t=this.Gh();return!t.includes(e)&&(this.Qh([...t,e]),this.Zh(),!0)}jh(e){let t=new Set(e);this.yh=this.yh.filter(n=>!t.has(n));let i=this.Jh(),s=i.filter(n=>!t.has(n));s.length!==i.length&&(this.Qh(s),s.length===0&&this.Kh()),this.zh(e),this.Vh()}Vh(){try{var e;(e=this.bh)===null||e===void 0||e.call(this)}catch(t){this.Nh().error("Error while handling activated items change",t)}}Xh(){var e;let t=this.Ch();if(!t)return{};let i=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[t];return i&&typeof i=="object"?i:{}}Wh(e){if(!this.Ch())return;let t=this.Xh();this.Th(f(f({},t),{},{[e]:Date.now()}))}zh(e){if(!this.Ch())return;let t=this.Xh(),i={},s=!1;for(let[n,r]of Object.entries(t))e.includes(n)?s=!0:i[n]=r;s&&(Me(i)?this.Ih():this.Th(i))}Yh(){this.Ch()&&this.Ih()}getActivationTimestamp(e){if(!this.Gh().includes(e))return;let t=this.Xh()[e];return oe(t)?t:void 0}Jh(){var e;let t=this.td();return((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[t])||[]}Gh(){var e,t,i;let s=this.Jh();if(s.length===0)return[];let n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.ed()],r=(t=this._instance)===null||t===void 0||(i=t.get_session_id)===null||i===void 0?void 0:i.call(t);return r&&n===r?s:[]}Zh(){var e,t;let i=(e=this._instance)===null||e===void 0||(t=e.get_session_id)===null||t===void 0?void 0:t.call(e);i&&this.nd(i)}Kh(){this.sd()}xh(e){var t;let i=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.ed()];if(i&&i!==e){let s=this.Jh(),n=this.Xh();s.length>0&&(this.Qh([]),s.filter(r=>oe(n[r])).forEach(r=>this.Hh(r))),this.Kh(),this.Yh(),s.length>0&&this.Vh()}}getActivatedIds(){return[...new Set([...this.Gh(),...this.yh])].filter(e=>!this.rd(e))}dispose(){var e,t,i;(e=this.Sh)===null||e===void 0||e.call(this),this.Sh=void 0,(t=this.uh)===null||t===void 0||t.call(this),this.uh=void 0,(i=this.Dh)===null||i===void 0||i.dispose(),this.Dh=void 0}reset(){this.yh=[],this.Jh().length>0&&this.Qh([]),this.Kh(),this.Yh(),this.Vh()}getEventToItemsMap(){return this._h}od(){return this.Dh}},Tf=class extends Mf{constructor(e,t){super(e,t)}td(){return Gl}ed(){return ql}Ch(){return Zl}Th(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated_timestamps:e})}Ih(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_timestamps")}$h(e){var t;let i;this.Rh(n=>{i=n.find(r=>r.id===e)});let s=i==null||(t=i.appearance)===null||t===void 0?void 0:t.surveyPopupDelaySeconds;return oe(s)&&s>0}ad(){return Ie.SHOWN}Rh(e){var t;(t=this._instance)===null||t===void 0||t.getSurveys(e)}Hh(e){var t;(t=this._instance)===null||t===void 0||t.cancelPendingSurvey(e)}Nh(){return q}Qh(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated:e})}nd(e){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.register({$surveys_activated_session:e})}sd(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_session")}rd(){return!1}qh(e,t,i){var s;if(e===Ie.SENT&&(i==null||(s=i.properties)===null||s===void 0?void 0:s.$survey_completed)===!1)return"ignore";let n;return this.Rh(r=>{n=r.find(o=>o.id===t)}),!n||(function(r){var o;return Kc(r)&&!!(!((o=r.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||r.schedule==="always"})(n)?e===Ie.SHOWN?"consume":"ignore":e===Ie.SHOWN?"persist":e===Ie.DISMISSED||e===Ie.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},If=class{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);let t={};for(let i of e){let s=this._instance.get_property(i);x(s)||(t[i]=s)}return t}set(e,t){this._instance.register(typeof e=="string"?{[e]:t}:e)}remove(e){typeof e!="string"?e.forEach(t=>this._instance.unregister(t)):this._instance.unregister(e)}},Cf=class{constructor(e){this._instance=e}get(){let e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){let e=F==null?void 0:F.__PosthogExtensions__;if(!e)return;let{generateSurveys:t,loadExternalDependency:i}=e;return{generateSurveys:t?s=>t(this._instance,s):void 0,loadExternalDependency:i?s=>i(this._instance,"surveys",s):void 0}}createEventReceiver(e){return new Tf(this._instance,e)}onMatchingConditionsChanged(e){let t=this._instance._addCaptureHook(r=>{r!=="$pageview"&&r!==Ie.SHOWN&&r!==Ie.DISMISSED&&r!==Ie.SENT||e()}),i=()=>e();G(b,"PHSurveyShown",i);let s=!1,n=this._instance.onFeatureFlags(()=>{s&&e()});return s=!0,()=>{s=!1,t(),n(),b==null||b.removeEventListener("PHSurveyShown",i)}}},Ff=b!=null&&b.location?ws(b.location.hash,"__posthog")||ws(location.hash,"state"):null,ba="_postHogToolbarParams",wa=re("[Toolbar]"),xa=re("[FeatureFlags]"),Et=re("[FeatureFlags]",{debugEnabled:!0}),Sn=`" failed. Feature flags didn't load in time.`,Af=[502,504],ka=["click","keydown","wheel","touchstart","pointerdown"],Sa="connection_error",Ea=e=>{let t={};for(let i=0;e.length>i;i++)t[e[i]]=!0;return t},$a=e=>{let t={};for(let[i,s]of rs(e||{}))s&&(t[i]=s);return t},Of=class{constructor(e){this.name="featureFlags",this.ld=!1,this.featureFlagEventHandlers=[],this.A=xa,this.ud={},this.hd={},this.dd=[],this.vd=new Set,this.fd=new Set,this.pd=!1,this.gd=!1,this.md=0,this.yd=!1,this.bd=!1,this._d=!1,this.wd=!1,this.kd=0,this.Sd=!1,this.rn=()=>{let t=this.xd();this.kd=0,t&&this.reloadFeatureFlags()},this.$d=()=>{var t,i;let s=this.Cd,n=(t=this.Td)!==null&&t!==void 0?t:s;x(s)||x(n)||this.Mr.remoteRequestsDisabled||!this.Id||this.Id.visibilityState==="hidden"||Date.now()-((i=this.Md)!==null&&i!==void 0?i:0)<n||(this.Td=this.Sd||!this.Mr.idleRefreshBackoff?s:Math.min(2*n,36e5),this.Sd=!1,this.reloadFeatureFlags(),this.Ed())},this.Pd=()=>{this.Sd&&this.Td===this.Cd||this.Rd()},this.sn=()=>{var t;((t=this.Id)===null||t===void 0?void 0:t.visibilityState)==="visible"&&this.Rd()},this.wo=e}get Ad(){}Fd(){this.bo&&this.Od()}setup(e){try{this.Dd=typeof window>"u"?void 0:window,this.Id=typeof document>"u"?void 0:document}catch{this.Dd=void 0,this.Id=void 0}return this.qc=e,this.A=e.logger.createLogger("[FeatureFlags]"),nu(e.kv.initialize(),()=>{this.qc===e&&(this.qc=void 0,this.bo=e,this.Ld(e))})}Ld(e){var t;if(this.bo===e)return this.Dd&&G(this.Dd,"online",this.rn),this.Od(),this.Nd=e.registerDynamicEventProperties(()=>this.qd()?this.ud:this.hd),this.jd=(t=this.Ad)===null||t===void 0?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Bd(),this.zd(),this.Hd()}),this.zd(),this.initialize()}Rd(){this.Sd=!0,this.Td=this.Cd,this.$d()}Od(){var e;let t=this.Mr.refreshIntervalMs,i=!this.Mr.remoteRequestsDisabled&&this.Id&&!x(t)&&t>0?t:void 0;this.Mr.idleRefreshBackoff||(this.Td=i),i!==this.Cd&&(this.Ud(),x(i)||(this.Cd=i,this.Td=i,this.Ed(),!((e=this.Id)===null||e===void 0)&&e.addEventListener&&(G(this.Id,Oi,this.sn),Wt(ka,s=>{G(this.Id,s,this.Pd,{capture:!0})}))))}Ed(){x(this.Cd)||(x(this.Wd)||clearInterval(this.Wd),this.Md=Date.now(),this.Wd=setInterval(this.$d,this.Cd))}Ud(){var e,t;x(this.Wd)||(clearInterval(this.Wd),this.Wd=void 0,(e=this.Id)===null||e===void 0||(t=e.removeEventListener)===null||t===void 0||t.call(e,"visibilitychange",this.sn),Wt(ka,i=>{var s,n;(s=this.Id)===null||s===void 0||(n=s.removeEventListener)===null||n===void 0||n.call(s,i,this.Pd,{capture:!0})})),this.Cd=void 0,this.Td=void 0,this.Sd=!1,this.Md=void 0}destroy(){this.Vd()}dispose(){this.Vd()}Vd(){var e,t,i;this.Ud(),this.md++,this.bd=!1,this.qc=void 0,this.Gd(this.vd,"cancelled"),this.Gd(this.fd,"cancelled"),this.bo&&(this.Qd(),(e=this.Nd)===null||e===void 0||e.dispose(),this.Nd=void 0,(t=this.jd)===null||t===void 0||t.call(this),this.jd=void 0,this.dd=[],(i=this.Dd)===null||i===void 0||i.removeEventListener("online",this.rn),this.bo=void 0)}get Mr(){return this.wo.get()}Zd(e){var t;return this.Jd&&e in this.Jd?this.Jd[e]:(t=this.bo)===null||t===void 0?void 0:t.kv.get(e)}Bd(){return!!this.Jd&&(this.Jd=void 0,!0)}Kd(){var e;return!x((e=this.bo)===null||e===void 0?void 0:e.kv.get("$enabled_feature_flags"))&&this.Bd()}$t(e){this.Xd(()=>{var t;return(t=this.bo)===null||t===void 0?void 0:t.kv.set(e)})}Yd(e,t,i){if(!this.Ad||!e.$enabled_feature_flags)return;let s=this.Zd("$enabled_feature_flags")||{},n=e.$enabled_feature_flags||{},r=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(([,g])=>!(g!=null&&g.failed)).map(([g])=>g):[],a=!!t.errorsWhileComputingFlags&&!!t.flags,l=a?o:i&&!O(r)?Object.keys(r||{}):Array.from(new Set([...Object.keys(s),...Object.keys(n)])),c=this.Zd("$feature_flag_payloads")||{},u=e.$feature_flag_payloads||{},d=a||i?l:Array.from(new Set([...Object.keys(c),...Object.keys(u)])),h=!a&&!i,p=!!h||l,v=!!h||d,_={[tt]:p,[Ve]:p,[_t]:v};e.$feature_flag_details&&(_[It]=p);for(let g of[Ct,mt,xi])x(e[g])||(_[g]=!0);this.Ad.markCrossTabFeatureFlagChanges(_)}Pt(e){this.Xd(()=>{var t;return(t=this.bo)===null||t===void 0?void 0:t.kv.remove(e)})}Xd(e){try{e()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}zd(){let e={};for(let s of[tt,_t,Ct,Ze]){let n=this.Zd(s);x(n)||(e[s]=n)}this.ud=e;let t=f({},e),i=this.Zd(Ve);if(i)for(let[s,n]of Object.entries(i))t[`$feature/${s}`]=n;this.hd=t}qd(){let e=this.Mr.cacheTtlMs;if(!e||0>=e)return!1;let t=this.Zd(mt);return typeof t!="number"||Date.now()-t>e}tv(){return!!this.qd()&&(this.wd||this.gd||(this.wd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}ev(){let e=this.Mr.evaluationContexts;return e!=null&&e.length?e.filter(t=>{let i=t&&typeof t=="string"&&t.trim().length>0;return i||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),i}):[]}iv(){let e=this.Mr.flagKeys;if(!x(e))return e.filter(t=>{let i=t&&typeof t=="string"&&t.trim().length>0;return i||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),i})}initialize(){var e,t;let i=this.Mr,s=(e=(t=i.bootstrap)===null||t===void 0?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(s).length){var n,r;let o=(n=(r=i.bootstrap)===null||r===void 0?void 0:r.featureFlagPayloads)!==null&&n!==void 0?n:{},a=Object.keys(s).filter(c=>!x(s[c])).reduce((c,u)=>(c[u]=s[u],c),{}),l=Object.keys(o).filter(c=>a[c]).reduce((c,u)=>(c[u]=o[u],c),{});return this.nv({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(e,t,i){var s,n;let r=i!=null&&i.merge&&(s=this.Zd("$enabled_feature_flags"))!==null&&s!==void 0?s:{},o=i!=null&&i.merge&&(n=this.Zd("$feature_flag_payloads"))!==null&&n!==void 0?n:{},a=f(f({},r),e),l=f(f({},o),t),c={};for(let[u,d]of Object.entries(a))c[u]={key:u,enabled:go(d),variant:_o(d),reason:void 0,metadata:x(l==null?void 0:l[u])?void 0:{id:0,version:void 0,description:void 0,payload:l[u]}};this.nv({flags:c})}get hasLoadedFlags(){return this.pd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){let e=this.Zd(It),t=this.Zd(Ze),i=this.Zd(Mt);if(!i&&!t)return e||{};let s=Q({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(let a of n){var r,o;let l=s[a],c=t==null?void 0:t[a],u=x(c)?(r=l==null?void 0:l.enabled)!==null&&r!==void 0&&r:!!c,d=x(c)?l==null?void 0:l.variant:typeof c=="string"?c:void 0,h=i==null?void 0:i[a],p=f(f({},l),{},{enabled:u,variant:u?d!=null?d:l==null?void 0:l.variant:void 0});u!==(l==null?void 0:l.enabled)&&(p.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(p.original_variant=l==null?void 0:l.variant),h&&(p.metadata=f(f({},l==null?void 0:l.metadata),{},{payload:h,original_payload:l==null||(o=l.metadata)===null||o===void 0?void 0:o.payload})),s[a]=p}return this.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ld=!0),s}getAllFeatureFlags(){let e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{let s=e[i];return{key:i,enabled:go(s),variant:_o(s),payload:vo(t[i])}})}getFlagVariants(){let e=this.Zd(Ve),t=this.Zd(Ze);if(!t)return e||{};let i=Q({},e||{}),s=Object.keys(t);for(let n=0;s.length>n;n++)i[s[n]]=t[s[n]];return this.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ld=!0),i}getFlagPayloads(){let e=this.Zd(_t),t=this.Zd(Mt);if(!t)return e||{};let i=Q({},e||{}),s=Object.keys(t);for(let n=0;s.length>n;n++)i[s[n]]=t[s[n]];return this.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ld=!0),i}reloadFeatureFlags(){this.yd||this.Mr.featureFlagsDisabled||this.xd()||(this.gd&&(this.bd=!0),this.sv||(this.dd.slice().forEach(e=>{try{e()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.sv=setTimeout(()=>{this.rv()},5)))}reloadFeatureFlagsAsync(){return!this.bo||this.yd||this.Mr.featureFlagsDisabled||this.Mr.remoteRequestsDisabled||this.xd()?Promise.resolve({status:"skipped"}):new Promise(e=>{this.vd.add(e),this.reloadFeatureFlags()})}Gd(e,t){e.forEach(i=>i({status:t})),e.clear()}Qd(){clearTimeout(this.sv),this.sv=void 0}onReloading(e){return this.dd.push(e),()=>{this.dd=this.dd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.pd||this.gd||this.sv||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.yd=e}resetFlagCallReported(){this.Pt(gt)}rv(e){var t;this.Qd();let i=this.bo;if(!i||this.Mr.remoteRequestsDisabled||this.xd())return void this.Gd(this.vd,"skipped");if(this.gd)return void(this.bd=!0);let s={token:i.projectToken,distinct_id:i.distinctId,groups:i.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:f(f(f({},i.initialPersonProperties),this.Zd("$stored_person_properties")||{}),{},{$lib:i.library.name,$lib_version:i.library.version}),group_properties:this.Zd(ft),timezone:xc()};x(i.deviceId)||(s.$device_id=i.deviceId),(e!=null&&e.disableFlags||this.Mr.featureFlagsDisabled)&&(s.disable_flags=!0);let n=this.ev();n.length&&(s.evaluation_contexts=n);let r=this.iv();x(r)||(s.flag_keys=r);let o=this.Mr.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.md,c=this.vd;this.vd=new Set,this.fd=c,this.gd=!0;let u=()=>{this.bd&&(this.bd=!1,this.rv())},d=g=>{var y,m;let w=(y=g.json)!==null&&y!==void 0?y:{},M=g.statusCode!==200;if(this.gd=!1,l!==this.md)return void u();if(this.ov(g.statusCode),M||this.bd||(this.$anon_distinct_id=void 0),s.disable_flags&&!this.bd)return void this.Gd(c,"skipped");this._d=!M;let P=[];g.error?P.push(g.error instanceof Error&&g.error.name==="AbortError"?"timeout":g.error instanceof Error?Sa:"unknown_error"):g.statusCode!==200&&P.push(`api_error_${g.statusCode}`),w.errorsWhileComputingFlags&&P.push("errors_while_computing_flags");let k=!!(!((m=w.quotaLimited)===null||m===void 0)&&m.includes("feature_flags"));k&&P.push("quota_limited"),this.$t({[Ai]:P}),k?this.A.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."):s.disable_flags||this.nv(w,M,{partialResponse:o}),this.Gd(c,s.disable_flags?"skipped":P.length||!w.flags&&!w.featureFlags?"error":"loaded"),u()},h=g=>{this.gd=!1,l===this.md&&(this.$t({[Ai]:[Sa]}),this.A.error("Feature flag request failed",g),this.Kd()&&this.Hd(!0),this.Gd(c,"error")),u()},p=(t=this.Mr.requestMaxRetries)!==null&&t!==void 0?t:1,v=()=>p>0&&l===this.md,_=()=>{if(l!==this.md||!this.bo||this.Mr.remoteRequestsDisabled)return this.gd=!1,this.Gd(c,"skipped"),void u();try{i.sendRequest(a,{target:"flags",method:"POST",body:s,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(g=>{if((y=>Af.includes(y.statusCode)||(m=>m.statusCode===0&&m.error instanceof Error&&m.error.name==="AbortError")(y))(g)&&v())return p--,void setTimeout(_,500);d(g)}).catch(h)}catch(g){h(g)}};_()}xd(){return Sc(this.kd,3)}ov(e){this.kd=Ec(e,this.kd,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t={}){var i;if(t.fresh&&!this._d)return;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+e+Sn);if(this.tv())return;let s=this.getFeatureFlagResult(e,t);return(i=s==null?void 0:s.variant)!==null&&i!==void 0?i:s==null?void 0:s.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){let t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t={}){if(t.fresh&&!this._d)return;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+e+Sn);if(this.tv())return;let i=this.getFlagVariants(),s=e in i,n=i[e],r=this.getFlagPayloads()[e],o=String(n),a=this.Zd("$feature_flag_request_id")||void 0,l=this.Zd("$feature_flag_evaluated_at")||void 0,c,u=this.Zd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){var d;let $=(d=this.bo)===null||d===void 0?void 0:d.session.sessionId,D=this.Zd(_i);$&&$!==D&&(u={},c=$)}if(!t.send_event&&"send_event"in t)c&&this.$t({[gt]:u,[_i]:c});else if(e in u&&u[e].includes(o))c&&this.$t({[gt]:u,[_i]:c});else{var h,p,v,_,g,y,m,w,M,P,k,I,S;O(u[e])?u[e].push(o):u[e]=[o],this.$t(f({[gt]:u},c?{[_i]:c}:{}));let $=this.getFeatureFlagDetails(e),D=[...(h=this.Zd("$feature_flag_errors"))!==null&&h!==void 0?h:[]];x(n)&&D.push("flag_missing");let R={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:r!=null?r:null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(p=(v=this.Mr.bootstrap)===null||v===void 0||(v=v.featureFlags)===null||v===void 0?void 0:v[e])!==null&&p!==void 0?p:null,$feature_flag_bootstrapped_payload:(_=(g=this.Mr.bootstrap)===null||g===void 0||(g=g.featureFlagPayloads)===null||g===void 0?void 0:g[e])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this._d};x($==null||(y=$.metadata)===null||y===void 0?void 0:y.has_experiment)||(R.$feature_flag_has_experiment=$.metadata.has_experiment),x($==null||(m=$.metadata)===null||m===void 0?void 0:m.version)||(R.$feature_flag_version=$.metadata.version);let N=(w=$==null||(M=$.reason)===null||M===void 0?void 0:M.description)!==null&&w!==void 0?w:$==null||(P=$.reason)===null||P===void 0?void 0:P.code;N&&(R.$feature_flag_reason=N),!($==null||(k=$.metadata)===null||k===void 0)&&k.id&&(R.$feature_flag_id=$.metadata.id),x($==null?void 0:$.original_variant)&&x($==null?void 0:$.original_enabled)||(R.$feature_flag_original_response=x($.original_variant)?$.original_enabled:$.original_variant),!($==null||(I=$.metadata)===null||I===void 0)&&I.original_payload&&(R.$feature_flag_original_payload=$==null||(S=$.metadata)===null||S===void 0?void 0:S.original_payload),D.length&&(R.$feature_flag_error=D.join(",")),this.av(R)}return s?{key:e,enabled:!!n,variant:typeof n=="string"?n:void 0,payload:vo(r)}:void 0}av(e){try{var t;(t=this.bo)===null||t===void 0||t.capture("$feature_flag_called",e)}catch(i){this.A.error("Failed to capture feature flag call",i)}}getRemoteConfigPayload(e,t){this.lv(e,t)}lv(e,t){var i=this;return ee(function*(){let s=i.bo;if(!s)return;let n={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},r=i.ev();r.length&&(n.evaluation_contexts=r);let o=i.iv(),a;x(o)||(n.flag_keys=o);try{var l;let c=(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Mr.compression,sentAt:"body",timeoutMs:i.Mr.requestTimeoutMs})).json)===null||l===void 0?void 0:l.featureFlagPayloads;a=(c==null?void 0:c[e])||void 0}catch(c){return void i.A.error("Remote config feature flag request failed",c)}try{t(a)}catch(c){i.A.error("Remote config feature flag callback failed",c)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this._d)return t.defaultValue;if(!(this.pd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+Sn),t.defaultValue;let i=this.getFeatureFlag(e,t);return x(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.nv(e,t,i)}nv(e,t,i){if(!this.bo)return;this.pd=!0;let s=((n,r={},o={},a={},l,c=xa)=>{let u=((w,M)=>{let P=w.flags;if(P){let k=Object.fromEntries(Object.keys(P).map(S=>{var $;return[S,($=P[S].variant)!==null&&$!==void 0?$:P[S].enabled]})),I=Object.fromEntries(Object.keys(P).filter(S=>P[S].enabled).filter(S=>{var $;return!x(($=P[S].metadata)===null||$===void 0?void 0:$.payload)}).map(S=>{var $;return[S,($=P[S].metadata)===null||$===void 0?void 0:$.payload]}));return f(f({},w),{},{featureFlags:k,featureFlagPayloads:I})}return w.featureFlags&&M.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),w})(n,c),d=u.flags,h=u.featureFlags,p=u.featureFlagPayloads;if(!h)return;let v=n.requestId,_=n.evaluatedAt;if(O(h)){c.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");let w={};if(h)for(let M=0;h.length>M;M++)w[h[M]]=!0;return{[tt]:h,[Ve]:w,[xi]:!1}}let g=h,y=p,m=d;if(l!=null&&l.partialResponse){let w=Object.keys(g),M=y||{};g=f(f({},r),g),y=f(f({},o),M),w.forEach(P=>{P in M||y==null||delete y[P]}),m=f(f({},a),m)}else if(n.errorsWhileComputingFlags)if(d){let w=new Set(Object.keys(d).filter(P=>{var k;return!(!((k=d[P])===null||k===void 0)&&k.failed)}));g=f(f({},r),Object.fromEntries(Object.entries(g).filter(([P])=>w.has(P))));let M=Object.fromEntries(Object.entries(y||{}).filter(([P])=>w.has(P)));y=f(f({},o),M),w.forEach(P=>{P in M||y==null||delete y[P]}),m=f(f({},a),Object.fromEntries(Object.entries(m||{}).filter(([P])=>w.has(P))))}else g=f(f({},r),g),y=f(f({},o),y),m=f(f({},a),m);return f(f({[tt]:Object.keys($a(g)),[Ve]:g||{},[_t]:y||{},[It]:m||{},[xi]:n.minimalFlagCalledEvents===!0},v?{[Ct]:v}:{}),_?{[mt]:_}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(s)if((i==null?void 0:i.persist)===!1){let n=!x(this.bo.kv.get(Ve));this.Jd=s,n||this.$t(s)}else this.Bd(),this.Yd(s,e,!!(i!=null&&i.partialResponse)),this.$t(s);else t&&this.Kd();t||(this.wd=!1),this.Hd(t)}override(e,t=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.uv(e)}uv(e){if(this.bo){if(e===!1)return this.Pt([Ze,Mt]),this.Hd(),void Et.info("All overrides cleared");if(O(e))return this.$t({[Ze]:Ea(e)}),this.Hd(),void Et.info("Flag overrides set",{flags:e});if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t;let i=e;this.ld=!!((t=i.suppressWarning)!==null&&t!==void 0&&t);let s={},n=i.flags,r=i.payloads;return n&&(s[Ze]=O(n)?Ea(n):n),r&&(s[Mt]=r),Object.keys(s).length&&this.$t(s),n===!1&&r===!1?this.Pt([Ze,Mt]):n===!1?this.Pt(Ze):r===!1&&this.Pt(Mt),this.Hd(),n===!1?Et.info("Flag overrides cleared"):n&&Et.info("Flag overrides set",{flags:n}),void(r===!1?Et.info("Payload overrides cleared"):r&&Et.info("Payload overrides set",{payloads:r}))}if(e&&typeof e=="object")return this.$t({[Ze]:e}),this.Hd(),void Et.info("Flag overrides set",{flags:e});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.pd){let{flags:t,flagVariants:i}=this.hv();try{e(t,i)}catch(s){this.A.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;let n=(this.Zd("$early_access_features")||[]).find(c=>c.flagKey===e),r={[`$feature_enrollment/${e}`]:t},o={$feature_flag:e,$feature_enrollment:t,$set:r};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i);let a=f(f({},this.getFlagVariants()),{},{[e]:t});(s=this.Ad)===null||s===void 0||s.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(r)}),this.$t({[tt]:Object.keys($a(a)),[Ve]:a,[vt]:f(f({},this.Zd("$stored_person_properties")||{}),r)}),this.Hd();try{var l;(l=this.bo)===null||l===void 0||l.capture("$feature_enrollment_update",o)}catch(c){this.A.error("Failed to capture early access feature enrollment",c)}}getEarlyAccessFeatures(e,t=!1,i){let s=this.Zd(Dn);!s||t?this.dv(e,i):e(s)}dv(e,t){var i=this;return ee(function*(){let s=i.bo;if(!s)return;let n=t?`&${t.map(o=>`stage=${o}`).join("&")}`:"",r;try{let o=yield s.sendRequest(`/api/early_access_features/?token=${s.projectToken}${n}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;r=o.json.earlyAccessFeatures,i.$t({[Dn]:r})}catch(o){return void i.A.error("Early access feature request failed",o)}try{e(r)}catch(o){i.A.error("Early access feature callback failed",o)}})()}hv(){let e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,s)=>(i[s]=t[s],i),{})}}Hd(e){this.zd();let{flags:t,flagVariants:i}=this.hv();this.featureFlagEventHandlers.forEach(s=>{try{s(t,i,{errorsLoading:e})}catch(n){this.A.error("Error while running feature flags callback",n)}})}setPersonPropertiesForFlags(e,t=!0){this.vv(e,t)}vv(e,t=!0){let i=this.Zd("$stored_person_properties")||{},s=(e==null?void 0:e.$set)||(e!=null&&e.$set_once?{}:e),n=e==null?void 0:e.$set_once,r={};if(n)for(let o in n)({}).hasOwnProperty.call(n,o)&&(o in i||(r[o]=n[o]));this.$t({[vt]:f(f(f({},i),r),s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){let i=f({},this.Zd("$stored_person_properties")||{});e.forEach(s=>{delete i[s]}),this.$t({[vt]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Pt(vt),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){let i=this.Zd("$stored_group_properties")||{},s=f({},i);for(let n of Object.keys(e))s[n]=f(f({},i[n]),e[n]);this.$t({[ft]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){let t=this.Zd("$stored_group_properties")||{};this.$t({[ft]:f(f({},t),{},{[e]:{}})})}else this.Pt(ft)}reset(){this.md++,this.Gd(this.vd,"cancelled"),this.Gd(this.fd,"cancelled"),this.bd=!1,this.ud={},this.hd={},this.Jd=void 0,this.pd=!1,this.yd=!1,this._d=!1,this.$anon_distinct_id=void 0,this.Qd(),this.ld=!1,this.kd=0}},Pa=re("[FeatureFlags]"),Rf=class{constructor(e,t=!1){this.fv=!1,this.update(e,t)}update(e,t){this.pv=((i,s)=>{var n,r,o,a,l,c,u,d;return{bootstrap:{featureFlags:(n=(r=i.bootstrap)===null||r===void 0?void 0:r.featureFlags)!==null&&n!==void 0?n:void 0,featureFlagPayloads:(o=(a=i.bootstrap)===null||a===void 0?void 0:a.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:s,featureFlagsDisabled:!!i.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!i.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!i.advanced_feature_flags_dedup_per_session,cacheTtlMs:i.feature_flag_cache_ttl_ms,refreshIntervalMs:(l=i.remote_config_refresh_interval_ms)!==null&&l!==void 0?l:3e5,idleRefreshBackoff:x(i.remote_config_refresh_interval_ms),requestTimeoutMs:i.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(c=i.feature_flag_request_max_retries)!==null&&c!==void 0?c:1),compression:i.disable_compression?void 0:"best-available",evaluationContexts:(u=(d=i.evaluation_contexts)!==null&&d!==void 0?d:i.evaluation_environments)!==null&&u!==void 0?u:[],flagKeys:O(i.flag_keys)?i.flag_keys:void 0}})(e,t),!e.evaluation_environments||e.evaluation_contexts||this.fv||(Pa.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.fv=!0),x(e.flag_keys)||O(e.flag_keys)||Pa.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.pv}},Ma=e=>ii(e)&&(e.name==="RangeError"&&e.message.indexOf("Maximum call stack size exceeded")===0||e.name==="InternalError"&&e.message==="too much recursion"),Ne=re("[Error tracking]"),ir="webkit-masked-url:",Lf=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],Df=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",ir],Nf=["__firefox__","__gCrWeb"],Ta="Refusing to render web experiment since the viewer is a likely bot",jf={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>$s(t,e),not_regex:(e,t)=>!$s(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},Le=re("[Conversations]"),$t="Conversations not available yet.";function Ia(e,t){var i,s,n,r,o,a,l;let c=(i=e==null?void 0:e.flushIntervalMs)!==null&&i!==void 0?i:3e3,u=(s=e==null?void 0:e.maxBufferSize)!==null&&s!==void 0?s:100,d=t!=null&&t.consoleCapture?void 0:(n=e==null?void 0:e.maxLogsPerInterval)!==null&&n!==void 0?n:1e3,h=x(d)?Math.max(u,2048):Math.max(u,d),p=f(f({},(function(){let v="",_="";try{let g=pe==null?void 0:pe.userAgent;g&&([v,_]=pl(g))}catch{}return(function(g,y){let m=(function(w){if(w)return{}.hasOwnProperty.call(ko,w)?ko[w]:w})(g);return f(f({},m?{"os.name":m}:{}),y?{"os.version":y}:{})})(v,_)})()),e==null?void 0:e.resourceAttributes);return{serviceName:(r=(o=p==null?void 0:p["service.name"])!==null&&o!==void 0?o:e==null?void 0:e.serviceName)!==null&&r!==void 0?r:t==null?void 0:t.serviceNameDefault,serviceVersion:(a=p==null?void 0:p["service.version"])!==null&&a!==void 0?a:e==null?void 0:e.serviceVersion,environment:(l=p==null?void 0:p["deployment.environment"])!==null&&l!==void 0?l:e==null?void 0:e.environment,resourceAttributes:p,beforeSend:e==null?void 0:e.beforeSend,flushIntervalMs:c,maxBufferSize:u,maxQueueSize:h,maxBatchRecordsPerPost:100,rateCapWindowMs:c,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Vf=["debug","log","warn","error","info"],Hf=e=>{for(;e!=null&&e.__rrweb_original__;)e=e.__rrweb_original__;return e},Ca="console",ru="__posthogHandledLogsRequestError",En=(e,t)=>{let i=e instanceof Error?e:new Error(t);return i[ru]=!0,i},Fa=e=>!!e&&typeof e=="object"&&e[ru]===!0,Ps=re("[NetworkMetrics]"),Pr=()=>{var e;return!(b==null||(e=b.performance)===null||e===void 0)&&e.now?b.performance.now():Date.now()},Bf={"http:":80,"https:":443},Wf=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),ou=(e,t)=>{var i;let s=String(t);return{method:String(e).toUpperCase(),url:((i=nt(s))===null||i===void 0?void 0:i.href)||s}},sr=(e,t,i,s,n,r,o=!1)=>{try{var a,l;let c=n();if(!c)return;let u=i||void 0,d=Pr()-s,h=nt(t.url);if(h&&h.protocol!=="http:"&&h.protocol!=="https:")return;let p={url:(h==null?void 0:h.href)||t.url,method:t.method},v=le(c.name)?c.name(p):V(c.name)?c.name:"http.client.request.duration";if(!v)return;let _=o&&!u?void 0:((y,m)=>y?400>y?void 0:String(y):(m==null?void 0:m.name)||"_OTHER")(u,r),g=f(f(f(f(f({},(y=>{let m=Wf.has(y)?y:"_OTHER";return f({"http.request.method":m},m==="_OTHER"&&y!==m?{"http.request.method_original":y}:{})})(p.method)),h?(y=>{return{"server.address":y.hostname.startsWith("[")&&y.hostname.endsWith("]")?y.hostname.slice(1,-1):y.hostname,"server.port":Number(y.port)||Bf[y.protocol],"url.scheme":y.protocol.slice(0,-1),"url.template":(m=y.pathname,m.split("/").map(w=>(M=>/^\d+$/.test(M)||M.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(M))(w)?":id":w).join("/"))};var m})(h):{}),u?{"http.response.status_code":u}:{}),_?{"error.type":_}:{}),(a=c.attributes)===null||a===void 0?void 0:a.call(c,p,{status:u,durationMs:d}));(l=e.metrics)===null||l===void 0||l.histogram(v,d,{unit:"ms",attributes:g})}catch(c){Ps.error("Failed to record network metric",c)}},au=()=>{},Uf=(e,t)=>le(b==null?void 0:b.fetch)?ti(b,"fetch",i=>function(...s){let n=Pr(),r=i.apply(this,s);if(!t())return r;try{var o,a,l;let[c,u]=s,d=ou((o=(a=u==null?void 0:u.method)!==null&&a!==void 0?a:c==null?void 0:c.method)!==null&&o!==void 0?o:"GET",(l=c==null?void 0:c.url)!==null&&l!==void 0?l:c);return r.then(h=>(sr(e,d,h==null?void 0:h.status,n,t,void 0,!0),h),h=>{throw sr(e,d,void 0,n,t,h),h})}catch(c){return Ps.error("Failed to observe fetch",c),r}}):au,zf=(e,t)=>{var i;let s=b==null||(i=b.XMLHttpRequest)===null||i===void 0?void 0:i.prototype;if(!s)return au;let n=new WeakMap,r=ti(s,"open",a=>function(...l){try{jc.has(this)||n.set(this,ou(l[0],l[1]))}catch(c){Ps.error("Failed to observe XHR open",c)}return a.apply(this,l)}),o=ti(s,"send",a=>function(...l){let c;try{let u=n.get(this);if(u&&t()){let d=Pr();c=()=>{this.removeEventListener("loadend",c),sr(e,u,this.status,d,t)},G(this,"loadend",c)}}catch(u){Ps.error("Failed to observe XHR send",u)}try{return a.apply(this,l)}catch(u){throw c&&this.removeEventListener("loadend",c),u}});return()=>{r(),o()}},Aa=new WeakMap,Gf={maxStringLength:2048,truncationSuffix:"..."};function Oa(e){if(e)return e===!0?{intent:!0,model:!0}:{intent:e.intent!==!1,model:e.model!==!1}}function ht(e,t){return{}.hasOwnProperty.call(e,t)}function $n(e,t){let i=Object.create(e);return t&&Object.defineProperty(i,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:t}),i}function Ra(e,t,i=!1){if(!V(e))return;let s=e.trim();return s?(i?Eh(s,Gf):s).slice(0,t):void 0}function La(e){try{return j(e)&&e.isError===!0}catch{return!1}}var Cs={featureFlags:class extends Of{constructor(e){let t=new Rf(e.config,e.il());super(t),this.name="featureFlags",this._instance=e,this.gv=t}get Ad(){return this._instance.persistence}updateConfig(e,t){this.gv.update(e,t),this.Fd()}}},qf={sessionRecording:class{get Mr(){return this._instance.config}get Il(){return this._instance.persistence}get started(){var e;return!!(!((e=this.mv)===null||e===void 0)&&e.isStarted)}get status(){var e,t;return this.yv==="awaiting_config"||this.yv==="missing_config"?this.yv:(e=(t=this.mv)===null||t===void 0?void 0:t.status)!==null&&e!==void 0?e:this.yv}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.yv=wn,this.bv=void 0,this._v=!1,this.Je=(()=>{var t,i;if(!(E!=null&&E.visibilityState)||E.visibilityState==="visible")return!0;let s=b==null||(t=b.performance)===null||t===void 0||(i=t.getEntriesByType)===null||i===void 0?void 0:i.call(t,"visibility-state");return!(s!=null&&s.length)||s.some(n=>n.name==="visible")})(),this.sn=()=>{var t,i;(E==null?void 0:E.visibilityState)==="visible"&&(this.Je=!0,(t=this.mv)===null||t===void 0||(i=t.setDocumentWasEverVisible)===null||i===void 0||i.call(t,!0))},!this._instance.sessionManager)throw Ke.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Mr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');E!=null&&E.addEventListener&&G(E,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this._v=!0,E==null||(t=E.removeEventListener)===null||t===void 0||t.call(E,"visibilitychange",this.sn),e?this.wv(!0):this.stopRecording()}get Sv(){var e;let t=!!(!((e=this._instance.get_property("$session_recording_remote_config"))===null||e===void 0)&&e.enabled),i=!this.Mr.disable_session_recording,s=this.Mr.disable_session_recording||this._instance.consent.isOptedOut();return b&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(this._v||this.Sv&&(!((t=this.mv)===null||t===void 0)&&t.isStarted))return;let i=!x(Object.assign)&&!x(Array.from);this.Sv&&i?(this.xv(e),Ke.info("starting")):(this.yv=wn,this.stopRecording())}xv(e){var t,i;if(this.Sv)if(this.yv!=="awaiting_config"&&this.yv!=="missing_config"&&(this.yv=_a),(F==null||(t=F.__PosthogExtensions__)===null||t===void 0||(t=t.rrweb)===null||t===void 0?void 0:t.record)&&((i=F.__PosthogExtensions__)===null||i===void 0?void 0:i.initSessionRecording))this.$v(e);else{var s,n;let r=this._instance.sessionManager;(s=F.__PosthogExtensions__)===null||s===void 0||(n=s.loadExternalDependency)===null||n===void 0||n.call(s,this._instance,this.Cv,o=>{if(!this._v&&this.Sv&&this._instance.sessionManager===r)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),Ke.error("could not load recorder",o)):void this.$v(e);this.yv="disabled"})}}stopRecording(){var e,t;(e=this.bv)===null||e===void 0||e.call(this),this.bv=void 0,(t=this.mv)===null||t===void 0||t.stop()}wv(e=!1){var t,i;(t=this.bv)===null||t===void 0||t.call(this),this.bv=void 0,(i=this.mv)===null||i===void 0||i.discard({discardProducerEvents:e})}Tv(){var e,t;(e=this.Il)===null||e===void 0||e.unregister("$session_is_sampled"),(t=this.Il)===null||t===void 0||t.unregister("$replay_sample_rate")}Iv(e,t){if(L(e))return null;let i=oe(e)?e:parseFloat(e);return typeof(s=i)!="number"||!Number.isFinite(s)||0>s||s>1?(Ke.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):i;var s}Mv(e){if(this.Il){var t,i;let s=this.Il,n=()=>{var r;let o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.Iv((r=this.Mr.session_recording)===null||r===void 0?void 0:r.sampleRate,"session_recording.sampleRate"),l=this.Iv(o==null?void 0:o.sampleRate,"remote config sampleRate"),c=a!=null?a:l;L(c)&&this.Tv();let u=o==null?void 0:o.minimumDurationMilliseconds;s.register({[Si]:f(f({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:f({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:c,minimumDurationMilliseconds:x(u)?null:u,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};n(),(t=this.bv)===null||t===void 0||t.call(this),this.bv=(i=this._instance.sessionManager)===null||i===void 0?void 0:i.onSessionId(n)}}onRemoteConfig(e){let t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?t.sessionRecording===!1?(this.Mv(t),void this.wv()):(this.Mv(t),void this.startIfEnabledOrStop()):(this.yv==="awaiting_config"&&(this.yv="missing_config",this._instance.register_for_session({[gr]:!0}),Ke.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var i;!((i=this.mv)===null||i===void 0)&&i.log?this.mv.log(e,t):Ke.warn("log called before recorder was ready")}get Cv(){var e,t;let i=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.get_property(Si);return(i==null||(t=i.scriptConfig)===null||t===void 0?void 0:t.script)||"lazy-recorder"}Ev(){let e=this._instance.get_property(Si);if(!e)return!1;let t;try{t=typeof e=="object"?e:JSON.parse(e)}catch(i){return Ke.warn("persisted remote config for session recording is invalid and will be ignored",i),!1}return!L(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}$v(e){var t,i,s;if(!this._v&&this.Sv&&this._instance.sessionManager){if(!(!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.initSessionRecording))return Ke.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[vr]:!0});var n;if(this.mv||(this.mv=(n=F.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording(this._instance,this.Je),this.mv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ev())return this.yv==="missing_config"||this.yv==="awaiting_config"?void 0:(this.yv="awaiting_config",Ke.info("persisted remote config is stale, requesting fresh config before starting"),void new Oc(this._instance).load());this.yv=_a,(i=(s=this.mv).setDocumentWasEverVisible)===null||i===void 0||i.call(s,this.Je),this.mv.start(e)}else this.yv=wn}onRRwebEmit(e){var t,i;(t=this.mv)===null||t===void 0||(i=t.onRRwebEmit)===null||i===void 0||i.call(t,e)}overrideLinkedFlag(){var e,t;this.mv||(t=this.Il)===null||t===void 0||t.register({$replay_override_linked_flag:!0}),(e=this.mv)===null||e===void 0||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.mv||(t=this.Il)===null||t===void 0||t.register({$replay_override_sampling:!0}),(e=this.mv)===null||e===void 0||e.overrideSampling()}overrideTrigger(e){var t,i;this.mv||(i=this.Il)===null||i===void 0||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.mv)===null||t===void 0||t.overrideTrigger(e)}get sdkDebugProperties(){var e;let t={};for(let s of kf){var i;let n=(i=this._instance.sessionPersistence)===null||i===void 0?void 0:i.get_property(s);x(n)||(t[s]=n)}return f(f({},t),((e=this.mv)===null||e===void 0?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(e,t){var i;return!!(!((i=this.mv)===null||i===void 0)&&i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;(e=this.mv)===null||e===void 0||(t=e.flushBeforeIdentityReset)===null||t===void 0||t.call(e)}}},Zf={autocapture:class extends mf{constructor(e){super(new yf(e)),this.instance=e}},historyAutocapture:class{constructor(e){this.Pv=!1,this._instance=e,this.Rv=this.Av()}initialize(){this.startIfEnabled()}get isEnabled(){let e=this.Fv();return!!(e.path||e.search||this.Ov(e))}startIfEnabled(){this.isEnabled&&(T.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Rv=this.Av(),this.startIfEnabled()}stop(){this.Dv&&this.Dv(),this.Dv=void 0,this.Lv&&this.Lv(),this.Lv=void 0,T.info("History API monitoring stopped")}monitorHistoryChanges(){b&&b.history&&(this.Nv("pushState"),this.Nv("replaceState"),this.qv(),this.Ov()&&this.jv())}Nv(e){var t;if(!b||!((t=b.history[e])===null||t===void 0)&&t.__posthog_wrapped__)return;let i=this;ti(b.history,e,s=>function(n,r,o){var a;i.Bv(o)&&i.zv(),s.call(this,n,r,o),i.Hv(e,!i.Pv&&(b==null||(a=b.event)===null||a===void 0?void 0:a.type)!=="popstate")})}Av(){let e=b==null?void 0:b.location;if(e!=null&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Fv(){let e=this._instance.config.capture_pageview;return e==="history_change"?{path:!0}:j(e)?e:{}}Ov(e=this.Fv()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}Uv(e){let t=this.Fv(),i=this.Rv;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.Ov(t)&&e.hash!==i.hash))}Hv(e,t=!1){try{t||this.zv();let i=this.Av();if(!i)return;if(this.Uv(i)){let s=()=>this._instance.capture(mr,{navigation_type:e});t?(this.Wv=s,Promise.resolve().then(()=>this.zv())):s()}this.Rv=i}catch(i){T.error(`Error capturing ${e} pageview`,i)}}Bv(e){var t,i;return!(L(e)||!b)&&((t=nt(String(e)))===null||t===void 0?void 0:t.href)!==((i=b.location)===null||i===void 0?void 0:i.href)}zv(){let e=this.Wv;if(e){this.Wv=void 0,this.Pv=!0;try{e()}catch(t){T.error("Error capturing deferred pageview",t)}finally{this.Pv=!1}this.Rv=this.Av()}}qv(){if(this.Dv)return;let e=()=>{this.Hv("popstate")};G(b,"popstate",e),this.Dv=()=>{b&&b.removeEventListener("popstate",e)}}jv(){if(this.Lv)return;let e=()=>{this.Hv("hashchange")};G(b,"hashchange",e),this.Lv=()=>{b&&b.removeEventListener("hashchange",e)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(e){var t;this.Vv=!1,this.ko=!1,this.Gv=null,this.instance=e,this.Vv=!!(!((t=this.instance.persistence)===null||t===void 0)&&t.props[jn]),this.rageclicks=new su(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return j(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Mr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return L(this.Mr.capture_heatmaps)?L(this.Mr.enable_heatmaps)?this.Vv:this.Mr.enable_heatmaps:this.Mr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ko)return;Sf.info("starting..."),this.Qv(),this.sn()}else{var e;clearInterval((e=this.Gv)!==null&&e!==void 0?e:void 0),this.Zv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("heatmaps"in t))return;let i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[jn]:i}),this.Vv=i,this.startIfEnabled()}getAndClearBuffer(){let e=this.Rt;return this.Rt=void 0,e}Jv(e){xn(e.originalEvent)&&this.Ir(e.originalEvent,"deadclick")}sn(){this.Gv&&clearInterval(this.Gv),this.Gv=(E==null?void 0:E.visibilityState)==="visible"?setInterval(this.fl.bind(this),this.flushIntervalMilliseconds):null}Qv(){b&&E&&(this.Kv=this.fl.bind(this),G(b,ys,this.Kv),this.Xv=e=>this.Ir(e||(b==null?void 0:b.event)),G(E,"click",this.Xv,{capture:!0}),this.Yv=e=>this.tf(e||(b==null?void 0:b.event)),G(E,"mousemove",this.Yv,{capture:!0}),this.ef=new zo(this.instance,xp,this.Jv.bind(this)),this.ef.startIfEnabledOrStop(),this.if=this.sn.bind(this),G(E,Oi,this.if),this.ko=!0)}Zv(){var e;b&&E&&(this.Kv&&b.removeEventListener(ys,this.Kv),this.Xv&&E.removeEventListener("click",this.Xv,{capture:!0}),this.Yv&&E.removeEventListener("mousemove",this.Yv,{capture:!0}),this.if&&E.removeEventListener(Oi,this.if),clearTimeout(this.nf),(e=this.ef)===null||e===void 0||e.stop(),this.ko=!1)}sf(e,t){let i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),r=(function(o,a,l){let c=o;for(;c&&Be(c)&&!_e(c,"body");){if(c===l)return!1;let p;try{var u,d,h;p=(u=(d=(h=c.ownerDocument)===null||h===void 0?void 0:h.defaultView)!==null&&d!==void 0?d:b)===null||u===void 0?void 0:u.getComputedStyle(c).position}catch{return!1}if(A(a,p))return!0;c=vc(c)}return!1})($i(e),["fixed","sticky"],n);return{x:e.clientX+(r?0:s),y:e.clientY+(r?0:i),target_fixed:r,type:t}}Ir(e,t="click"){var i;if(Oo(e.target)||!xn(e))return;let s=this.sf(e,t);!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&_c($i(e),this.instance.config.rageclick)&&this.Qs(f(f({},s),{},{type:"rageclick"})),this.Qs(s)}tf(e){!Oo(e.target)&&xn(e)&&(clearTimeout(this.nf),this.nf=setTimeout(()=>{this.Qs(this.sf(e,"mousemove"))},500))}Qs(e){if(!b)return;let t=this.Mr.disable_capture_url_hashes?yt(b.location.href):b.location.href,i=this.Mr.custom_personal_data_properties,s=this.Mr.mask_personal_data_properties?[...Qt,...i||[]]:[],n=Li(t,s,Di);this.Rt=this.Rt||{},this.Rt[n]||(this.Rt[n]=[]),this.Rt[n].push(e)}fl(){this.Rt&&!Me(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:zo,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.Vv=!1,this.ko=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rf=()=>{clearTimeout(this.af),this.af=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",f({$current_url:this.Rt.url},this.Rt.metrics.reduce((i,s)=>f(f({},i),{},{[`$web_vitals_${s.name}_event`]:f({},s),[`$web_vitals_${s.name}_value`]:s.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.lf=i=>{var s;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},L(i==null?void 0:i.name)||L(i==null?void 0:i.value))return void St.error("Invalid metric received",i);let n=typeof i.navigationURL=="string"?i.navigationURL:void 0,r=this.uf(n);if(x(r))return;let o=oe(i.navigationId)||typeof i.navigationId=="string"?`navigation:${i.navigationId}`:`url:${r}`;if(this.cf&&i.value>=this.cf)return void St.error("Ignoring metric with value >= "+this.cf,i);this.Rt.navigationKey!==o&&(this.rf(),this.af=setTimeout(this.rf,this.flushToCaptureTimeoutMs)),x(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=r),this.Rt.firstMetricTimestamp=x(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;let a=(s=this._instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0),l=f(f(f({},i),n?{navigationURL:r}:{}),{},{$current_url:r,timestamp:Date.now()});if(delete l.entries,j(i.attribution)&&this.attributionMetrics.indexOf(i.name)>-1){let c={};for(let u of xf){let d=u==="url"&&typeof i.attribution[u]=="string"?this.uf(i.attribution[u]):i.attribution[u];x(d)||(c[u]=d)}l.attribution=c}else delete l.attribution;x(a)||(l.$session_id=a.sessionId,l.$window_id=a.windowId),this.Rt.metrics.push(l),this.Rt.metrics.length===this.allowedMetrics.length&&this.rf()},this.hf=()=>{if(this.ko)return;let i,s,n,r,o=!1,a=F.__PosthogExtensions__,l=a==null?void 0:a.postHogWebVitalsCallbacksByFlavor,c=(l==null?void 0:l[this.df])||(this.df==="web-vitals"&&x(l)?a==null?void 0:a.postHogWebVitalsCallbacks:void 0);if(!x(c)){let h=c.withoutAttribution,p=this.attributionMetrics;o=!x(h),i=p.indexOf("LCP")>-1?c.onLCP:(h==null?void 0:h.onLCP)||c.onLCP,s=p.indexOf("CLS")>-1?c.onCLS:(h==null?void 0:h.onCLS)||c.onCLS,n=p.indexOf("FCP")>-1?c.onFCP:(h==null?void 0:h.onFCP)||c.onFCP,r=p.indexOf("INP")>-1?c.onINP:(h==null?void 0:h.onINP)||c.onINP}if(!(i&&s&&n&&r))return void St.error("web vitals callbacks not loaded - not starting");let u={reportSoftNavs:this.useSoftNavs},d=o&&this.attributionMetrics.indexOf("INP")>-1?f(f({},u),{},{includeProcessedEventEntries:!1}):u;this.allowedMetrics.indexOf("LCP")>-1&&i(this.lf.bind(this),u),this.allowedMetrics.indexOf("CLS")>-1&&s(this.lf.bind(this),u),this.allowedMetrics.indexOf("FCP")>-1&&n(this.lf.bind(this),u),this.allowedMetrics.indexOf("INP")>-1&&r(this.lf.bind(this),d),this.ko=!0},this.Vv=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[Bn]),this.startIfEnabled()}get vf(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;let i=j(this.vf)?(e=this.vf)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return L(i)?((t=this._instance.persistence)===null||t===void 0?void 0:t.props.$web_vitals_allowed_metrics)||ga:i}get flushToCaptureTimeoutMs(){return(j(this.vf)?this.vf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){let e=j(this.vf)?this.vf.web_vitals_attribution:void 0;return Se(e)?e?ga:[]:O(e)?e:wf}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){let e=j(this.vf)?this.vf.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get cf(){let e=j(this.vf)&&oe(this.vf.__web_vitals_max_value)?this.vf.__web_vitals_max_value:va;return e>0&&6e4>=e?va:e}get isEnabled(){let e=K==null?void 0:K.protocol;if(e!=="http:"&&e!=="https:")return St.info("Web Vitals are disabled on non-http/https protocols"),!1;let t=j(this.vf)?this.vf.web_vitals:Se(this.vf)?this.vf:void 0;return Se(t)?t:this.Vv}startIfEnabled(){this.isEnabled&&!this.ko&&(St.info("enabled, starting..."),this.zo(this.hf))}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("capturePerformance"in t))return;let i=j(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=j(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Bn]:i}),this._instance.persistence.register({[Wl]:s})),this.Vv=i,this.startIfEnabled()}get df(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}zo(e){var t;let i=F.__PosthogExtensions__,s=this.df,n=i==null?void 0:i.postHogWebVitalsCallbacksByFlavor;n!=null&&n[s]||s==="web-vitals"&&x(n)&&(i!=null&&i.postHogWebVitalsCallbacks)?e():i==null||(t=i.loadExternalDependency)===null||t===void 0||t.call(i,this._instance,s,r=>{r?St.error("failed to load script",r):e()})}uf(e){let t=e||(b==null?void 0:b.location.href);if(!t)return void St.error("Could not determine current URL");let i=this._instance.config.disable_capture_url_hashes?yt(t):t,s=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Qt,...s||[]]:[];return Li(i,n,Di)}}},Yf={exceptionObserver:class{constructor(e){var t;this.hf=()=>{var i;if(!b||!this.isEnabled||!(!((i=F.__PosthogExtensions__)===null||i===void 0)&&i.errorWrappingFunctions))return;let s=F.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=F.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=F.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ff&&this.Mr.capture_unhandled_errors&&(this.ff=s(this.captureException.bind(this))),!this.pf&&this.Mr.capture_unhandled_rejections&&(this.pf=n(this.captureException.bind(this))),!this.gf&&this.Mr.capture_console_errors&&(this.gf=r(this.captureException.bind(this)))}catch(o){gi.error("failed to start",o),this.mf()}},this._instance=e,this.yf=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[Vn]),this.wt=new fd(f(f({},(function(i={}){var s,n,r,o;return{refillRate:(s=(n=i.exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:i.__exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:1,bucketSize:(r=(o=i.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:i.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:gi})),this.Mr=this.bf(),this.startIfEnabledOrStop()}bf(){let e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return j(e)?t=f(f({},t),e):(x(e)?this.yf:e)&&(t=f(f({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(gi.info("enabled"),this.mf(),this.zo(this.hf)):this.mf()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.errorWrappingFunctions?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"exception-autocapture",n=>{if(n)return gi.error("failed to load script",n);e()})}mf(){var e,t,i;(e=this.ff)===null||e===void 0||e.call(this),this.ff=void 0,(t=this.pf)===null||t===void 0||t.call(this),this.pf=void 0,(i=this.gf)===null||i===void 0||i.call(this),this.gf=void 0}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"autocaptureExceptions"in t&&(this.yf=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Vn]:this.yf}),this.Mr=this.bf(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.bf()}captureException(e){try{var t,i,s;let n=(t=e==null||(i=e.$exception_list)===null||i===void 0||(i=i[0])===null||i===void 0?void 0:i.type)!==null&&t!==void 0?t:"Exception";if(this.wt.consumeRateLimit(n))return void gi.info("Skipping exception capture because of client rate limiting.",{exception:n});(s=this._instance.exceptions)===null||s===void 0||s.sendExceptionEvent(e)}catch{}}},exceptions:class{constructor(e){var t,i;this._f=[],this.wf=new $d([new Hd,new Xd,new Wd,new Bd,new Zd,new qd,new zd,new Yd],(function(s,...n){return(r,o=0)=>{let a=[],l=r.split(`
3
+ `),c=Math.min(l.length,o+1e3),u=[];for(let p=o;c>p;p++){let v=l[p];if(v.length>1024)continue;let _=fo.test(v)?v.replace(fo,"$1"):v;if(!_.match(/\S*Error: /)){for(let g of n){let y=g(_,s);if(y){a.push(y);let m=Dd(a);if(m){for(let w=u.length-1;w>=0;w--){let M=u[w];if(m.start>=M.start+M.length)break;u.pop()}u.push(m)}break}}if(jd(a,u)>=50)break}}let d=[...u].sort((p,v)=>v.start-p.start),h=d[d.length-1];if(h){let p=wl(a,h);a.splice(h.start-p,p);for(let v of d)v.start-=p}for(let p of d)Nd(a,p);return u.some(p=>p.start===0&&a.length===p.length)&&(function(p){let v=p.map(g=>`${g.function}|${g.filename}|${g.lineno}|${g.colno}|${g.module}`),_=0;for(let g=1;v.length>g;g++)Vd(v,g,_)&&(_=g);p.push(...p.splice(0,_))})(a),(function(p){if(!p.length)return[];let v=Array.from(p);return v.reverse(),v.slice(0,50).map(_=>{return f(f({},_),{},{filename:_.filename||(g=v,g[g.length-1]||{}).filename,function:_.function||"?"});var g})})(a)}})("web:javascript",Ad,Ld)),this._instance=e,this._f=(t=(i=this._instance.persistence)===null||i===void 0?void 0:i.get_property("$error_tracking_suppression_rules"))!==null&&t!==void 0?t:[],this.kf=fs(this.Sf()),this.xf=new Kd(this.kf)}onConfigChange(){this.kf=fs(this.Sf()),this.xf.setConfig(this.kf)}onRemoteConfig(e){var t,i,s;if(!e.ok)return;let n=e.config;if(!("errorTracking"in n))return;let r=(t=(i=n.errorTracking)===null||i===void 0?void 0:i.suppressionRules)!==null&&t!==void 0?t:[],o=(s=n.errorTracking)===null||s===void 0?void 0:s.captureExtensionExceptions;this._f=r,this._instance.persistence&&this._instance.persistence.register({[Hl]:this._f,[Hn]:o})}get $f(){var e;let t=!!this._instance.get_property(Hn),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i!=null?i:t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.wf.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}addExceptionStep(e,t){if(this.kf.enabled)try{if(!V(e)||e.trim().length===0)return void Ne.warn("Ignoring exception step because message must be a non-empty string");let{sanitizedProperties:i,droppedKeys:s}=(function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};let r=[];return{sanitizedProperties:Object.keys(n).reduce((o,a)=>Jd.has(a)?(r.push(a),o):(o[a]=n[a],o),{}),droppedKeys:r}})(this.Cf(t));s.length>0&&Ne.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.xf.add(f({[hs]:e,[ps]:new Date().toISOString()},i))}catch(i){Ne.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(e){try{let t=e.$exception_list;if(this.Tf(t)){if(this.If(t))return this.Mf("Exception dropped: matched a suppression rule"),void Ne.info("Skipping exception capture because a suppression rule matched");if(!this.$f&&this.Ef(t))return this.Mf("Exception dropped: thrown by a browser extension"),void Ne.info("Skipping exception capture because it was thrown by an extension");if(!this.$f&&this.Pf(t))return this.Mf("Exception dropped: thrown by an injected browser script"),void Ne.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Rf(t))return this.Mf("Exception dropped: thrown by the PostHog SDK"),void Ne.info("Skipping exception capture because it was thrown by the PostHog SDK")}let i=this.kf.enabled&&L(e.$exception_steps)?this.Af(e):e,s=(function(){let n=globalThis._posthogReleaseId;return typeof n=="string"&&n.length>0?n:void 0})();s&&(i.$release_id=s);try{let n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",fc:!0});return n&&this.xf.clear(),n}catch(n){return Ma(n)||Ne.error("Failed to capture exception event. Dropping this exception.",n),void this.xf.clear()}}catch(t){return void(Ma(t)||Ne.error("Failed to process exception event. Ignoring this exception.",t))}}Af(e){try{let t=this.xf.getAttachable();return t.length===0?e:f(f({},e),{},{$exception_steps:t})}catch(t){return Ne.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Mf(e){this.kf.enabled&&this.xf.add({[hs]:e,[ps]:new Date().toISOString()})}Cf(e){return j(e)?f({},e):{}}Sf(){var e,t;return(e=(t=this._instance.config.error_tracking)===null||t===void 0?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}If(e){if(e.length===0)return!1;try{let t=e.reduce((i,{type:s,value:n})=>(V(s)&&s.length>0&&i.$exception_types.push(s),V(n)&&n.length>0&&i.$exception_values.push(n),i),{$exception_types:[],$exception_values:[]});return this._f.some(i=>{let s=i.values.map(n=>{let r=Qc[n.operator],o=t[n.key];if(!r||!o)return!1;let a=O(n.value)?n.value:[n.value];return a.length>0&&r(a,o)});return i.type==="OR"?s.some(Boolean):s.every(Boolean)})}catch(t){return Ne.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Ef(e){let t=e.flatMap(s=>{var n,r;return(n=(r=s.stacktrace)===null||r===void 0?void 0:r.frames)!==null&&n!==void 0?n:[]}),i=t.filter(({filename:s})=>!!s&&Df.some(n=>s.startsWith(n)));return i.length!==0&&(!i.every(({filename:s})=>!!s&&s.startsWith(ir))||e.some(({type:s,value:n})=>s==="NoResponse"||V(n)&&Lf.some(({value:r,exact:o})=>o?n===r:n.includes(r)))&&!t.some(({in_app:s,filename:n})=>s&&!(n!=null&&n.startsWith(ir))))}Pf(e){return e.some(({value:t})=>V(t)&&Nf.some(i=>t.includes(i)))}Rf(e){if(e.length>0){var t,i,s,n;let r=(t=(i=e[0].stacktrace)===null||i===void 0?void 0:i.frames)!==null&&t!==void 0?t:[],o=r[r.length-1];return(s=o==null||(n=o.filename)===null||n===void 0?void 0:n.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Tf(e){return!L(e)&&O(e)}}},Xf=f({productTours:class{get Il(){return this._instance.persistence}constructor(e){this.Ff=null,this.Of=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if("productTours"in t){var i,s;if(this.Il&&this.Il.register({[pr]:!!t.productTours}),!kn(this._instance))return!this.Ff&&L((i=this.Il)===null||i===void 0?void 0:i.props.ph_product_tours)||Qi.info("product tours disabled; stopping and clearing cached tours"),(s=this.Ff)===null||s===void 0||s.stop(),this.Ff=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Ff&&kn(this._instance)&&this.zo(()=>this.Df())}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"product-tours",n=>{n?Qi.error("Could not load product tours script",n):e()})}Df(){var e;!this.Ff&&(!((e=F.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours)&&(this.Ff=F.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(O(this.Of)&&!t)return void e(this.Of,{isLoaded:!0});let i=this.Il;if(i){let s=i.props[Wn];if(O(s)&&!t)return this.Of=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:s=>{if(!kn(this._instance))return void e([],{isLoaded:!0});let n=s.statusCode;if(n!==200||!s.json){let o=`Product Tours API could not be loaded, status: ${n}`;return n===0?s.error||Qi.warn(o):Qi.error(o),void e([],{isLoaded:!1,error:o})}let r=O(s.json.product_tours)?s.json.product_tours:[];this.Of=r,i&&i.register({[Wn]:r}),e(r,{isLoaded:!0})}})}getActiveProductTours(e){L(this.Ff)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ff.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ff)===null||t===void 0||t.showTourById(e)}previewTour(e){this.Ff?this.Ff.previewTour(e):this.zo(()=>{var t;this.Df(),(t=this.Ff)===null||t===void 0||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Ff)===null||e===void 0||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ff)===null||e===void 0||e.nextStep()}previousStep(){var e;(e=this.Ff)===null||e===void 0||e.previousStep()}clearCache(){var e;this.Of=null,(e=this.Il)===null||e===void 0||e.unregister("ph_product_tours")}resetTour(e){var t;(t=this.Ff)===null||t===void 0||t.resetTour(e)}resetAllTours(){var e;(e=this.Ff)===null||e===void 0||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ff)===null||t===void 0||t.cancelPendingTour(e)}}},Cs),Jf={siteApps:class{constructor(e){this._instance=e,this.Lf=0,this.Nf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qf(e,t){if(!t)return;let i=this.globalsForEvent(t);this.Nf.push(i),this.Nf.length>1e3&&(this.Nf=this.Nf.slice(10))}get siteAppLoaders(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.siteApps}initialize(){if(this.isEnabled){let e=this._instance._addCaptureHook(this.qf.bind(this));this.jf=()=>{e(),this.Nf=[],this.jf=void 0}}}globalsForEvent(e){var t,i,s,n,r,o,a;if(!e)throw new Error("Event payload is required");let l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(let[p,v]of Object.entries(u))l[p]={id:c[p],type:p,properties:v};let{$set_once:d,$set:h}=e;return{event:f(f({},El(e,Ef)),{},{properties:f(f(f({},e.properties),h?{$set:f(f({},(t=(i=e.properties)===null||i===void 0?void 0:i.$set)!==null&&t!==void 0?t:{}),h)}:{}),d?{$set_once:f(f({},(s=(n=e.properties)===null||n===void 0?void 0:n.$set_once)!==null&&s!==void 0?s:{}),d)}:{}),elements_chain:(r=(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&r!==void 0?r:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Bf(e){var t;let i=(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase();return i==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(qe.error("prepare_external_dependency_stylesheet returned null"),null):i==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(qe.error("prepare_external_dependency_script returned null"),null):e}zf(){var e,t,i,s,n,r,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};let l=E==null?void 0:E.defaultView,c=l==null||(e=l.Node)===null||e===void 0?void 0:e.prototype;if(!l||!c)return()=>{};if(this.Lf++,this.Hf)return this.Uf();let u=[],d=this,h=new WeakSet,p=(g,y,m)=>{if(!(g!=null&&g[y]))return;let w=g[y];g[y]=m(w),u.push(()=>{g[y]=w})},v=g=>{if(h.has(g))return g;let y=d.Bf(g);return y&&h.add(y),y},_=g=>g.map(y=>typeof y=="string"?y:v(y)).filter(y=>!ne(y));return p(c,"appendChild",g=>function(y){let m=v(y);return m?g.call(this,m):y}),p(c,"insertBefore",g=>function(y,m){let w=v(y);return w?g.call(this,w,m):y}),p(c,"replaceChild",g=>function(y,m){let w=v(y);return w?g.call(this,w,m):m}),[(t=l.Element)===null||t===void 0?void 0:t.prototype,(i=l.Document)===null||i===void 0?void 0:i.prototype,(s=l.DocumentFragment)===null||s===void 0?void 0:s.prototype].forEach(g=>{p(g,"append",y=>function(...m){return y.apply(this,_(m))}),p(g,"prepend",y=>function(...m){return y.apply(this,_(m))})}),[(n=l.Element)===null||n===void 0?void 0:n.prototype,(r=l.CharacterData)===null||r===void 0?void 0:r.prototype,(o=l.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(g=>{p(g,"before",y=>function(...m){return y.apply(this,_(m))}),p(g,"after",y=>function(...m){return y.apply(this,_(m))}),p(g,"replaceWith",y=>function(...m){let w=_(m);return m.length&&!w.length?void 0:y.apply(this,w)})}),p((a=l.Element)===null||a===void 0?void 0:a.prototype,"insertAdjacentElement",g=>function(y,m){let w=v(m);return w?g.call(this,y,w):null}),this.Hf=()=>{u.forEach(g=>g()),this.Hf=void 0},this.Uf()}Uf(){let e=!1;return()=>{var t;e||(e=!0,this.Lf--,this.Lf===0&&((t=this.Hf)===null||t===void 0||t.call(this)))}}Wf(e,t=!0){let i=this.zf();try{let s=e(i);return t&&i(),s}catch(s){throw i(),s}}setupSiteApp(e){let t=this.apps[e.id],i=()=>{var r;!t.errored&&this.Nf.length&&(qe.info(`Processing ${this.Nf.length} events for site app with id ${e.id}`),this.Nf.forEach(o=>this.Wf(()=>{var a;return(a=t.processEvent)===null||a===void 0?void 0:a.call(t,o)})),t.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((r=this.jf)===null||r===void 0||r.call(this))},s=!1,n=r=>{t.errored=!r,t.loaded=!0,qe.info(`Site app with id ${e.id} ${r?"loaded":"errored"}`),s&&i()};try{let{processEvent:r}=this.Wf(o=>e.init({posthog:this._instance,callback(a){o(),n(a)}}),!1);r&&(t.processEvent=r),s=!0}catch(r){qe.error(ma+e.id,r),n(!1)}if(s&&t.loaded)try{i()}catch(r){qe.error(`Error while processing buffered events PostHog app with config id ${e.id}`,r),t.errored=!0}}Vf(){let e=this.siteAppLoaders||[];for(let t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(let t of e)this.setupSiteApp(t)}Gf(e){if(Object.keys(this.apps).length===0)return;let t=this.globalsForEvent(e);for(let i of Object.values(this.apps))try{this.Wf(()=>{var s;return(s=i.processEvent)===null||s===void 0?void 0:s.call(i,t)})}catch(s){qe.error(`Error while processing event ${e.event} for site app ${i.id}`,s)}}onRemoteConfig(e){var t,i,s;if(!((t=this.siteAppLoaders)===null||t===void 0)&&t.length)return this.isEnabled?(this.Vf(),void this._instance.on("eventCaptured",a=>this.Gf(a))):void qe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.jf)===null||i===void 0||i.call(this),!e.ok)return;let n=e.config;if(!((s=n.siteApps)===null||s===void 0)&&s.length)if(this.isEnabled)for(let{id:a,url:l}of n.siteApps){var r,o;F[`__$$ph_site_app_${a}`]=this._instance,(r=F.__PosthogExtensions__)===null||r===void 0||(o=r.loadSiteApp)===null||o===void 0||o.call(r,this._instance,l,c=>{if(c)return qe.error(ma+a,c)})}else qe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Kf={tracingHeaders:class{constructor(e){this._instance=e,this.Qf=void 0,this.Zf=void 0,this.Jf=void 0,this.hf=()=>{let t=this.Kf();var i,s;t?(x(this.Qf)&&(this.Qf=(i=F.__PosthogExtensions__)===null||i===void 0||(i=i.tracingHeadersPatchFns)===null||i===void 0?void 0:i._patchXHR(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),x(this.Zf)&&(this.Zf=(s=F.__PosthogExtensions__)===null||s===void 0||(s=s.tracingHeadersPatchFns)===null||s===void 0?void 0:s._patchFetch(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.mf()}}initialize(){this.startIfEnabledOrStop()}zo(e){var t,i,s;!((t=F.__PosthogExtensions__)===null||t===void 0)&&t.tracingHeadersPatchFns?e():(i=F.__PosthogExtensions__)===null||i===void 0||(s=i.loadExternalDependency)===null||s===void 0||s.call(i,this._instance,"tracing-headers",n=>{if(n)return bf.error("failed to load script",n);e()})}Xf(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}Kf(){let e=this.Xf();return O(e)?(O(this.Jf)?this.Jf.splice(0,this.Jf.length,...e):this.Jf=[...e],e.length>0?this.Jf:void 0):(O(this.Jf)&&this.Jf.splice(0),this.Jf=e||void 0,this.Jf)}mf(){var e,t;(e=this.Qf)===null||e===void 0||e.call(this),(t=this.Zf)===null||t===void 0||t.call(this),this.Qf=void 0,this.Zf=void 0}startIfEnabledOrStop(){this.Kf()?this.zo(this.hf):this.mf()}}},Qf=f({surveys:class extends $f{constructor(e){var t;super(new Cf(e),(t=e,{get projectToken(){return t.config.token},kv:new If(t)})),this._instance=e}Gc(e,t){let i=t.query?ji(e,t.query):e;return new Promise(s=>{var n;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor((n=t.target)!==null&&n!==void 0?n:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:s})})}}},Cs),ev={toolbar:class{constructor(e){this.instance=e}Yf(e){F.ph_toolbar_state=e}tp(){var e;return(e=F.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e=void 0,t=void 0,i=void 0){var s,n;if(zn(this.instance.config)||!b||!E)return!1;e=(s=e)!==null&&s!==void 0?s:b.location,i=(n=i)!==null&&n!==void 0?n:b.history;try{if(!t){try{b.localStorage.setItem("test","test"),b.localStorage.removeItem("test")}catch{return!1}t=b==null?void 0:b.localStorage}let r=Ff||ws(e.hash,"__posthog")||ws(e.hash,"state"),o,a=r?co(()=>JSON.parse(atob(decodeURIComponent(r))))||co(()=>JSON.parse(decodeURIComponent(r))):null;return a&&a.action==="ph_authorize"?(o=a,o.source="url",o&&Object.keys(o).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):(o=JSON.parse(t.getItem(ba)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}ep(e){let t=F.ph_load_toolbar||F.ph_load_editor;!L(t)&&le(t)?t(e,this.instance):wa.warn("No toolbar load function found")}loadToolbar(e){let t=!!(E!=null&&E.getElementById("__POSTHOG_TOOLBAR__"));if(!b||t)return!1;let i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=f(f({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(b.localStorage.setItem(ba,JSON.stringify(f(f({},s),{},{source:void 0}))),this.tp()===2)this.ep(s);else if(this.tp()===0){var n,r;this.Yf(1),(n=F.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"toolbar",o=>{if(o)return wa.error("[Toolbar] Failed to load",o),void this.Yf(0);this.Yf(2),this.ep(s)}),G(b,"turbolinks:load",()=>{this.Yf(0),this.loadToolbar(s)})}return!0}np(e){return this.loadToolbar(e)}maybeLoadEditor(e=void 0,t=void 0,i=void 0){return this.maybeLoadToolbar(e,t,i)}}},tv=f({experiments:class we{get Mr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(i=!1)=>{this.getWebExperiments(s=>{we.sp("retrieved web experiments from the server"),this.rp=new Map,s.forEach(n=>{if(n.feature_flag_key){var r;this.rp&&(we.sp("setting flag key ",n.feature_flag_key," to web experiment ",n),(r=this.rp)===null||r===void 0||r.set(n.feature_flag_key,n));let o=this._instance.getFeatureFlag(n.feature_flag_key);V(o)&&n.variants[o]&&this.op(n.name,o,n.variants[o].transforms)}else if(n.variants)for(let o in n.variants){let a=n.variants[o];we.ap(a,this._instance)&&this.op(n.name,o,a.transforms)}})},i)},this._instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}initialize(){}onFeatureFlags(t){if(this._is_bot())we.sp(Ta);else if(!this.Mr.disable_web_experiments){if(L(this.rp))return this.rp=new Map,this.loadIfEnabled(),void this.previewWebExperiment();we.sp("applying feature flags",t),t.forEach(i=>{var s;if(this.rp&&(!((s=this.rp)===null||s===void 0)&&s.has(i))){var n;let r=this._instance.getFeatureFlag(i),o=(n=this.rp)===null||n===void 0?void 0:n.get(i);r&&(o!=null&&o.variants[r])&&this.op(o.name,r,o.variants[r].transforms)}})}}previewWebExperiment(){let t=we.getWindowLocation();if(t!=null&&t.search){let i=Kt(t==null?void 0:t.search,"__experiment_id"),s=Kt(t==null?void 0:t.search,"__experiment_variant");i&&s&&(we.sp(`previewing web experiments ${i} && ${s}`),this.getWebExperiments(n=>{this.lp(parseInt(i),s,n)},!1,!0))}}loadIfEnabled(){this.Mr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,i,s){if(this.Mr.disable_web_experiments&&!s)return t([]);let n=this._instance.get_property("$web_experiments");if(n&&!i)return t(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Mr.token}`),method:"GET",timestampMode:"query",callback:r=>t(r.statusCode===200&&r.json&&r.json.experiments||[])})}lp(t,i,s){let n=s.filter(r=>r.id===t);n&&n.length>0&&(we.sp(`Previewing web experiment [${n[0].name}] with variant [${i}]`),this.op(n[0].name,i,n[0].variants[i].transforms))}static ap(t,i){return!L(t.conditions)&&we.up(t,i)&&we.cp(t)}static up(t,i){var s;if(L(t.conditions)||L((s=t.conditions)===null||s===void 0?void 0:s.url))return!0;let n=we.getWindowLocation();if(n){var r,o,a;let l=hc(i,n.href);return!(!((r=t.conditions)===null||r===void 0)&&r.url)||jf[(o=(a=t.conditions)===null||a===void 0?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l)}return!1}static getWindowLocation(){return b==null?void 0:b.location}static cp(t){var i;if(L(t.conditions)||L((i=t.conditions)===null||i===void 0?void 0:i.utm))return!0;let s=$c();if(s.utm_source){var n,r,o,a,l,c,u,d;let h=!(!((n=t.conditions)===null||n===void 0||(n=n.utm)===null||n===void 0)&&n.utm_campaign)||((r=t.conditions)===null||r===void 0||(r=r.utm)===null||r===void 0?void 0:r.utm_campaign)==s.utm_campaign,p=!(!((o=t.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((a=t.conditions)===null||a===void 0||(a=a.utm)===null||a===void 0?void 0:a.utm_source)==s.utm_source,v=!(!((l=t.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0)&&l.utm_medium)||((c=t.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0?void 0:c.utm_medium)==s.utm_medium,_=!(!((u=t.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_term)||((d=t.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_term)==s.utm_term;return h&&v&&_&&p}return!1}static sp(t,...i){T.info(`[WebExperiments] ${t}`,i)}op(t,i,s){this._is_bot()?we.sp(Ta):i!=="control"?s.forEach(n=>{if(n.selector){var r;we.sp(`applying transform of variant ${i} for experiment ${t} `,n);let o=(r=document)===null||r===void 0?void 0:r.querySelectorAll(n.selector);o==null||o.forEach(a=>{let l=a;n.html&&(l.innerHTML=n.html),n.css&&l.setAttribute("style",n.css)})}}):we.sp("Control variants leave the page unmodified.")}_is_bot(){return pe&&this._instance?Xc(pe,this.Mr.custom_blocked_useragents):void 0}}},Cs),iv={conversations:class{constructor(e){this._instance=e,this.hp=void 0,this._conversationsManager=null,this.dp=!1,this.ne=null,this.vp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations||(this.fp=e.ok,!e.ok))return;let t=e.config.conversations;L(t)||(Se(t)?this.hp=t:(this.hp=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;(e=this._conversationsManager)===null||e===void 0||e.reset(),this._conversationsManager=null,this.hp=void 0,this.ne=null,this.fp=void 0,this.vp=!1}loadIfEnabled(){if(this._conversationsManager||this.dp||this._instance.config.disable_conversations||zn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;let e=F==null?void 0:F.__PosthogExtensions__;if(e&&!x(this.hp)&&this.hp)if(this.ne&&this.ne.token){this.dp=!0;try{let t=e.initConversations;if(t)return this.pp(t),void(this.dp=!1);let i=e.loadExternalDependency;if(!i)return void this.gp(_r);i(this._instance,"conversations",s=>{s||!e.initConversations?this.gp("Could not load conversations script",s):this.pp(e.initConversations),this.dp=!1})}catch(t){this.gp("Error initializing conversations",t),this.dp=!1}}else Le.error("Conversations enabled but missing token in remote config.")}pp(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.vp=!1,Le.info("Conversations loaded successfully")}catch(t){this.gp("Error completing conversations initialization",t)}else Le.error("Cannot complete initialization: remote config is null")}gp(e,t){Le.error(e,t),this._conversationsManager=null,this.dp=!1,this.vp=!0}show(){this._conversationsManager?this._conversationsManager.show():Le.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.hp===!0&&!ne(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":zn(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.fp===!1?"remote_config_failed":x(this.hp)?this.fp?"disabled_in_project":"remote_config_pending":this.hp?L(this.ne)||!this.ne.token?"missing_token":F!=null&&F.__PosthogExtensions__?this.dp?"initializing":this.vp?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,i){var s=this;return ee(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(Le.warn($t),null)})()}getMessages(e,t){var i=this;return ee(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(Le.warn($t),null)})()}markAsRead(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Le.warn($t),null)})()}getTickets(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Le.warn($t),null)})()}requestRestoreLink(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Le.warn($t),null)})()}restoreFromToken(e){var t=this;return ee(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Le.warn($t),null)})()}restoreFromUrlToken(){var e=this;return ee(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Le.warn($t),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}xc(){var e;(e=this._conversationsManager)===null||e===void 0||e.setIdentity()}$c(){var e;(e=this._conversationsManager)===null||e===void 0||e.clearIdentity()}}},sv={logs:class{constructor(e){var t;this._instance=e,this.name="logs",this.mp=!1,this.yp=!1,this.bp=!1,this.A=re("[logs]"),this._p=f(f({},this.A),{},{error:(...i)=>{i.some(Fa)||this.A.error(...i)}}),this.ol=[],this.wp=[],this.kd=0,this.To=!1,this.kp=[],this.Sp=[],this.xp=!1,this.$p=!1,this.Cp=()=>{var i,s;this.To||(this.kd=0,(i=this.Tp)===null||i===void 0||i.onReconnect(),(s=this.Ip)===null||s===void 0||s.onReconnect())},this._instance&&(!((t=this._instance.config.logs)===null||t===void 0)&&t.captureConsoleLogs)&&(this.mp=!0),b&&G(b,"online",this.Cp)}Mp(e,t,i,s){var n;let r=Ia((n=this._instance)===null||n===void 0||(n=n.config)===null||n===void 0?void 0:n.logs,i);return[new Oh(this.Ep(e,t),r,this._p,()=>this.Pp(),o=>o(),void 0,s),r]}Rp(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var i;return this.Tp&&this.Ap===t||((i=this.Tp)===null||i===void 0||i.reset(),this.Ap=t,[this.Tp,this.Fp]=this.Mp(()=>this.ol,s=>{this.ol=s})),this.Tp}Op(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs;var i;return this.Ip&&this.Dp===t||((i=this.Ip)===null||i===void 0||i.reset(),this.Dp=t,[this.Ip,this.Lp]=this.Mp(()=>this.wp,s=>{this.wp=s},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Ca)),this.Ip}setup(e){var t;if(this.To)return;this.bo=e,!((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0||(t=t.logs)===null||t===void 0)&&t.captureConsoleLogs&&(this.mp=!0),(this.mp||this.Np()&&this.qp())&&this.jp();let i=!1,s=e.onRemoteConfig(n=>{var r;i=n.ok&&((r=n.config.logs)===null||r===void 0?void 0:r.captureConsoleLogs)===!0,this.onRemoteConfig(n)});this.To?s.dispose():(this.Eo=s,i||this.loadIfEnabled())}dispose(){var e,t,i,s;this.To||(this.To=!0,this.Bp(),(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.bo=void 0,this.bp=!1,b==null||b.removeEventListener("online",this.Cp),(t=this.zp)===null||t===void 0||t.call(this),this.zp=void 0,(i=this.Tp)===null||i===void 0||i.reset(),(s=this.Ip)===null||s===void 0||s.reset())}onRemoteConfig(e){var t,i;if(this.To)return;let s=e.ok?(t=e.config.logs)===null||t===void 0?void 0:t.captureConsoleLogs:void 0;L(s)?this.Hp():((i=this._instance)===null||i===void 0||(i=i.persistence)===null||i===void 0||i.register({$logs_capture_enabled_server_side:!!s}),s?(this.mp=!0,this.yp||this.jp(),this.loadIfEnabled()):this.Hp())}reset(){var e,t,i,s;this.Bp(),(e=this.Tp)===null||e===void 0||e.clearQueue(),this.ol=[],(t=this.Tp)===null||t===void 0||t.reset(),(i=this.Ip)===null||i===void 0||i.clearQueue(),this.wp=[],(s=this.Ip)===null||s===void 0||s.reset(),this.kd=0}captureLog(e){this.To||this.Rp().captureLog(e)}captureConsoleLog(e){this.To||this.Op().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.To||this.Op().captureLog(e,{context:t,occurredAtMs:i})}qp(){var e;return!!(!((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e[Bl])}Np(){var e,t,i;return!(!((e=this._instance)===null||e===void 0||(t=e.il)===null||t===void 0)&&t.call(e))||!!(!((i=F._POSTHOG_REMOTE_CONFIG)===null||i===void 0||(i=i[this._instance.config.token])===null||i===void 0)&&i.config)}Tc(){var e;this.Bp(),(e=this.Ip)===null||e===void 0||e.clearQueue(),this.wp=[]}Hp(){this.mp||this.Bp()}jp(){var e;if(this.xp||!(F!=null&&F.console))return;let t=Ia((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.logs).maxBufferSize,i=!0;this.Sp.push(()=>{i=!1});for(let s of Vf){let n;try{n=Hf(F.console[s])}catch{continue}n&&this.Sp.push(ti(F.console,s,r=>{let o=(...a)=>{try{i&&this.Up(s,a,t)}catch{}return r.apply(F.console,a)};return o.__rrweb_original__=n,o}))}this.xp=!0,this.Wp=setTimeout(()=>{this.Bp()},3e4)}Up(e,t,i){var s;if(this.xp&&!this.$p&&t.length!==0)if(!((s=this._instance)===null||s===void 0)&&s.is_capturing()){if(i>this.kp.length){this.$p=!0;try{this.kp.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Pp()})}finally{this.$p=!1}}}else this.Bp()}Bp(){if(this.kp=[],this.xp){this.xp=!1,this.Wp&&(clearTimeout(this.Wp),this.Wp=void 0);for(let e of this.Sp)e();this.Sp=[]}}Vp(){let e=this.kp;return this.Bp(),e}get logger(){return this.Gp||(this.Gp={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Gp}flushLogs(e){e?this.Qp(e):(this.Tp&&this.Tp.flush().catch(t=>this.Zp(t)),this.Ip&&this.Ip.flush().catch(t=>this.Zp(t)))}Zp(e){Fa(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.To||!this.mp||this.yp||this.bp)return;let e=F==null?void 0:F.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.Bp();let t=e.loadExternalDependency;if(!t)return this.A.error(_r),void this.Bp();this.bp=!0;try{t(this._instance,"logs",i=>{if(this.bp=!1,this.To||!this.mp)return;let s=e.logs;if(i||!(s!=null&&s.initializeLogs))this.A.error("Could not load logs script",i),this.Bp();else{var n;let a=this.Vp();var r,o;this.zp=s.initializeLogs((n=this.bo)!==null&&n!==void 0?n:this._instance),this.yp=!0,a.length>0&&((r=s.replayConsoleBuffer)===null||r===void 0||r.call(s,(o=this.bo)!==null&&o!==void 0?o:this._instance,a))}})}catch(i){throw this.bp=!1,i}}Ep(e,t){let i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:s=>s===Ye.LogsQueue?e():void 0,setPersistedProperty(s,n){var r;s===Ye.LogsQueue&&t((r=n)!==null&&r!==void 0?r:[])},js:s=>this.js(s),getLibraryId:()=>ue.LIB_NAME,getLibraryVersion:()=>ue.LIB_VERSION}}js(e){return new Promise(t=>{if(Sc(this.kd,3))return void t({kind:"fatal",error:En(void 0,"logs endpoint is unreachable, dropping batch")});let i=!1,s=r=>{i||(i=!0,clearTimeout(n),t(r))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:En(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Jp(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:r=>{let o=r.statusCode;if(this.Kp(o),o>=200&&300>o)s({kind:"ok"});else if(o===413)s({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)s({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var a;o===0?(r.error||this.A.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:En(r.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:(a=r.error)!==null&&a!==void 0?a:new Error(`logs request failed with status ${o}`)})}}})})}Kp(e){(e!==0||this._instance.__loaded)&&(this.kd=Ec(e,this.kd,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Qp(e){this.ol.length>0&&this.Xp(e,this.ol,this.Fp,ue.LIB_NAME,t=>{this.ol=t}),this.wp.length>0&&this.Xp(e,this.wp,this.Lp,Ca,t=>{this.wp=t})}Xp(e,t,i,s,n){if(t.length===0)return;let r=t.map(a=>a.record);n([]);let o=Rl(r,Ol(i,ue.LIB_NAME,ue.LIB_VERSION),s,ue.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Jp(),data:o,compression:"best-available",batchKey:"logs",transport:e})}Jp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Pp(){var e;let t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){let{sessionId:i,windowId:s,sessionStartTimestamp:n,lastActivityTimestamp:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i,t.windowId=s,L(n)||(t.sessionStartTimestamp=n),L(r)||(t.lastActivityTimestamp=r)}if(!(F==null||(e=F.location)===null||e===void 0)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?yt(F.location.href):F.location.href),this._instance.featureFlags){let i=this._instance.featureFlags.getFlags();i&&i.length>0&&(t.activeFeatureFlags=i)}return t}}},nv={metrics:class{constructor(e){this._instance=e,this.A=re("[metrics]"),this.To=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.To)return;let t=!!(!((e=this._instance.config.metrics)===null||e===void 0)&&e.network);t&&!this.Yp?this.Yp=(i=>{let s=!0,n=()=>s?(a=>{var l;let c=(l=a.config.metrics)===null||l===void 0?void 0:l.network;return c===!0?{}:c||void 0})(i):void 0,r=Uf(i,n),o=zf(i,n);return()=>{s=!1,r(),o()}})(this._instance):!t&&this.Yp&&(this.Yp(),this.Yp=void 0)}Rp(){var e;let t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.metrics;var i;return this.Tp&&this.Ap===t||((i=this.Tp)===null||i===void 0||i.reset(),this.Ap=t,this.Tp=new Rh(this.Ep(),(function(s){var n,r,o,a,l;let c=s==null?void 0:s.resourceAttributes;return{serviceName:(n=c==null?void 0:c["service.name"])!==null&&n!==void 0?n:s==null?void 0:s.serviceName,serviceVersion:(r=c==null?void 0:c["service.version"])!==null&&r!==void 0?r:s==null?void 0:s.serviceVersion,environment:(o=c==null?void 0:c["deployment.environment"])!==null&&o!==void 0?o:s==null?void 0:s.environment,resourceAttributes:c,beforeSend:s==null?void 0:s.beforeSend,flushIntervalMs:(a=s==null?void 0:s.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(l=s==null?void 0:s.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}})(t),this.A)),this.Tp}count(e,t=1,i){this.Rp().count(e,t,i)}gauge(e,t,i){this.Rp().gauge(e,t,i)}histogram(e,t,i){this.Rp().histogram(e,t,i)}flush(e){if(!this.Tp)return Promise.resolve();if(e){let t=this.Tp.drainWindow();return t&&this.Ys(t,e),Promise.resolve()}return this.Tp.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var e;(e=this.Tp)===null||e===void 0||e.reset()}dispose(){var e,t;this.To=!0,(e=this.Yp)===null||e===void 0||e.call(this),this.Yp=void 0,(t=this.Tp)===null||t===void 0||t.reset()}Ep(){let e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ys:i=>t.Ys(i),getLibraryId:()=>ue.LIB_NAME,getLibraryVersion:()=>ue.LIB_VERSION}}Ys(e,t){return new Promise(i=>{let s=!1,n=o=>{s||(s=!0,clearTimeout(r),i(o))},r=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(f(f({method:"POST",url:this.tg(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(o){let a=o.statusCode;if(a>=200&&300>a)n({kind:"ok"});else if(a===413)n({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)n({kind:"fatal",error:new Error(`metrics request failed with status ${a}`)});else{var l;n({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error(`metrics request failed with status ${a}`)})}}}))})}tg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},rv={webMCP:class{constructor(e){this._instance=e,this.eg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.eg)return;let e=E==null?void 0:E.modelContext;if(!e||!le(e.registerTool))return;let t=Aa.get(e);if(t)return t.instances.add(this._instance),void(this.eg=!0);let i={instances:new Set([this._instance])},s=e.registerTool,n=this;ti(e,"registerTool",r=>{let o=r;return function(a,...l){let c=a;try{c=n.ig(a,i)}catch{return o.call(this,a,...l)}return o.call(this,c,...l)}}),e.registerTool!==s&&(Aa.set(e,i),this.eg=!0)}ig(e,t){if(!e||!le(e.execute))return e;let i=e.execute,s=this,{tool:n,injected:r}=(function(o,a){let l={intent:!1,model:!1},c=o.inputSchema;if(c&&(ht(c,"$ref")||ht(c,"oneOf")||ht(c,"anyOf")||ht(c,"allOf")||c.additionalProperties===!0||j(c.additionalProperties)||c.type&&c.type!=="object"||c.properties&&!j(c.properties)||c.required&&!O(c.required))||!x(c)&&!j(c))return{tool:$n(o),injected:l};let u=(c==null?void 0:c.properties)||{};if(l.intent=a.intent&&!ht(u,"context"),l.model=a.model&&!ht(u,"llm_model"),!l.intent&&!l.model)return{tool:$n(o),injected:l};let d=f({},u),h=O(c==null?void 0:c.required)?[...c.required]:[];return l.intent&&(d.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},h.includes("context")||h.push("context")),l.model&&(d.llm_model={type:"string",description:'The exact model identifier you are running as, taken from your system prompt or environment. Pass "unknown" if you do not know it. Never guess.'},h.includes("llm_model")||h.push("llm_model")),{tool:$n(o,f(f({},c),{},{type:(c==null?void 0:c.type)||"object",properties:d,required:h})),injected:l}})(e,(function(o){let a={intent:!1,model:!1};for(let l of o.instances){let c=Oa(l.config.capture_webmcp);a.intent||(a.intent=(c==null?void 0:c.intent)===!0),a.model||(a.model=(c==null?void 0:c.model)===!0)}return a})(t));return Object.defineProperty(n,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){let a=new Date,l=(function(h,p){if(!j(h))return{};try{let v=p.intent?Ra(h.context,2048,!0):void 0,_=p.model?Ra(h.llm_model,256):void 0;return f(f({},v&&v!=="{}"?{intent:v}:{}),_&&_.toLowerCase()!=="unknown"?{model:_}:{})}catch{return{}}})(o[0],r),c=(function(h,p){let v=h[0];if(!j(v))return h;try{let _=p.intent&&ht(v,"context"),g=p.model&&ht(v,"llm_model");if(!_&&!g)return h;let y=f({},v);return _&&delete y.context,g&&delete y.llm_model,[y,...h.slice(1)]}catch{return h}})(o,r),u;try{u=i.apply(this===n?e:this,c)}catch(h){throw s.ng(t,n,a,!0,l),h}return(d=u)&&typeof d.then=="function"?Promise.resolve(u).then(h=>(s.ng(t,n,a,La(h),l),h),h=>{throw s.ng(t,n,a,!0,l),h}):(s.ng(t,n,a,La(u),l),u);var d}}),n}ng(e,t,i,s,n){let r=Date.now()-i.getTime();for(let o of e.instances){let a=Oa(o.config.capture_webmcp);if(a)try{o.capture("$mcp_tool_call",f(f({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:K==null?void 0:K.hostname,$mcp_duration_ms:r,$mcp_is_error:s},a.intent&&n.intent?{$mcp_intent:n.intent,$mcp_intent_source:"context_parameter"}:{}),a.model&&n.model?{$mcp_llm_model:n.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:i})}catch{continue}}}}};Ii.__defaultExtensionClasses=f({},f(f(f(f(f(f(f(f(f(f(f(f(f(f({},Cs),qf),Zf),Yf),Xf),Jf),Qf),Kf),ev),tv),iv),sv),nv),rv));var ov=(function(){ue.SDK_DIST_CHANNEL="npm";let e=Mi[yi]=new Ii;return(function(){function t(){t.done||(t.done=!0,Zc=!1,Z(Mi,function(i){i._dom_loaded()}))}E!=null&&E.addEventListener?E.readyState==="complete"?t():G(E,"DOMContentLoaded",t,{capture:!1}):b&&T.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),e})(),Ae=ov;var wu="5.3.0";function av(e,t){for(let i=0,s=e.length;i<s;++i)if(e[i]===t)return!0;return!1}function lv(e,t){return!av(e,t)}function Ar(e){return parseInt(e)}function We(e){return parseFloat(e)}function rt(e,t){return typeof e=="number"&&isNaN(e)?t:e}function ve(e){return e.reduce((t,i)=>t+(i?1:0),0)}function xu(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{let i=1/t;return Math.round(e*i)/i}}function cv(e){var t,i;let s=`Unexpected syntax '${e}'`,n=/^\s*([a-z-]*)(.*)$/i.exec(e),r=n[1]||void 0,o={},a=/([.:#][\w-]+|\[.+?\])/gi,l=(c,u)=>{o[c]=o[c]||[],o[c].push(u)};for(;;){let c=a.exec(n[2]);if(!c)break;let u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":{let d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(d)l(d[1],(i=(t=d[4])!==null&&t!==void 0?t:d[5])!==null&&i!==void 0?i:"");else throw new Error(s);break}default:throw new Error(s)}}return[r,o]}function uv(e){let t=new Uint8Array(e.length);for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(s>127)return new TextEncoder().encode(e);t[i]=s}return t}function dv(e){var t;return{name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
4
+ `),...e}}function hv(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function ku(){let e=window,t=navigator;return ve(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function pv(){let e=window,t=navigator;return ve(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!ku()}function oi(){let e=window,t=navigator;return ve(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Ue(){let e=window,t=navigator;return ve(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function Or(){let e=window,{HTMLElement:t,Document:i}=e;return ve(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),i&&"pointerLockElement"in i.prototype])>=4}function Hi(){let e=window;return hv(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Bi(){var e,t;let i=window;return ve(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in i,"mozInnerScreenX"in i,"CSSMozDocumentRule"in i,"CanvasCaptureMediaStream"in i])>=4}function fv(){let e=window,t=navigator,{CSS:i}=e;return ve(["userActivation"in t,i.supports("color","light-dark(#000, #fff)"),i.supports("height","1lh"),"globalPrivacyControl"in t])>=3}function Su(){let{CSS:e}=window;return ve([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function vv(){let e=window;return ve([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,`${e.Intl}`=="[object Intl]",`${e.Reflect}`=="[object Reflect]"])>=3}function gv(){let e=window,{URLPattern:t}=e;return ve(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function _v(){let e=window,t=document,{CSS:i,Promise:s,AudioContext:n}=e;return ve([s&&"try"in s,"caretPositionFromPoint"in t,n&&"onerror"in n.prototype,i.supports("ruby-align","space-around")])>=3}function mv(){let e=window;return ve(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Wi(){let e=window,t=navigator,{CSS:i,HTMLButtonElement:s}=e;return ve([!("getStorageUpdates"in t),s&&"popover"in s.prototype,"CSSCounterStyleRule"in e,i.supports("font-size-adjust: ex-height 0.5"),i.supports("text-transform: full-width")])>=4}function yv(){if(navigator.platform==="iPad")return!0;let e=screen,t=e.width/e.height;return ve(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function bv(){let e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function wv(){let e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ls(){var e,t;let i=oi(),s=Bi(),n=window,r=navigator;return i?ve([kv(),"HTMLInputElement"in n&&"capture"in HTMLInputElement.prototype,"NetworkInformation"in n&&"ontypechange"in((t=(e=n.NetworkInformation)===null||e===void 0?void 0:e.prototype)!==null&&t!==void 0?t:{}),!("sinkId"in new Audio)])>=2:s?ve(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function xv(){let e=navigator,t=window,i=Audio.prototype,{visualViewport:s}=t;return ve(["srLatency"in i,"srChannelCount"in i,"devicePosture"in e,s&&"segments"in s,"getTextInformation"in Image.prototype])>=3}function kv(){var e,t;try{return!!(!((t=(e=window.Intl)===null||e===void 0?void 0:e.supportedValuesOf)===null||t===void 0)&&t.call(e,"collation").includes("dict"))}catch{return!1}}var Sv="$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score";function Ev(e){let t=$v(e),i=Pv(t);return{score:t,comment:Sv.replace(/\$/g,`${i}`)}}function $v(e){if(Ls())return .4;if(Ue())return Or()&&!(Wi()&&Hi())?.5:.3;let t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Pv(e){return xu(.99+.01*e,1e-4)}function Rs(e,t){return new Promise(i=>setTimeout(i,e,t))}function Mv(){return new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Tv(e,t=1/0){let{requestIdleCallback:i}=window;return i?new Promise(s=>i.call(window,()=>s(),{timeout:t})):Rs(Math.min(e,t))}function Eu(e){return!!e&&typeof e.then=="function"}function lu(e,t){try{let i=e();Eu(i)?i.then(s=>t(!0,s),s=>t(!1,s)):t(!0,i)}catch(i){t(!1,i)}}async function cu(e,t,i=16){let s=Array(e.length),n=Date.now();for(let r=0;r<e.length;++r){s[r]=t(e[r],r);let o=Date.now();o>=n+i&&(n=o,await Mv())}return s}function Vi(e){return e.then(void 0,()=>{}),e}function Iv(e){return typeof e!="function"}function Cv(e,t){let i=Vi(new Promise(s=>{let n=Date.now();lu(e.bind(null,t),(...r)=>{let o=Date.now()-n;if(!r[0])return s(()=>({error:r[1],duration:o}));let a=r[1];if(Iv(a))return s(()=>({value:a,duration:o}));s(()=>new Promise(l=>{let c=Date.now();lu(a,(...u)=>{let d=o+Date.now()-c;if(!u[0])return l({error:u[1],duration:d});l({value:u[1],duration:d})})}))})}));return function(){return i.then(n=>n())}}function Fv(e,t,i,s){let n=Object.keys(e).filter(o=>lv(i,o)),r=Vi(cu(n,o=>Cv(e[o],t),s));return async function(){let a=await r,l=await cu(a,d=>Vi(d()),s),c=await Promise.all(l),u={};for(let d=0;d<n.length;++d)u[n[d]]=c[d];return u}}async function $u(e,t,i=50){var s,n,r;let o=document;for(;!o.body;)await Rs(i);let a=o.createElement("iframe");try{for(await new Promise((l,c)=>{let u=!1,d=()=>{u=!0,l()},h=_=>{u=!0,c(_)};a.onload=d,a.onerror=h;let{style:p}=a;p.setProperty("display","block","important"),p.position="absolute",p.top="0",p.left="0",p.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",o.body.appendChild(a);let v=()=>{var _,g;u||(((g=(_=a.contentWindow)===null||_===void 0?void 0:_.document)===null||g===void 0?void 0:g.readyState)==="complete"?d():setTimeout(v,10))};v()});!(!((n=(s=a.contentWindow)===null||s===void 0?void 0:s.document)===null||n===void 0)&&n.body);)await Rs(i);return await e(a,a.contentWindow)}finally{(r=a.parentNode)===null||r===void 0||r.removeChild(a)}}function Av(e){let[t,i]=cv(e),s=document.createElement(t!=null?t:"div");for(let n of Object.keys(i)){let r=i[n].join(" ");n==="style"?Ov(s.style,r):s.setAttribute(n,r)}return s}function Ov(e,t){for(let i of t.split(";")){let s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);if(s){let[,n,r,,o]=s;e.setProperty(n,r,o||"")}}}function Rv(){let e=window;for(;;){let t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(i){if(i instanceof Error&&i.name==="SecurityError")return!0;throw i}e=t}}function Lv(){let{ApplePaySession:e}=window;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(Dv())return-3;try{return e.canMakePayments()?1:0}catch(t){return Nv(t)}}var Dv=Rv;function Nv(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function jv(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Vv(){return Wv()?-4:Hv()}function Hv(){let e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Bv())return-1;let i=4500,s=5e3,n=new t(1,s,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;let o=n.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,r.connect(o),o.connect(n.destination),r.start(0);let[a,l]=Uv(n),c=Vi(a.then(u=>zv(u.getChannelData(0).subarray(i)),u=>{if(u.name==="timeout"||u.name==="suspended")return-3;throw u}));return()=>(l(),c)}function Bv(){return Ue()&&!Or()&&!mv()}function Wv(){return Ue()&&Wi()&&Hi()||oi()&&xv()&&gv()}function Uv(e){let r=()=>{};return[new Promise((a,l)=>{let c=!1,u=0,d=0;e.oncomplete=v=>a(v.renderedBuffer);let h=()=>{setTimeout(()=>l(uu("timeout")),Math.min(500,d+5e3-Date.now()))},p=()=>{try{let v=e.startRendering();switch(Eu(v)&&Vi(v),e.state){case"running":d=Date.now(),c&&h();break;case"suspended":document.hidden||u++,c&&u>=3?l(uu("suspended")):setTimeout(p,500);break}}catch(v){l(v)}};p(),r=()=>{c||(c=!0,d>0&&h())}}),r]}function zv(e){let t=0;for(let i=0;i<e.length;++i)t+=Math.abs(e[i]);return t}function uu(e){let t=new Error(e);return t.name=e,t}function Gv(){if(!(Ls()||Ue()))return-2;if(!window.AudioContext)return-1;let t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function qv(){return Zv(tg())}function Zv(e){let t=!1,i,s,[n,r]=Yv();return Xv(n,r)?(t=Jv(r),e?i=s="skipped":[i,s]=Kv(n,r)):i=s="unsupported",{winding:t,geometry:i,text:s}}function Yv(){let e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function Xv(e,t){return!!(t&&e.toDataURL)}function Jv(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function Kv(e,t){Qv(e,t);let i=Mr(e),s=Mr(e);return i!==s?["unstable","unstable"]:(eg(e,t),[Mr(e),i])}function Qv(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';let i="Cwm fjordbank gly \u{1F603}";t.fillText(i,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(i,4,45)}function eg(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(let[i,s,n]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=i,t.beginPath(),t.arc(s,n,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Mr(e){return e.toDataURL()}function tg(){let e=Ue()&&Wi()&&Hi(),t=Bi()&&fv();return e||t}function ig(){return window.screen.colorDepth}function sg(){for(let e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function ng(){if(si("no-preference"))return 0;if(si("high")||si("more"))return 1;if(si("low")||si("less"))return-1;if(si("forced"))return 10}function si(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function rg(){let e=document;try{e.cookie="cookietest=1; SameSite=Strict;";let t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function og(){return navigator.cpuClass}function ag(){if(!window.Intl)return-1;let e=window.Intl.DateTimeFormat;if(!e)return-2;let t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}function lg(){return rt(We(navigator.deviceMemory),void 0)}function cg(){let e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}async function ug({debug:e}={}){if(!dg())return;let t=cg(),i=Object.keys(t),s=[].concat(...i.map(o=>t[o])),n=await hg(s);e&&pg(t,n);let r=i.filter(o=>{let a=t[o];return ve(a.map(c=>n[c]))>a.length*.6});return r.sort(),r}function dg(){return Ue()||Ls()}async function hg(e){var t;let i=document,s=i.createElement("div"),n=new Array(e.length),r={};du(s);for(let o=0;o<e.length;++o){let a=Av(e[o]);a.tagName==="DIALOG"&&a.show();let l=i.createElement("div");du(l),l.appendChild(a),s.appendChild(l),n[o]=a}for(;!i.body;)await Rs(50);i.body.appendChild(s);try{for(let o=0;o<e.length;++o)n[o].offsetParent||(r[e[o]]=!0)}finally{(t=s.parentNode)===null||t===void 0||t.removeChild(s)}return r}function du(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function pg(e,t){let i="DOM blockers debug:\n```";for(let s of Object.keys(e)){i+=`
5
5
  ${s}:`;for(let n of e[s])i+=`
6
6
  ${t[n]?"\u{1F6AB}":"\u27A1\uFE0F"} ${n}`}console.log(`${i}
7
- \`\`\``)}var dg="mmMwWLliI0fiflO&1",Tr={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function hg(){return fg((e,t,i)=>{let s={},n={};for(let o of Object.keys(Tr)){let[a={},l=dg]=Tr[o],c=e.createElement("span");c.textContent=l,c.style.whiteSpace="nowrap";for(let u of Object.keys(a)){let d=a[u];d!==void 0&&(c.style[u]=d)}s[o]=c,t.append(e.createElement("br"),c)}let r=oi()&&fv();for(let o of Object.keys(Tr)){let a=s[o].getBoundingClientRect().width;n[o]=r?pg(a*i.devicePixelRatio):a}return n})}function pg(e){let t=Ls()?0:3,i=Math.pow(10,t);return Math.floor(e*i)/i}function fg(e,t=4e3){return $u((i,s)=>{let n=s.document,r=n.body,o=r.style;o.width=`${t}px`,o.webkitTextSizeAdjust=o.textSizeAdjust="none",oi()?r.style.zoom=`${1/s.devicePixelRatio}`:Ue()&&(r.style.zoom="reset");let a=n.createElement("div");return a.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),r.appendChild(a),e(n,r,s)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}var vg="mmMwWLliI0O&1",gg="48px",ni=["monospace","sans-serif","serif"],hu=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function _g(){return $u((e,{document:t})=>{let i=t.body;i.style.fontSize=gg;let s=t.createElement("div");s.style.setProperty("visibility","hidden","important");let n={},r={},o=p=>{let v=t.createElement("span"),{style:_}=v;return _.position="absolute",_.top="0",_.left="0",_.fontFamily=p,v.textContent=vg,s.appendChild(v),v},a=(p,v)=>o(`'${p}',${v}`),l=()=>ni.map(o),c=()=>{let p={};for(let v of hu)p[v]=ni.map(_=>a(v,_));return p},u=p=>ni.some((v,_)=>p[_].offsetWidth!==n[v]||p[_].offsetHeight!==r[v]),d=l(),h=c();i.appendChild(s);for(let p=0;p<ni.length;p++)n[ni[p]]=d[p].offsetWidth,r[ni[p]]=d[p].offsetHeight;return hu.filter(p=>u(h[p]))})}function mg(){if(pu("active"))return!0;if(pu("none"))return!1}function pu(e){return matchMedia(`(forced-colors: ${e})`).matches}function yg(){let e=bg();return e!==void 0&&Wi()&&Su()?e>=8?8:4:e}function bg(){return rt(Ar(navigator.hardwareConcurrency),void 0)}function wg(){if(fu("high"))return!0;if(fu("standard"))return!1}function fu(e){return matchMedia(`(dynamic-range: ${e})`).matches}function xg(){if(!(ku()||uv()))try{return!!window.indexedDB}catch{return!0}}function kg(){if(vu("inverted"))return!0;if(vu("none"))return!1}function vu(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Sg(){let e=navigator,t=[],i=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(i!==void 0&&t.push([i]),Array.isArray(e.languages))oi()&&hv()||t.push(e.languages);else if(typeof e.languages=="string"){let s=e.languages;s&&t.push(s.split(","))}return t}function Eg(){try{return!!window.localStorage}catch{return!0}}var X=Math,$e=()=>0;function $g(){let e=X.acos||$e,t=X.acosh||$e,i=X.asin||$e,s=X.asinh||$e,n=X.atanh||$e,r=X.atan||$e,o=X.sin||$e,a=X.sinh||$e,l=X.cos||$e,c=X.cosh||$e,u=X.tan||$e,d=X.tanh||$e,h=X.exp||$e,p=X.expm1||$e,v=X.log1p||$e,_=S=>X.pow(X.PI,S),g=S=>X.log(S+X.sqrt(S*S-1)),y=S=>X.log(S+X.sqrt(S*S+1)),m=S=>X.log((1+S)/(1-S))/2,w=S=>X.exp(S)-1/X.exp(S)/2,M=S=>(X.exp(S)+1/X.exp(S))/2,P=S=>X.exp(S)-1,k=S=>(X.exp(2*S)-1)/(X.exp(2*S)+1),I=S=>X.log(1+S);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:g(1e154),asin:i(.12312423423423424),asinh:s(1),asinhPf:y(1),atanh:n(.5),atanhPf:m(.5),atan:r(.5),sin:o(-1e300),sinh:a(1),sinhPf:w(1),cos:l(10.000000000123),cosh:c(1),coshPf:M(1),tan:u(-1e300),tanh:d(1),tanhPf:k(1),exp:h(1),expm1:p(1),expm1Pf:P(1),log1p:v(10),log1pPf:I(10),powPI:_(-100)}}var Pg=100;function Mg(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=Pg;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function Tg(){return!!window.openDatabase}function Ig(){return navigator.oscpu}function Cg(){return navigator.pdfViewerEnabled}function Fg(){let{platform:e}=navigator;return e==="MacIntel"&&Ue()&&!Or()?gv()?"iPad":"iPhone":e}function Ag(){let e=navigator.plugins;if(!e)return;let t=[];for(let i=0;i<e.length;++i){let s=e[i];if(!s)continue;let n=[];for(let r=0;r<s.length;++r){let o=s[r];n.push({type:o.type,suffixes:o.suffixes})}t.push({name:s.name,description:s.description,mimeTypes:n})}return t}function Og(){var e;let t=document.createElement("a"),i=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return i===void 0?void 0:String(i)}function Rg(){if(gu("reduce"))return!0;if(gu("no-preference"))return!1}function gu(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Lg(){if(_u("reduce"))return!0;if(_u("no-preference"))return!1}function _u(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}var Dg=2500,Ng=10,Os,Ir;function jg(){if(Ir!==void 0)return;let e=()=>{let t=Cr();Fr(t)?Ir=setTimeout(e,Dg):(Os=t,Ir=void 0)};e()}function Vg(){return jg(),async()=>{let e=Cr();if(Fr(e)){if(Os)return[...Os];_v()&&(await mv(),e=Cr())}return Fr(e)||(Os=e),e}}function Hg(){let e=Ue()&&Bi()&&Hi(),t=Wi()&&Su();if(e||t)return()=>Promise.resolve(void 0);let i=Vg();return async()=>{let s=await i(),n=r=>r===null?null:xu(r,Ng);return[n(s[0]),n(s[1]),n(s[2]),n(s[3])]}}function Cr(){let e=screen;return[rt(Be(e.availTop),null),rt(Be(e.width)-Be(e.availWidth)-rt(Be(e.availLeft),0),null),rt(Be(e.height)-Be(e.availHeight)-rt(Be(e.availTop),0),null),rt(Be(e.availLeft),null)]}function Fr(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Wg(){if(!(Ue()&&Bi()&&Hi()))return Bg()}function Bg(){let e=screen,t=s=>rt(Ar(s),null),i=[t(e.width),t(e.height)];return i.sort().reverse(),i}function Ug(){try{return!!window.sessionStorage}catch{return!0}}function zg(){var e;let t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){let s=new t().resolvedOptions().timeZone;if(s)return s}let i=-Gg();return`UTC${i>=0?"+":""}${i}`}function Gg(){let e=new Date().getFullYear();return Math.max(Be(new Date(e,0,1).getTimezoneOffset()),Be(new Date(e,6,1).getTimezoneOffset()))}function qg(){let e=navigator,t=0,i;e.maxTouchPoints!==void 0?t=Ar(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),i=!0}catch{i=!1}let s="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:i,touchStart:s}}function Zg(e){return/not/i.test(e)}async function Yg(){let e=navigator.userAgentData;if(!e)return;let t=e.brands.filter(({brand:n})=>!Zg(n)).map(({brand:n})=>n),s={brands:t.length>1?t.filter(n=>n!=="Chromium"):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{let n=await e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);s.architecture=n.architecture,s.bitness=n.bitness,s.model=n.model,s.platformVersion=n.platformVersion}catch(n){if(n instanceof DOMException&&n.name==="NotAllowedError")s.highEntropyStatus="not_allowed";else throw n}return s}function Xg(){return navigator.vendor||""}function Jg(){let e=[];for(let t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){let i=window[t];i&&typeof i=="object"&&e.push(t)}return e.sort()}var Pu=-1,Mu=-2,Kg=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Qg=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),e_=["FRAGMENT_SHADER","VERTEX_SHADER"],t_=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Tu="WEBGL_debug_renderer_info",i_="WEBGL_polygon_mode";function s_({cache:e}){var t,i,s,n,r,o;let a=Iu(e);if(!a)return Pu;if(!Fu(a))return Mu;let l=Cu()?null:a.getExtension(Tu);return{version:((t=a.getParameter(a.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((i=a.getParameter(a.VENDOR))===null||i===void 0?void 0:i.toString())||"",vendorUnmasked:l?(s=a.getParameter(l.UNMASKED_VENDOR_WEBGL))===null||s===void 0?void 0:s.toString():"",renderer:((n=a.getParameter(a.RENDERER))===null||n===void 0?void 0:n.toString())||"",rendererUnmasked:l?(r=a.getParameter(l.UNMASKED_RENDERER_WEBGL))===null||r===void 0?void 0:r.toString():"",shadingLanguageVersion:((o=a.getParameter(a.SHADING_LANGUAGE_VERSION))===null||o===void 0?void 0:o.toString())||""}}function n_({cache:e}){let t=Iu(e);if(!t)return Pu;if(!Fu(t))return Mu;let i=t.getSupportedExtensions(),s=t.getContextAttributes(),n=[],r=[],o=[],a=[],l=[];if(s)for(let u of Object.keys(s))r.push(`${u}=${s[u]}`);let c=mu(t);for(let u of c){let d=t[u];o.push(`${u}=${d}${Kg.has(d)?`=${t.getParameter(d)}`:""}`)}if(i)for(let u of i){if(u===Tu&&Cu()||u===i_&&a_())continue;let d=t.getExtension(u);if(!d){n.push(u);continue}for(let h of mu(d)){let p=d[h];a.push(`${h}=${p}${Qg.has(p)?`=${t.getParameter(p)}`:""}`)}}for(let u of e_)for(let d of t_){let h=r_(t,u,d);l.push(`${u}.${d}=${h.join(",")}`)}return a.sort(),o.sort(),{contextAttributes:r,parameters:o,shaderPrecisions:l,extensions:i,extensionParameters:a,unsupportedExtensions:n}}function Iu(e){if(e.webgl)return e.webgl.context;let t=document.createElement("canvas"),i;t.addEventListener("webglCreateContextError",()=>i=void 0);for(let s of["webgl","experimental-webgl"]){try{i=t.getContext(s)}catch{}if(i)break}return e.webgl={context:i},i}function r_(e,t,i){let s=e.getShaderPrecisionFormat(e[t],e[i]);return s?[s.rangeMin,s.rangeMax,s.precision]:[]}function mu(e){return Object.keys(e.__proto__).filter(o_)}function o_(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Cu(){return Wi()}function a_(){return oi()||Ue()}function Fu(e){return typeof e.getParameter=="function"}var l_={userAgentData:Yg,fonts:_g,domBlockers:ag,fontPreferences:hg,audio:Dv,screenFrame:Hg,canvas:Uv,osCpu:Ig,languages:Sg,colorDepth:Qv,deviceMemory:rg,screenResolution:Wg,hardwareConcurrency:yg,timezone:zg,sessionStorage:Ug,localStorage:Eg,indexedDB:xg,openDatabase:Tg,cpuClass:sg,platform:Fg,plugins:Ag,touchSupport:qg,vendor:Xg,vendorFlavors:Jg,cookiesEnabled:ig,colorGamut:eg,invertedColors:kg,forcedColors:mg,monochrome:Mg,contrast:tg,reducedMotion:Rg,reducedTransparency:Lg,hdr:wg,math:$g,pdfViewerEnabled:Cg,architecture:Lv,applePay:Av,privateClickMeasurement:Og,audioBaseLatency:Bv,dateTimeLocale:ng,webGlBasics:s_,webGlExtensions:n_};function c_(e){return Tv(l_,e,[])}function bt(e,t){let i=e[0]>>>16,s=e[0]&65535,n=e[1]>>>16,r=e[1]&65535,o=t[0]>>>16,a=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,h=0,p=0;p+=r+c,h+=p>>>16,p&=65535,h+=n+l,d+=h>>>16,h&=65535,d+=s+a,u+=d>>>16,d&=65535,u+=i+o,u&=65535,e[0]=u<<16|d,e[1]=h<<16|p}function De(e,t){let i=e[0]>>>16,s=e[0]&65535,n=e[1]>>>16,r=e[1]&65535,o=t[0]>>>16,a=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,h=0,p=0;p+=r*c,h+=p>>>16,p&=65535,h+=n*c,d+=h>>>16,h&=65535,h+=r*l,d+=h>>>16,h&=65535,d+=s*c,u+=d>>>16,d&=65535,d+=n*l,u+=d>>>16,d&=65535,d+=r*a,u+=d>>>16,d&=65535,u+=i*c+s*l+n*a+r*o,u&=65535,e[0]=u<<16|d,e[1]=h<<16|p}function ri(e,t){let i=e[0];t%=64,t===32?(e[0]=e[1],e[1]=i):t<32?(e[0]=i<<t|e[1]>>>32-t,e[1]=e[1]<<t|i>>>32-t):(t-=32,e[0]=e[1]<<t|i>>>32-t,e[1]=i<<t|e[1]>>>32-t)}function Oe(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function ae(e,t){e[0]^=t[0],e[1]^=t[1]}var u_=[4283543511,3981806797],d_=[3301882366,444984403];function yu(e){let t=[0,e[0]>>>1];ae(e,t),De(e,u_),t[1]=e[0]>>>1,ae(e,t),De(e,d_),t[1]=e[0]>>>1,ae(e,t)}var Fs=[2277735313,289559509],As=[1291169091,658871167],bu=[0,5],h_=[0,1390208809],p_=[0,944331445];function f_(e,t){let i=av(e);t=t||0;let s=[0,i.length],n=s[1]%16,r=s[1]-n,o=[0,t],a=[0,t],l=[0,0],c=[0,0],u;for(u=0;u<r;u=u+16)l[0]=i[u+4]|i[u+5]<<8|i[u+6]<<16|i[u+7]<<24,l[1]=i[u]|i[u+1]<<8|i[u+2]<<16|i[u+3]<<24,c[0]=i[u+12]|i[u+13]<<8|i[u+14]<<16|i[u+15]<<24,c[1]=i[u+8]|i[u+9]<<8|i[u+10]<<16|i[u+11]<<24,De(l,Fs),ri(l,31),De(l,As),ae(o,l),ri(o,27),bt(o,a),De(o,bu),bt(o,h_),De(c,As),ri(c,33),De(c,Fs),ae(a,c),ri(a,31),bt(a,o),De(a,bu),bt(a,p_);l[0]=0,l[1]=0,c[0]=0,c[1]=0;let d=[0,0];switch(n){case 15:d[1]=i[u+14],Oe(d,48),ae(c,d);case 14:d[1]=i[u+13],Oe(d,40),ae(c,d);case 13:d[1]=i[u+12],Oe(d,32),ae(c,d);case 12:d[1]=i[u+11],Oe(d,24),ae(c,d);case 11:d[1]=i[u+10],Oe(d,16),ae(c,d);case 10:d[1]=i[u+9],Oe(d,8),ae(c,d);case 9:d[1]=i[u+8],ae(c,d),De(c,As),ri(c,33),De(c,Fs),ae(a,c);case 8:d[1]=i[u+7],Oe(d,56),ae(l,d);case 7:d[1]=i[u+6],Oe(d,48),ae(l,d);case 6:d[1]=i[u+5],Oe(d,40),ae(l,d);case 5:d[1]=i[u+4],Oe(d,32),ae(l,d);case 4:d[1]=i[u+3],Oe(d,24),ae(l,d);case 3:d[1]=i[u+2],Oe(d,16),ae(l,d);case 2:d[1]=i[u+1],Oe(d,8),ae(l,d);case 1:d[1]=i[u],ae(l,d),De(l,Fs),ri(l,31),De(l,As),ae(o,l)}return ae(o,s),ae(a,s),bt(o,a),bt(a,o),yu(o),yu(a),bt(o,a),bt(a,o),`00000000${(o[0]>>>0).toString(16)}`.slice(-8)+`00000000${(o[1]>>>0).toString(16)}`.slice(-8)+`00000000${(a[0]>>>0).toString(16)}`.slice(-8)+`00000000${(a[1]>>>0).toString(16)}`.slice(-8)}function v_(e){let t="";for(let i of Object.keys(e).sort()){let s=e[i],n="error"in s?"error":JSON.stringify(s.value);t+=`${t?"|":""}${i.replace(/([:|\\])/g,"\\$1")}:${n}`}return t}function Au(e){return JSON.stringify(e,(t,i)=>i instanceof Error?lv(i):i,2)}function Ou(e){return f_(v_(e))}function g_(e){let t,i=xv(e);return{get visitorId(){return t===void 0&&(t=Ou(this.components)),t},set visitorId(s){t=s},confidence:i,components:e,version:wu}}function __(e=50){return $v(e,e*2)}function m_(e,t){let i=Date.now();return{async get(s){let n=Date.now(),r=await e(),o=g_(r);return(t||s!=null&&s.debug)&&console.log(`Copy the text below to get the debug data:
7
+ \`\`\``)}var fg="mmMwWLliI0fiflO&1",Tr={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function vg(){return _g((e,t,i)=>{let s={},n={};for(let o of Object.keys(Tr)){let[a={},l=fg]=Tr[o],c=e.createElement("span");c.textContent=l,c.style.whiteSpace="nowrap";for(let u of Object.keys(a)){let d=a[u];d!==void 0&&(c.style[u]=d)}s[o]=c,t.append(e.createElement("br"),c)}let r=oi()&&_v();for(let o of Object.keys(Tr)){let a=s[o].getBoundingClientRect().width;n[o]=r?gg(a*i.devicePixelRatio):a}return n})}function gg(e){let t=Ls()?0:3,i=Math.pow(10,t);return Math.floor(e*i)/i}function _g(e,t=4e3){return $u((i,s)=>{let n=s.document,r=n.body,o=r.style;o.width=`${t}px`,o.webkitTextSizeAdjust=o.textSizeAdjust="none",oi()?r.style.zoom=`${1/s.devicePixelRatio}`:Ue()&&(r.style.zoom="reset");let a=n.createElement("div");return a.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),r.appendChild(a),e(n,r,s)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}var mg="mmMwWLliI0O&1",yg="48px",ni=["monospace","sans-serif","serif"],hu=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function bg(){return $u((e,{document:t})=>{let i=t.body;i.style.fontSize=yg;let s=t.createElement("div");s.style.setProperty("visibility","hidden","important");let n={},r={},o=p=>{let v=t.createElement("span"),{style:_}=v;return _.position="absolute",_.top="0",_.left="0",_.fontFamily=p,v.textContent=mg,s.appendChild(v),v},a=(p,v)=>o(`'${p}',${v}`),l=()=>ni.map(o),c=()=>{let p={};for(let v of hu)p[v]=ni.map(_=>a(v,_));return p},u=p=>ni.some((v,_)=>p[_].offsetWidth!==n[v]||p[_].offsetHeight!==r[v]),d=l(),h=c();i.appendChild(s);for(let p=0;p<ni.length;p++)n[ni[p]]=d[p].offsetWidth,r[ni[p]]=d[p].offsetHeight;return hu.filter(p=>u(h[p]))})}function wg(){if(pu("active"))return!0;if(pu("none"))return!1}function pu(e){return matchMedia(`(forced-colors: ${e})`).matches}function xg(){let e=kg();return e!==void 0&&Bi()&&Su()?e>=8?8:4:e}function kg(){return rt(Ar(navigator.hardwareConcurrency),void 0)}function Sg(){if(fu("high"))return!0;if(fu("standard"))return!1}function fu(e){return matchMedia(`(dynamic-range: ${e})`).matches}function Eg(){if(!(ku()||pv()))try{return!!window.indexedDB}catch{return!0}}function $g(){if(vu("inverted"))return!0;if(vu("none"))return!1}function vu(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Pg(){let e=navigator,t=[],i=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(i!==void 0&&t.push([i]),Array.isArray(e.languages))oi()&&vv()||t.push(e.languages);else if(typeof e.languages=="string"){let s=e.languages;s&&t.push(s.split(","))}return t}function Mg(){try{return!!window.localStorage}catch{return!0}}var X=Math,$e=()=>0;function Tg(){let e=X.acos||$e,t=X.acosh||$e,i=X.asin||$e,s=X.asinh||$e,n=X.atanh||$e,r=X.atan||$e,o=X.sin||$e,a=X.sinh||$e,l=X.cos||$e,c=X.cosh||$e,u=X.tan||$e,d=X.tanh||$e,h=X.exp||$e,p=X.expm1||$e,v=X.log1p||$e,_=S=>X.pow(X.PI,S),g=S=>X.log(S+X.sqrt(S*S-1)),y=S=>X.log(S+X.sqrt(S*S+1)),m=S=>X.log((1+S)/(1-S))/2,w=S=>X.exp(S)-1/X.exp(S)/2,M=S=>(X.exp(S)+1/X.exp(S))/2,P=S=>X.exp(S)-1,k=S=>(X.exp(2*S)-1)/(X.exp(2*S)+1),I=S=>X.log(1+S);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:g(1e154),asin:i(.12312423423423424),asinh:s(1),asinhPf:y(1),atanh:n(.5),atanhPf:m(.5),atan:r(.5),sin:o(-1e300),sinh:a(1),sinhPf:w(1),cos:l(10.000000000123),cosh:c(1),coshPf:M(1),tan:u(-1e300),tanh:d(1),tanhPf:k(1),exp:h(1),expm1:p(1),expm1Pf:P(1),log1p:v(10),log1pPf:I(10),powPI:_(-100)}}var Ig=100;function Cg(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=Ig;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function Fg(){return!!window.openDatabase}function Ag(){return navigator.oscpu}function Og(){return navigator.pdfViewerEnabled}function Rg(){let{platform:e}=navigator;return e==="MacIntel"&&Ue()&&!Or()?yv()?"iPad":"iPhone":e}function Lg(){let e=navigator.plugins;if(!e)return;let t=[];for(let i=0;i<e.length;++i){let s=e[i];if(!s)continue;let n=[];for(let r=0;r<s.length;++r){let o=s[r];n.push({type:o.type,suffixes:o.suffixes})}t.push({name:s.name,description:s.description,mimeTypes:n})}return t}function Dg(){var e;let t=document.createElement("a"),i=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return i===void 0?void 0:String(i)}function Ng(){if(gu("reduce"))return!0;if(gu("no-preference"))return!1}function gu(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function jg(){if(_u("reduce"))return!0;if(_u("no-preference"))return!1}function _u(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}var Vg=2500,Hg=10,Os,Ir;function Bg(){if(Ir!==void 0)return;let e=()=>{let t=Cr();Fr(t)?Ir=setTimeout(e,Vg):(Os=t,Ir=void 0)};e()}function Wg(){return Bg(),async()=>{let e=Cr();if(Fr(e)){if(Os)return[...Os];bv()&&(await wv(),e=Cr())}return Fr(e)||(Os=e),e}}function Ug(){let e=Ue()&&Wi()&&Hi(),t=Bi()&&Su();if(e||t)return()=>Promise.resolve(void 0);let i=Wg();return async()=>{let s=await i(),n=r=>r===null?null:xu(r,Hg);return[n(s[0]),n(s[1]),n(s[2]),n(s[3])]}}function Cr(){let e=screen;return[rt(We(e.availTop),null),rt(We(e.width)-We(e.availWidth)-rt(We(e.availLeft),0),null),rt(We(e.height)-We(e.availHeight)-rt(We(e.availTop),0),null),rt(We(e.availLeft),null)]}function Fr(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function zg(){if(!(Ue()&&Wi()&&Hi()))return Gg()}function Gg(){let e=screen,t=s=>rt(Ar(s),null),i=[t(e.width),t(e.height)];return i.sort().reverse(),i}function qg(){try{return!!window.sessionStorage}catch{return!0}}function Zg(){var e;let t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){let s=new t().resolvedOptions().timeZone;if(s)return s}let i=-Yg();return`UTC${i>=0?"+":""}${i}`}function Yg(){let e=new Date().getFullYear();return Math.max(We(new Date(e,0,1).getTimezoneOffset()),We(new Date(e,6,1).getTimezoneOffset()))}function Xg(){let e=navigator,t=0,i;e.maxTouchPoints!==void 0?t=Ar(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),i=!0}catch{i=!1}let s="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:i,touchStart:s}}function Jg(e){return/not/i.test(e)}async function Kg(){let e=navigator.userAgentData;if(!e)return;let t=e.brands.filter(({brand:n})=>!Jg(n)).map(({brand:n})=>n),s={brands:t.length>1?t.filter(n=>n!=="Chromium"):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{let n=await e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);s.architecture=n.architecture,s.bitness=n.bitness,s.model=n.model,s.platformVersion=n.platformVersion}catch(n){if(n instanceof DOMException&&n.name==="NotAllowedError")s.highEntropyStatus="not_allowed";else throw n}return s}function Qg(){return navigator.vendor||""}function e_(){let e=[];for(let t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){let i=window[t];i&&typeof i=="object"&&e.push(t)}return e.sort()}var Pu=-1,Mu=-2,t_=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),i_=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),s_=["FRAGMENT_SHADER","VERTEX_SHADER"],n_=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Tu="WEBGL_debug_renderer_info",r_="WEBGL_polygon_mode";function o_({cache:e}){var t,i,s,n,r,o;let a=Iu(e);if(!a)return Pu;if(!Fu(a))return Mu;let l=Cu()?null:a.getExtension(Tu);return{version:((t=a.getParameter(a.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((i=a.getParameter(a.VENDOR))===null||i===void 0?void 0:i.toString())||"",vendorUnmasked:l?(s=a.getParameter(l.UNMASKED_VENDOR_WEBGL))===null||s===void 0?void 0:s.toString():"",renderer:((n=a.getParameter(a.RENDERER))===null||n===void 0?void 0:n.toString())||"",rendererUnmasked:l?(r=a.getParameter(l.UNMASKED_RENDERER_WEBGL))===null||r===void 0?void 0:r.toString():"",shadingLanguageVersion:((o=a.getParameter(a.SHADING_LANGUAGE_VERSION))===null||o===void 0?void 0:o.toString())||""}}function a_({cache:e}){let t=Iu(e);if(!t)return Pu;if(!Fu(t))return Mu;let i=t.getSupportedExtensions(),s=t.getContextAttributes(),n=[],r=[],o=[],a=[],l=[];if(s)for(let u of Object.keys(s))r.push(`${u}=${s[u]}`);let c=mu(t);for(let u of c){let d=t[u];o.push(`${u}=${d}${t_.has(d)?`=${t.getParameter(d)}`:""}`)}if(i)for(let u of i){if(u===Tu&&Cu()||u===r_&&u_())continue;let d=t.getExtension(u);if(!d){n.push(u);continue}for(let h of mu(d)){let p=d[h];a.push(`${h}=${p}${i_.has(p)?`=${t.getParameter(p)}`:""}`)}}for(let u of s_)for(let d of n_){let h=l_(t,u,d);l.push(`${u}.${d}=${h.join(",")}`)}return a.sort(),o.sort(),{contextAttributes:r,parameters:o,shaderPrecisions:l,extensions:i,extensionParameters:a,unsupportedExtensions:n}}function Iu(e){if(e.webgl)return e.webgl.context;let t=document.createElement("canvas"),i;t.addEventListener("webglCreateContextError",()=>i=void 0);for(let s of["webgl","experimental-webgl"]){try{i=t.getContext(s)}catch{}if(i)break}return e.webgl={context:i},i}function l_(e,t,i){let s=e.getShaderPrecisionFormat(e[t],e[i]);return s?[s.rangeMin,s.rangeMax,s.precision]:[]}function mu(e){return Object.keys(e.__proto__).filter(c_)}function c_(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Cu(){return Bi()}function u_(){return oi()||Ue()}function Fu(e){return typeof e.getParameter=="function"}var d_={userAgentData:Kg,fonts:bg,domBlockers:ug,fontPreferences:vg,audio:Vv,screenFrame:Ug,canvas:qv,osCpu:Ag,languages:Pg,colorDepth:ig,deviceMemory:lg,screenResolution:zg,hardwareConcurrency:xg,timezone:Zg,sessionStorage:qg,localStorage:Mg,indexedDB:Eg,openDatabase:Fg,cpuClass:og,platform:Rg,plugins:Lg,touchSupport:Xg,vendor:Qg,vendorFlavors:e_,cookiesEnabled:rg,colorGamut:sg,invertedColors:$g,forcedColors:wg,monochrome:Cg,contrast:ng,reducedMotion:Ng,reducedTransparency:jg,hdr:Sg,math:Tg,pdfViewerEnabled:Og,architecture:jv,applePay:Lv,privateClickMeasurement:Dg,audioBaseLatency:Gv,dateTimeLocale:ag,webGlBasics:o_,webGlExtensions:a_};function h_(e){return Fv(d_,e,[])}function bt(e,t){let i=e[0]>>>16,s=e[0]&65535,n=e[1]>>>16,r=e[1]&65535,o=t[0]>>>16,a=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,h=0,p=0;p+=r+c,h+=p>>>16,p&=65535,h+=n+l,d+=h>>>16,h&=65535,d+=s+a,u+=d>>>16,d&=65535,u+=i+o,u&=65535,e[0]=u<<16|d,e[1]=h<<16|p}function De(e,t){let i=e[0]>>>16,s=e[0]&65535,n=e[1]>>>16,r=e[1]&65535,o=t[0]>>>16,a=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,h=0,p=0;p+=r*c,h+=p>>>16,p&=65535,h+=n*c,d+=h>>>16,h&=65535,h+=r*l,d+=h>>>16,h&=65535,d+=s*c,u+=d>>>16,d&=65535,d+=n*l,u+=d>>>16,d&=65535,d+=r*a,u+=d>>>16,d&=65535,u+=i*c+s*l+n*a+r*o,u&=65535,e[0]=u<<16|d,e[1]=h<<16|p}function ri(e,t){let i=e[0];t%=64,t===32?(e[0]=e[1],e[1]=i):t<32?(e[0]=i<<t|e[1]>>>32-t,e[1]=e[1]<<t|i>>>32-t):(t-=32,e[0]=e[1]<<t|i>>>32-t,e[1]=i<<t|e[1]>>>32-t)}function Oe(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function ae(e,t){e[0]^=t[0],e[1]^=t[1]}var p_=[4283543511,3981806797],f_=[3301882366,444984403];function yu(e){let t=[0,e[0]>>>1];ae(e,t),De(e,p_),t[1]=e[0]>>>1,ae(e,t),De(e,f_),t[1]=e[0]>>>1,ae(e,t)}var Fs=[2277735313,289559509],As=[1291169091,658871167],bu=[0,5],v_=[0,1390208809],g_=[0,944331445];function __(e,t){let i=uv(e);t=t||0;let s=[0,i.length],n=s[1]%16,r=s[1]-n,o=[0,t],a=[0,t],l=[0,0],c=[0,0],u;for(u=0;u<r;u=u+16)l[0]=i[u+4]|i[u+5]<<8|i[u+6]<<16|i[u+7]<<24,l[1]=i[u]|i[u+1]<<8|i[u+2]<<16|i[u+3]<<24,c[0]=i[u+12]|i[u+13]<<8|i[u+14]<<16|i[u+15]<<24,c[1]=i[u+8]|i[u+9]<<8|i[u+10]<<16|i[u+11]<<24,De(l,Fs),ri(l,31),De(l,As),ae(o,l),ri(o,27),bt(o,a),De(o,bu),bt(o,v_),De(c,As),ri(c,33),De(c,Fs),ae(a,c),ri(a,31),bt(a,o),De(a,bu),bt(a,g_);l[0]=0,l[1]=0,c[0]=0,c[1]=0;let d=[0,0];switch(n){case 15:d[1]=i[u+14],Oe(d,48),ae(c,d);case 14:d[1]=i[u+13],Oe(d,40),ae(c,d);case 13:d[1]=i[u+12],Oe(d,32),ae(c,d);case 12:d[1]=i[u+11],Oe(d,24),ae(c,d);case 11:d[1]=i[u+10],Oe(d,16),ae(c,d);case 10:d[1]=i[u+9],Oe(d,8),ae(c,d);case 9:d[1]=i[u+8],ae(c,d),De(c,As),ri(c,33),De(c,Fs),ae(a,c);case 8:d[1]=i[u+7],Oe(d,56),ae(l,d);case 7:d[1]=i[u+6],Oe(d,48),ae(l,d);case 6:d[1]=i[u+5],Oe(d,40),ae(l,d);case 5:d[1]=i[u+4],Oe(d,32),ae(l,d);case 4:d[1]=i[u+3],Oe(d,24),ae(l,d);case 3:d[1]=i[u+2],Oe(d,16),ae(l,d);case 2:d[1]=i[u+1],Oe(d,8),ae(l,d);case 1:d[1]=i[u],ae(l,d),De(l,Fs),ri(l,31),De(l,As),ae(o,l)}return ae(o,s),ae(a,s),bt(o,a),bt(a,o),yu(o),yu(a),bt(o,a),bt(a,o),`00000000${(o[0]>>>0).toString(16)}`.slice(-8)+`00000000${(o[1]>>>0).toString(16)}`.slice(-8)+`00000000${(a[0]>>>0).toString(16)}`.slice(-8)+`00000000${(a[1]>>>0).toString(16)}`.slice(-8)}function m_(e){let t="";for(let i of Object.keys(e).sort()){let s=e[i],n="error"in s?"error":JSON.stringify(s.value);t+=`${t?"|":""}${i.replace(/([:|\\])/g,"\\$1")}:${n}`}return t}function Au(e){return JSON.stringify(e,(t,i)=>i instanceof Error?dv(i):i,2)}function Ou(e){return __(m_(e))}function y_(e){let t,i=Ev(e);return{get visitorId(){return t===void 0&&(t=Ou(this.components)),t},set visitorId(s){t=s},confidence:i,components:e,version:wu}}function b_(e=50){return Tv(e,e*2)}function w_(e,t){let i=Date.now();return{async get(s){let n=Date.now(),r=await e(),o=y_(r);return(t||s!=null&&s.debug)&&console.log(`Copy the text below to get the debug data:
8
8
 
9
9
  \`\`\`
10
10
  version: ${o.version}
@@ -12,4 +12,4 @@ userAgent: ${navigator.userAgent}
12
12
  timeBetweenLoadAndGet: ${n-i}
13
13
  visitorId: ${o.visitorId}
14
14
  components: ${Au(r)}
15
- \`\`\``),o}}}function y_(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{let e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${wu}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}async function b_(e={}){let{delayFallback:t,debug:i,monitoring:s=!0}=e;s&&y_(),await __(t);let n=c_({cache:{},debug:i});return m_(n,i)}var Ru={load:b_,hashComponents:Ou,componentsToDebugString:Au};var w_=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_placement"],x_=["fbclid","gclid","gbraid","wbraid","gad_source","gad_campaignid","msclkid","ctwa_clid"],Dr=["ad_id","adset_id","campaign_id","adgroup_id","h_ad_id","fbc_id"],k_=["lp"],S_=[...w_,...x_,...Dr,...k_],Du=new Set(S_),E_=e=>Du.has(String(e).toLowerCase()),Rr=e=>e.split(/[?#]/)[0],$_=/^[a-z][a-z0-9+.-]*:/i;function ze(e,t){if(typeof e!="string"||e==="")return e;let i=$_.test(e),s;try{s=new URL(e,t||void 0)}catch{return Rr(e)}if(s.protocol!=="http:"&&s.protocol!=="https:")return i?e:Rr(e);let n=new URLSearchParams;for(let[r,o]of s.searchParams)E_(r)&&n.append(r,o);return s.search=n.toString(),s.hash="",i||e.startsWith("//")?s.href:e.startsWith("/")?s.pathname+s.search:Rr(e)+s.search}function Nr(e){let t={},i;try{i=new URL(e)}catch{return t}for(let[s,n]of i.searchParams){let r=s.toLowerCase();Du.has(r)&&n!==""&&!(r in t)&&(t[r]=n)}return t}var P_=new Set(["href","attr__href","action","attr__action"]),M_=/((?:attr__)?(?:href|action))="((?:[^"\\]|\\.)*)"/g,Lu={event:8,snapshot:400},T_=/\.(png|jpe?g|gif|webp|avif|svg|ico|bmp|mp4|webm|mov|m4v|mp3|wav|ogg|js|mjs|css|woff2?|ttf|otf|json)$/i;function I_(e,t){try{return T_.test(new URL(e,t).pathname)}catch{return!1}}function C_(e,t,i,s){return t==="$elements_chain"?e.replace(M_,(n,r,o)=>`${r}="${ze(o,i)}"`):P_.has(t)?ze(e,i):s&&(t==="src"||t==="rr_src")?e.startsWith("data:")||I_(e,i)?e:ze(e,i):!s&&/^https?:\/\//i.test(e)?ze(e):e}var F_=/^https?:\/\//i;function Lr(e,t,i,s,n){if(typeof e=="string")return C_(e,t,i,s);if(!e||typeof e!="object"||n>(s?Lu.snapshot:Lu.event))return e;if(Array.isArray(e)){for(let r=0;r<e.length;r++)e[r]=Lr(e[r],t,i,s,n+1);return e}for(let r of Object.keys(e)){let o=Lr(e[r],r,i,s,n+1),a=F_.test(r)?ze(r):r;if(a===r){e[r]=o;continue}delete e[r];let l=e[a];Array.isArray(l)&&Array.isArray(o)?e[a]=l.concat(o):l&&o&&typeof l=="object"&&typeof o=="object"?e[a]={...l,...o}:e[a]=o}return e}function Nu(e,t){if(!e||typeof e!="object")return e;let i=e.event==="$snapshot";for(let s of["properties","$set","$set_once"])e[s]&&typeof e[s]=="object"&&(e[s]=Lr(e[s],s,t,i,0));return e}var A_=/^[^\s@<>()]+@[^\s@<>()]+\.[^\s@<>()]{2,}$/,O_=["email"],R_=["phone","phonenumber","phone_number","tel","telefone"];function jr(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return A_.test(t)&&t.length<=254?t:null}function Vr(e,t){if(typeof e!="string")return null;let i=e.trim().replace(/\s*(ext\.?|x|#)\s*\d+$/i,""),s=i.replace(/\D/g,"");i.startsWith("00")&&(s=s.slice(2));let n=i.startsWith("+")||i.startsWith("00");if(!n&&t){let r=String(t).replace(/\D/g,""),o=["39","378","379"].includes(r);r&&!s.startsWith(r)&&(s=r+(o?s:s.replace(/^0/,"")))}return s.length<7||s.length>15?null:n||t?`+${s}`:s}function ju(e){let t={},i;try{i=new URL(e)}catch{return t}for(let[s,n]of i.searchParams){let r=s.toLowerCase();!t.email&&O_.includes(r)&&(t.email=jr(n)||void 0),!t.phone&&R_.includes(r)&&(t.phone=Vr(n)||void 0)}return Object.fromEntries(Object.entries(t).filter(([,s])=>s))}var Br=["ph_anon_id","ph_distinct_id","ph_session_id","contact_id"],L_=/\/widget\/(form|survey|booking)\//,Uu=["buy.stripe.com","checkout.stripe.com"],D_="input[type=email], input[type=tel], input[name*=email i], input[name*=phone i]",Wr="data-f10x-field";function Vu(e,t,i){if(!e||e.hasAttribute("data-f10x-skip"))return;let s=i&&e.querySelector(D_);for(let[n,r]of Object.entries(t)){let o=e.querySelector(`[name="${CSS.escape(n)}"]`);if(o)o.tagName==="INPUT"&&(o.type==="hidden"||o.value===""||o.hasAttribute(Wr))&&(o.value=r);else if(s){let a=document.createElement("input");a.type="hidden",a.name=n,a.value=r,a.setAttribute(Wr,""),e.appendChild(a)}}}var Hu=new WeakMap;function N_(e){for(let t of document.querySelectorAll("input[data-q]")){let i=e[t.getAttribute("data-q")];if(i==null)continue;let s=Hu.get(t);s!==i&&(s===void 0&&t.value!==""||(t.value=i,Hu.set(t,i),t.setAttribute(Wr,""),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))))}}function Hr(e,t,i){let s;try{s=new URL(e,i)}catch{return null}if(s.protocol!=="http:"&&s.protocol!=="https:")return null;let n=s.href;for(let[r,o]of Object.entries(t))Br.includes(r)?s.searchParams.set(r,o):s.searchParams.has(r)||s.searchParams.set(r,o);return Uu.includes(s.hostname)&&t.ph_distinct_id&&!s.searchParams.has("client_reference_id")&&s.searchParams.set("client_reference_id",t.ph_distinct_id),s.href===n?null:s.href}var Wu=e=>{try{return new URL(e,location.href).hostname}catch{return""}};function Ur({values:e,checkoutHosts:t,addFields:i}){let s=new Set([...Uu,...t||[]].map(u=>u.toLowerCase())),n=!1,r=0,o=u=>{for(let d of document.querySelectorAll("a[href]")){if(!s.has(Wu(d.getAttribute("href"))))continue;let h=Hr(d.getAttribute("href"),u,location.href);h&&d.setAttribute("href",h)}},a=u=>{for(let d of document.querySelectorAll("iframe[src]")){let h=d.getAttribute("src");if(!L_.test(h))continue;let p=Hr(h,u,location.href);p&&d.setAttribute("src",p)}},l=(u={})=>{u.iframes&&(n=!0);let d=e();for(let h of document.forms)Vu(h,d,i);N_(d),o(d),n&&a(d)},c=()=>{r||(r=setTimeout(()=>{r=0,l()},50))};return new MutationObserver(c).observe(document.documentElement,{childList:!0,subtree:!0}),document.addEventListener("submit",u=>Vu(u.target,e(),i),!0),document.addEventListener("click",u=>{let d=u.target instanceof Element?u.target.closest("a[href]"):null;if(!d||!s.has(Wu(d.getAttribute("href"))))return;let h=Hr(d.getAttribute("href"),e(),location.href);h&&d.setAttribute("href",h)},!0),l(),{refresh:l}}var j_=/e-?mail/i,V_=/phone|telefone|telem[oó]vel|celular|whatsapp|(^|[\s_.-])(tel|mobile)($|[\s_.-])/i,H_=new Set(["hidden","password","checkbox","radio","search","submit","button","file","reset","image"]),zu=e=>[e.name,e.id,e.getAttribute("data-q"),e.getAttribute("autocomplete")].filter(Boolean).join(" "),W_=e=>e.type==="email"||j_.test(zu(e)),B_=e=>e.type==="tel"||e.type!=="email"&&V_.test(zu(e));function U_(e){let t=e.closest(".iti")||e.closest('.form-builder--item, [class*="phone"]')||e.parentElement,i=t&&t.querySelector('.iti__selected-dial-code, [class*="dial-code"], [class*="dialCode"]'),s=i&&i.textContent;if(s&&/\+?\d{1,4}/.test(s))return s.match(/\d{1,4}/)[0];let n=t&&t.querySelector(".iti__selected-flag, .iti__selected-country"),r=n&&(n.getAttribute("title")||n.getAttribute("aria-label")||"").match(/\+(\d{1,4})/);return r?r[1]:null}function Bu(e){if(!(e instanceof HTMLInputElement)||H_.has(e.type))return{};if(W_(e)){let t=jr(e.value);return t?{email:t}:{}}if(B_(e)){let t=Vr(e.value,U_(e));return t?{phone:t}:{}}return{}}function Gu(e){document.addEventListener("change",t=>{let i=Bu(t.target);(i.email||i.phone)&&e(i,"field")},!0),document.addEventListener("submit",t=>{if(!(t.target instanceof HTMLFormElement))return;let i={};for(let s of t.target.querySelectorAll("input")){let n=Bu(s);n.email&&!i.email&&(i.email=n.email),n.phone&&!i.phone&&(i.phone=n.phone)}(i.email||i.phone)&&e(i,"form")},!0)}var Zr="1.1.0",zr="f10x_consent",Yr="f10x_contact_id",z_="contact_id",G_=/^[A-Za-z0-9_-]{6,128}$/,q_=1e3,Z_={defaults:"2026-08-30",person_profiles:"identified_only",advanced_disable_feature_flags:!0,disable_surveys:!0,disable_conversations:!0,disable_product_tours:!0,disable_web_experiments:!0},Xr=e=>{try{return e==="session"?window.sessionStorage:window.localStorage}catch{return null}},qu=(e,t)=>{var i,s;try{return(s=(i=Xr(e))==null?void 0:i.getItem(t))!=null?s:null}catch{return null}},Gr=(e,t,i)=>{var s;try{(s=Xr(e))==null||s.setItem(t,i)}catch{}};function Zu(e){let t={};try{let i=new URL(e).searchParams;for(let s of Br){let n=i.get(s);n&&G_.test(n)&&(t[s]=n)}}catch{}return t}var qr=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""));function Yu(){for(let i of["local","session"]){let s=Xr(i);if(s)try{for(let n of Object.keys(s))(n.startsWith("ph_")||n===Yr)&&s.removeItem(n)}catch{}}let e=location.hostname.split("."),t=e.map((i,s)=>e.slice(s).join(".")).filter(i=>i.includes("."));for(let i of document.cookie.split(";")){let s=i.split("=")[0].trim();if(s.startsWith("ph_")){document.cookie=`${s}=; Max-Age=0; path=/`;for(let n of t)document.cookie=`${s}=; Max-Age=0; path=/; domain=.${n}`}}}function Ju(e={}){if(window.__f10xTracking)return Ds(window.__f10xTracking);let t,i=typeof e.consent=="boolean",s=location.href;if(i&&/_\d+\/?$/.test(location.pathname))return t=Xu("preview"),Ds(t);let n=!1;try{n=window.top!==window.self}catch{n=!0}if(n){let $=qr({...Nr(s),...Zu(s)});return Ur({values:()=>$,checkoutHosts:e.checkoutHosts,addFields:e.addFields!==!1}),t=Xu("frame",()=>$),Ds(t)}let r=Nr(s),o=Zu(s)[z_]||null,a=[],l=!1,c=null,u=null,d=()=>{let $={...r};return l&&($.ph_anon_id=Ae.get_property("$device_id"),$.ph_distinct_id=Ae.get_distinct_id(),$.ph_session_id=Ae.get_session_id(),u&&($.contact_id=u)),qr($)},h=Ur({values:d,checkoutHosts:e.checkoutHosts,addFields:e.addFields!==!1}),p=new Set,v=[],_=($,D)=>{if(!l){i&&w()==="denied"||v.push([$,D]);return}let R=Object.fromEntries(Object.entries($).filter(([N,W])=>W&&!p.has(`${N}:${W}`)));if(Object.keys(R).length){for(let[N,W]of Object.entries(R))p.add(`${N}:${W}`);Ae.capture("contact_captured",{...R,contact_source:D})}},g=ju(s);Gu(_);let y=qr({tracking_version:Zr,page_version:i?e.pageVersion||1:void 0,ab_test:i&&e.test||void 0}),m=$=>$&&($.event!=="$snapshot"&&($.properties={...$.properties,...y,...c?{fingerprint:c}:{}}),Nu($,location.href)),w=()=>{let $=qu("local",zr);return $==="granted"||$==="denied"?$:null},M=!i||e.consent===!1||w()==="granted",P=!1,k=!1,I=$=>{var D;return{...$,compress_events:!1,...((D=e.posthog)==null?void 0:D.session_recording)||{},maskCapturedNetworkRequestFn:R=>({...R,name:ze(R.name,location.href),requestBody:void 0,responseBody:void 0})}};async function S(){if(P||k)return;P=!0;try{let R=await Ru.load({monitoring:!1}),N=await Promise.race([R.get(),new Promise(W=>setTimeout(W,q_))]);c=(N==null?void 0:N.visitorId)||null}catch{c=null}if(P=!1,!M)return;k=!0;let{session_recording:$,...D}=e.posthog||{};Ae.init(e.key,{api_host:e.apiHost||"https://us.i.posthog.com",ui_host:"https://us.posthog.com",...Z_,custom_campaign_params:[...Dr,"utm_id","utm_placement","lp"],...D,before_send:m,loaded:R=>{R.set_config({session_recording:I(R.config.session_recording)}),R.has_opted_out_capturing()&&R.opt_in_capturing({captureEventName:!1});let N=R.get_property("$initial_person_info"),W=document.referrer?ze(document.referrer):"$direct";R.register({$initial_person_info:N&&typeof N=="object"?{...N,r:ze(N.r),u:ze(N.u)}:{r:W,u:ze(location.href)}}),u=o||qu("session",Yr),o&&(Gr("session",Yr,o),R.get_distinct_id()!==o&&R.identify(o)),l=!0,h.refresh({iframes:!0}),_(g,"url");for(let[C,H]of v.splice(0))_(C,H);for(let C of a.splice(0))C(!0)}})}return M?S():(w()==="denied"&&Yu(),h.refresh({iframes:!0})),t={version:Zr,mode:i?"direct":"tag",consent:()=>i&&e.consent?w():null,grant(){Gr("local",zr,"granted"),M=!0,k?l||(Ae.set_config({disable_persistence:!1}),Ae.opt_in_capturing({captureEventName:!1}),l=!0,h.refresh({iframes:!0})):S()},deny(){var $,D;Gr("local",zr,"denied"),M=!1,v=[],k&&(Ae.opt_out_capturing(),(D=($=Ae).stopSessionRecording)==null||D.call($),Ae.set_config({disable_persistence:!0}),Yu(),l=!1,u=null,h.refresh())},onReady($){l?$(!0):a.push($)},fields:d,capture($,D){l&&Ae.capture($,D)},posthog:Ae},Ds(t)}function Ds(e){return window.__f10xTracking=e,window.f10xTracking=e,e}function Xu(e,t=()=>({})){return{version:Zr,mode:e,consent:()=>null,grant(){},deny(){},onReady(){},fields:t,capture(){},posthog:null}}var ai=window.f10xTracking;window.__f10xTracking?window.f10xTracking=window.__f10xTracking:ai&&typeof ai=="object"&&!ai.version&&(typeof ai.key=="string"&&ai.key?Ju(ai):console.warn("[@funnel10x/tracking] window.f10xTracking.key is missing: nothing is tracked."));})();
15
+ \`\`\``),o}}}function x_(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{let e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${wu}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}async function k_(e={}){let{delayFallback:t,debug:i,monitoring:s=!0}=e;s&&x_(),await b_(t);let n=h_({cache:{},debug:i});return w_(n,i)}var Ru={load:k_,hashComponents:Ou,componentsToDebugString:Au};var S_=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_placement"],E_=["fbclid","gclid","gbraid","wbraid","gad_source","gad_campaignid","msclkid","ctwa_clid"],Dr=["ad_id","adset_id","campaign_id","adgroup_id","h_ad_id","fbc_id"],$_=["lp"],P_=[...S_,...E_,...Dr,...$_],Du=new Set(P_),M_=e=>Du.has(String(e).toLowerCase()),Rr=e=>e.split(/[?#]/)[0],T_=/^[a-z][a-z0-9+.-]*:/i;function ze(e,t){if(typeof e!="string"||e==="")return e;let i=T_.test(e),s;try{s=new URL(e,t||void 0)}catch{return Rr(e)}if(s.protocol!=="http:"&&s.protocol!=="https:")return i?e:Rr(e);let n=new URLSearchParams;for(let[r,o]of s.searchParams)M_(r)&&n.append(r,o);return s.search=n.toString(),s.hash="",i||e.startsWith("//")?s.href:e.startsWith("/")?s.pathname+s.search:Rr(e)+s.search}function Nr(e){let t={},i;try{i=new URL(e)}catch{return t}for(let[s,n]of i.searchParams){let r=s.toLowerCase();Du.has(r)&&n!==""&&!(r in t)&&(t[r]=n)}return t}var I_=new Set(["href","attr__href","action","attr__action"]),C_=/((?:attr__)?(?:href|action))="((?:[^"\\]|\\.)*)"/g,Lu={event:8,snapshot:400},F_=/\.(png|jpe?g|gif|webp|avif|svg|ico|bmp|mp4|webm|mov|m4v|mp3|wav|ogg|js|mjs|css|woff2?|ttf|otf|json)$/i;function A_(e,t){try{return F_.test(new URL(e,t).pathname)}catch{return!1}}function O_(e,t,i,s){return t==="$elements_chain"?e.replace(C_,(n,r,o)=>`${r}="${ze(o,i)}"`):I_.has(t)?ze(e,i):s&&(t==="src"||t==="rr_src")?e.startsWith("data:")||A_(e,i)?e:ze(e,i):!s&&/^https?:\/\//i.test(e)?ze(e):e}var R_=/^https?:\/\//i;function Lr(e,t,i,s,n){if(typeof e=="string")return O_(e,t,i,s);if(!e||typeof e!="object"||n>(s?Lu.snapshot:Lu.event))return e;if(Array.isArray(e)){for(let r=0;r<e.length;r++)e[r]=Lr(e[r],t,i,s,n+1);return e}for(let r of Object.keys(e)){let o=Lr(e[r],r,i,s,n+1),a=R_.test(r)?ze(r):r;if(a===r){e[r]=o;continue}delete e[r];let l=e[a];Array.isArray(l)&&Array.isArray(o)?e[a]=l.concat(o):l&&o&&typeof l=="object"&&typeof o=="object"?e[a]={...l,...o}:e[a]=o}return e}function Nu(e,t){if(!e||typeof e!="object")return e;let i=e.event==="$snapshot";for(let s of["properties","$set","$set_once"])e[s]&&typeof e[s]=="object"&&(e[s]=Lr(e[s],s,t,i,0));return e}var L_=/^[^\s@<>()]+@[^\s@<>()]+\.[^\s@<>()]{2,}$/,D_=["email"],N_=["phone","phonenumber","phone_number","tel","telefone"];function jr(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return L_.test(t)&&t.length<=254?t:null}function Vr(e,t){if(typeof e!="string")return null;let i=e.trim().replace(/\s*(ext\.?|x|#)\s*\d+$/i,""),s=i.replace(/\D/g,"");i.startsWith("00")&&(s=s.slice(2));let n=i.startsWith("+")||i.startsWith("00");if(!n&&t){let r=String(t).replace(/\D/g,""),o=["39","378","379"].includes(r);r&&!s.startsWith(r)&&(s=r+(o?s:s.replace(/^0/,"")))}return s.length<7||s.length>15?null:n||t?`+${s}`:s}function ju(e){let t={},i;try{i=new URL(e)}catch{return t}for(let[s,n]of i.searchParams){let r=s.toLowerCase();!t.email&&D_.includes(r)&&(t.email=jr(n)||void 0),!t.phone&&N_.includes(r)&&(t.phone=Vr(n)||void 0)}return Object.fromEntries(Object.entries(t).filter(([,s])=>s))}var Wr=["ph_anon_id","ph_distinct_id","ph_session_id","contact_id"],j_=/\/widget\/(form|survey|booking)\//,Uu=["buy.stripe.com","checkout.stripe.com"],V_="input[type=email], input[type=tel], input[name*=email i], input[name*=phone i]",Br="data-f10x-field";function Vu(e,t,i){if(!e||e.hasAttribute("data-f10x-skip"))return;let s=i&&e.querySelector(V_);for(let[n,r]of Object.entries(t)){let o=e.querySelector(`[name="${CSS.escape(n)}"]`);if(o)o.tagName==="INPUT"&&(o.type==="hidden"||o.value===""||o.hasAttribute(Br))&&(o.value=r);else if(s){let a=document.createElement("input");a.type="hidden",a.name=n,a.value=r,a.setAttribute(Br,""),e.appendChild(a)}}}var Hu=new WeakMap;function H_(e){for(let t of document.querySelectorAll("input[data-q]")){let i=e[t.getAttribute("data-q")];if(i==null)continue;let s=Hu.get(t);s!==i&&(s===void 0&&t.value!==""||(t.value=i,Hu.set(t,i),t.setAttribute(Br,""),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))))}}function Hr(e,t,i){let s;try{s=new URL(e,i)}catch{return null}if(s.protocol!=="http:"&&s.protocol!=="https:")return null;let n=s.href;for(let[r,o]of Object.entries(t))Wr.includes(r)?s.searchParams.set(r,o):s.searchParams.has(r)||s.searchParams.set(r,o);return Uu.includes(s.hostname)&&t.ph_distinct_id&&!s.searchParams.has("client_reference_id")&&s.searchParams.set("client_reference_id",t.ph_distinct_id),s.href===n?null:s.href}var Bu=e=>{try{return new URL(e,location.href).hostname}catch{return""}};function Ur({values:e,checkoutHosts:t,addFields:i}){let s=new Set([...Uu,...t||[]].map(u=>u.toLowerCase())),n=!1,r=0,o=u=>{for(let d of document.querySelectorAll("a[href]")){if(!s.has(Bu(d.getAttribute("href"))))continue;let h=Hr(d.getAttribute("href"),u,location.href);h&&d.setAttribute("href",h)}},a=u=>{for(let d of document.querySelectorAll("iframe[src]")){let h=d.getAttribute("src");if(!j_.test(h))continue;let p=Hr(h,u,location.href);p&&d.setAttribute("src",p)}},l=(u={})=>{u.iframes&&(n=!0);let d=e();for(let h of document.forms)Vu(h,d,i);H_(d),o(d),n&&a(d)},c=()=>{r||(r=setTimeout(()=>{r=0,l()},50))};return new MutationObserver(c).observe(document.documentElement,{childList:!0,subtree:!0}),document.addEventListener("submit",u=>Vu(u.target,e(),i),!0),document.addEventListener("click",u=>{let d=u.target instanceof Element?u.target.closest("a[href]"):null;if(!d||!s.has(Bu(d.getAttribute("href"))))return;let h=Hr(d.getAttribute("href"),e(),location.href);h&&d.setAttribute("href",h)},!0),l(),{refresh:l}}var B_=/e-?mail/i,W_=/phone|telefone|telem[oó]vel|celular|whatsapp|(^|[\s_.-])(tel|mobile)($|[\s_.-])/i,zu=new Set(["hidden","password","checkbox","radio","search","submit","button","file","reset","image"]),Gu=e=>[e.name,e.id,e.getAttribute("data-q"),e.getAttribute("autocomplete")].filter(Boolean).join(" "),qu=e=>e.type==="email"||B_.test(Gu(e)),Zu=e=>e.type==="tel"||e.type!=="email"&&W_.test(Gu(e));function U_(e){let t=e.closest(".iti")||e.closest('.form-builder--item, [class*="phone"]')||e.parentElement,i=t&&t.querySelector('.iti__selected-dial-code, [class*="dial-code"], [class*="dialCode"]'),s=i&&i.textContent;if(s&&/\+?\d{1,4}/.test(s))return s.match(/\d{1,4}/)[0];let n=t&&t.querySelector(".iti__selected-flag, .iti__selected-country"),r=n&&(n.getAttribute("title")||n.getAttribute("aria-label")||"").match(/\+(\d{1,4})/);return r?r[1]:null}function z_(e){if(!(e instanceof HTMLInputElement)||zu.has(e.type))return{};if(qu(e)){let t=jr(e.value);return t?{email:t}:{}}if(Zu(e)){let t=Vr(e.value,U_(e));return t?{phone:t}:{}}return{}}function Wu(e){let t={};for(let i of e){let s=z_(i);s.email&&!t.email&&(t.email=s.email),s.phone&&!t.phone&&(t.phone=s.phone)}return t}function G_(e){let t=e.parentElement;for(let i=0;t&&t!==document.body&&t!==document.documentElement&&i<12;i++,t=t.parentElement)if([...t.querySelectorAll("input")].some(n=>!zu.has(n.type)&&(qu(n)||Zu(n))))return t.querySelectorAll("button[type=submit], input[type=submit]").length===1?t:null;return null}var q_=e=>[...e.querySelectorAll("input, select, textarea")].some(t=>t.willValidate&&!t.checkValidity());function Yu(e){document.addEventListener("submit",t=>{if(!(t.target instanceof HTMLFormElement))return;let i=Wu(t.target.querySelectorAll("input"));(i.email||i.phone)&&e(i,"form")},!0),document.addEventListener("click",t=>{let i=t.target instanceof Element?t.target.closest("button[type=submit], input[type=submit]"):null;if(!i||i.closest("form")||i.getAttribute("type")!=="submit")return;let s=G_(i);if(!s||q_(s))return;let n=Wu(s.querySelectorAll("input"));(n.email||n.phone)&&e(n,"form")},!0)}var Zr="1.2.0",zr="f10x_consent",Yr="f10x_contact_id",Z_="contact_id",Y_=/^[A-Za-z0-9_-]{6,128}$/,X_=1e3,J_={defaults:"2026-08-30",person_profiles:"identified_only",advanced_disable_feature_flags:!0,disable_surveys:!0,disable_conversations:!0,disable_product_tours:!0,disable_web_experiments:!0},Xr=e=>{try{return e==="session"?window.sessionStorage:window.localStorage}catch{return null}},Xu=(e,t)=>{var i,s;try{return(s=(i=Xr(e))==null?void 0:i.getItem(t))!=null?s:null}catch{return null}},Gr=(e,t,i)=>{var s;try{(s=Xr(e))==null||s.setItem(t,i)}catch{}};function Ju(e){let t={};try{let i=new URL(e).searchParams;for(let s of Wr){let n=i.get(s);n&&Y_.test(n)&&(t[s]=n)}}catch{}return t}var qr=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""));function Ku(){for(let i of["local","session"]){let s=Xr(i);if(s)try{for(let n of Object.keys(s))(n.startsWith("ph_")||n===Yr)&&s.removeItem(n)}catch{}}let e=location.hostname.split("."),t=e.map((i,s)=>e.slice(s).join(".")).filter(i=>i.includes("."));for(let i of document.cookie.split(";")){let s=i.split("=")[0].trim();if(s.startsWith("ph_")){document.cookie=`${s}=; Max-Age=0; path=/`;for(let n of t)document.cookie=`${s}=; Max-Age=0; path=/; domain=.${n}`}}}function ed(e={}){if(window.__f10xTracking)return Ds(window.__f10xTracking);let t,i=typeof e.consent=="boolean",s=location.href;if(i&&/_\d+\/?$/.test(location.pathname))return t=Qu("preview"),Ds(t);let n=!1;try{n=window.top!==window.self}catch{n=!0}if(n){let $=qr({...Nr(s),...Ju(s)});return Ur({values:()=>$,checkoutHosts:e.checkoutHosts,addFields:e.addFields!==!1}),t=Qu("frame",()=>$),Ds(t)}let r=Nr(s),o=Ju(s)[Z_]||null,a=[],l=!1,c=null,u=null,d=()=>{let $={...r};return l&&($.ph_anon_id=Ae.get_property("$device_id"),$.ph_distinct_id=Ae.get_distinct_id(),$.ph_session_id=Ae.get_session_id(),u&&($.contact_id=u)),qr($)},h=Ur({values:d,checkoutHosts:e.checkoutHosts,addFields:e.addFields!==!1}),p=new Set,v=[],_=($,D)=>{if(!l){i&&w()==="denied"||v.push([$,D]);return}let R=Object.fromEntries(Object.entries($).filter(([N,B])=>B&&!p.has(`${N}:${B}`)));if(Object.keys(R).length){for(let[N,B]of Object.entries(R))p.add(`${N}:${B}`);Ae.capture("contact_captured",{...R,contact_source:D})}},g=ju(s);Yu(_);let y=qr({tracking_version:Zr,page_version:i?e.pageVersion||1:void 0,ab_test:i&&e.test||void 0}),m=$=>$&&($.event!=="$snapshot"&&($.properties={...$.properties,...y,...c?{fingerprint:c}:{}}),Nu($,location.href)),w=()=>{let $=Xu("local",zr);return $==="granted"||$==="denied"?$:null},M=!i||e.consent===!1||w()==="granted",P=!1,k=!1,I=$=>{var D;return{...$,compress_events:!1,...((D=e.posthog)==null?void 0:D.session_recording)||{},maskCapturedNetworkRequestFn:R=>({...R,name:ze(R.name,location.href),requestBody:void 0,responseBody:void 0})}};async function S(){if(P||k)return;P=!0;try{let R=await Ru.load({monitoring:!1}),N=await Promise.race([R.get(),new Promise(B=>setTimeout(B,X_))]);c=(N==null?void 0:N.visitorId)||null}catch{c=null}if(P=!1,!M)return;k=!0;let{session_recording:$,...D}=e.posthog||{};Ae.init(e.key,{api_host:e.apiHost||"https://us.i.posthog.com",ui_host:"https://us.posthog.com",...J_,custom_campaign_params:[...Dr,"utm_id","utm_placement","lp"],...D,before_send:m,loaded:R=>{R.set_config({session_recording:I(R.config.session_recording)}),R.has_opted_out_capturing()&&R.opt_in_capturing({captureEventName:!1});let N=R.get_property("$initial_person_info"),B=document.referrer?ze(document.referrer):"$direct";R.register({$initial_person_info:N&&typeof N=="object"?{...N,r:ze(N.r),u:ze(N.u)}:{r:B,u:ze(location.href)}}),u=o||Xu("session",Yr),o&&(Gr("session",Yr,o),R.get_distinct_id()!==o&&R.identify(o)),l=!0,h.refresh({iframes:!0}),_(g,"url");for(let[C,H]of v.splice(0))_(C,H);for(let C of a.splice(0))C(!0)}})}return M?S():(w()==="denied"&&Ku(),h.refresh({iframes:!0})),t={version:Zr,mode:i?"direct":"tag",consent:()=>i&&e.consent?w():null,grant(){Gr("local",zr,"granted"),M=!0,k?l||(Ae.set_config({disable_persistence:!1}),Ae.opt_in_capturing({captureEventName:!1}),l=!0,h.refresh({iframes:!0})):S()},deny(){var $,D;Gr("local",zr,"denied"),M=!1,v=[],k&&(Ae.opt_out_capturing(),(D=($=Ae).stopSessionRecording)==null||D.call($),Ae.set_config({disable_persistence:!0}),Ku(),l=!1,u=null,h.refresh())},onReady($){l?$(!0):a.push($)},fields:d,capture($,D){l&&Ae.capture($,D)},posthog:Ae},Ds(t)}function Ds(e){return window.__f10xTracking=e,window.f10xTracking=e,e}function Qu(e,t=()=>({})){return{version:Zr,mode:e,consent:()=>null,grant(){},deny(){},onReady(){},fields:t,capture(){},posthog:null}}var ai=window.f10xTracking;window.__f10xTracking?window.f10xTracking=window.__f10xTracking:ai&&typeof ai=="object"&&!ai.version&&(typeof ai.key=="string"&&ai.key?ed(ai):console.warn("[@funnel10x/tracking] window.f10xTracking.key is missing: nothing is tracked."));})();