PageSourceSearch

https://www.getroamify.com/_next/static/chunks/05x-nq..t2i18.js

js getroamify.com collected 2026-09-24 20:28:07 UTC 287,611 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,720565,669430,e=>{"use strict";var t,i,s,r,n,a,o,l,u,h=["retriesPerformedSoFar"],c=["$set_once","$set"];function d(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}function p(){return(p=Object.assign.bind()).apply(null,arguments)}function v(e,t,i,s,r,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(s,r)}function f(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){v(n,s,r,a,o,"next",e)}function o(e){v(n,s,r,a,o,"throw",e)}a(void 0)})}}var g="u">typeof window?window:void 0,_="u">typeof globalThis?globalThis:g,m=null==_?void 0:_.navigator,y=null==_?void 0:_.document,b=null==_?void 0:_.location,w=null==_?void 0:_.fetch,x=null!=_&&_.XMLHttpRequest&&"withCredentials"in new _.XMLHttpRequest?_.XMLHttpRequest:void 0,k=null==_?void 0:_.AbortController,E=null==_?void 0:_.CompressionStream,S=null==m?void 0:m.userAgent;function P(){return!(!g||!1===g.navigator.onLine)}var F="u">typeof globalThis?globalThis:g;F&&"u"<typeof self&&(F.self=F),F&&"u"<typeof File&&(F.File=function(){});var $=null!=g?g:{},I="0.8.2",C={DEBUG:!1,LIB_VERSION:I,LIB_NAME:"browser-common",JS_SDK_VERSION:I},A=["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"],T=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return A.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function O(e,t){return -1!==e.indexOf(t)}var M=function(e){return e.trim()},R=function(e){return e.replace(/^\$/,"")};function L(e){var t,i=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))?t:"null"}var D=((tl={}).AnonymousId="anonymous_id",tl.DistinctId="distinct_id",tl.Props="props",tl.EnablePersonProcessing="enable_person_processing",tl.PersonMode="person_mode",tl.FeatureFlagDetails="feature_flag_details",tl.FeatureFlags="feature_flags",tl.FeatureFlagPayloads="feature_flag_payloads",tl.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",tl.BootstrapFeatureFlags="bootstrap_feature_flags",tl.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",tl.OverrideFeatureFlags="override_feature_flags",tl.Queue="queue",tl.AiQueue="ai_queue",tl.AiCaptureQueue="ai_capture_queue",tl.LogsQueue="logs_queue",tl.OptedOut="opted_out",tl.SessionId="session_id",tl.SessionStartTimestamp="session_start_timestamp",tl.SessionLastTimestamp="session_timestamp",tl.PersonProperties="person_properties",tl.GroupProperties="group_properties",tl.InstalledAppBuild="installed_app_build",tl.InstalledAppVersion="installed_app_version",tl.SessionReplay="session_replay",tl.PushRegistered="push_registered",tl.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",tl.SurveyLastSeenDate="survey_last_seen_date",tl.SurveysSeen="surveys_seen",tl.Surveys="surveys",tl.RemoteConfig="remote_config",tl.FlagsEndpointWasHit="flags_endpoint_was_hit",tl.DeviceId="device_id",tl),j=((tu={}).GZipJS="gzip-js",tu.Base64="base64",tu),N=["$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"],B=["token"],H=Object.prototype,q=H.hasOwnProperty,z=H.toString,W=Array.isArray||function(e){return"[object Array]"===z.call(e)},V=e=>"function"==typeof e,U=e=>e===Object(e)&&!W(e),G=e=>{if(U(e)){for(var t in e)if(q.call(e,t))return!1;return!0}return!1},J=e=>void 0===e,K=e=>"[object String]"==z.call(e),Y=e=>K(e)&&0===e.trim().length,Z=e=>null===e,X=e=>
1J(e)||Z(e),Q=e=>"[object Number]"==z.call(e)&&e==e,ee=e=>Q(e)&&e>0,et=e=>"[object Boolean]"===z.call(e),ei=e=>O(N,e),es=e=>O(B,e);function er(e){return null===e||"object"!=typeof e}function en(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ea(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 el(e,Error)}}function eo(e){return"u">typeof Event&&el(e,Event)}function el(e,t){try{return e instanceof t}catch(e){return!1}}var eu=[!0,"true",1,"1","yes"],eh=[!1,"false",0,"0","no"];function ec(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),Q(e)?e>i?(s.warn(" cannot be  greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),ec(null!=r?r:i,t,i,s))}var ed=class{constructor(e){this.C={},this.I=e.I,this.R=ec(e.bucketSize,0,100,e.A),this.O=ec(e.refillRate,0,this.R,e.A),this.F=ec(e.refillInterval,0,864e5,e.A)}N(e,t){var i=Math.floor((t-e.lastAccess)/this.F);i>0&&(e.tokens=Math.min(e.tokens+i*this.O,this.R),e.lastAccess=e.lastAccess+i*this.F)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.C[s];return r?this.N(r,i):this.C[s]=r={tokens:this.R,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.I)||t.call(this,e)),0===r.tokens)}stop(){this.C={}}},ep="Mobile",ev="Android",ef="Tablet",eg="Android Tablet",e_="iPad",em="Apple Watch",ey="Safari",eb="BlackBerry",ew="Samsung Internet",ex="Chrome",ek="Chrome iOS",eE="Internet Explorer",eS="Internet Explorer Mobile",eP="Opera",eF="Microsoft Edge",e$="Firefox",eI="Firefox iOS",eC="Nintendo",eA="PlayStation",eT="Xbox",eO="Android Mobile",eM="Mobile Safari",eR="Windows",eL="Windows Phone",eD="Nokia",ej="Ouya",eN="Generic "+ep.toLowerCase(),eB="Generic "+ef.toLowerCase(),eH="Konqueror",eq="Oculus Browser",ez="Vivaldi",eW="Yandex",eV="Whale",eU="DuckDuckGo",eG="Pale Moon",eJ="Waterfox",eK="Brave",eY="Claude",eZ="Codex",eX="ChatGPT",eQ="Google Search App",e0=RegExp("Version/(\\d+(\\.\\d+)?)"),e1=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),e2=RegExp(eT,"i"),e3=RegExp("PlayStation \\w+","i"),e5=RegExp("Nintendo \\w+","i"),e6=RegExp("BlackBerry|PlayBook|BB10","i"),e4={"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"},e8=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?eK:null)||(null!=s&&s.detectGoogleSearchApp&&O(e,"GSA/")?eQ:O(e," OPR/")&&O(e,"Mini")?"Opera Mini":O(e," OPR/")?eP:e6.test(e)?eb:O(e,"IEMobile")||O(e,"WPDesktop")?eS:O(e,"OculusBrowser")?eq:O(e,"SamsungBrowser")?ew:O(e,"Edge")||O(e,"Edg/")?eF:O(e,"Vivaldi/")?ez:O(e,"YaBrowser/")?eW:O(e,"Whale/")?eV:O(e,"DuckDuckGo/")||O(e,"Ddg/")?eU:O(e,"Claude/")?eY:O(e,"Codex/")?eZ:O(e,"ChatGPT/")?eX:O(e,"FBIOS")?"Facebook Mobile":O(e,"UCWEB")||O(e,"UCBrowser")?"UC Browser":O(e,"CriOS")?ek:O(e,"CrMo")||O(e,ex)?ex:O(e,ev)&&O(e,ey)?eO:O(e,"FxiOS")?eI:O(e.toLowerCase(),eH.toLowerCase())?eH:O(e,"Brave/")?eK:(r=t)&&O(r,"Apple")||O(e,ey)&&!O(e,ex)&&!O(e,ev)?O(e,ep)?eM:ey:O(e,"PaleMoon/")?eG:O(e,"Waterfox/")?eJ:O(e,e$)?e$:O(e,"MSIE")||O(e,"Trident/")?eE:O(e,"Gecko")?e$:"")},e9={[eS]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[eF]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ex]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ek]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ey]:[e0],[eM]:[e0],[eP]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[e$]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[eI]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[eH]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[eb]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),e0],[eO]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ew]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[eq]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[ez]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[eW]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[eV]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[eK]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[eY]:[e1],[eZ]:[e1],[eX]:[e1],[eU]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[eG]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[eJ]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[eQ]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[eE]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},e7=function(e,t,i,s){var r=e9[e8(e,t,i,s)];if(J(r))return null;for(var n=0;r.length>n;n++){var a=e.match(r[n]);if(a)return parseFloat(a[a.length-2])}return null},te=[[RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[eT,e&&e[1]||""]],[RegExp(eC,"i"),[eC,""]],[RegExp(eA,"i"),[eA,""]],[e6,[eb,""]],[RegExp(eR,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eL,""];if(new RegExp(ep).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=e4[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eR,s]}return[eR,""]}],[/((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=>{var t="";return e&&e.length>=3&&(t=J(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[ev,[e[2],e[3],e[4]||"0"].join(".")]:[ev,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],tt=function(e){for(var t=0;te.length>t;t++){var i=te[t],s=i[1],r=i[0].exec(e),n=r&&(V(s)?s(r,e):s);if(n)return n}return["",""]},ti=function(e){return e5.test(e)?eC:e3.test(e)?eA:e2.test(e)?eT:RegExp(ej,"i").test(e)?ej:RegExp("(Windows Phone|WPDesktop)","i").test(e)?eL:/iPad/.test(e)?e_:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?em:e6.test(e)?eb:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eD,"i").test(e)?eD:/(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(ep).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)?ev:eg:RegExp("(pda|Mobile)","i").test(e)?eN:RegExp(ef,"i").test(e)&&!RegExp("Tablet pc","i").test(e)?eB:""},ts=/\bFBAV\/(\d+(?:\.\d+)*)/i,tr=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",ts],[/\bFBAN\/EMA\b/i,"Facebook Lite",ts],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",ts],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?
1:\/(\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"]],tn="[Truncated]",ta="[Unserializable]";function to(e){for(var t="",i=0;e.length>i;i++){var s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"�";else{var r=e.charCodeAt(i+1);56320>r||r>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}var tl,tu,th,tc,td,tp=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tv(e,t){return"string"==typeof e&&tp.test(e)?e:t()}function tf(e,t){var i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function tg(e){return e?e.split("#")[0]:e}function t_(e,t){var i=setTimeout(e,t);return null!=i&&i.unref&&(null==i||i.unref()),i}function tm(e,t,i){return ty.apply(this,arguments)}function ty(){return(ty=f(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=t_(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var tb=class{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return f(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&W(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:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),p({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return f(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(s=t.handled)||s,synthetic:null!=(r=e.synthetic)&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,p({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return td&&i.length===tc?td:(tc=i.length,td=i.reduce((i,s)=>{th||(th={});var r=th[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o,l=null==(o=n[a])?void 0:o.filename,u=t[s];if(l&&u){i[l]=u,th[s]=[l,u];break}}return i},{}))}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(4>=s){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return p({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}};function tw(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!!t&&!t.startsWith("webkit-masked-url://")&&"<anonymous>"!==t};return J(s)||(n.lineno=s),J(r)||(n.colno=r),n}var tx=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]}
1,tk=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tE=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tS=/\((\S*)(?::(\d+))(?::(\d+))\)/,tP=(e,t)=>{var i=tk.exec(e);if(i)return tw(t,i[1],"?",+i[2],+i[3]);var s=tE.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var r=tS.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=tx(s[1]||"?",s[2]);return tw(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tF=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,t$=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tI=(e,t)=>{var i=tF.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=t$.exec(i[3]);s&&(i[1]=i[1]||"eval",i[3]=s[1],i[4]=s[2],i[5]="")}var r=i[3],n=i[1]||"?",a=tx(n,r);return tw(t,r=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tC=/\(error: (.*)\)/,tA=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=K(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){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return en(e,"DOMException")}isDOMError(e){return en(e,"DOMError")}},tT=class{match(e){return ea(e)}coerce(e,t){var i,s=this.getStack(e);return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=s?s:null==(i=t.syntheticException)?void 0:i.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:void 0===s}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}},tO=class{match(e){return!!en(e,"ErrorEvent")&&(null!=e.error||this.Ki(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,s=t.apply(e.message);return p({},s,{stack:null!=(i=this.Xi(e))?i:s.stack,synthetic:!0})}Ki(e){return K(e.message)&&e.message.length>0}Xi(e){var t,i,s=null!=(t=e.lineno)?t:0,r=null!=(i=e.colno)?i:0;if(K(e.filename)&&0!==e.filename.length&&0!==s)return"Error\n    at "+e.filename+":"+s+":"+r}},tM=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,tR=class{match(e){return"string"==typeof e}coerce(e,t){var i,s=this.getInfos(e),r=s[0],n=s[1];return{type:null!=r?r:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(tM);return s&&(t=s[1],i=s[2]),[t,i]}},tL=["fatal","error","warning","log","info","debug"];function tD(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}var tj=class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!=(i=this.getStack(e))?i:null==(s=t.syntheticException)?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(eo(e))return e.constructor.name;var t="name"in e?e.name:void 0;return K(t)&&!Y(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tD(e)}isSeverityLevel(e){return K(e)&&!Y(e)&&tL.indexOf(e)>=0}getStack(e){try{return K(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:K(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(ea(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},tN=class{match(e){return eo(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tD(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}},tB=class{match(e){return er(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}},tH=class{match(e){return en(e,"PromiseRejectionEvent")||this.isCu
1stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!eo(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return er(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}},tq="$message",tz="$timestamp",tW=new Set([tq,tz]),tV={enabled:!0,max_bytes:32768};function tU(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tV.enabled,max_bytes:function(e,t){if(!Q(e)||1/0===e||-1/0===e)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tV.max_bytes)}:p({},tV)}var tG=class{constructor(e){this.$n=[],this.Bn=0,this._n=tU(e)}setConfig(e){this._n=tU(e),this.Hn()}add(e){var t=function(e){var t;try{t=L(e)}catch(e){return}try{var i=JSON.parse(t);if(!U(i))return;var s=i[tq],r=i[tz];if(!K(s)||0===s.trim().length||!K(r)&&!Q(r))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,s=0;t.length>s;s++)"%"===t[s]?(i+=1,s+=2):i+=1;return i}(t.json);i>this._n.max_bytes||(this.$n.push({step:t.step,bytes:i}),this.Bn+=i,this.Hn())}}getAttachable(){return this.$n.map(e=>e.step)}clear(){this.$n=[],this.Bn=0}size(){return this.$n.length}Hn(){for(;this.Bn>this._n.max_bytes&&this.$n.length>0;){var e=this.$n.shift();e&&(this.Bn-=e.bytes)}}},tJ=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function tK(e){return"string"==typeof e||e}function tY(e){return"string"==typeof e?e:void 0}var tZ,tX,tQ=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],t0="NativeGzipValidationError",t1=e=>e.length>=2&&31===e[0]&&139===e[1],t2=(e,t)=>e===j.GZipJS||t===j.GZipJS||"gzip"===t,t3=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),t5=e=>{throw tf(t0,"Native gzip produced invalid output: "+e)},t6=(tZ=f(function*(e,t){18>e.size&&t5("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));t1(i)&&8===i[2]||t5("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(tX)return tX;tX=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;tX[e]=t>>>0}return tX})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&t5("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&t5("invalid-size")}),function(e,t){return tZ.apply(this,arguments)});function t4(){return(t4=f(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(r).then(()=>a.close()).catch((s=f(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield t6(u,r),u}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var t8={}.propertyIsEnumerable;function t9(e,t){try{return t7(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function t7(e,t,i,s){var r=[];for(var n in e)if(t8.call(e,n)){if(!n){null==t||t.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>
1=i.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=e[n];if(Z(a)||J(a))continue;r.push({key:to(n),value:function e(t,i,s,r){if(0>=s.remainingNodes)return{stringValue:tn};if(s.remainingNodes--,et(t))return{boolValue:t};if("bigint"==typeof t){var n,a;return n=t.toString(),t>=(a=BigInt("9223372036854775808"))||-a>t?(null==i||i.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};var o=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==i||i.debug("Attribute "+o+" is outside the int64 range; encoding it as a string"),{stringValue:o}):{intValue:o}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:to(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(s.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:tn};if(t instanceof Date){var l=Number.isFinite(t.getTime())?t.toISOString():String(t);return{stringValue:"string"==typeof l?to(l):String(l)}}s.ancestors.add(t);try{try{var u=t.toJSON;if("function"==typeof u)return e(u.call(t),i,s,r+1)}catch(e){}return W(t)?{arrayValue:{values:function(t,i,s,r){for(var n=[],a=Math.min(t.length,1e3),o=0;a>o&&s.remainingNodes>0;o++)try{var l=o in t?t[o]:void 0;if(X(l))continue;n.push(e(l,i,s,r))}catch(e){n.push({stringValue:ta})}return t.length>o&&n.push({stringValue:tn}),n}(t,i,s,r+1)}}:{kvlistValue:{values:t7(t,i,s,r+1)}}}finally{s.ancestors.delete(t)}}return{stringValue:to(String(t))}}(a,t,i,s)})}catch(e){r.push({key:to(n),value:{stringValue:ta}})}}return r}function ie(e,t,i){return p({},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 it={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"},ii={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}},is=ii.info;function ir(e,t,i,s){return{resourceLogs:[{resource:{attributes:t9(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}var ia=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this._n=t,this.A=i,this.zn=s,this.Un=r,this.Wn=n,this.Vn=a,this.Gn=null,this.Zn=0,this.Jn=0,this.Qn=0,this.Kn=0,this.Xn=0,this.Yn=!1,this.ts=t.maxBufferSize,this.es=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.rs=t.flushIntervalMs,this.ns=t.maxBatchRecordsPerPost,this.ss=t.rateCapWindowMs,this.ls=t.maxLogsPerInterval}clearQueue(){this.Jn++,this._instance.setPersistedProperty(D.LogsQueue,[])}reset(){this.us(),this.Kn=0,this.Xn=0,this.Yn=!1,this.Qn=0,this.ns=this._n.maxBatchRecordsPerPost}onReconnect(){this.Qn=0,this.hs()}captureLog(e,t){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var s=this.ds(e);if(null!==s)if(s.body){if(this.vs()){var r={record:function(e,t,i,s){var r,n=ii[e.level||"info"]||is,a=n.text,o=n.number,l=(void 0===(r=Q(s)?s:void 0)&&(r=Date.now()),String(r)+"000000"),u={};t.distinctId&&(u.posthogDistinctId=t.distinctId),t.sessionId&&(u.sessionId=t.sessionId),t.windowId&&(u["window.id"]=t.windowId),X(t.sessionStartTimestamp)||(u.sessionStartTimestamp=String(t.sessionStartTimestamp)),X(t.lastActivityTimestamp)||(u.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(u["url.full"]=t.currentUrl),t.screenName&&(u["screen.name"]=t.screenName),t.appState&&(u["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(u.feature_flags=t.activeFeatureFlags);var h=p({},u),c=e.attributes;if(c){var d=[];try{d=Object.keys(c)}catch(e){d=[]}for(var v of d){var f=void 0;try{f=c[v]}catch(e){f=ta}Object.defineProperty(h,v,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:function(e){try{return to(String(e))}catch(e){return ta}}(e.body)},attributes:t9(h,i)};return e.trace_id&&(g.traceId=e.trace_id),e.span_id&&(g.spanId=e.span_id),J(e.trace_flags)||(g.flags=e.trace_flags),g}(s,null!=(i=null==t?void 0:t.context)?i:this.zn(),this.A,null==t?void 0:t.occurredAtMs)};this.Un(()=>this.cs(r))}}else this.A.info("Log was rejected in beforeSend function")}}ds(e){var t=this._n.beforeSend;if(!t)return e;var i=W(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.A.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.A.error("Error in beforeSend function for log:",e),null}return s}vs(){if(void 0===this.ls)return!0;var e=Date.now(),t=e-this.Kn;return this.ss>t&&t>=0||(this.Kn=e,this.Xn=0,this.Yn=!1),this.ls>this.Xn?(this.Xn++,!0):(this.Yn||(this.A.warn("captureLog dropping logs: exceeded "+this.ls+" logs per "+this.ss+"ms"),this.Yn=!0),!1)}flush(){var e=this;return f(function*(){if(!e._instance.isDisabled)return e.Gn||(e.Gn=e.fs().finally(()=>{e.Gn=null})),e.Gn})()}fs(){var e=this;return f(function*(){e.us();var t=null!=(r=e._instance.getPersistedProperty(D.LogsQueue))?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){var r,n,a,o=e.Jn;e.Zn=0;var l=Math.min(t.length,e.ns),u=t.slice(0,l),h=ir(u.map(e=>e.record),e.ps(),null!=(n=e.Vn)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.gs(h);if(e.Jn!==o)return;if("too-large"===c.kind&&u.length>1)e.ns=Math.max(1,Math.floor(u.length/2)),e.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+e.ns);else if("retry-later"===c.kind||("too-large"===c.kind?e.A.warn("Dropping a single log record after 413 with batch size 1 — the record 
1is larger than the server cap and cannot be split further."):"ok"===c.kind&&e._n.maxBatchRecordsPerPost>e.ns&&(e.ns=Math.min(e._n.maxBatchRecordsPerPost,e.ns+1)),yield e.ys(u.length),t=null!=(a=e._instance.getPersistedProperty(D.LogsQueue))?a:[],s+=u.length,"fatal"===c.kind))throw c.error}})()}ys(e){var t=this;return f(function*(){var i,s=Math.max(0,e-t.Zn),r=null!=(i=t._instance.getPersistedProperty(D.LogsQueue))?i:[];t._instance.setPersistedProperty(D.LogsQueue,r.slice(s)),yield t.Wn()})()}ps(){var e;return e=this._n,ie(e,this._instance.getLibraryId(),this._instance.getLibraryVersion())}cs(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(D.LogsQueue))?t:[];this.es>i.length||(i.shift(),this.Zn++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(D.LogsQueue,i),this.ts>i.length?this.bs():this.hs()}}bs(e){void 0===e&&(e=this.rs),this._s||(this._s=t_(()=>{this._s=void 0,this.hs()},e))}ws(){var e=Math.min(Math.max(0,this.Qn-1),6);return this.rs*Math.pow(2,e)}ks(){var e=this._instance.getPersistedProperty(D.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return f(function*(){t.us();var i=t.flush().catch(()=>{});void 0!==e?yield tm(i,e):yield i})()}flushWithTimeout(e){var t=this;return f(function*(){var i=t.flush();yield tm(i,e,()=>{i.catch(()=>{})})})()}hs(){this.flush().then(()=>{this.Qn=0},e=>{this.Qn++,this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.ks()&&this.bs(this.ws())})}us(){this._s&&(clearTimeout(this._s),this._s=void 0)}},io=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function il(e){return String(e)+"000000"}function iu(e,t,i,s){var r="";return s&&(r=Object.keys(s).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(s[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+r}var ih=class{constructor(e,t,i){this._instance=e,this._n=t,this.A=i,this.Ss=new Map,this.Gn=null,this.xs=!1,this.Cs=new Map,this.Ts=new Set,this.Ms=0}count(e,t,i){void 0===t&&(t=1),this.Is({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.Is({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.Is({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this,i=this.Gn,s=(e=f(function*(){i&&(yield i.catch(()=>{})),yield t.Es()}),function(){return e.apply(this,arguments)})().finally(()=>{this.Gn===s&&(this.Gn=null)});return this.Gn=s,s}drainWindow(){if(0===this.Ss.size)return null;var e=this.Ss;return this.Ss=new Map,this.xs=!1,this.Cs=new Map,this.Ts=new Set,this.Rs(e)}reset(){this.Ms++,this.us(),this.Ss=new Map,this.Gn=null,this.xs=!1,this.Cs=new Map,this.Ts=new Set}Is(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.ds(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.A.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?p({},t.attributes):void 0,s=iu(t.type,t.name,t.unit,i)}catch(e){return void this.A.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,s,r=this.Ss.get(s);if(!r){if(!this.As())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Ss.set(s,r)}var n=this.Cs.get(t.name);void 0===n?this.Cs.set(t.name,t.type):n===t.type||this.Ts.has(t.name)||(this.Ts.add(t.name),this.A.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Ps(r,t.value),this.bs()}else this.A.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}As(){return this._n.maxSeriesPerFlush>this.Ss.size||(this.xs||(this.xs=!0,this.A.warn("Metric series cap reached ("+this._n.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ps(e,t){var i;switch(e.type){case"count":e.total=(null!=(i=e.total)?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:Array(io.length+1).fill(0)});var 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(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,io)]+=1}}ds(e){var t=this._n.beforeSend;if(!t)return e;var i=W(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.A.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.A.error("Error in beforeSend function for metric:",e),null}return s}bs(){this._s||(this._s=t_(()=>{this._s=void 0,this.flush().catch(e=>{this.A.error("Metrics flush failed:",e)})},this._n.flushIntervalMs))}us(){this._s&&(clearTimeout(this._s),this._s=void 0)}Es(){var e=this;return f(function*(){if(0!==e.Ss.size){var t=e.Ss;e.Ss=new Map,e.xs=!1,e.Cs=new Map,e.Ts=new Set;var i=e.Ms,s=yield e._instance.Fs(e.Rs(t));if(i===e.Ms)switch(s.kind){case"ok":return;case"retry-later":return e.Os(t),void e.bs();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)}}})()}Rs(e){var t,i,s,r;return t=this.$s(e),i=ie(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:t9(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}$s(e){var t=il(Date.now()),i=new Map;for(var s of e.values()){var r,n=iu(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=p({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,a));var o=t9(null!=(r=s.attributes)?r:{},this.A),l=il(s.windowStartMs);if("count"===s.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(u=s.total)?u:0};a.sum.dataPoints.push(h)}else if("gauge"===s.type){var c,d={attributes:o,timeUnixNano:t,asDouble:null!=(c=s.last)?c:0};a.gauge.dataPoints.push(d)}else s.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:io})}return Array.from(i.values())}Os(e){var t,i;for(var s of e){var r=s[0],n=s[1],a=this.Ss.get(r);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,n.windowStartMs),a.type){case"count":a.total=(null!=(t=a.total)?t:0)+(null!=(i=n.total)?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(a.hist){a.hist.count+=n.hist.count,a.hist.sum+=n.hist.sum,a.hist.min=Math.min(a.hist.min,n.hist.min),a.hist.max=Math.max(a.hist.max,n.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else a.hist=n.hist}else this.As()&&this.Ss.set(r,n)}}},ic=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={q(t){for(var s=arguments.length,r=Array(s>1?s-1:0),n=1;s>n;n++)r[n-1]=arguments[n];g&&(C.DEBUG||g.POSTHOG_DEBUG||i)&&!J(g.console)&&g.console&&("__rrweb_original__"in g.console[t]?g.console[t].__rrweb_original__:g.console[t])(e,...r)},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("error",...t)},critical(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>ic(e+" "+t,i)};return s},id=ic("[PostHog.js]"),ip=id.createLogger,iv=ip("[ExternalScriptsLoader]"),ig=e=>{var t=null==y?void 0:y.querySelectorAll("script");
1if(t){for(var i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},i_=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return iv.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=ig(t);if(s){if(s.__posthog_loading_callback_fired)return i();var r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)}),void s.addEventListener("error",e=>{s.__posthog_loading_error=e,i(e)}))}var n=()=>{if(!y)return i("document not found");if(ig(t))return i_(e,t,i);var s=y.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>{s.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)y.head.appendChild(s);else{var r,n=y.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):y.body.appendChild(s)}};null!=y&&y.body?n():null==y||y.addEventListener("DOMContentLoaded",n)},im={},iy=(e,t)=>{var i="/static/"+t+".js?v="+e.version;return"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),e.requestRouter.endpointFor("assets",i)};$.__PosthogExtensions__=$.__PosthogExtensions__||{},$.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s=e.config.strict_script_versioning;if(s){var r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=im[r];if("fallback"===s&&n){if(ig(n))return void i_(e,n,i);delete im[r]}i_(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var a,o=iy(e,t);im[r]=o;var l=ig(r);null==l||null==(a=l.parentNode)||a.removeChild(l),i_(e,o,i)}else i(void 0,n)}:i)}else i_(e,iy(e,t),i)}else i_(e,e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js"),i)},$.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{i_(e,e.requestRouter.endpointFor("api",t),i)},C.DEBUG=!1,C.LIB_VERSION="1.428.3",C.LIB_NAME="web";var ib="distinct_id",iw="$device_id",ix="$device_model",ik="__alias",iE="$fbc",iS="$fbc_persistence",iP="__timers",iF="$autocapture_disabled_server_side",i$="$heatmaps_enabled_server_side",iI="$exception_capture_enabled_server_side",iC="$error_tracking_suppression_rules",iA="$error_tracking_capture_extension_exceptions",iT="$web_vitals_enabled_server_side",iO="$dead_clicks_enabled_server_side",iM="$product_tours_enabled_server_side",iR="$logs_capture_enabled_server_side",iL="$web_vitals_allowed_metrics",iD="$session_recording_remote_config",ij="$replay_sample_rate",iN="$replay_override_sampling",iB="$replay_override_linked_flag",iH="$replay_override_url_trigger",iq="$replay_override_event_trigger",iz="$sesid",iW="$session_is_sampled",iV="$enabled_feature_flags",iU="$active_feature_flags",iG="$early_access_features",iJ="$feature_flag_details",iK="$feature_flag_payloads",iY="$feature_flag_request_id",iZ="$minimal_flag_called_events",iX="$override_feature_flags",iQ="$override_feature_flag_payloads",i0="$stored_person_properties",i1="$stored_group_properties",i2="$groups",i3="$surveys",i5="$surveys_loaded_at",i6="$surveys_activated",i4="$surveys_activated_session",i8="$surveys_activated_timestamps",i9="ph_product_tours",i7="$flag_call_reported",se="$flag_call_reported_session_id",st="$feature_flag_errors",si="$feature_flag_evaluated_at",ss="$user_state",sr="$client_session_props",sn="$capture_rate_limit",sa="$initial_campaign_params",so="$initial_referrer_info",sl="$initial_person_info",su="$epp",sh="$posthog_cookieless",sc="$cookieless_mode",sd="$sdk_debug_extensions_init_method",sp="$sdk_debug_extensions_init_time_ms",sv="$sdk_debug_recording_script_not_loaded",sf="PostHog loadExternalDependency extension not found.",sg="anonymous",s_="identified",sm="identified_only",sy="visibilitychange",sb="beforeunload",sw="$pageview",sx="$pageleave",sk="$identify",sE="$groupidentify";function sS(e,t){W(e)&&e.forEach(t)}function sP(e,t){if(!X(e))if(W(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)q.call(e,i)&&t(e[i],i)}var sF=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e};function s$(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var sI=function(e){try{return e()}catch(e){return}},sC=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){id.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),id.critical(e)}}},sA=function(e){var t={};return sP(e,function(e,i){(K(e)&&e.length>0||Q(e))&&(t[i]=e)}),t};function sT(e){var t=p({},e);for(var i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch(e){}return t}var sO=["herokuapp.com","vercel.app","netlify.app"];function sM(e,t,i,s){var r=null!=s?s:{},n=r.capture,a=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===a||a})}function sR(e){return"ph_toolbar_internal"===e.name}var sL=e=>{if(y){try{for(var t=e+"=",i=y.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Q(e)&&isFinite(e)&&Math.floor(e)===e});var sD=class e{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(t,i,s,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(r)||0>t||0>i||0>s||0>r||t>0xffffffffffff||i>4095||s>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/0x10000000000,n[1]=t/0x100000000,n[2]=t/0x1000000,n[3]=t/65536,n[4]=t/256,n[5]=t,n[6]=112|i>>>8,n[7]=i,n[8]=128|s>>>24,n[9]=s>
vendor: 5,694 bytes, line 1
1>>16,n[10]=s>>>8,n[11]=s,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new e(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}},sj=class{generate(){var e=this.generateOrAbort();if(!J(e))return e;this.ri=0;var t=this.generateOrAbort();if(J(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e,t=Q(e=Date.now())&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0;if(t>this.ri)this.ri=t,this.ii();else{if(this.ri>=t+1e4)return;this.ni++,this.ni>0x3ffffffffff&&(this.ri++,this.ii())}return sD.fromFieldsV7(this.ri,Math.trunc(this.ni/0x40000000),0x3fffffff&this.ni,this.oi.nextUint32())}ii(){this.ni=1024*this.oi.nextUint32()+(1023&this.oi.nextUint32())}constructor(){this.ri=0,this.ni=0,this.oi=new sH}},sN=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};g&&!J(g.crypto)&&crypto.getRandomValues&&(sN=e=>crypto.getRandomValues(e));var sB,sH=class{nextUint32(){return this.Pe.length>this.ai||(sN(this.Pe),this.ai=0),this.Pe[this.ai++]}constructor(){this.Pe=new Uint32Array(8),this.ai=1/0}},sq=()=>sz().toString(),sz=()=>(sB||(sB=new sj)).generate(),sW="",sV=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sU=null,sG={si(){if(!Z(sU))return sU;if(sU=!1,y)try{var e="__ph_cookie_support_"+sq();sG.ui(e,"xyz"),sU='"xyz"'===sL(e),sG.hi(e)}catch(e){sU=!1}return sU},ci(e){id.error("cookieStore error: "+e)},li:sL,di(e){var t;try{t=JSON.parse(sG.li(e))||{}}catch(e){}return t},ui(e,t,i,s,r){if(!y)return!1;try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=y),sW)return sW;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sq();!sW&&s--;){var n=i.slice(s).join("."),a=r+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(r)&&(t.cookie=a+";max-age=0",sW=n)}return sW}(e);if(!i){var s,r=(s=e.match(sV))?s[0]:"";r!==i&&id.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(y.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}r&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&id.warn("cookieStore warning: large cookie, len="+u.length),y.cookie=u,!0}catch(e){return!1}},hi(e,t){if(null!=y&&y.cookie)try{sG.ui(e,"",-1,t)}catch(e){return}}},sJ=null,sK={si(){if(!Z(sJ))return sJ;var e=!0;if(J(g))e=!1;else try{var t="__mplssupport__";sK.ui(t,"xyz"),'"xyz"'!==sK.li(t)&&(e=!1),sK.hi(t)}catch(t){e=!1}return e||id.error("localStorage unsupported; falling back to cookie store"),sJ=e,e},ci(e){id.error("localStorage error: "+e)},li(e){try{return null==g?void 0:g.localStorage.getItem(e)}catch(e){sK.ci(e)}return null},di(e){try{return JSON.parse(sK.li(e))||{}}catch(e){}return null},ui(e,t){try{return null==g||g.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sK.ci(e)}return!1},hi(e){try{null==g||g.localStorage.removeItem(e)}catch(e){sK.ci(e)}}},sY=[i0,iU,iV,iJ,iK,iY,si,st,i7],sZ=[iw,ib,iz,iW,su,sl,iS,ss],sX=["__proto__","constructor","prototype"],sQ=e=>{if(!U(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===sX.indexOf(i)&&(t[i]=e[i])}),t},s0=function(e,t){void 0===t&&(t=[]);var i={};return[...sZ,...t].forEach(t=>{var s=e[t];J(s)||Z(s)||""===s||(i[t]=s)}),i},s1=e=>{for(var t=5381,i=0x811c9dc5,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},s2=(e,t)=>({p:t,f:s1(JSON.stringify(e))}),s3=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=sG.di(e+"_cpm"),s=(null==i?void 0:i.f)===s1(t)&&W(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},s5=(e,t)=>t+"|"+(sG.li(e+"_cpm")||""),s6={},s4={si:()=>!0,ci(e){id.error("memoryStorage error: "+e)},li:e=>e in s6?s6[e]:null,di:e=>e in s6?s6[e]:null,ui:(e,t)=>(s6[e]=t,!0),hi(e){delete s6[e]}},s8=null,s9={si(){if(!Z(s8))return s8;if(s8=!0,J(g))s8=!1;else try{var e="__support__";s9.ui(e,"xyz"),'"xyz"'!==s9.li(e)&&(s8=!1),s9.hi(e)}catch(e){s8=!1}return s8},ci(e){id.error("sessionStorage error: ",e)},li(e){try{return null==g?void 0:g.sessionStorage.getItem(e)}catch(e){s9.ci(e)}return null},di(e){try{return JSON.parse(s9.li(e))||null}catch(e){}return null},ui(e,t){try{return null==g||g.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){s9.ci(e)}return!1},hi(e){try{null==g||g.sessionStorage.removeItem(e)}catch(e){s9.ci(e)}}},s7=class{constructor(e){this._instance=e}get _n(){return this._instance.config}get consent(){return this.so()?0:this.oo}isOptedOut(){return"always"===this._n.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this._n.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this._n.opt_out_capturing_by_default}optInOut(e){this.ao.ui(this.lo,+!!e,this._n.cookie_expiration,this._n.cross_subdomain_cookie,this._n.secure_cookie)}reset(){this.ao.hi(this.lo,this._n.cross_subdomain_cookie)}get lo(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;
1return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get oo(){var e=this.ao.li(this.lo);return O(eu,e)?1:O(eh,e)?0:-1}get ao(){var e=this._n.opt_out_capturing_persistence_type,t="localStorage"===e?sK:sG,i=t.si()?t:s4;if(!this.uo||this.uo!==i){this.uo=i;var s="localStorage"===e?sG:sK;s.li(this.lo)&&(this.uo.li(this.lo)||this.optInOut(O(eu,s.li(this.lo))),s.hi(this.lo,this._n.cross_subdomain_cookie))}return this.uo}so(){return!!this._n.respect_dnt&&[null==m?void 0:m.doNotTrack,null==m?void 0:m.msDoNotTrack,$.doNotTrack,null==m?void 0:m.globalPrivacyControl].some(e=>O(eu,e))}};function re(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!V(s))return t;try{var r=s(t);return K(r)&&r?r:t}catch(e){return id.error("Error in get_current_url, falling back to window.location.href",e),t}}function rt(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function ri(e){return!!e&&1===e.nodeType}function rs(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function rr(e){return!!e&&3===e.nodeType}function rn(e){return!!e&&11===e.nodeType&&ri(e.host)}function ra(e){return e?M(e).split(/\s+/):[]}function ro(e,t){var i,s,r=J(s=null==g||null==(i=g.location)?void 0:i.href)?void 0:re(t,s);return!!(r&&e&&e.some(e=>r.match(e)))}function rl(e){var 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 ra(t)}function ru(e){return X(e)?null:M(e).split(/(\s+)/).filter(e=>rO(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rh(e){var t="";return rS(e)&&!rP(e)&&e.childNodes&&e.childNodes.length&&sP(e.childNodes,function(e){var i;rr(e)&&e.textContent&&(t+=null!=(i=ru(e.textContent))?i:"")}),M(t)}function rc(e){var t;return J(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rd=["a","button","form","input","select","textarea","label"];function rp(e,t){var i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}}function rv(e,t){if(J(t))return!0;var i,s=function(e){if(t.some(t=>rp(e,t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function rf(e){var t=e.parentNode;return!(!t||!ri(t))&&t}var rg=[".ph-no-autocapture","[data-ph-no-autocapture]"],r_=["next","previous","prev",">","<"],rm=[...r_,"+","-","−","–"],ry=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,rb=[".ph-no-rageclick",".ph-no-capture"],rw=["","text","search","email","password","url","tel","number"];function rx(e,t){if(!g||rk(e)||(et(t)?(s=!!t&&rb,r=void 0,n=!1):(s=null!=(a=null==t?void 0:t.css_selector_ignorelist)?a:rb,r=null==t?void 0:t.content_ignorelist,n=null!=(o=null==t?void 0:t.ignore_text_selection)&&o),!1===s)||n&&!(!(i=e)||!ri(i))&&(rs(i,"textarea")||(rs(i,"input")?O(rw,(i.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(i))))return!1;var i,s,r,n,a,o,l=rE(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||J(e))return!1;if(!0===e)i=r_;else{if(!W(e))return!1;if(e.length>10)return id.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,s=e.ariaLabel;return i.some(e=>ry(t,e)||ry(s,e))})}(r,l.map(e=>{var t;return{safeText:rh(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rv(l,s)}var rk=e=>!e||rs(e,"html")||!ri(e),rE=(e,t)=>{if(!g||rk(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],r=e;r.parentNode&&!rs(r,"body");)if(rn(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var n=rf(r);if(!n)break;if(t||rd.indexOf(n.tagName.toLowerCase())>-1)i=!0;else try{var a=g.getComputedStyle(n);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(n),r=n}return{parentIsUsefulElement:i,targetElementList:s}};function rS(e){for(var t=new Set,i=0,s=e;s.parentNode&&!rs(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=rl(s);if(O(r,"ph-sensitive")||O(r,"ph-no-capture"))return!1}if(O(rl(e),"ph-include"))return!0;var n=e.type||"";if(K(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
1var a=e.name||e.id||"";return!K(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function rP(e){return!!(rs(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||rs(e,"select")||rs(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rF=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}))$"),r$=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,rI=[16,15,14,13],rC=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),rA=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),rT=/[0-9A-Za-z_]/;function rO(e,t){return void 0===t&&(t=!0),!(X(e)||K(e)&&(e=M(e),(t?rF.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(r$.lastIndex=0;t=r$.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of rI){var a=r+n;if(s.length>=a){var o=s.slice(r,a);if(rF.test(o)&&function(e){for(var t=0,i=!1,s=e.length-1;s>=0;s--){var r=e.charCodeAt(s)-48;i&&(r*=2)>9&&(r-=9),t+=r,i=!i}return t%10==0}(o))return!0}}}return!1}(e))||(t?rC.test(e):function(e){var t;for(rA.lastIndex=0;t=rA.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&rT.test(i)&&rT.test(s)))return!0}return!1}(e))))&&!0}function rM(e){var t=rh(e);return rO(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&sP(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=rh(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){id.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rR(e){return e.replace(/"|\\"/g,'\\"')}var rL=ip("[Dead Clicks]"),rD=()=>!0,rj=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(iO)),s=e.instance.config.capture_dead_clicks;return et(s)?s:!!U(s)||i},rN=class{get lazyLoadedDeadClicksAutocapture(){return this.ho}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[iO]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.do(()=>{this.vo()}):this.stop()}do(e){var t,i;null!=(t=$.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=$.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rL.error("failed to load script",t):e()})}vo(){var e;if(y){if(!this.ho&&null!=(e=$.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=U(this.instance.config.capture_dead_clicks)?p({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.ho=$.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ho.start(y),rL.info("starting...")}}else rL.error("`document` not found. Cannot start.")}stop(){this.ho&&(this.ho.stop(),this.ho=void 0,rL.info("stopping..."))}},rB=ip("[SegmentIntegration]");function rH(e,t,i){void 0===i&&(i=!0);var s=e.config.segment;if(!s)return t();!function(e,t,i){var s=e.config.segment;if(!s)return t();var r=s=>{var r=()=>s.anonymousId()||sq();e.config.get_device_id=r,i&&s.id()&&(e.register({distinct_id:s.id(),$device_id:r()}),e.persistence.set_property(ss,s_)),t(i?void 0:s.anonymousId()||void 0)},n=s.user();"then"in n&&V(n.then)?n.then(r):r(n)}(e,i=>{var r,n;s.register((r=i,"u">typeof Promise&&Promise.resolve||rB.warn("This browser does not have Promise support, and can not use the segment integration"),n=(t,i)=>{if(!i)return t;var s=!!r&&t.event.anonymousId===r&&!t.event.userId;s||t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rB.info("No userId set, resetting PostHog"),e.reset()),s||(r=void 0),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rB.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var n=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},n,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>n(e,e.event.event),page:e=>n(e,sw),identify:e=>n(e,sk),screen:e=>n(e,"$screen")})).then(()=>{t()},e=>{rB.error("Failed to register the Segment integration",e),t()})},i)}var rq="posthog-js";function rz(e,t){var i=void 0===t?{}:t,s=i.organization,r=i.projectId,n=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i,a,l,h,c,d,v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
1on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null==(i=t.exception)?void 0:i.values)||[],g=f.map(e=>p({},e,{stacktrace:e.stacktrace?p({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>p({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(a=f[0])?void 0:a.value)||t.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(c=f[0])?void 0:c.type,$sentry_tags:t.tags};return s&&r&&(_.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),u&&(null==(d=e.exceptions)||d.sendExceptionEvent(_)),t}}var rW=class{constructor(e,t,i,s,r,n){this.name=rq,this.setupOnce=function(a){a(rz(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}},rV=class{constructor(e){this.co=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(id.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.fo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.po()}po(){var e;this.mo=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.co)}destroy(){var e;null==(e=this.mo)||e.call(this),this.mo=void 0}doPageView(e,t){var i,s=this.yo(e,t);return this.fo={pathname:null!=(i=null==g?void 0:g.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.yo(e,null==(t=this.fo)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.fo)?void 0:e.pageViewId}}yo(e,t){var i=this.fo;
1if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,a=r.lastScrollY,o=r.maxScrollY,l=r.maxContentHeight,u=r.lastContentY,h=r.maxContentY;if(!(J(n)||J(a)||J(o)||J(l)||J(u)||J(h))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?ec(a/n,0,1,id):1,d=n>1?ec(o/n,0,1,id):1,p=l>1?ec(u/l,0,1,id):1,v=l>1?ec(h/l,0,1,id):1;s=sF(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$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}},rU=["flags","surveys"],rG={$people_distinct_id:{exposure:"hidden"},[ik]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[iP]:{exposure:"hidden"},[iS]:{exposure:"hidden"}
1,[iF]:{exposure:"event"},[i$]:{exposure:"hidden"},[iR]:{exposure:"hidden"},[iI]:{exposure:"event"},[iC]:{exposure:"hidden"},[iA]:{exposure:"event"},[iT]:{exposure:"event"},[iO]:{exposure:"event"},[iM]:{exposure:"hidden"},[iL]:{exposure:"event"},[iD]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[iz]:{exposure:"hidden"},[iW]:{exposure:"event"},[ij]:{exposure:"event",shouldSkipFromEventProperties:e=>Z(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[iV]:{exposure:"hidden",storageGroup:"flags"},[iU]:{exposure:"hidden",storageGroup:"flags"},[iG]:{exposure:"hidden"},[iJ]:{exposure:"hidden",storageGroup:"flags"},[iK]:{exposure:"hidden",storageGroup:"flags"},[iY]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iZ]:{exposure:"hidden",storageGroup:"flags"},[iX]:{exposure:"hidden"},[iQ]:{exposure:"hidden"},[i0]:{exposure:"hidden"},[i1]:{exposure:"hidden"},[i3]:{exposure:"hidden",storageGroup:"surveys"},[i5]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[i6]:{exposure:"event"},[i4]:{exposure:"hidden"},[i8]:{exposure:"hidden"},[i9]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[i7]:{exposure:"hidden"},[se]:{exposure:"hidden"},[i2]:{exposure:"event"},[st]:{exposure:"hidden"},[si]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ss]:{exposure:"hidden"},[sr]:{exposure:"hidden"},[sn]:{exposure:"hidden"},[sa]:{exposure:"hidden"},[so]:{exposure:"hidden"},[sl]:{exposure:"hidden"},[su]:{exposure:"hidden"},[iN]:{exposure:"event"},[iB]:{exposure:"event"},[iH]:{exposure:"event"},[iq]:{exposure:"event"},[sd]:{exposure:"event"},[sp]:{exposure:"event"},[sv]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
1,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rJ=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rK=e=>{var t=rG[e];if(t)return t;for(var i of rJ){var s=i[1];if(0===e.indexOf(i[0]))return s}},rY=(e,t)=>{try{var i;return JSON.stringify(e,(e,t)=>ea(t)?(null!=i||(i=new WeakMap),i.has(t)||i.set(t,sT(t)),i.get(t)):"bigint"==typeof t?t.toString():t,t)}catch(t){return L(e)}},rZ=e=>{var t=null==y?void 0:y.createElement("a");return J(t)?null:(t.href=e,t)},rX=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!W(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){id.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rQ=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");W(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},r0=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},r1=(e,t)=>e>=t&&P(),r2=(e,t,i,s)=>{if(0===e){if(P()){var r=t+1;return r===i&&s(),r}return t}return 0},r3=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],r5=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...r3],r6="<masked>",r4=["li_fat_id"];function r8(e,t,i){if(!y)return{};var s,r=t?[...r3,...i||[]]:[],n=r9(rQ(y.URL,r,r6),e);return sF((s={},sP(r4,function(e){var t=sL(e);s[e]=t||null}),s),n)}function r9(e,t){var i=r5.concat(t||[]),s={};return sP(i,function(t){var i=rX(e,t);s[t]=i||null}),s}function r7(e){var t=e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null,i={};if(!Z(t)){i.$search_engine=t;var s=y?rX(y.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function ne(){return navigator.language||navigator.userLanguage}var nt="$direct";function ni(){return(null==y?void 0:y.referrer)||nt}function ns(e,t,i){void 0===i&&(i=!1);var s,r=e?[...r3,...t||[]]:[],n=null==(s=i?tg(null==b?void 0:b.href):null==b?void 0:b.href)?void 0:s.substring(0,1e3);return{r:ni().substring(0,1e3),u:n?rQ(n,r,r6):void 0}}function nr(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?tg(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==nt?nt:null==(i=rZ(s))?void 0:i.host};
vendor: 6,684 bytes, line 1
1if(n){a.$current_url=n;var o=rZ(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,sF(a,r9(n))}return s&&sF(a,r7(s)),a}function nn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var na={flags:si,surveys:i5},no=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],nl=e=>{var t="",i=0;for(var s of e){var r=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+r>1e3)break;t+=s,i+=r}return t},nu="main",nh=[iV,iU,iJ,iK,iY,si,iZ,i0],nc=e=>-1!==nh.indexOf(e),nd=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},np=e=>{if(!e)return{};var t=JSON.parse(e);return U(t)?t:{}},nv=(e,t)=>{sP(e,(i,s)=>{var r=rK(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})},nf=class{constructor(e,t,i){if(void 0===i&&(i=!0),this.bo={},this._o=!1,this.wo=!1,this.ko=!1,this.So=!1,this.xo=!1,this.Co=new Map,this.To=!1,this.Mo=!1,this.Io=!1,this.Eo=!1,this.Ro=new Set,this._n=e,this.Ao=i,this.props={},this.Po=void 0,this.Fo=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.ao=this.Oo(e),this.ko=this.$o(e),this.load(),this.Do(),e.debug&&id.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,t),this.save(),g){var s=()=>this.flush();sM(g,"beforeunload",s,{capture:!1}),sM(g,"pagehide",s,{capture:!1}),this.Lo=e=>{if(this._o&&(!e.storageArea||e.storageArea===(null==g?void 0:g.localStorage))&&e.key)if(e.key!==this.Fo){if(this.ko){var t=rU.find(t=>e.key===this.No(t));t&&this.qo(e.key,t)}}else this.qo(e.key,nu)},sM(g,"storage",this.Lo)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(e=>{var t=e[0],i=e[1],s=this.Co.get(t);if(nc(t)&&!0!==s)if(!0!==i){var r=new Set(s||[]);i.forEach(e=>r.add(e)),r.size&&this.jo(t,r)}else this.jo(t,!0)})}onCrossTabFeatureFlagChange(e){return this.Ro.add(e),()=>this.Ro.delete(e)}destroy(){this.Lo&&g&&(g.removeEventListener("storage",this.Lo),this.Lo=void 0),this.Ro.clear()}qo(e,t,i){if(void 0===i&&(i=!0),this.Bo)return!1;try{if(r=sK.li(e),Z(r)){var s,r,n=this.Ho(t);return n.storageValue=null,t!==nu&&(n.persisted=!1),!1}s=np(r)}catch(e){return!1}var a=t===nu?s:sK.di(this.Fo);if(a&&this.zo(a))return!1;var o=this.Uo(s,t,i);return t===nu&&this.ko&&!nd(this.Wo().main,s)||this.Vo(s,t,!0,r),o}zo(e){var t=this.props[ib],i=e[ib];return!J(t)&&!J(i)&&t!==i}Vo(e,t,i,s){var r=this.Ho(t);r.storageValue=s,t!==nu&&(r.persisted=i);try{r.fingerprint=this.Go(e,t)}catch(e){r.fingerprint=void 0}}Uo(e,t,i){var s=!1;return nh.forEach(i=>{var r,n=null==(r=rK(i))?void 0:r.storageGroup;if(!(t===nu&&this.ko&&n||t!==nu&&n!==t)){var a=i in e,o=this.Zo(i,a?e[i]:void 0),l=this.Co.has(i)?i in this.props:a;l===i in this.props&&nd(o,this.props[i])||(l?this.Jo(i,o,!1):this.Qo(i,!1),s=!0)}}),s&&i&&this.Ro.forEach(e=>e()),s}Ko(){if(!this._o)return!1;try{this.Io=!1;var e,t=sK.li(this.Fo),i=this.Ho(nu),s=!1,r=!1;if(t!==i.storageValue)if(Z(t))i.storageValue=null;else{if(e=np(t),this.Io=!this.Mo&&this.zo(e),this.Io)return!1;r=this.Uo(e,nu,!1),!this.ko||nd(this.Wo().main,e)?this.Vo(e,nu,!0,t):i.storageValue=t,s=!0}return this.ko&&rU.forEach(t=>{var i=sK.li(this.No(t)),n=this.Ho(t),a=e||{},o=s&&nh.some(e=>{var i;return(null==(i=rK(e))?void 0:i.storageGroup)===t&&e in a});if(i!==n.storageValue||o){if(Z(i))return n.storageValue=null,n.persisted=!1,void(o&&(r=this.Uo(a,t,!1)||r));var l=np(i);r=this.Uo(l,t,!1)||r,this.Vo(l,t,!0,i)}}),r}catch(e){return!1}}jo(e,t){this.Co.set(e,t);var i=rK(e);null!=i&&i.volatile||(this.Ho((this.ko?null==i?void 0:i.storageGroup:void 0)||nu).fingerprint=void 0,this.Xo(e))}Yo(){nh.forEach(e=>this.Co.set(e,!0))}Do(){if(this._o)try{var e=sK.li(this.Fo),t=np(e);this.Ho(nu).storageValue=e,nh.forEach(e=>{var i,s=this.ko?null==(i=rK(e))?void 0:i.storageGroup:void 0,r=s?sK.li(this.No(s)):null;if(s){var n=this.Ho(s);n.storageValue=r,n.persisted=!Z(r)}var a=s&&!Z(r)?np(r):t;e in this.props?this.ta(e,a[e],this.props[e]):e in a&&this.jo(e,!0)})}catch(e){}}Zo(e,t){var i=this.Co.get(e);if(!i)return t;if(!0===i)return this.props[e];if("$active_feature_flags"===e){var s=new Set(W(t)?t:[]),r=new Set(W(this.props[e])?this.props[e]:[]);return i.forEach(e=>r.has(e)?s.add(e):s.delete(e)),Array.from(s)}var n=U(t)?p({},t):{},a=U(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in a?n[e]=a[e]:delete n[e]}),n}ta(e,t,i){if(nc(e)){var s=this.Co.get(e);if(!0!==s){var r=t;if(this._o)try{var n,a=this.ko?null==(n=rK(e))?void 0:n.storageGroup:void 0,o=a?this.No(a):this.Fo;r=np(sK.li(o))[e]}catch(e){}var l=new Set(s||[]);if("$active_feature_flags"===e){if(!J(t)&&!W(t)||!J(r)&&!W(r)||!W(i))return void this.jo(e,!0);var u=new Set(t||[]),h=new Set(r||[]),c=new Set(i);new Set([...u,...c]).forEach(e=>{u.has(e)!==c.has(e)&&l.add(e)}),l.forEach(e=>{h.has(e)===c.has(e)&&l.delete(e)})}else{if(!U(i))return void(nd(r,i)?this.Co.delete(e):this.jo(e,!0));if(!J(t)&&!U(t)||J(t)&&G(i)&&J(r))return void this.jo(e,!0);var d=U(t)?t:{},p=U(r)?r:{};new Set([...Object.keys(d),...Object.keys(i)]).forEach(e=>{e in d==e in i&&nd(d[e],i[e])||l.add(e)}),l.forEach(e=>{e in p==e in i&&nd(p[e],i[e])&&l.delete(e)})}l.size?this.jo(e,l):this.Co.delete(e)}}}ea(){var e,t=null==(e=this._n)?void 0:e.persistence_save_debounce_ms;return Q(t)&&t>0?t:0}ia(e){if(this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase())if(e)try{var t=s0(e,this._n.cookie_persisted_properties||[]),i=s2(t,this._n.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=sG.li(this.Fo)||void 0;r&&s5(this.Fo,r)===s&&(this.ra=s,this.na=r)}catch(e){}else try{var n=sG.li(this.Fo)||void 0;this.ra=n?s5(this.Fo,n):void 0,this.na=n}catch(e){}}syncCookieProperties(){return this.sa(this._n)}sa(e,t){if(void 0===t&&(t=!1),this.Bo&&!t||this.xo||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=sG.li(this.Fo)||void 0}catch(e){}if(!i||i===this.na)return!1;var i,s,r=s5(this.Fo,i);try{s=sQ(JSON.parse(i))}catch(e){return!1}if((sG.li(this.Fo)||void 0)!==i)return!1;this.ra=r,this.na=i;var n=s3(this.Fo,i),a=[...sZ,...n.properties],o={};if(Object.keys(s).forEach(e=>{var t=s[e];(J(t)||Z(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(o[e]=!0,delete s[e])}),G(s))return!1;var l="distinct_id"in s||"anonymous"===s.$user_state||"identified"===s.$user_state,u=this.props,h=u[ib],c=u[ss],d=sF({},u);[...sZ,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==a.indexOf(e)&&!(e in s)&&!o[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=d[e];(n.isValid||-1===sZ.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}
1),this.props=sF(d,s),nh.forEach(e=>{var t=e in this.props;e in u===t&&nd(u[e],this.props[e])||(t?this.ta(e,u[e],this.props[e]):this.jo(e,!0))}),!l||"$user_state"in s||"$user_state"in this.props||this.Jo(ss,sg);var p=this.props[ib],v=this.props[ss];return l&&(p!==h||v!==c)&&(this.Mo=!0,this.So=!0,s9.ui(this.Fo+"_cookie_identity_change_pending",!0),this.Qo(i0),this.Qo(iU),this.Qo(iV),this.Qo(iJ),this.Qo(iK),this.Qo(iY),this.Qo(si),this.Qo(st),this.Qo(i7),"anonymous"!==v||"identified"!==c&&"anonymous"!==s.$user_state&&(J(h)||p===h)||(nv(this.props,s),this.Qo(i1)),"identified"===v?this.props.$user_id=p:delete this.props.$user_id,this.Qo(ik)),!0}consumeCookieIdentityChange(){var e=this.Fo+"_cookie_identity_change_pending",t=this.So||!!s9.li(e);return this.So=!1,t&&s9.hi(e),t}oa(e){return void 0===e&&(e=!1),!(this.xo||this.Bo&&!e||!this._n.cookieWinsOnConflict||"localstorage+cookie"!==this._n.persistence.toLowerCase()||(this.xo=!0,0))}aa(){this.xo&&(J(this.la)||(clearTimeout(this.la),this.la=void 0),delete this.bo[nu],this.ua(!0))}ha(e){if(void 0===e&&(e=!0),this.xo)try{e?this.aa():J(this.la)||(clearTimeout(this.la),this.la=void 0)}finally{this.xo=!1}}isDisabled(){return!!this.Bo}Oo(e){-1===no.indexOf(e.persistence.toLowerCase())&&(id.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,r,n=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...sZ,...t],p({},sK,{di(e){try{var t,r={};try{r=(t=sG.li(e)||void 0)?sQ(JSON.parse(t)):{}}catch(e){}var n,a=JSON.parse(sK.li(e)||"{}");if(i){var o=s3(e,t),l=[...sZ,...o.properties],u={};Object.keys(r).forEach(e=>{var t=r[e];Z(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(u[e]=t)});var h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var c,d=a[ib],p=null!=(c=a.$user_state)?c:"anonymous";s.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in r)&&(h||"distinct_id"!==e&&"$user_state"!==e)){var t=a[e];(o.isValid||-1===sZ.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!h||"$user_state"in r||"$user_state"in a||(a[ss]=sg),h&&(("distinct_id"in u?u[ib]:a[ib])!==d||("$user_state"in u?u[ss]:a[ss])!==p)&&(sY.forEach(e=>delete a[e]),"identified"===u.$user_state&&"distinct_id"in u?a.$user_id=u[ib]:delete a.$user_id,"identified"!==u.$user_state&&(delete a[i2],delete a[i1]),delete a.__alias)}n=sF(a,u)}else n=sF(r,a);return sK.ui(e,n),n}catch(e){}return null},ui(e,s,r,n,a,o){var l=sK.ui(e,s,void 0,void 0,o);try{var u=s0(s,t);if(Object.keys(u).length){if(i){var h=e+"_cpm",c=s2(u,t);if(sG.ui(h,c,r,n,a,o),sG.li(h)!==JSON.stringify(c)){sG.hi(h,n);var d=s0(s);return sG.ui(e,d,r,n,a,o),l}}sG.ui(e,u,r,n,a,o)}}catch(e){sK.ci(e)}return l},hi(e,t){try{null==g||g.localStorage.removeItem(e),sG.hi(e,t),sG.hi(e+"_cpm",t)}catch(e){sK.ci(e)}}})),a=!1,o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sK.si()?(r=sK,o=!0):"localstorage+cookie"===l&&n.si()?(r=n,o=!0,a=!0):"sessionstorage"===l&&s9.si()?r=s9:"memory"===l?r=s4:"cookie"===l&&sG.si()?(r=sG,a=!0):n.si()?(r=n,o=!0,a=!0):sG.si()?(r=sG,a=!0):r=s4,this._o=o,this.wo=a,r}No(e){return this.Fo+"__"+e}$o(e){return this._o&&!!e.split_storage}properties(){var e={};return sP(this.props,(t,i)=>{var s=rK(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(e){if(void 0===e&&(e=!1),!this.Bo||e){var t=this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase(),i=t?sK.di(this.Fo):null,s={};if(t)try{sP(s=sQ(sG.di(this.Fo)),(e,t)=>{(J(e)||Z(e)||""===e)&&delete s[t]})}catch(e){}var r=this.ao.di(this.Fo);if(r&&(this.props=sF({},r)),this.ko&&this.da(),t&&r){var n,a,o=null==i?void 0:i[ib],l=null!=(n=null==i?void 0:i.$user_state)?n:"anonymous",u=r[ib],h=null!=(a=r.$user_state)?a:"anonymous";if(u!==o||h!==l){this.So=!0,s9.ui(this.Fo+"_cookie_identity_change_pending",!0);var c=sF({},this.props);sY.forEach(e=>delete c[e]),"anonymous"!==h||"identified"!==l&&"anonymous"!==s.$user_state&&(J(o)||u===o)||(nv(c,s),delete c[i1
vendor: 4,781 bytes, line 1
1]),this.props=c;var d=new Set;sY.forEach(e=>{var t,i=null==(t=rK(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{var t={};sP(this.props,(i,s)=>{var r;(null==(r=rK(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),G(t)?(sK.hi(this.No(e)),this.bo[e]={}):sK.ui(this.No(e),t)&&(this.bo[e]={persisted:!0,fingerprint:this.Go(t,e)})})}}s9.li(this.Fo+"_cookie_identity_change_pending")&&(this.So=!0)}}da(){for(var e of rU){var t=sK.di(this.No(e));if(t&&!G(t)){var i=this.Ho(e);i.persisted=!0,this.va(e)||(i.fingerprint=this.Go(t,e)),this.ca(e,t)||sF(this.props,t)}}}va(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rK(t))?void 0:i.storageGroup)===e})}ca(e,t){var i=na[e];if(!i)return!1;var s=t[i],r=this.props[i];return Q(s)&&Q(r)&&r>s}refreshKey(e){var t;if(!(this.Bo||"$fbc_persistence"===e&&this.Eo)){var i=this.ko?null==(t=rK(e))?void 0:t.storageGroup:void 0,s=i?sK.di(this.No(i)):this.ao.di(this.Fo);if(s&&e in s)this.Jo(e,s[e],!1);else{if(i){var r=this.ao.di(this.Fo);if(r&&e in r)return void this.Jo(e,r[e],!1)}this.Qo(e,!1)}}}save(){if(!this.Bo){var e=this.ea();e>0?J(this.la)&&(this.la=setTimeout(()=>{this.la=void 0,this.ua()},e)):this.ua()}}flush(){J(this.la)||(clearTimeout(this.la),this.la=void 0,this.ua())}ua(e){if(void 0===e&&(e=!1),!(this.Bo||this.xo&&!e)){e||(this.syncCookieProperties(),this.Eo||this._n.cookieWinsOnConflict&&"localstorage+cookie"===this._n.persistence.toLowerCase()||this.refreshKey(iS));var t=!e&&!this.To;t||(this.Io=!1);var i=!!t&&this.Ko();if(this.Io)this._n.debug&&id.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.ko)return this.fa(),void(i&&this.Ro.forEach(e=>e()));var s=this.pa(this.ao,this.Fo,this.props,nu);"written"===s&&this.ia(this.props),"failed"!==s&&(this.Co.clear(),this.Mo=!1,this.Eo=!1),i&&this.Ro.forEach(e=>e())}}}fa(){var e=this,t=this.Wo(),i=t.main,s=t.groups,r=this.pa(this.ao,this.Fo,i,nu);"written"===r&&this.ia(i),"failed"!==r&&(this.Mo=!1,this.Eo=!1,nh.forEach(e=>{var t;null!=(t=rK(e))&&t.storageGroup||this.Co.delete(e)}));var n=function(t){var i,r=s[t];if(G(r)&&(null==(i=e.bo[t])||!i.persisted))return nh.forEach(i=>{var s;(null==(s=rK(i))?void 0:s.storageGroup)===t&&e.Co.delete(i)}),1;var n=e.pa(sK,e.No(t),r,t);"failed"!==n&&nh.forEach(i=>{var s=rK(i);(null==s?void 0:s.storageGroup)!==t||"written"!==n&&s.volatile||e.Co.delete(i)})};for(var a of rU)if(n(a))continue}Wo(){var e={},t={flags:{},surveys:{}};return sP(this.props,(i,s)=>{var r,n=null==(r=rK(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Go(e,t){if(t===nu)return JSON.stringify(e)+"|"+this.ga+"|"+this.ma+"|"+this.ya;var i={};return sP(e,(e,t)=>{var s;i[t]=null!=(s=rK(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}pa(e,t,i,s){var r,n=this.Ho(s);if(s!==nu&&!n.dirty&&!J(n.fingerprint))return"skipped";try{if((r=this.Go(i,s))===n.fingerprint)return n.dirty=!1,"skipped"}catch(e){r=void 0}return e.ui(t,i,this.ga,this.ma,this.ya,this._n.debug)?(n.dirty=!1,s!==nu&&(n.persisted=!0),J(r)||(n.fingerprint=r),this._o&&(n.storageValue=sK.li(t)),"written"):(this._n.debug&&id.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(this.Yo(),J(this.la)||(clearTimeout(this.la),this.la=void 0),this.ao.hi(this.Fo,!1),this.ao.hi(this.Fo,!0),!i&&this.Ao)for(var s of rU)sK.hi(this.No(s));i?delete this.bo[nu]:this.bo={},this.ra=void 0,this.na=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(U(e)){this.syncCookieProperties(),J(t)&&(t="None"),this.ga=J(i)?this.ba:i;var s=!1;if(sP(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Jo(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(U(e)){this.syncCookieProperties(),this.ga=J(t)?this.ba:t;var i=!1;if(sP(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||U(t)||W(t))&&(this.Jo(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t=!1;for(var i of"string"==typeof e?[e]:e)i in this.props&&(this.Qo(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==y?void 0:y.URL;if(e!==this.Po){var t=r8(this._n.custom_campaign_params,this._n.mask_personal_data_properties,this._n.custom_personal_data_properties),i=!G(sA(t));return i&&this.register(t),this.Po=e,i?t:void 0}}update_search_keyword(){var e;this.register((e=null==y?void 0:y.referrer)?r7(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ni(),$referring_domain:null!=y&&y.referrer&&(null==(e=rZ(y.referrer))?void 0:e.host)||nt},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var e=ns(this._n.mask_personal_data_properties,this._n.custom_personal_data_properties,this._n.disable_capture_url_hashes
1);this.register_once({[sl]:this.wo?{r:nl(e.r),u:e.u?nl(e.u):void 0}:e},void 0)}}get_initial_props(){var e,t,i,s={};sP([so,sa],e=>{var t=this.props[e];t&&sP(t,function(e,t){s["$initial_"+R(t)]=e})});var r=this.props[sl];return r&&sF(s,(void 0===(e=this._n.disable_capture_url_hashes)&&(e=!1),t=nr(r,e),i={},sP(t,function(e,t){i["$initial_"+R(t)]=e}),i)),s}safe_merge(e){return sP(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var s=e.persistence!==t.persistence,r=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=s||r,a=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,o=e.disable_persistence||!!i,l=!!this.Bo&&!o;o||this.sa(t,l),this._n=e,!o&&(s||r||a)&&(this.ra=void 0,this.na=void 0,this.sa(p({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var u=n||a?this.Oo(e):this.ao;this._a();var h=this.$o(e),c=n||h!==this.ko,d=!o&&(c||e.cross_subdomain_cookie!==this.ma||e.secure_cookie!==this.ya)&&this.oa(l);this.To=c;try{if(this.ba=this.ga=e.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var v=this.props;this.clear(),this.ao=u,this.ko=h,this.props=v,this.save()}else a&&(this.ao=u,o||(delete this.bo[nu],this.ua()))}finally{this.To=!1,d&&this.ha()}}_a(){var e=this.props[sl];if(this.wo&&U(e)&&"string"==typeof e.r){var t=nl(e.r),i="string"==typeof e.u?nl(e.u):e.u;t===e.r&&i===e.u||this.Jo(sl,p({},e,{r:t,u:i}))}}set_disabled(e){this.Bo=e,this.Bo?this.remove():this.save()}set_cross_subdomain(e){e!==this.ma&&(this.ma=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ya&&(this.ya=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props.__timers||{};i[e]=t,this.Jo(iP,i),this.save()}remove_event_timer(e){var t=this.props.__timers||{},i=t[e];return J(i)||(delete t[e],this.Jo(iP,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Jo(e,t),this.save()}Jo(e,t,i){void 0===i&&(i=!0);var s,r=this.props[e];this.props[e]=t,i&&("distinct_id"!==e&&"$user_state"!==e||r===t||(this.Mo=!0),"$fbc_persistence"!==e||nd(r,t)||(this.Eo=!0),this.ta(e,r,t),null!=(s=rK(e))&&s.volatile||this.Xo(e))}Qo(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(nc(e)&&this.jo(e,!0),"$fbc_persistence"===e&&(this.Eo=!0),this.Xo(e))}Xo(e){var t,i=null==(t=rK(e))?void 0:t.storageGroup;i&&(this.Ho(i).dirty=!0)}Ho(e){return this.bo[e]||(this.bo[e]={})}},ng="gzip-js",n_="base64",nm="events",ny="cancelEvents",nb="survey shown",nw="survey dismissed",nx="survey sent",nk="popover";function nE(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&V(i.then)&&i.then(void 0,()=>{})}}}}var nS=ip("[RateLimiter]"),nP=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{nS.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void nS.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))?t:{tokens:r,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>r&&(o.tokens=r);var l=1>o.tokens;if(l||e||(o.tokens=Math.max(0,o.tokens-1)),l&&!e){var u=(Q(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.wa(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(sn,o),{isRateLimited:l,remainingTokens:o.tokens}}ka(e){var t=this.instance.config.property_denylist;return!W(t)||!t.includes(e)}Sa(){var e;if(this.ka("$current_url")&&this.ka("$pathname")&&null!=b&&b.pathname)return""+(null!=(e=b.origin)?e:"")+b.pathname}wa(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.Sa(),a=this.ka("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,o=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,a?"session "+a:void 0].filter(
vendor: 5,377 bytes, line 1
1Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}},nF=ip("[RemoteConfig]"),n$=class{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=$._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}xa(e){var t,i;null!=(t=$.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=$.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ca(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 nF.info("Using preloaded remote config",this.remoteConfig),void this.Ta(this.remoteConfig);if(this._instance.Ma())return void nF.warn("Remote config is disabled. Falling back to local config.");this.xa(e=>{e?this.Ta(e):(nF.info("No config found after loading remote JS config. Falling back to JSON."),this.Ca(e=>{this.Ta(e.json,e)}))})}catch(e){nF.error("Error loading remote config",e),this.Ta()}}Ta(e,t){!e&&t&&(0===t.statusCode?t.error||nF.warn("Failed to fetch remote config from PostHog."):nF.error("Failed to fetch remote config from PostHog."));try{this._instance.Ta(e?{ok:!0,config:e}:{ok:!1})}catch(e){nF.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){nF.error("Error loading feature flags",e)}}},nI=Uint8Array,nC=Uint16Array,nA=Uint32Array,nT=new nI([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]),nO=new nI([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]),nM=new nI([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nR=function(e,t){for(var i=new nC(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new nA(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},nL=nR(nT,2),nD=nL[1];nL[0][28]=258,nD[258]=28;for(var nj=nR(nO,0)[1],nN=new nC(32768),nB=0;32768>nB;++nB){var nH=(43690&nB)>>>1|(21845&nB)<<1;nN[nB]=((65280&(nH=(61680&(nH=(52428&nH)>>>2|(13107&nH)<<2))>>>4|(3855&nH)<<4))>>>8|(255&nH)<<8)>>>1}var nq=function(e,t,i){for(var s=e.length,r=0,n=new nC(t);s>r;++r)++n[e[r]-1];var a,o=new nC(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new nC(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],h=t-e[r],c=o[e[r]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)a[nN[c]>>>l]=u}else for(a=new nC(s),r=0;s>r;++r)a[r]=nN[o[e[r]-1]++]>>>15-e[r];return a},nz=new nI(288);for(nB=0;144>nB;++nB)nz[nB]=8;for(nB=144;256>nB;++nB)nz[nB]=9;for(nB=256;280>nB;++nB)nz[nB]=7;for(nB=280;288>nB;++nB)nz[nB]=8;var nW=new nI(32);for(nB=0;32>nB;++nB)nW[nB]=5;var nV=nq(nz,9,0),nU=nq(nW,5,0),nG=function(e){return(e/8|0)+(7&e&&1)},nJ=function(e,t,i){(null==t||0>t)&&(t=0),(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof nC?nC:e instanceof nA?nA:nI)(i-t);return s.set(e.subarray(t,i)),s},nK=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},nY=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},nZ=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new nI(0),0];if(1==r){var a=new nI(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=r-1;)o=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new nC(d+1),v=nX(i[h-1],p,0);if(v>t){s=0;var f=0,g=v-t,_=1<<g;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;f+=_-(1<<v-p[m]),p[m]=t}for(f>>>=g;f>0;){var y=n[s].s;t>p[y]?f-=1<<t-p[y]++-1:++s}for(;s>=0&&f;--s){var b=n[s].s;p[b]==t&&(--p[b],++f)}v=t}return[new nI(p),v]},nX=function(e,t,i){return -1==e.s?Math.max(nX(e.l,t,i+1),nX(e.r,t,i+1)):t[e.s]=i},nQ=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new nC(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},o=1;t>=o;++o)if(e[o]==r&&o!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=e[o]}return[i.subarray(0,s),t]},n0=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},n1=function(e,t,i){var s=i.length,r=nG(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},n2=function(e,t,i,s,r,n,a,o,l,u,h){nK(t,h++,i),++r[256];for(var c=nZ(r,15),d=c[0],p=c[1],v=nZ(n,15),f=v[0],g=v[1],_=nQ(d),m=_[0],y=_[1],b=nQ(f),w=b[0],x=b[1],k=new nC(19),E=0;m.length>E;++E)k[31&m[E]]++;for(E=0;w.length>E;++E)k[31&w[E]]++;for(var S=nZ(k,7),P=S[0],F=S[1],$=19;$>4&&!P[nM[$-1]];--$);var I,C,A,T,O=u+5<<3,M=n0(r,nz)+n0(n,nW)+a,R=n0(r,d)+n0(n,f)+a+14+3*$+n0(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(M>=O&&R>=O)return n1(t,h,e.subarray(l,l+u));if(nK(t,h,1+(M>R)),h+=2,M>
1R){I=nq(d,p,0),C=d,A=nq(f,g,0),T=f;var L=nq(P,F,0);for(nK(t,h,y-257),nK(t,h+5,x-1),nK(t,h+10,$-4),h+=14,E=0;$>E;++E)nK(t,h+3*E,P[nM[E]]);h+=3*$;for(var D=[m,w],j=0;2>j;++j){var N=D[j];for(E=0;N.length>E;++E)nK(t,h,L[B=31&N[E]]),h+=P[B],B>15&&(nK(t,h,N[E]>>>5&127),h+=N[E]>>>12)}}else I=nV,C=nz,A=nU,T=nW;for(E=0;o>E;++E)if(s[E]>255){nY(t,h,I[257+(B=s[E]>>>18&31)]),h+=C[B+257],B>7&&(nK(t,h,s[E]>>>23&31),h+=nT[B]);var B,H=31&s[E];nY(t,h,A[H]),h+=T[H],H>3&&(nY(t,h,s[E]>>>5&8191),h+=nO[H])}else nY(t,h,I[s[E]]),h+=C[s[E]];return nY(t,h,I[256]),h+C[256]},n3=new nA([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),n5=new nI(0),n6=function(){for(var e=new nA(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),n4=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},n8=!!x||!!w,n9="text/plain",n7=!1,ae=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],a=r[1];if(!a)return e;var o=a.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(o?"?"+o:"")+(s?"#"+s:"")},at=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,l=e.split("?"),u=l[0],h=l[1],c=p({},t),d=null!=(o=null==h?void 0:h.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!=(t=c[r])?t:s[1];return delete c[r],r+"="+n}))?o:[],v=(void 0===s&&(s="&"),a=[],sP(c,function(e,t){J(e)||J(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return v&&d.push(v),d.length>0?u+"?"+d.join("&"):u},ai=e=>{if(e.Ia)return e.Ia;var t=e.data,i=e.compression;if(t){if(i===ng){var s,r,n,a,o,l,u,h,c,d=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new nI(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var a=new nI(s+8+(t-n<<1));a.set(i),i=a}var o=e.charCodeAt(n);128>o?r(o):(2048>o?r(192|o>>>6):(o>55295&&57344>o?(r(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++n))>>>18),r(128|o>>>12&63)):r(224|o>>>12),r(128|o>>>6&63)),r(128|63&o))}return nJ(i,0,s)}(rY(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=n6[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},o=s.length,a.p(s),c=(l=10+(r.filename&&r.filename.length+1||0),h=function(e,t,i,s,r){var n=e.length,a=new nI(s+n+5*(1+Math.floor(n/7e3))+8),o=a.subarray(s,a.length-8),l=0;if(!t||8>n)for(var u=0;n>=u;u+=65535){var h=u+65535;n>h?l=n1(o,l,e.subarray(u,h)):(o[u]=r,l=n1(o,l,e.subarray(u,n)))}else{for(var c=n3[t-1],d=c>>>13,p=8191&c,v=(1<<i)-1,f=new nC(32768),g=new nC(v+1),_=Math.ceil(i/3),m=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<m)&v},b=new nA(25e3),w=new nC(288),x=new nC(32),k=0,E=0,S=(u=0,0),P=0,F=0;n>u;++u){var $=y(u),I=32767&u,C=g[$];if(f[I]=C,g[$]=I,u>=P){var A=n-u;if((k>7e3||S>24576)&&A>423){l=n2(e,o,0,b,w,x,E,S,F,u-F,l),S=k=E=0,F=u;for(var T=0;286>T;++T)w[T]=0;for(T=0;30>T;++T)x[T]=0}var O=2,M=0,R=p,L=I-C&32767;if(A>2&&$==y(u-L))for(var D=Math.min(d,A)-1,j=Math.min(32767,u),N=Math.min(258,A);j>=L&&--R&&I!=C;){if(e[u+O]==e[u+O-L]){for(var B=0;N>B&&e[u+B]==e[u+B-L];++B);if(B>O){if(O=B,M=L,B>D)break;var H=Math.min(L,B-2),q=0;for(T=0;H>T;++T){var z=u-L+T+32768&32767,W=z-f[z]+32768&32767;W>q&&(q=W,C=z)}}}L+=(I=C)-(C=f[I])+32768&32767}if(M){b[S++]=0x10000000|nD[O]<<18|nj[M];var V=31&nD[O],U=31&nj[M];E+=nT[V]+nO[U],++w[257+V],++x[U],P=u+O,++k}else b[S++]=e[u],++w[e[u]]}}l=n2(e,o,r,b,w,x,E,S,F,u-F,l),r||(l=n1(o,l,n5))}return nJ(a,0,s+nG(l)+8)}(s,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+r.mem,l,!u)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&n4(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(h,r),n4(h,c-8,a.d()),n4(h,c-4,o),h);return{contentType:n9,body:d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength),estimatedSize:d.byteLength}}if(i===n_){let e;var p,v="data="+encodeURIComponent("string"==typeof(e=(p=rY(t))?btoa(encodeURIComponent(p).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):p)?e:rY(e));return{contentType:"application/x-www-form-urlencoded",body:v,estimatedSize:new Blob([v]).size}}var f=rY(t);return{contentType:"application/json",body:f,estimatedSize:new Blob([f]).size}}},as=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:at(e.url,{compression:n_}),encodedBody:ai(p({},e,{compression:n_,Ia:void 0}))}:{url:ae(e.url,"compression"),encodedBody:ai(p({},e,{compression:void 0,Ia:void 0}))};try{t=ai(e)}catch(t){if(t2(e.compression,rX(e.url,"compression")))return id.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&t2(e.compression,rX(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?t1(new Uint8Array(i)):ArrayBuffer.isView(i)&&t1(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(n7=!0,s())},ar=e=>{try{return as(e)}catch(t){return id.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},an=(t=f(function*(e){var t=yield function(e,t,i){return t4.apply(this,arguments)}(rY(e.data),C.DEBUG,{rethrow:!0});if(!t)return e;var i=yield t.arrayBuffer();return p({},e,{Ia:{contentType:n9,body:i,estimatedSize:i.byteLength}})}),function(e){return t.apply(this,arguments)}),aa=/Failed to fetch|NetworkError|Load failed/i,ao=e=>"TypeError"===(null==e?void 0:e.name)&&aa.test((null==e?void 0:e.message)||""),al=e=>{var t=ar(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},a=n.contentType,o=n.body,l=n.estimatedSize,u=new Headers;sP(e.headers,function(e,t){u.append(t,e)}),a&&u.append("Content-Type",a);var h=null,c=!1;if(k){var d=new k;h={signal:d.signal,timeout:setTimeout(()=>{var t;c=!0,d.abort(tf("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}
1,e.timeout)}}var v=t=>{c&&"AbortError"===(null==t?void 0:t.name)||ao(t)?id.warn(t):id.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{w(s,p({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.Ea&&52428.8>(l||0),body:o,signal:null==(i=h)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){id.error(e)}null==e.callback||e.callback(s)})).catch(v).finally(()=>h?clearTimeout(h.timeout):null)}catch(e){h&&clearTimeout(h.timeout),v(e)}}},au=e=>{try{var t,i=as(e),s=i.url,r=i.encodedBody,n=null!=r?r:{},a=n.body,o=n.estimatedSize;if(!a)return;var l=a instanceof Blob?a:new Blob([a],{type:n.contentType});if(m.sendBeacon(s,l))return;var u=W(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(W(u)&&u.length>1&&(null!=o?o:0)>16384){var h=Math.ceil(u.length/2),c=t=>W(e.data)?t:p({},e.data,{batch:t});return au(p({},e,{data:c(u.slice(0,h))})),void au(p({},e,{data:c(u.slice(h))}))}id.warn("Beacon of ~"+(null!=o?o:0)+" bytes was rejected by the browser, falling back to fetch"),al(p({},e,{Ea:!0}))}catch(e){id.warn("Beacon send failed",e)}},ah=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return at(i===ng?ae(e,"compression"):e,p({},r?{[r]:Date.now().toString()}:{},i===ng?{}:{compression:i}))},ac=[];w&&ac.push({transport:"fetch",method:al}),x&&ac.push({transport:"XHR",method(e){var t=ar(e);if(t){var i=new x,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,a=r.body;sP(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=m&&m.sendBeacon&&ac.push({transport:"sendBeacon",method:au});var ad=class{constructor(e,t){this.Ra=!0,this.Aa=[],this.Pa=ec((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,id.createLogger("flush interval"),3e3),this.Fa=e}enqueue(e){this.Aa.push(e),this.Oa||this.$a()}unload(){this.Da();var e=Object.values(this.Aa.length>0?this.La():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Na(p({},e,{transport:"sendBeacon"}))})}enable(){this.Ra=!1,this.$a()}$a(){var e=this;this.Ra||(this.Oa=setTimeout(()=>{if(this.Da(),this.Aa.length>0){var t=this.La();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&W(s.data)&&sP(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Na(s)}()}},this.Pa))}Na(e){try{this.Fa(e)}catch(e){id.error(e)}}Da(){clearTimeout(this.Oa),this.Oa=void 0}La(){var e={};return sP(this.Aa,t=>{var i,s=(t?t.batchKey:null)||t.url;J(e[s])&&(e[s]=p({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Aa=[],e}},ap=class{constructor(e){this._instance=e,this.qa=!1,this.ja=3e3,this.Aa=[],this.Aa=[],this.Ba=!0,!J(g)&&"onLine"in g.navigator&&(this.Ba=g.navigator.onLine,this.Ha=()=>{this.Ba=!0,this.za()},this.Ua=()=>{this.Ba=!1},sM(g,"online",this.Ha),sM(g,"offline",this.Ua))}get length(){return this.Aa.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=d(e,h);ee(t)&&(i.url=at(i.url,{retry_count:t})),this._instance._send_request(p({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.cs(p({retriesPerformedSoFar:t},i));0===e.statusCode&&id.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==i.callback||i.callback(e)}}))}cs(e){var t,i,s,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=(s=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,r)))-t/2),Math.ceil(i+s)),a=Date.now()+n;this.Aa.push({retryAt:a,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),id.warn(o),this.qa||(this.qa=!0,this.Wa())}Wa(){(this.Va&&clearTimeout(this.Va),0===this.Aa.length)?(this.qa=!1,this.Va=void 0):this.Va=setTimeout(()=>{this.Ba&&this.Aa.length>0&&this.za(),this.Wa()},this.ja)}za(){var e=Date.now(),t=[],i=this.Aa.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Aa=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Va&&(clearTimeout(this.Va),this.Va=void 0),this.qa=!1,J(g)||(this.Ha&&(g.removeEventListener("online",this.Ha),this.Ha=void 0),this.Ua&&(g.removeEventListener("offline",this.Ua),this.Ua=void 0)),this.Aa)){var t=e.requestOptions;try{this._instance._send_request(p({},t,{transport:"sendBeacon"}))}catch(e){id.error(e)}}this.Aa=[]}},av=class{constructor(e){this._instance=e,this.Ga=()=>{this.Za||(this.Za={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Za.lastScrollY=Math.ceil(n),this.Za.maxScrollY=Math.max(n,null!=(e=this.Za.maxScrollY)?e:0),this.Za.maxScrollHeight=Math.max(a,null!=(t=this.Za.maxScrollHeight)?t:0),this.Za.lastContentY=o,this.Za.maxContentY=Math.max(o,null!=(i=this.Za.maxContentY)?i:0),this.Za.maxContentHeight=Math.max(l,null!=(s=this.Za.maxContentHeight)?s:0)}}get Ja(){return this._instance.config.scroll_root_selector}getContext(){return this.Za}resetContext(){var e=this.Za;return setTimeout(this.Ga,0),e}startMeasuringScrollPosition(){sM(g,"scroll",this.Ga,{capture:!0}),sM(g,"scrollend",this.Ga,{capture:!0}),sM(g,"resize",this.Ga)}scrollElement(){var e;if(!this.Ja)return null==g||null==(e=g.document)?void 0:e.documentElement;for(var t of W(this.Ja)?this.Ja:[this.Ja]){var i,s=null==g||null==(i=g.document)?void 0:i.querySelector(t);if(s)return s}}Qa(e){var t,i;if(this.Ja){var s=this.scrollElement();return s&&s["y"===e?"scrollTop":"scrollLeft"]||0}return g?"y"===e?g.scrollY||g.pageYOffset||(null==(t=g.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:g.scrollX||g.pageXOffset||(null==(i=g.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Qa("y")}scrollX(){return this.Qa("x")}},af=e=>ns(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes
vendor: 1,132 bytes, line 1
1),ag=class{constructor(e,t,i,s){this.Te=e=>{var t=this.Ka();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Xa(this._instance)};this.Ya.register({[sr]:i})}},this._instance=e,this.tl=t,this.Ya=i,this.Xa=s||af,this.tl.onSessionId(this.Te)}Ka(){return this.Ya.props[sr]}getSetOnceProps(){var e,t=null==(e=this.Ka())?void 0:e.props;return t?"r"in t?nr(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return sP(sA(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+R(i)]=t}),e}},a_=class{on(e,t){return this.el[e]||(this.el[e]=[]),this.el[e].push(t),()=>{this.el[e]=this.el[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.el[e]||[])i(t);for(var s of this.el["*"]||[])s(e,t)}constructor(){this.el={}}},am=ip("[SessionId]"),ay=class{on(e,t){return this.il.on(e,t)}constructor(e,t,i){if(this.rl=null,this.nl=null,this.sl=[],this.ol=void 0,this.al=!1,this.il=new a_,this.ll=(e,t)=>
1!(!ee(e)||!ee(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this._n=e.config,this.Ya=e.persistence,this.Ie=void 0,this.Bt=void 0,this._sessionStartTimestamp=null,this.ul=void 0,this._sessionActivityTimestamp=null,this.hl=t||sq,this.dl=i||sq;var s,r=this._n.persistence_name||this._n.token;if(this._sessionTimeoutMs=1e3*ec(this._n.session_idle_timeout_seconds||1800,60,36e3,am.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.vl(),this.cl="ph_"+r+"_window_id",this.fl="ph_"+r+"_primary_window_exists",this.pl()){var n=s9.di(this.cl),a=s9.di(this.fl);n&&!a?this.Ie=n:s9.hi(this.cl),s9.ui(this.fl,!0)}null!=(s=this._n.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this._n.bootstrap.sessionID),this.gl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return J(this.sl)&&(this.sl=[]),this.sl.push(e),this.Bt&&e(this.Bt,this.Ie),()=>{this.sl=this.sl.filter(t=>t!==e)}}pl(){return"memory"!==this._n.persistence&&!this.Ya.Bo&&s9.si()}ml(e){e!==this.Ie&&(this.Ie=e,this.pl()&&s9.ui(this.cl,e))}yl(){return this.Ie?this.Ie:this.pl()?s9.di(this.cl):null}bl(e){var t=this.rl;return!Z(t)&&!Z(e)&&5e3>Math.abs(e-t)}_l(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.Bt&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Bt=e,r&&!s||r&&this.bl(t)||(this.rl=t,this.Ya.register({[iz]:[t,e,i]}))}wl(){var e,t=null==(e=this._n)?void 0:e.persistence_save_debounce_ms;return ee(t)&&t>0}kl(){this.wl()?this.Ya.refreshKey(iz):(this.Ya.flush(),this.Ya.load())}Sl(){var e;if(!Z(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.rl){this.kl();var t=this.xl();t[1]===this.Bt&&t[2]===this._sessionStartTimestamp&&(this.rl=this._sessionActivityTimestamp,this.Ya.register({[iz]:[this._sessionActivityTimestamp,null!=(e=this.Bt)?e:null,this._sessionStartTimestamp]}),this.Ya.flush())}}Cl(){var e=this.xl()[0];return Math.max(ee(e)?e:0,ee(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Tl(e){return this.kl(),this.ll(e,this.Cl())}xl(){var e=this.Ya.props[iz];return W(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.rl=null,this.ul=void 0,clearTimeout(this.Ml),this.Ml=void 0,this._l(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void am.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void am.error("Invalid sessionID in bootstrap",e)}}(e);return!J(i)&&(t?this.ul={sessionId:e,sessionStartTimestamp:i}:this._l(e,(new Date).getTime(),i),!0)}destroy(){this.al=!0,this.Sl(),clearTimeout(this.Ml),this.Ml=void 0,this.ol&&g&&(g.removeEventListener(sb,this.ol,{capture:!1}),this.ol=void 0),this.sl=[]}gl(){this.ol=()=>{this.Sl(),this.pl()&&s9.hi(this.fl)},sM(g,sb,this.ol,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),"always"===this._n.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),a=this.Bt;i?this.nl=n:(Z(this.nl)||this.nl>n||n-this.nl>=1e3)&&(null==(s=(r=this.Ya).syncCookieProperties)||s.call(r),this.nl=n);var o=this.xl(),l=o[1],u=o[2],h=!J(a)&&l!==a,c=this.Cl(),d=this.yl(),p=this.ul,v=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),f=p?v:ee(u)&&Math.abs(n-u)>864e5,g=!1,_=h,m=!l||!!p,y=l,b=!m&&!e&&this.ll(n,c);if(b){(b=this.Tl(n))||am.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.xl();l=w[1],u=w[2]}if(m||b||f){_=!1;var x=p&&!v;l=x?p.sessionId:this.hl(),d=this.dl(),am.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:f}}),u=x?p.sessionStartTimestamp:n,this.ul=void 0,g=!0}else d||(d=this.dl(),g=!0),(_=_||l!==y)&&(am.info("adopted cross-tab session id",{sessionId:l,windowId:d}),g=!0);var k=ee(c)&&e&&!f?c:n,E=ee(u)?u:(new Date).getTime();this.ml(d),this._l(l,k,E),e||this.vl();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:f,crossTabAdoption:_};
1return g&&this.sl.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:g?S:void 0,lastActivityTimestamp:c}}vl(){this.al||(clearTimeout(this.Ml),this.Ml=setTimeout(()=>{if(!this.al)if(this.Tl((new Date).getTime())){var e=this.Bt;this.resetSessionId(),this.il.emit("forcedIdleReset",{idleSessionId:e})}else this.vl()},1.1*this.sessionTimeoutMs))}},ab=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&T(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>T(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function aw(){return(aw=f(function*(){var e=null==m?void 0:m.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t,i=null==(t=yield e.getHighEntropyValues(["model"]))?void 0:t.model;return K(i)&&i.length>0?i:void 0}catch(e){return void id.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function ax(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var ak=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},aE=e=>e.toLowerCase(),aS={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>ak(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!ak(t,e))),icontains:(e,t)=>t.map(aE).some(t=>e.map(aE).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(aE).every(t=>e.map(aE).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})};function aP(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],s=null==t?void 0:t[e[0]];if(null==s)return!1;var r=aS[i.operator];return!!r&&r(i.values,[String(s)])})}function aF(e,t,i){return rY({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}for(var a$="custom",aI="i.posthog.com",aC=/^\/static\//,aA=["/s/","/e/","/i/"],aT=class{constructor(e){this.Il={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+aI,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Il[this.apiHost]||(this.Il[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":a$),this.Il[this.apiHost]}El(e){if(aC.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}Rl(e){var t=rZ(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}Al(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;if(r&&(s=r(new URL((null==(a=rZ(i))?void 0:a.href)||i)).toString()),r&&"api"===e&&aA.some(e=>0===t.indexOf(e))){var n=this.Rl(s);if(n){var a,o,l=this.apiHost,u=this.Pl;(null==(o=u)?void 0:o.apiHost)===l&&u.rewriteRequestPath===r||(this.Pl=u={apiHost:l,rewriteRequestPath:r,urls:new Set}),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.Pl,i=this.Rl(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.Al(e,t,this.uiHost+t);if("flags"===e)return this.Al(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.El(t);if(i)return this.Al(e,t,""+i+t)}if(this.region===a$)return this.Al(e,t,this.apiHost+t);var s=aI+t;switch(e){case"assets":return this.Al(e,t,"https://"+this.region+"-assets."+s);case"api":return this.Al(e,t,"https://"+this.region+"."+s)}}},aO=ip("[Surveys]"),aM=e=>{try{var t="seenSurvey_"+(e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){aO.error("Failed to persist survey seen state",e)}}
1,aR=["popover","widget","api"],aL={ignoreConditions:!1,ignoreDelay:!1,displayType:nk},aD=ip("[PostHog ExternalIntegrations]"),aj={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},aN=class{constructor(e){this._instance=e}do(e,t){var i;null==(i=$.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return aD.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,s,r,n=i[0],a=i[1];!a||null!=(e=$.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.do(aj[n],()=>{var e;null==(e=$.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!a&&null!=(s=$.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=$.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}},aB=class{constructor(e,t){this.A=e,this.Hs=t,this.Fl=new Map,this.Js=!1}add(e){var t=this;return f(function*(){if(t.Js)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.Fl.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.Fl.set(e.name,e);try{var i=e.setup(t.Hs);i&&(yield i)}catch(i){var s=t.Fl.get(e.name)===e;s&&t.Fl.delete(e.name),t.A.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.Ol(e)}})()}getExtension(e){return this.Fl.get(e)}dispose(){if(!this.Js){this.Js=!0;var e=Array.from(this.Fl.values()).reverse();for(var t of(this.Fl.clear(),e))this.Ol(t)}}Ol(e){try{var t=null==e.dispose?void 0:e.dispose();t&&V(t.then)&&t.then(void 0,t=>{this.A.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.A.error('Failed to dispose browser extension "'+e.name+'"',t)}}},aH=class{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);J(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}},aq="extensionsRemoteConfig",az=class{constructor(e){this.instance=e,this.Js=!1,this.A=id,this.$l=e.Dl,this.kv=new aH(e),this.onEvent=e=>nE(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.A.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.Js)return nE(()=>{});var t=t=>{try{e(t)}catch(e){this.A.error("Browser extension remote config listener failed",e)}},i=this.instance.Ll.on(aq,t);return this.$l&&t(this.$l),nE(i)},this.Nl=new aB(id.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property("$device_id"))?e:this.distinctId}get deviceId(){var e=this.instance.get_property(iw);return"string"==typeof e?e:void 0}get library(){return{name:C.LIB_NAME,version:C.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==r?void 0:r.sessionId)?t:"",windowId:null!=(i=null==r?void 0:r.windowId)?i:"",sessionStartTimestamp:null!=(s=null==r?void 0:r.sessionStartTimestamp)?s:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.Nl.add(e)}getExtension(e){return this.Nl.getExtension(e)}capture(e,t,i){var s=this;return f(function*(){i?s.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):s.instance.capture(e,t)})()}registerDynamicEventProperties(e){return nE(this.instance.ql(e))}handleRemoteConfig(e){this.Js||(this.$l=e,this.instance.Ll.emit(aq,e))}sendRequest(e,t){var i=this;return f(function*(){void 0===t&&(t={});var s,r=i.instance.requestRouter.endpointFor(null!=(s=t.target)?s:"api",e),n={method:t.method,url:t.query?at(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,compressionFallback:"flags"===t.target&&"best-available"===t.compression?j.Base64:void 0,timestampMode:t.sentAt};return"sendBeacon"===t.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,i.instance._send_request(n)})})()}dispose(){this.Js||(this.Js=!0,this.Nl.dispose())}},aW={},aV=0,aU=()=>{}
1,aG='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',aJ="Surveys module not available",aK="sanitize_properties is deprecated. Use before_send instead",aY="Invalid value for property_denylist config: ",aZ=/^[A-Za-z0-9_-]{1,400}$/,aX=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,aQ=["token","distinct_id",sc],a0="posthog",a1=!n8&&-1===(null==S?void 0:S.indexOf("MSIE"))&&-1===(null==S?void 0:S.indexOf("Mozilla")),a2=e=>{var t,i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!K(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of sO)if(i===s)return!1;return!0}(null==y?void 0:y.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:aU,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:b&&K(null==b?void 0:b.search)&&-1!==b.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==g||null==(t=g.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){id.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:sm,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:aU},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:rm,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:(i={},e&&"unset"!==e&&("2025-11-30">e||(i.strictMinimumDuration=!0),"2026-05-30">e||(i.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(i.streamNetworkBody=!0),"2026-08-30">e||(i.captureJsonLd=!0)),i),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)})},a3=[["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"]],a5=e=>{var t={};for(var i of a3){var s=i[0],r=i[1];J(e[s])||(t[r]=e[s])}var n=sF({},t,e),a=e.__preview_external_dependency_versioned_paths;return J(a)||(J(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),K(a)&&J(e.asset_host)&&(n.asset_host=a)),W(e.property_blacklist)&&(J(e.property_denylist)?n.property_denylist=e.property_blacklist:W(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:id.error(aY+e.property_denylist)),n},a6=class{constructor(){this.__forceAllowLocalhost=!1}get jl(){return this.__forceAllowLocalhost}set jl(e){id.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},a4=((u=class e{Bl(e){if(e){var t=this.Fl.indexOf(e);-1!==t&&this.Fl.splice(t,1)}}Hl(e,t){return this.Bl(e),this.Fl.push(t),null==t.initialize||t.initialize(),t}zl(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Ul(){if(!(this.Wl||this.config.reuseAnonymousId||this.config.segment||this.zl())){var e,t,i,s="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(s||this.config.disable_persistence)&&(this.Vl||(s?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.Wl=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", 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. "+i)))}}Gl(){if(!this.zl()&&"$posthog_cookieless"===this.get_distinct_id()){var e=this.persistence;if(e){this.Zl()||e.load(!0);var t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){var i=this.config.get_device_id(sq());this.register({distinct_id:i,$device_id:i}),e.set_property(ss,sg)}this.Jl()}}}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new a6,this.Ql=!1,this.version=C.LIB_VERSION,this.Kl=new Set,this.Xl="",this.Ll=new a_,this.Fl=[],this.Yl=[],this.Vl=!1,this.Wl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=a2(),this.SentryIntegration=rW,this.sentryIntegration=e=>{var t;return t=rz(this,e),{name:rq,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tu=!1,this.eu=null,this.iu=null,this.ru=null,this.scrollManager=new av(this),this.pageViewM
vendor: 7,972 bytes, line 1
1anager=new rV(this),this.rateLimiter=new nP(this),this.requestRouter=new aT(this),this.consent=new s7(this),this.externalIntegrations=new aN(this);var t,i=null!=(t=e.__defaultExtensionClasses)?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:(e,t,i)=>{var s=K(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=K(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>id.info('send "'+(null==e?void 0:e.event)+'"',e))}init(t,i,s){if(s&&s!==a0){var r,n=null!=(r=aW[s])?r:new e;return n._init(t,i,s),aW[s]=n,aW[a0][s]=n,n}return this._init(t,i,s)}_init(e,t,i){void 0===t&&(t={});var s,r,n,a,o=K(e)?e.trim():"";if(!o)return id.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return o!==(null==(a=this.config)?void 0:a.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('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=a2(t.defaults),t.debug=this.nu(t.debug),this.su=t,this.ou=[],t.person_profiles?this.iu=t.person_profiles:t.process_person&&(this.iu=t.process_person);var l=a2(t.defaults),u=a5(t),h=sF({},l,u,{name:i,token:o});U(l.rageclick)&&U(u.rageclick)&&(h.rageclick=sF({},l.rageclick,u.rageclick)),U(l.session_recording)&&U(u.session_recording)&&(h.session_recording=sF({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&id.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:ng;var c=this.Zl();if(this.persistence=new nf(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new nf(p({},this.config,{persistence:"sessionStorage"}),c,!1),this.Xl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&s9.si()){var d=s9.di(this.Xl);W(d)&&d.forEach(e=>{K(e)&&this.Kl.add(e)})}else s9.hi(this.Xl);var v=p({},this.persistence.props),f=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.au=new ad(e=>this.lu(e),this.config.request_queue_config),this.uu=new ap(this),this.__request_queue=[];var _=this.zl();_||(this.sessionManager=new ay(this),this.sessionPropsManager=new ag(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.hu()})),this.du(),this.config.__preview_deferred_init_extensions?(id.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.vu(_)},0)):(id.info("Initializing extensions synchronously"),this.vu(_)),C.DEBUG=C.DEBUG||this.config.debug,C.DEBUG&&id.info("Starting in debug mode",{this:this,config:t,thisC:p({},this.config),p:v,s:f}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=p({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var m=null==(r=t.bootstrap)?void 0:r.distinctID;if(this.Vl=!!m&&!Y(m),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var y=t.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(ss);if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"anonymous"===w)this.identify(y);else if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"identified"===w)id.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var x=this.config.get_device_id(sq()),k=t.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(ss,t.bootstrap.isIdentifiedID?s_:sg),this.register({distinct_id:y,$device_id:k})}}if(_)this.register_once({distinct_id:sh,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(sq());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(ss,sg)}return sM(g,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?rH(this,()=>this.cu()):this.cu(),V(this.config._onCapture)&&this.config._onCapture!==aU&&(id.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&id.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 aw.apply(this,arguments)})().then(e=>{e&&this.register({[ix]:e})}).catch(aU),this}fu(e){return K(e.name)&&V(e.setup)}pu(e,t){this.fu(e)?t.push(()=>{this.gu().add(e).catch(()=>null==e.dispose?void 0:e.dispose()).catch(t=>{id.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this.Fl.push(e)}du(){var t,i,s,r,n,a,o=null!=(t=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)?t:null==(s=e.__defaultExtensionClasses)?void 0:s.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(a=this.mu)||a.call(this),this.mu=void 0,this.featureFlags=new o(this)),V(this.featureFlags.onReloading)&&V(this.featureFlags.setup)?this.mu||(this.mu=this.featureFlags.onReloading(()=>{this.Ll.emit("featureFlagsReloading",!0)}),this.gu().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}vu(t){var i,s,r,n,a,o,l,u=performance.now(),h=p({},e.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.exceptions&&this.Fl.push(this.exceptions=null!=(i=this.exceptions)?i:new h.exceptions(this)),h.historyAutocapture&&this.Fl.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Fl.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.Fl.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.Fl.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this.pu(this.autocapture=new h.autocapture(this),c),h.surveys&&this.pu(this.surveys=null!=(s=this.surveys)?s:new h.surveys(this),c),h.logs&&this.pu(this.logs=null!=(r=this.logs)?r:new h.logs(this),c),h.metrics&&this.Fl.push(this.metrics=null!=(n=this.metrics)?n:new h.metrics(this)),h.conversations&&this.Fl.push(this.conversations=null!=(a=this.conversations)?a:new h.conversations(this)),h.productTours&&this.Fl.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Fl.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Fl.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Fl.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Fl.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,rj)),h.toolbar&&this.Fl.push(this.toolbar=null!=(o=this.toolbar)?o:new h.toolbar(this)),h.experiments&&this.Fl.push(this.experiments=null!=(l=this.experiments)?l:new h.experiments(this)),this.Fl.forEach(e
1=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.yu){var e=this.yu;this.yu=void 0,this.Fl.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.bu(c,u)}bu(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.bu(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){id.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[sd]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[sp]:s}),this.config.__preview_deferred_init_extensions&&id.info("PostHog extensions initialized ("+s+"ms)")}Ta(e){var t;if(!y||!y.body)return id.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ta(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.yu=e),this.Dl=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=O(s.supportedCompression,ng)?ng:O(s.supportedCompression,n_)?n_:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.iu?this.iu:sm}),null==(t=this._u)||t.handleRemoteConfig(e),this.Fl.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}cu(){try{this.config.loaded(this)}catch(e){id.critical("`loaded` function failed",e)}if(this.wu(),this.config.internal_or_test_user_hostname&&null!=b&&b.hostname){var e=b.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.zl())&&this.ku()},1),this.Su=new n$(this),this.Su.load()}wu(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.au)||e.enable())}_dom_loaded(){this.is_capturing()&&sS(this.__request_queue,e=>this.lu(e)),this.__request_queue=[],this.wu()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.xu()&&this.capture(sx),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.au)||s.unload(),null==(r=this.uu)||r.unload()):this.xu()&&this.capture(sx,null,{transport:"sendBeacon"})}_send_request(e){var t;this.__loaded?a1?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=p({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!=(t=this.compression)?t:e.compressionFallback:e.compression,(J(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r,n,a=p({},e);a.timeout=a.timeout||6e4;var o,l,u,h,c,d=null!=(s=a.transport)?s:"fetch";"sendBeacon"===d&&J(a.compression)&&a.data&&(a.compression=n_),"POST"===a.method&&a.data&&("capture-body"===a.timestampMode?a.data={api_key:null!=(l=null==(c=(h=(W(o=a.data)?o:[o]).map(e=>p({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(u=c.properties)?void 0:u.token)?l:null==c?void 0:c.token,batch:h,sent_at:(new Date).toISOString()}:"body"===a.timestampMode&&(t=a.data,void 0===i&&(i=(new Date).toISOString()),a.data=W(t)?t.map(e=>p({},e,{sent_at:i})):p({},t,{sent_at:i}))),a.url=ah(a.url,a.method,a.compression,a.timestampMode);var v=ac.filter(e=>!a.disableTransport||!e.transport||!a.disableTransport.includes(e.transport)),f=null!=(r=null==(n=function(e,t){for(var i=0;e.length>i;i++)if(t(e[i]))return e[i]}(v,e=>e.transport===d))?void 0:n.method)?r:v[0].method;if(!f)throw Error("No available transport method");var g=e=>{try{f(e)}catch(e){ao(e)?id.warn(e):id.error(e),null==a.callback||a.callback({statusCode:0,error:e})}};"sendBeacon"!==d&&a.data&&a.compression===ng&&E&&"u">typeof Promise&&!n7?an(a).then(e=>{g(e)}).catch(t=>{t3(t)?(n7=!0,g(p({},a,{compression:void 0,url:ah(e.url,e.method,void 0,e.timestampMode)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return t3(e)||t===t0})(t)&&(n7=!0),g(a))}):f(a)})(p({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}lu(e){this.uu?this.uu.retriableRequest(e):this._send_request(e)}_execute_array(e){aV++;try{var t,i=[],s=[],r=[];sS(e,e=>{if(e)if(W(t=e[0]))r.push(e);else if(V(e))try{e.call(this)}catch(t){id.error("Error executing queued PostHog call",e,t)}else W(e)&&"alias"===t?i.push(e):W(e)&&-1!==t.indexOf("capture")&&V(this[t])?r.pu
1sh(e):s.push(e)});var n=function(e,t){sS(e,function(e){try{if(W(e[0])){var i=t;sP(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){id.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{aV--}}push(t){if(aV>0&&W(t)&&K(t[0])){var i=e.prototype[t[0]];V(i)&&i.apply(this,t.slice(1))}else this._execute_array([t])}Cu(){var e,t=null==(e=this.persistence)?void 0:e.get_property(iS);return K(t)&&aX.test(t)?{value:t,delivered:!1}:U(t)&&K(t.value)&&aX.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0}Tu(e,t,i,s){if(this.persistence){this.persistence.refreshKey(iS);var r=this.Cu();if(!s){if(i)return K(t)&&aX.test(t)?(t!==(null==r?void 0:r.value)&&this.persistence.register({[iS]:{value:t,delivered:!1}}),{value:t,pending:t!==(null==r?void 0:r.value)||!r.delivered}):void this.persistence.unregister(iS);if(K(e)&&aZ.test(e)){if((null==r?void 0:r.value.split(".")[3])===e)return{value:r.value,pending:!r.delivered};var n="fb.1."+Date.now()+"."+e;return this.persistence.register({[iS]:{value:n,delivered:!1}}),{value:n,pending:!0}}return r?{value:r.value,pending:!r.delivered}:void 0}this.persistence.unregister(iS)}}Mu(e){if(this.persistence){this.persistence.refreshKey(iS);var t=this.Cu();(null==t?void 0:t.value)!==e||t.delivered||this.persistence.register({[iS]:{value:e,delivered:!0}})}}capture(e,t,i){var s,r,n,a,o,l,u,h,c,d;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.au){if(this.is_capturing())if(!J(e)&&K(e)){this.Gl();var v=!this.config.opt_out_useragent_filter&&this._is_bot();if(!v||this.config.__preview_capture_bot_pageviews){var f=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==f||!f.isRateLimited){null!=t&&t.$current_url&&!K(null==t?void 0:t.$current_url)&&(id.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.Iu||id.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&&(g=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var g,_=new Date,m=(null==i?void 0:i.timestamp)||_,y=tv(null==i?void 0:i.uuid,sq),b={uuid:y,event:e,properties:this.calculateEventProperties(e,t||{},m,y)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&v&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),f&&(b.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);var w="$feature_flag_called"===e&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(b.$set=null==i?void 0:i.$set);var x=U(null==t?void 0:t.$set)?t.$set:void 0,k=!(null==i||!i.$set)&&"$fbc"in i.$set,E=k||!!x&&"$fbc"in x,S=k?null==i||null==(s=i.$set)?void 0:s[iE]:null==x?void 0:x[iE],P=W(null==t?void 0:t.$unset)?t.$unset:[],F=(null==i?void 0:i.$unset)||[],$=-1!==P.indexOf("$fbc")||-1!==F.indexOf("$fbc"),I=this.Tu(null==(r=g)?void 0:r.fbclid,S,E,$);I&&!0===b.properties.$process_person_profile&&I.pending&&!E&&!w&&(b.$set=p({[iE]:I.value},b.$set));var C=null==i?void 0:i.$unset;C&&(b.$unset=C);var A=w?void 0:this.Eu(null==i?void 0:i.$set_once,e!==sE,e===sk);if(A&&(b.$set_once=A),null!=i&&i._noTruncate||(u=this.config.properties_string_max_length,h=b,c=e=>K(e)?e.slice(0,u):e,d=new Set,b=function e(t,i){if(t!==Object(t))return c?c(t):t;if(!d.has(t)){var s;if(d.add(t),W(t))s=[],sS(t,t=>{s.push(e(t))});else{var r={};sP(ea(t)?sT(t):t,(t,i)=>{d.has(t)||(r[i]=e(t,i))}),s=r}return s}}(h)),b.timestamp=m,J(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=_),w&&(b.properties=(T=b.properties,void 0===(O=aQ)&&(O=[]),M={},R=e=>{void 0!==T[e]&&(M[e]=T[e])},tQ.forEach(R),O.forEach(R),M)),e===nw||e===nx){var T,O,M,R,L,D,j,N=null==t?void 0:t.$survey_id,B=null==t?void 0:t.$survey_iteration;aM({id:N,current_iteration:B}),b.$set=p({},b.$set,{[(L={id:N,current_iteration:B},j="$survey_"+(D=e===nx?"responded":"dismissed")+"/"+L.id,L.current_iteration&&L.current_iteration>0&&(j="$survey_"+D+"/"+L.id+"/"+L.current_iteration),j)]:!0})}else e===nb&&(b.$set=p({},b.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var H=null==t?void 0:t.$product_tour_type;H&&(b.$set=p({},b.$set,{["$product_tour_last_seen_date/"+H]:(new Date).toISOString()}))}var q=p({},b.properties.$set,b.$set);if(G(q)||this.setPersonPropertiesForFlags(q),!X(this.config.before_send)){var z=this.ds(b);if(!z)return;(b=z).uuid=tv(b.uuid,sq)}var V=null!=(n=null==(a=b.$set)?void 0:a.$fbc)?n:U(null==(o=b.properties)?void 0:o.$set)?b.properties.$set.$fbc:void 0,Y=null!=I&&I.pending&&V===I.value?I.value:void 0;this.Ll.emit("eventCaptured",b);var Z=null!=(l=null==i?void 0:i._url)?l:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),Q=p({method:"POST",url:Z,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(Z)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},Y?{fireCallbackOnDrop:!0,callback:e=>{e.statusCode>=200&&300>e.statusCode&&this.Mu(Y)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||Y?this.lu(Q):this.au.enqueue(Q),b}id.critical("This capture call is ignored due to client rate limiting.")}}else id.error("No event name provided to posthog.capture")}else id.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this._u)?void 0:t.getExtension(e)}gu(){var e;return null!=(e=this._u)?e:this._u=new az(this)}ql(e){this.Yl.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.Yl.indexOf(e);-1!==i&&this.Yl.splice(i,1)}}}Ru(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.ru=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(s=this.sessionPersistence)||s.clear(),this.Kl.clear(),this.Au()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,s,r){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.Ru();var n,a=r?void 0:this.persistence.remove_event_timer(e),o=p({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.zl()&&(o[sc]=!0),"$snapshot"===e){var l=p({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!K(o.distinct_id)&&!Q(o.distinct_id)||Y(o.distinct_id))&&id.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,h=function(e,t,i,s){if(void 0===s&&(s=!1),!S)return{};var r,n,a,o,l,u=e?[...r3,...t||[]]:[],h=tt(S),c=h[0],d=h[1],p=function(e){for(var t=0;tr.length>t;t++){var i,s=tr[t],r=s[1],n=s[2],a=e.match(s[0]);if(a)return[r,(null==(i=n&&e.match(n)||a)?void 0:i[1])||""]}
1return["",""]}(S),v=p[0],f=p[1],_=null!=(l="u">typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},m={};J(i)||(m.detectGoogleSearchApp=i);var y={},w=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,x=null==(n=navigator)?void 0:n.maxTouchPoints,k=null==g||null==(a=g.screen)?void 0:a.width,E=null==g||null==(o=g.screen)?void 0:o.height,P=null==g?void 0:g.devicePixelRatio;J(w)||(y.userAgentDataPlatform=w),J(x)||(y.maxTouchPoints=x),J(k)||(y.screenWidth=k),J(E)||(y.screenHeight=E),J(P)||(y.devicePixelRatio=P);var F,$,I,A,T,O,M=sF(sA({$os:c,$os_version:d,$browser:e8(S,navigator.vendor,_,m),$webview_app:v,$webview_app_version:f,$device:ti(S),$device_type:(O=ti(S))===e_||O===eg||"Kobo"===O||"Kindle Fire"===O||O===eB?ef:O===eC||O===eT||O===eA||O===ej?"Console":O===em?"Wearable":O?ep:"Android"===(null==y?void 0:y.userAgentDataPlatform)&&(null!=($=null==y?void 0:y.maxTouchPoints)?$:0)>0?600>Math.min(null!=(I=null==y?void 0:y.screenWidth)?I:0,null!=(A=null==y?void 0:y.screenHeight)?A:0)/(null!=(T=null==y?void 0:y.devicePixelRatio)?T:1)?ep:ef:"Desktop",$timezone:nn(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rQ(s?tg(null==b?void 0:b.href):null==b?void 0:b.href,u,r6),$host:null==b?void 0:b.host,$pathname:null==b?void 0:b.pathname,$raw_user_agent:S.length>1e3?S.substring(0,997)+"...":S,$browser_version:e7(S,navigator.vendor,_,m),$browser_language:ne(),$browser_language_prefix:"string"==typeof(F=ne())?F.split("-")[0]:void 0,$screen_height:null==g?void 0:g.screen.height,$screen_width:null==g?void 0:g.screen.width,$viewport_height:null==g?void 0:g.innerHe
vendor: 5,861 bytes, line 1
1ight,$viewport_width:null==g?void 0:g.innerWidth,$lib:C.LIB_NAME,$lib_version:C.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return C.SDK_DIST_CHANNEL&&(M.$sdk_dist_channel=C.SDK_DIST_CHANNEL),M}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime(),!0),d=c.windowId;o.$session_id=c.sessionId,o.$window_id=d}this.sessionPropsManager&&sF(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&sF(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(n=this.uu)?void 0:n.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===a$&&(o.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=sF(o,u),"$pageview"===e&&y&&(o.title=y.title),!J(a)){var v=i.getTime()-a;o.$duration=parseFloat((v/1e3).toFixed(3))}S&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var f=this.persistence.properties(),_=this.sessionPersistence.properties(),m=o.$groups,w=f.$groups;U(m)&&!G(m)&&(o.$groups=p({},U(w)?w:{},m)),sP(["$referrer","$referring_domain"],e=>{e in f&&delete _[e]});var x={};if(this.Yl.length>0)for(var k of this.Yl.slice())try{sF(x,k())}catch(e){id.error("Failed to produce browser extension event properties",e)}(o=sF({},h,f,_,p({},x,o))).$is_identified=this._isIdentified(),W(this.config.property_denylist)?sP(this.config.property_denylist,function(e){delete o[e]}):id.error(aY+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(id.error(aK),o=E(o,e));var P=this.Pu();return o.$process_person_profile=P,P&&!r&&this.Fu("_calculate_event_properties"),o}Eu(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Pu()||this.Ql&&!i)return e;var s,r=sF({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(id.error(aK),r=n(r,"$set_once")),t&&(this.Ql=!0),G(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.Ru(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.Kl.add(e)),this.Au()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.Kl.delete(e),this.Au()}Ou(e,t){this.register({[e]:t})}hu(){this.Kl.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.Kl.clear(),this.Au()}Au(){var e;if(this.Xl)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.Bo||!s9.si())s9.hi(this.Xl);else{var t=[];this.Kl.forEach(e=>t.push(e)),t.length>0?s9.ui(this.Xl,t):s9.hi(this.Xl)}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,s;return null!=(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.Ll.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:aJ}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:aJ})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:aJ})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=aL),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:aJ}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:aJ})}$u(e){return!e||Y(e)?(id.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(id.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(id.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return id.uninitializedWarning("posthog.identify");if(Q(e)&&(e=e.toString(),id.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.$u(e)&&this.Fu("posthog.identify")){this.Gl();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.Ru(!1),a=this.persistence.oa(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property("__alias")&&(this.unregister(ik),this.register({distinct_id:e}));var u=(this.persistence.get_property("$user_state")||"anonymous")===sg,h=e!==l,c=!h&&u;if(h&&u){var d,p=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:l};this.persistence.set_property(ss,s_),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.aa(),this.capture(sk,p,{$set:t||{},$set_once:i||{}}),this.ru=aF(e,t,i),null==(d=this.featureFlags)||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(c){this.persistence.set_property(ss,s_);var v=t||{},f=i||{};this.setPersonPropertiesForFlags({$set:v,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.aa(),this.capture("$set",{$set:v,$set_once:f}),this.ru=aF(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);h||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(i7)):c&&(t||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.ha(o)}}}setPersonProperties(e,t){if((e||t)&&this.Fu("posthog.setPersonProperties")){var i=aF(this.get_distinct_id(),e,t);this.ru!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.ru=i):id.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(W(e)?e:[e]).filter(e=>K(e)&&e.length>0);0!==i.length&&this.Fu("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.ru=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.Ru();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:p({},r,{[e]:t})}),(n||i)&&this.Pu()){var a={$group_type:e,$group_key:t};i&&(a.$group_set=i),this.capture(sE,a)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else id.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.Fu("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=et(e)?e:null==e?void 0:e.resetDeviceID,i=et(e)||null==e?void 0:e.bootstrap;this.Du(t,!1,i)}Du(e,t,i){if(void 0===t&&(t=!1),id.info("reset"),!this.__loaded)return id.uninitializedWarning("posthog.reset");var s,r,n,a,o,l,u,h,c,d,v,f,g,_,m,y,b,w,x=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.su)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ma());var k=this.get_property(iw),E=this.get_property(ix),S=this.get_property(iD);null==(n=this.sessionRecording)||n.flushBeforeIdentityReset();var P=this.is_capturing();this.consent.reset(),t||!P||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var F=null==(a=this.persistence)||null==a.oa?void 0:a.oa(),$=!1;try{if(null==(o=this.persistence)||o.clear(),null==(l=this.sessionPersistence)||l.clear(),this.Kl.clear(),this.Au(),J(S)||null==(u=this.persistence)||u.register({[iD]:S}),null==(h=this.surveys)||h.reset(),null==(c=this.featureFlags)||c.reset(),null==(d=this.conversations)||d.reset(),null==(v=this.logs)||v.reset(),null==(f=this.metrics)||f.reset(),null==(g=this.persistence)||g.set_property(ss,sg),null==(_=this.sessionManager)||_.resetSessionId(),this.ru=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:sh,$device_id:null},"");else{var I=this.config.get_device_id(sq());this.register_once({distinct_id:I,$device_id:e?I:k},""),e||J(E)||this.register({[ix]:E})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.zl()||(null==(b=this.persistence)||b.set_property(ss,i.isIdentifiedID?s_:sg),this.register({distinct_id:i.distinctID}
vendor: 5,788 bytes, line 1
1)),null==(m=this.featureFlags)||m.initialize(),!(J(x)||null!=(y=this.sessionManager)&&y.setBootstrapSessionId(x,!0)))){var C=p({},i);delete C.sessionID,this.config.bootstrap=C}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,$=!0}finally{F&&(null==(w=this.persistence)||null==w.ha||w.ha($))}this.reloadFeatureFlags()}shutdown(e){var t=this;return f(function*(){var e,i,s,r,n,a,o,l;if(t.__loaded){t.gu().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(i=t.logs)||i.flushLogs("sendBeacon"),null==(s=t.metrics)||s.flush("sendBeacon"),null==(r=t.au)||r.unload(),null==(n=t.uu)||n.unload();try{null==(l=t.featureFlags)||l.destroy()}catch(e){id.error("Error while destroying feature flags",e)}null==(a=t.persistence)||a.destroy(),null==(o=t.sessionPersistence)||o.destroy()}else id.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.Lu()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e.Nu()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property("$people_distinct_id")?(id.critical("Attempting to create alias for existing People user - aborting."),-2):this.Fu("posthog.alias")?(J(t)&&(t=this.get_distinct_id()),e!==t?(this.Ou(ik,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(id.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=p({},this.config);if(U(e)){sF(this.config,a5(e));var i,s,r,n,a,o,l,u,h,c,d,v,f,g=this.Zl();null==(i=this.persistence)||i.update_config(this.config,t,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new nf(p({},this.config,{persistence:"sessionStorage"}),g,!1);var _=this.nu(this.config.debug);et(_)&&(this.config.debug=_),et(this.config.debug)&&(this.config.debug?(C.DEBUG=!0,sK.si()&&sK.ui("ph_debug",!0),id.info("set_config",{config:e,oldConfig:t,newConfig:p({},this.config)})):(C.DEBUG=!1,sK.si()&&sK.hi("ph_debug"))),null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Ma()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(h=this.historyAutocapture)||h.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.Jl(),null==(f=this.externalIntegrations)||f.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&rH(this,aU,!1)}}_overrideSDKInfo(e,t){C.LIB_NAME=e,C.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),o.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(p({},i,t))}catch(e){return}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var t,i;return null!=(t=null==(i=this.logs)?void 0:i.logger)?t:e.qu}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:a0;return t!==a0&&(t="posthog."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))}Pu(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&
1!this._isIdentified()&&G(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e.__alias)&&(null==(t=this.persistence)||null==(t=t.props)||!t.$epp))}xu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Pu()||this.Fu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Fu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Fu(e){return"never"===this.config.person_profiles?(id.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ul(),this.Ou(su,!0),!0)}Zl(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}Jl(){var e,t,i,s,r,n=this.Zl();return this.is_capturing()||null==(e=this.logs)||e.ju(),(null==(t=this.persistence)?void 0:t.Bo)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(s=this.sessionPersistence)?void 0:s.Bo)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.Kl.clear(),this.Au()),n}opt_in_capturing(t){var i,s,r;if("always"!==this.config.cookieless_mode){if(this.zl()){null==(n=this.sessionRecording)||n.dispose({discardBufferedEvents:!0}),this.Du(!0,!0),null==(a=this.sessionManager)||a.destroy(),null==(o=this.pageViewManager)||o.destroy(),this.sessionManager=new ay(this),this.pageViewManager=new rV(this),this.persistence&&(this.sessionPropsManager=new ag(this,this.sessionManager,this.persistence));var n,a,o,l,u,h,c,d=null!=(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)?l:null==(h=e.__defaultExtensionClasses)?void 0:h.sessionRecording;d&&(this.sessionRecording=this.Hl(this.sessionRecording,new d(this)),this.Dl&&(null==(c=this.sessionRecording)||null==c.onRemoteConfig||c.onRemoteConfig(this.Dl)))}this.consent.optInOut(!0),this.Jl(),this.wu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(s=this.surveys)||s.loadIfEnabled()),(J(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!=(r=null==t?void 0:t.captureEventName)?r:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.ku()}else id.warn(aG)}opt_out_capturing(){if("always"!==this.config.cookieless_mode){var e,t,i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.Du(!0,!0),this.consent.optInOut(!1),this.Jl(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:sh,$device_id:null}),this.Bl(i),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.ku(),this.wu())}else id.warn(aG)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Jl()}_is_bot(){return m?ab(m,this.config.custom_blocked_useragents):void 0}ku(){y&&("visible"===y.visibilityState?this.tu||(this.tu=!0,this.capture(sw,{title:y.title},{send_instantly:!0}),this.eu&&(y.removeEventListener(sy,this.eu),this.eu=null)):this.eu||(this.eu=this.ku.bind(this),sM(y,sy,this.eu)))}debug(e){!1===e?(null==g||g.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==g||g.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}))}Ma(){var e,t,i,s,r=this.su||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(id.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):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!X(r[e]),s=t in r&&!X(r[t]),i?r[e]:!!s&&(id&&id.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}ds(e){if(X(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(es),s=W(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;
1for(var n of s)try{if(r=n(r),X(r)){var a="Event '"+e.event+"' was rejected in beforeSend function";return ei(e.event)?id.warn(a+". This can cause unexpected behavior."):id.info(a),null}r.properties&&!G(r.properties)||id.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return id.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var o of i)if(r.properties&&X(r.properties[o]))return id.warn("Event '"+e.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 e;return null==(e=this.pageViewManager.fo)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}nu(e){var t=et(e)&&!e,i=sK.si()&&"true"===sK.li("ph_debug");return!t&&(!!i||e)}}).__defaultExtensionClasses={},u.qu={trace:i=()=>{},debug:i,info:i,warn:i,error:i,fatal:i},u),a8=["identify"],a9=0;a8.length>a9;a9++)a4.prototype[a8[a9]]=sC(a4.prototype[a8[a9]]);var a7=class{constructor(e){this.disabled=!1===e;var t=U(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;var 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}},oe="$copy_autocapture",ot=ip("[AutoCapture]");function oi(e,t){return t.length>e?t.slice(0,e)+"...":t}var os=class{Ds(){this.Ls=void 0,clearTimeout(this.Ns),this.Ns=void 0}qs(e){var t;if(!rS(e))return!0;for(var i,s=null!=(t=this.js().css_selector_ignorelist)?t:rg,r=new Set,n=e;n;)if(i=function(){if(r.size>=1e3||r.has(n))return{v:!0};r.add(n);var e=n,t=rl(e);if(O(t,"ph-no-capture")||O(t,"ph-sensitive")||rP(e)||s.some(t=>rp(e,t)))return{v:!0};var i=n.parentNode;n=rn(i)?i.host:i&&ri(i)?i:null}())return i.v;return!1}Bs(e){if(this.isEnabled&&"pointercancel"!==e.type)if("pointerdown"!==e.type){var t=this.Ls;t&&(e.pointerId!==t.id||Math.abs(e.clientX-t.x)>5||Math.abs(e.clientY-t.y)>5?this.Ds():"pointerup"===e.type&&(t.released=!0,this.Ns=setTimeout(()=>this.Ds(),0)))}else{this.Ds();var i,s=rc(e);e.isPrimary&&0===e.button&&!e.ctrlKey&&s&&ri(s)&&(this.Ls={target:s,excluded:this.qs(s),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(i=this.Hs)?void 0:i.distinctId})}else this.Ds()}zs(e){var t,i=this.Ls;this.Ds();var s=rc(e);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(t=this.Hs)?void 0:t.distinctId)&&e.pointerId===i.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-i.x)&&5>=Math.abs(e.clientY-i.y)&&s&&(rs(s,"html")||rs(s,"body"))){if(i.excluded)return null;var r,n=null!=(r=this.js().css_selector_ignorelist)?r:rg;return[s,null==y?void 0:y.documentElement,null==y?void 0:y.body].some(e=>{if(!e)return!1;var t=rl(e);return O(t,"ph-no-capture")||O(t,"ph-sensitive")||!rS(e)||rP(e)||n.some(t=>rp(e,t))})?null:i.target}}constructor(e){this.Us=e,this.name="autocapture",this.Ws=!1,this.Vs=null,this.Gs=!1,this.Zs=!1,this._n={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Js=!1,this.Us.refresh(this._n),this.rageclicks=new a7(this._n.rageclick),this.Qs=null}setup(e){this.Ks(),this.Hs=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Js?t.dispose():(this.Xs=t,this.startIfEnabled())}dispose(){var e;this.Js||(this.Js=!0,this.Hs=void 0,null==(e=this.Xs)||e.dispose(),this.Xs=void 0,this.Ys())}js(){return this.Us.refresh(this._n),this._n}Ks(){var e,t;return this.js(),this._n.url_allowlist=null==(e=this._n.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this._n.url_ignorelist=null==(t=this._n.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this._n}
vendor: 5,039 bytes, line 1
1eo(){if(this.isBrowserSupported()){if(g&&y){var e=this.io=e=>{e=e||(null==g?void 0:g.event);try{if("blur"===e.type)return void this.Ds();if(0===e.type.indexOf("pointer"))return void this.Bs(e);var t="click"===e.type?this.zs(e):void 0;if(Z(t))return;this.ro(e,"$autocapture",t)}catch(e){ot.error("Failed to capture event",e)}};if(sM(g,"blur",e),sM(y,"submit",e,{capture:!0}),sM(y,"change",e,{capture:!0}),sM(y,"click",e,{capture:!0}),sP(["pointerdown","pointermove","pointerup","pointercancel"],t=>{sM(y,t,e,{capture:!0})}),this.js().capture_copied_text){var t=this.no=e=>{e=e||(null==g?void 0:g.event);try{this.ro(e,oe)}catch(e){ot.error("Failed to capture clipboard event",e)}};sM(y,"copy",t,{capture:!0}),sM(y,"cut",t,{capture:!0}),sM(y,"paste",t,{capture:!0})}}}else ot.info("Disabling Automatic Event Collection because this browser is not supported")}Ys(){this.Ds(),this.io&&(null==g||g.removeEventListener("blur",this.io),sP(["pointerdown","pointermove","pointerup","pointercancel"],e=>{null==y||y.removeEventListener(e,this.io,!0)}),null==y||y.removeEventListener("submit",this.io,!0),null==y||y.removeEventListener("change",this.io,!0),null==y||y.removeEventListener("click",this.io,!0),this.io=void 0),this.no&&(null==y||y.removeEventListener("copy",this.no,!0),null==y||y.removeEventListener("cut",this.no,!0),null==y||y.removeEventListener("paste",this.no,!0),this.no=void 0),this.Ws=!1}startIfEnabled(){this.isEnabled||this.Ds(),!this.Js&&this.Hs&&this.isEnabled&&!this.Ws&&(this.eo(),this.Ws=!0)}onRemoteConfig(e){if(!this.Js)if(this.Gs=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.Zs=t.elementsChainAsString);var i,s=t.autocapture_opt_out;et(s)&&(null==(i=this.Hs)||i.kv.set(iF,s),this.Vs=s),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.Qs=e}getElementSelectors(e,t){var i,s=[];return null==(i=this.Qs)||i.forEach(i=>{var r;null==y||null==(r=y.querySelectorAll(i))||r.forEach(r=>{e!==r&&t!==r||O(s,i)||s.push(i)})}),s}get isEnabled(){if(this.Js)return!1;var e,t,i=null==(e=this.Hs)?void 0:e.kv.get(iF),s=this.Vs,r=this.js();if(!r.remoteRequestsDisabled&&!this.Gs)return!1;var n=r.remoteRequestsDisabled&&!this.Gs;if(Z(s)&&!et(i)&&!n)return!1;var a=null!=(t=this.Vs)?t:!!i;return!!r.enabled&&!a}ro(e,t,i){if(void 0===t&&(t="$autocapture"),this.isEnabled){var s=i||rc(e);rr(s)&&(s=s.parentNode||null);var r,n=this.Ks();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&n.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&rx(s,n.rageclick)&&this.ro(e,"$rageclick",i);var a=t===oe,o=a?p({},n,{dom_event_allowlist:void 0}):n;if(s&&function(e,t,i,s,r,n){if(!g||rk(e)||null!=i&&i.url_allowlist&&!ro(i.url_allowlist,n)||null!=i&&i.url_ignorelist&&ro(i.url_ignorelist,n))return!1;if(null!=i&&i.dom_event_allowlist){var a,o=i.dom_event_allowlist;if(o&&!o.some(e=>t.type===e))return!1}var l=rE(e,s),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(J(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(h,i)||!rv(h,null==i?void 0:i.css_selector_allowlist)||rv(h,null!=(a=null==i?void 0:i.css_selector_ignorelist)?a:rg))return!1;try{var c=g.getComputedStyle(e);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var d=e.tagName.toLowerCase();switch(d){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return u?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(rd.indexOf(d)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:n.getCurrentUrl}})){var l,u=function(e,t){var i,s,r=t.e,n=t.maskAllElementAttributes,a=t.maskAllText,o=t.elementAttributeIgnoreList,l=t.elementsChainAsString,u=t.disableCaptureUrlHashes;if(!ri(e))return{props:{}};for(var h=[e],c=new Set([e]),d=e;d.parentNode&&!rs(d,"body")&&1e3>h.length;)if(rn(d.parentNode)){var v=d.parentNode.host;if(c.has(v))break;c.add(v),h.push(v),d=v}else{if(!ri(d.parentNode)||c.has(d.parentNode))break;c.add(d.parentNode),h.push(d.parentNode),d=d.parentNode}var f="click"===r.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?h.findIndex(e=>rs(e,"button")||rs(e,"a")):-1;f>0&&(a=a||h.slice(0,f+1).some(e=>!rS(e)||rP(e)));var _,m=[],y={},b=!1,w=!1;if(sP(h,e=>{var t=rS(e);if(rs(e,"a")){var i=e.getAttribute("href");b=!!(t&&i&&rO(i))&&(u?tg(i):i)}O(rl(e),"ph-no-capture")&&(w=!0),m.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};rd.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?oi(1024,rM(e)):oi(1024,rh(e)));var o=rl(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),sP(e.attributes,function(i){var n;if((!rP(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&
1!t&&rO(i.value)&&(!K(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=ra(o).join(" ")),a["attr__"+i.name]=oi(1024,"href"===i.name&&r?tg(o):o)}});for(var l=1,u=1,h=e;h=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ri(t))return t}(h);)l++,h.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,n,a,o,u)),sP(function(e){if(!rS(e))return{};var t={};return sP(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&rO(s)&&(t[i]=s)}}),t}(e),(e,t)=>{({}).hasOwnProperty.call(y,t)||(y[t]=e)})}),w)return{props:{},explicitNoCapture:w};if(f>0&&(e=h[f],m.splice(0,f)),a||(m[0].$el_text=rs(e,"a")||rs(e,"button")?rM(e):rh(e)),b){m[0].attr__href=b;var x,k,E=null==(x=rZ(b))?void 0:x.host,S=null==g||null==(k=g.location)?void 0:k.host;E&&S&&E!==S&&(_=b)}return{props:sF({$event_type:r.type,$ce_version:1},l?{}:{$elements:m},{$elements_chain:W(m)?m.map(e=>{var t,i,s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){var t=e.attr__class;if(t)return W(t)?t:ra(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return s$(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>s.attributes[e[0]]=e[1]),s}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=p({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return s$(n).sort((e,t)=>{var i,s;return(s=t[0])>(i=e[0])?-1:+(i>s)}).forEach(e=>{var t=e[1];return a[rR(e[0].toString())]=rR(t.toString())}),(s+=":")+s$(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";"):""},null!=(i=m[0])&&i.$el_text?{$el_text:null==(s=m[0])?void 0:s.$el_text}:{},_&&"click"===r.type?{$external_click_url:_}:{},y),target:e}}(s,{e:e,maskAllElementAttributes:n.maskAllElementAttributes,maskAllText:n.maskAllText,elementAttributeIgnoreList:n.element_attribute_ignorelist,elementsChainAsString:this.Zs,disableCaptureUrlHashes:n.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var c=this.getElementSelectors(s,u.target);if(c&&c.length>0&&(h.$element_selectors=c),t===oe){var d=e.type||"clipboard";if("paste"!==d){var v,f,_=null==g||null==(v=g.getSelection())?void 0:v.toString(),m=ru(_);if(!m)return!1;h.$selected_content=m,h.$clipboard_text_length=null!=(f=null==_?void 0:_.length)?f:0}h.$copy_type=d}return null==(l=this.Hs)||l.capture(t,h).catch(e=>ot.error("Failed to capture event",e)),!0}}else this.Ds()}isBrowserSupported(){return V(null==y?void 0:y.querySelectorAll)}},or=class{constructor(e){this._instance=e}refresh(e){var t=this._instance.config,i=U(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.Ma(),e.url_allowlist=null==i?void 0:i.url_allowlist,e.url_ignorelist=null==i?void 0:i.url_ignorelist,e.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,e.element_allowlist=null==i?void 0:i.element_allowlist,e.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,e.capture_copied_text=null==i?void 0:i.capture_copied_text}},on=ip("[ExceptionAutocapture]"),oa=()=>{},oo=e=>{var t;if(V(e))return null!=(t=e.__posthog_layer__)?t:e.__rrweb_layer__};function ol(e,t,i){try{if(!(t in e))return oa;var s={next:e[t]},r=i(function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];return s.next.apply(this,t)});return V(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r,()=>{if(e[t]!==r)for(var i=e[t],n=oo(i);n;){if(n.next===r)return void(n.next=s.next);n=oo(i=n.next)}else e[t]=s.next}}catch(e){return oa}}var ou=ip("[TracingHeaders]"),oh=ip("[Web Vitals]"),oc=["CLS","FCP","INP","LCP"],od=["INP","LCP"],op=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],ov="disabled",of="lazy_loading",og=ip("[SessionRecording]"),o_=ip("[Heatmaps]");function om(e){return U(e)&&"clientX"in e&&"clientY"in e&&Q(e.clientX)&&Q(e.clientY)}var oy=ip("[Product Tours]"),ob=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(iM))},ow=ip("[SiteApps]"),ox="Error while initializing PostHog app with config id ",ok=(e,t)=>null!=e&&e.then?e.then(t):t(e),oE="SDK is not enabled or survey functionality is not yet loaded",oS="Disabled. Not loading surveys.",oP=class{constructor(e,t){this.Us=e,this.Bu=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Hu=!1,this.zu=[],this.Uu=null,this.Wu=null,this.Js=!1,this.Vu=new Set,this.onRemoteConfig=e=>{if(!this.Js&&!this._n.disableSurveys){if(!e.ok)return aO.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(X(t))return aO.warn("Flags not loaded yet. Not loading surveys.");this.Gu=et(t)?t:t.length>0,aO.info("flags response received, isSurveysEnabled: "+this.Gu),this.loadIfEnabled()}}}setup(e){if(!this.Js)return this.Zu=e,ok(e.kv.initialize(),()=>{if(this.Zu===e&&!this.Js){this.Zu=void 0,this.Hs=e;var t=e.onRemoteConfig(this.onRemoteConfig);this.Js?t.dispose():(this.Xs=t,this.loadIfEnabled())}})}dispose(){var e,t,i;this.Js||(this.Js=!0,this.Zu=void 0,this.Hs=void 0,null==(e=this.Xs)||e.dispose(),this.Xs=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.zu=[],this.Uu=null,this.Vu.forEach(e
1=>clearTimeout(e)),this.Vu.clear())}get _n(){return this.Us.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var s=localStorage.key(i);(null!=s&&s.startsWith("seenSurvey_")||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this.Js&&this.Hs){var e=this._n;if(!this._surveyManager)if(this.Hu)aO.info("Already initializing surveys, skipping...");else if(e.disableSurveys)aO.info(oS);else if(e.cookielessMode&&this.Us.isOptedOut())aO.info("Not loading surveys in cookieless mode without consent.");else{var t=this.Us.getExtensions();if(t){if(!J(this.Gu)||e.advancedEnableSurveys){var i=this.Gu||e.advancedEnableSurveys;this.Hu=!0;try{var s=t.generateSurveys;if(s)return this.Ju(s,i),void(this.Hu=!1);var r=t.loadExternalDependency;if(!r)return this.Qu(sf),void(this.Hu=!1);r(e=>{try{if(this.Js)return;var t=this.Us.getExtensions();e||null==t||!t.generateSurveys?this.Qu("Could not load surveys script",e):this.Ju(t.generateSurveys,i)}finally{this.Hu=!1}})}catch(e){throw this.Hu=!1,this.Qu("Error initializing surveys",e),e}}}else aO.error("PostHog Extensions not found.")}}}Ju(e,t){this.Js||(this._surveyManager=e(t),this._surveyEventReceiver=this.Us.createEventReceiver(),aO.info("Surveys loaded successfully"),this.Ku({isLoaded:!0}))}Qu(e,t){aO.error(e,t),this.Ku({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.zu.push(e),this._surveyManager&&this.Ku({isLoaded:!0}),()=>{this.zu=this.zu.filter(t=>t!==e)}}getSurveys(e,t){void 0===t&&(t=!1);var i,s=null!=(i=this.Hs)?i:this.Bu;if(s&&!this.Js){if(this._n.disableSurveys)return aO.info(oS),e([]);var r=s.kv.get(i3);if(r&&!t)return e(r,{isLoaded:!0}),void(this.Xu()&&this.getSurveys(()=>{},!0));if(this.Uu)this.Uu.then(t=>{this.Js||e(t.surveys,t.context)}).catch(e=>aO.error("Error in survey callback",e));else{var n=this.Yu("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this._n.requestTimeoutMs}).then(e=>{try{return this.th(s,e)}catch(e){return aO.error("Error processing surveys response",e),this.th(s,{statusCode:0,error:e})}},e=>this.th(s,{statusCode:0,error:e}));this.Uu=n;var a=()=>{this.Uu===n&&(this.Uu=null)};n.then(t=>{a(),this.Js||e(t.surveys,t.context)},a).catch(e=>aO.error("Error in survey callback",e))}}}Yu(e,t){var i=this.Hs;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(oE)}))}th(e,t){if(this.Js)return{surveys:[],context:{isLoaded:!1,error:oE}};var i,s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;return 0!==s?aO.error(r):t.error||aO.warn(r),this.Wu=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Wu=null;var n=t.json.surveys||[],a=n.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(ax(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});return a.length>0&&(null==(i=this._surveyEventReceiver)||i.register(a)),e.kv.set({[i3]:n,[i5]:Date.now()}),{surveys:n,context:{isLoaded:!0}}}Xu(){return this.eh()&&!this.Uu&&!this.ih()}eh(){var e,t,i=null==(e=null!=(t=this.Hs)?t:this.Bu)?void 0:e.kv.get(i5);return Q(i)&&Date.now()-i>3e5}ih(){return Q(this.Wu)&&3e5>Date.now()-this.Wu}markSurveyAsSeen(e,t){var i;aM({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}Ku(e){for(var t of this.zu)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){aO.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!X(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);aO.warn("init was not called")}rh(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}nh(e){if(X(this._surveyManager))return{eligible:!1,reason:oE};var t="string"==typeof e?this.rh(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}sh(e){if(X(this._surveyManager))return{eligible:!1,reason:oE};var t="string"==typeof e?this.rh(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(X(this._surveyManager))return aO.warn("init was not called"),{visible:!1,disabledReason:oE};var t=this.sh(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return X(this._surveyManager)?(aO.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:oE})):new Promise(i=>
1{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.sh(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(X(this._surveyManager))aO.warn("init was not called");else{var r="string"==typeof e?this.rh(e):e;if(null!=r&&r.id)if(aR.includes(r.type)){var n=null==y?void 0:y.querySelector(t);if(n)if(null!=(s=r.appearance)&&s.surveyPopupDelaySeconds){aO.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var e,t;this.Vu.delete(a),this.Js||(aO.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,n,i),aO.info("Survey "+r.id+" rendered"))},1e3*r.appearance.surveyPopupDelaySeconds);this.Vu.add(a)}else this._surveyManager.renderSurvey(r,n,i);else aO.warn("Survey element not found")}else aO.warn("Surveys of type "+r.type+" cannot be rendered in the app");else aO.warn("Survey not found")}}displaySurvey(e,t){var i;if(X(this._surveyManager))aO.warn("init was not called");else{var s=this.rh(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=p({},s,{appearance:p({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==nk&&t.initialResponses&&aO.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.nh(s);if(!n.eligible)return void aO.warn("Survey is not eligible to be displayed: ",n.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else aO.warn("Survey not found")}}cancelPendingSurvey(e){X(this._surveyManager)?aO.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}};function oF(e,t,i){if(X(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var o$=class{constructor(e){this._instance=e,this.oh=new Set,this.ah=new Set,this.uh=new a_,this.hh=(e,t)=>this.dh(e,t)&&this.fh(e,t)&&this.ph(e,t)&&this.gh(e,t),this.dh=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)}init(){var e,t;J(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.mh=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e;null==(e=this.mh)||e.call(this),this.mh=void 0,this.uh=new a_}register(e){var t,i;if(!J(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.oh.add(e),null==(t=e.steps)||t.forEach(e=>{this.ah.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s=new Set;this.oh.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(e.selector)})}),this._instance.autocapture.setElementSelectors(s)}}replace(e){this.oh.clear(),this.ah.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.ah.has(e)||this.ah.has(t.event))&&this.oh.forEach(e=>{this.yh(t,e)&&this.uh.emit("actionCaptured",e.name)})}bh(e){this.onAction("actionCaptured",t=>e(t))}yh(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.hh(e,i))return!0;return!1}onAction(e,t){return this.uh.on(e,t)}fh(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!oF(s,t.url,t.url_matching||"contains"))return!1}return!0}ph(e,t){return!!this._h(e,t)&&!!this.wh(e,t)&&!!this.kh(e,t)}_h(e,t){if(null==t||!t.href)return!0;var i=this.Sh(e);if(i.length>0)return i.some(e=>oF(e.href,t.href,t.href_matching||"exact"));var s,r,n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!n&&oF((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}wh(e,t){if(null==t||!t.text)return!0;var i=this.Sh(e);if(i.length>0)return i.some(e=>oF(e.text,t.text,t.text_matching||"exact")||oF(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,a,o=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!o&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!X(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",r.some(e=>oF(e,n,a)))}kh(e,t){if(null==t||!t.selector||null!=e&&null!=(i=e.properties)&&null!=(i=i.$element_selectors)&&i.includes(t.selector))return!0;var i,s,r=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&r)try{return new RegExp(t.selector_regex).test(r)}catch(e){}return!1}Sh(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}gh(e,t){return null==t||!t.properties||0===t.properties.length||aP(t.properties.reduce((e,t)=>
vendor: 4,854 bytes, line 1
1{var i=W(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}},oI=class{constructor(e){var t;this.xh=[],this._instance=e,this.Ch=new Map,this.Th=new Map,this.Mh=new Map,this.Ih=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId(e=>this.Eh(e))}Rh(e){return!1}Ah(){return null}Ph(e){}Fh(){}Oh(e,t){return!!e&&aP(e.propertyFilters,null==t?void 0:t.properties)}$h(e,t){var i=new Map;return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null!=t&&t.name){var s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}Dh(e,t,i){var s=(i===nm?this.Ch:this.Th).get(e),r=[];return this.Lh(e=>{r=e.filter(e=>null==s?void 0:s.includes(e.id))}),r.filter(s=>{var r,n=null==(r=s.conditions)||null==(r=r[i])||null==(r=r.values)?void 0:r.find(t=>t.name===e);return this.Oh(n,t)})}register(e){this.Nh(e,!1)}replace(e){this.Nh(e,!0)}Nh(e,t){var i;J(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.qh(e,t),this.jh(e,t))}jh(e,t){var i,s=e.filter(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this.Mh.clear(),0!==s.length){this.Bh||(this.Bh=new o$(this._instance),this.Bh.init(),this.Bh.bh(e=>this.onAction(e)));var r=[];s.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(t=>{if(r.push(t),t.name){var i,s=null!=(i=this.Mh.get(t.name))?i:[];s.includes(e.id)||s.push(e.id),this.Mh.set(t.name,s)}})}),t?this.Bh.replace(r):this.Bh.register(r)}else t&&(null==(i=this.Bh)||i.replace([]))}Hh(e,t){t.forEach((t,i)=>{var s,r=null!=(s=e.get(i))?s:[];t.forEach(e=>{r.includes(e)||r.push(e)}),e.set(i,r)})}qh(e,t){var i,s=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),n=this.$h(e,nm),a=this.$h(e,ny);t?(this.Ch=n,this.Th=a):(this.Hh(this.Ch,n),this.Hh(this.Th,a)),(0!==s.length||0!==r.length)&&(null!=this.mh||(this.mh=null==(i=this._instance)?void 0:i._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,s,r=this.zh(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(s=t.properties)?void 0:s.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var a=this.Uh(e,n);if("consume"===a)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.Wh([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.Vh(n),void this.Gh([n])}if(this.Th.has(e)){var o=this.Dh(e,t,ny);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.Wh(o.map(e=>e.id)),o.forEach(e=>this.Zh(e.id)))}if(this.Ch.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Ch.get(e)});var l=this.Dh(e,t,nm);this.Jh(l.map(e=>e.id))}}onAction(e){this.Mh.has(e)&&this.Jh(this.Mh.get(e)||[])}Jh(e){var t;if(0!==e.length){var i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),s=[];for(var r of e)i&&this.Rh(r)?this.Vh(r)&&this.Qh(r):s.push(r);s.length>0&&(this.xh=[...new Set([...this.xh,...s])]),this.zh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Vh(e){this.xh=this.xh.filter(t=>t!==e);var t=this.Kh();return!t.includes(e)&&(this.Xh([...t,e]),this.Yh(),!0)}Wh(e){var t=new Set(e);this.xh=this.xh.filter(e=>!t.has(e));var i=this.td(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.Xh(s),0===s.length&&this.ed()),this.Gh(e)}rd(){var e,t=this.Ah();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Qh(e){if(this.Ah()){var t=this.rd();this.Ph(p({},t,{[e]:Date.now()}))}}Gh(e){if(this.Ah()){var t=this.rd(),i={},s=!1;for(var r of Object.entries(t)){var n=r[0],a=r[1];e.includes(n)?s=!0:i[n]=a}s&&(G(i)?this.Fh():this.Ph(i))}}nd(){this.Ah()&&this.Fh()}getActivationTimestamp(e){if(this.Kh().includes(e)){var t=this.rd()[e];return Q(t)?t:void 0}}td(){var e,t=this.sd();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}Kh(){var e,t,i=this.td();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.od()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}Yh(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.ad(t)}ed(){this.ld()}Eh(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.od()];if(i&&i!==e){var s=this.td(),r=this.rd();s.length>0&&(this.Xh([]),s.filter(e=>
1Q(r[e])).forEach(e=>this.Zh(e))),this.ed(),this.nd()}}getActivatedIds(){return[...new Set([...this.Kh(),...this.xh])].filter(e=>!this.ud(e))}dispose(){var e,t,i;null==(e=this.Ih)||e.call(this),this.Ih=void 0,null==(t=this.mh)||t.call(this),this.mh=void 0,null==(i=this.Bh)||i.dispose(),this.Bh=void 0}reset(){this.xh=[],this.td().length>0&&this.Xh([]),this.ed(),this.nd()}getEventToItemsMap(){return this.Ch}hd(){return this.Bh}},oC=class extends oI{constructor(e){super(e)}sd(){return i6}od(){return i4}Ah(){return i8}Ph(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i8]:e})}Fh(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(i8)}Rh(e){this.Lh(t=>{i=t.find(t=>t.id===e)});var t,i,s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return Q(s)&&s>0}dd(){return nb}Lh(e){var t;null==(t=this._instance)||t.getSurveys(e)}Zh(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}zh(){return aO}Xh(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i6]:e})}ad(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i4]:e})}ld(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(i4)}ud(){return!1}Uh(e,t){var i,s,r;return this.Lh(e=>{i=e.find(e=>e.id===t)}),!i||ax(s=i)&&!(null==(r=s.conditions)||null==(r=r.events)||!r.repeatedActivation)||"always"===s.schedule?e===nb?"consume":"ignore":e===nb?"persist":e===nw||e===nx?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},oA=class{constructor(e){this._instance=e}initialize(){}get(e){if("string"==typeof e)return this._instance.get_property(e);var t={};for(var i of e){var s=this._instance.get_property(i);J(s)||(t[i]=s)}return t}set(e,t){this._instance.register("string"==typeof e?{[e]:t}:e)}remove(e){"string"!=typeof e?e.forEach(e=>this._instance.unregister(e)):this._instance.unregister(e)}},oT=class{constructor(e){this._instance=e}get(){var 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()}getExtensions(){var e=null==$?void 0:$.__PosthogExtensions__;if(e){var t=e.generateSurveys,i=e.loadExternalDependency;return{generateSurveys:t?e=>t(this._instance,e):void 0,loadExternalDependency:i?e=>i(this._instance,"surveys",e):void 0}}}createEventReceiver(){return new oC(this._instance)}},oO=null!=g&&g.location?r0(g.location.hash,"__posthog")||r0(location.hash,"state"):null,oM="_postHogToolbarParams",oR=ip("[Toolbar]"),oL=ip("[FeatureFlags]"),oD=class{constructor(e,t){void 0===t&&(t=!1),this.vd=!1,this.update(e,t)}update(e,t){var i,s,r,n,a;this.fd={bootstrap:{featureFlags:null==(i=e.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(s=e.bootstrap)?void 0:s.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!=(r=e.remote_config_refresh_interval_ms)?r:3e5,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!=(n=null!=(a=e.evaluation_contexts)?a:e.evaluation_environments)?n:[],flagKeys:W(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.vd||(oL.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.vd=!0),J(e.flag_keys)||W(e.flag_keys)||oL.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.fd}},oj=ip("[FeatureFlags]"),oN=ip("[FeatureFlags]",{debugEnabled:!0}),oB="\" failed. Feature flags didn't load in time.",oH="connection_error",oq=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},oz=e=>{var t={};for(var i of s$(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},oW=e=>ea(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message),oV=ip("[Error tracking]"),oU="webkit-masked-url:",oG=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",oU],oJ=["__firefox__","__gCrWeb"],oK="Refusing to render web experiment since the viewer is a likely bot",oY={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>ak(t,e),not_regex:(e,t)=>!ak(t,e),exact:(e,t)=>
1t===e,is_not:(e,t)=>t!==e},oZ=ip("[Conversations]"),oX="Conversations not available yet.";function oQ(e,t){var i,s,r,n,a,o,l,u=null!=(i=null==e?void 0:e.flushIntervalMs)?i:3e3,h=null!=(s=null==e?void 0:e.maxBufferSize)?s:100,c=null!=t&&t.consoleCapture?void 0:null!=(r=null==e?void 0:e.maxLogsPerInterval)?r:1e3,d=J(c)?Math.max(h,2048):Math.max(h,c),v=p({},function(){var e,t,i,s="",r="";try{var n=null==m?void 0:m.userAgent;if(n){var a=tt(n);s=a[0],r=a[1]}}catch(e){}return e=s,t=r,i=function(e){if(e)return({}).hasOwnProperty.call(it,e)?it[e]:e}(e),p({},i?{"os.name":i}:{},t?{"os.version":t}:{})}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!=(n=null!=(a=null==v?void 0:v["service.name"])?a:null==e?void 0:e.serviceName)?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!=(o=null==v?void 0:v["service.version"])?o:null==e?void 0:e.serviceVersion,environment:null!=(l=null==v?void 0:v["deployment.environment"])?l:null==e?void 0:e.environment,resourceAttributes:v,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:d,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var o0=["debug","log","warn","error","info"],o1="console",o2="__posthogHandledLogsRequestError",o3=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[o2]=!0,i},o5=e=>!!e&&"object"==typeof e&&!0===e[o2],o6={featureFlags:class{constructor(e){this.name="featureFlags",this.pd=!1,this.featureFlagEventHandlers=[],this.A=oj,this.gd={},this.md={},this.yd=[],this.bd=!1,this._d=!1,this.wd=0,this.kd=!1,this.Sd=!1,this.xd=!1,this.Cd=!1,this.Td=0,this.Ve=()=>{var e=this.Md();this.Td=0,e&&this.reloadFeatureFlags()},this.Id=()=>{var e,t=this.Ed;J(t)||this._n.remoteRequestsDisabled||!y||"hidden"===y.visibilityState||Date.now()-(null!=(e=this.Rd)?e:0)<t||(this.reloadFeatureFlags(),this.Ad())},this.Ze=()=>{"visible"===(null==y?void 0:y.visibilityState)&&this.Id()},"get"in e?this.Us=e:(this._instance=e,this.Pd=new oD(e.config,e.Ma()),this.Us=this.Pd)}updateConfig(e,t){var i;null==(i=this.Pd)||i.update(e,t),this.Hs&&this.Fd()}setup(e){return this.Zu=e,this.A=e.logger.createLogger("[FeatureFlags]"),ok(e.kv.initialize(),()=>{this.Zu===e&&(this.Zu=void 0,this.Hs=e,this.Od(e))})}Od(e){var t;if(this.Hs===e)return g&&sM(g,"online",this.Ve),this.Fd(),this.$d=e.registerDynamicEventProperties(()=>this.Dd()?this.gd:this.md),this.Ld=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Nd(),this.qd(),this.jd()}),this.qd(),this.initialize()}Fd(){var e=this._n.refreshIntervalMs,t=!this._n.remoteRequestsDisabled&&y&&!J(e)&&e>0?e:void 0;t!==this.Ed&&(this.Bd(),J(t)||(this.Ed=t,this.Ad(),null!=y&&y.addEventListener&&sM(y,sy,this.Ze)))}Ad(){J(this.Ed)||(J(this.Hd)||clearInterval(this.Hd),this.Rd=Date.now(),this.Hd=setInterval(this.Id,this.Ed))}Bd(){J(this.Hd)||(clearInterval(this.Hd),this.Hd=void 0,null==y||null==y.removeEventListener||y.removeEventListener(sy,this.Ze)),this.Ed=void 0,this.Rd=void 0}destroy(){this.zd()}dispose(){this.zd()}zd(){var e,t;this.Bd(),this.wd++,this.Sd=!1,this.Zu=void 0,this.Hs&&(this.Ud(),null==(e=this.$d)||e.dispose(),this.$d=void 0,null==(t=this.Ld)||t.call(this),this.Ld=void 0,this.yd=[],null==g||g.removeEventListener("online",this.Ve),this.Hs=void 0)}get _n(){return this.Us.get()}Wd(e){var t;return this.Vd&&e in this.Vd?this.Vd[e]:null==(t=this.Hs)?void 0:t.kv.get(e)}Nd(){return!!this.Vd&&(this.Vd=void 0,!0)}Gd(){var e;return!J(null==(e=this.Hs)?void 0:e.kv.get("$enabled_feature_flags"))&&this.Nd()}ui(e){this.Zd(()=>{var t;return null==(t=this.Hs)?void 0:t.kv.set(e)})}Jd(e,t,i){var s;if(null!=(s=this._instance)&&s.persistence&&e.$enabled_feature_flags){var r=this.Wd("$enabled_feature_flags")||{},n=e.$enabled_feature_flags||{},a=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(e=>{var t=e[1];return!(null!=t&&t.failed)}).map(e=>e[0]):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,u=l?o:i&&!W(a)?Object.keys(a||{}):Array.from(new Set([...Object.keys(r),...Object.keys(n)])),h=this.Wd("$feature_flag_payloads")||{},c=e.$feature_flag_payloads||{},d=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(c)])),p=!l&&!i,v=!!p||u,f={[iU]:v,[iV]:v,[iK]:!!p||d};for(var g of(e.$feature_flag_details&&(f[iJ]=v),[iY,si,iZ]))J(e[g])||(f[g]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(f)}}hi(e){this.Zd(()=>{var t;return null==(t=this.Hs)?void 0:t.kv.remove(e)})}Zd(e){try{e()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}qd(){var e={};for(var t of[iU,iK,iY,iX]){var i=this.Wd(t);J(i)||(e[t]=i)}this.gd=e;var s=p({},e),r=this.Wd(iV);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.md=s}Dd(){var e=this._n.cacheTtlMs;
1if(!e||0>=e)return!1;var t=this.Wd(si);return"number"!=typeof t||Date.now()-t>e}Qd(){return!!this.Dd()&&(this.Cd||this._d||(this.Cd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Kd(){var e=this._n.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Xd(){var e=this._n.flagKeys;if(!J(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this._n,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){var r,n,a=null!=(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?r:{},o=Object.keys(s).filter(e=>!J(s[e])).reduce((e,t)=>(e[t]=s[t],e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(e[t]=a[t],e),{});return this.Yd({featureFlags:o,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!=(s=this.Wd("$enabled_feature_flags"))?s:{},a=null!=i&&i.merge&&null!=(r=this.Wd("$feature_flag_payloads"))?r:{},o=p({},n,e),l=p({},a,t),u={};for(var h of Object.entries(o)){var c=h[0],d=h[1];u[c]={key:c,enabled:tK(d),variant:tY(d),reason:void 0,metadata:J(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.Yd({flags:u})}get hasLoadedFlags(){return this.bd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Wd(iJ),t=this.Wd(iX),i=this.Wd(iQ);if(!i&&!t)return e||{};var s=sF({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],l=null==t?void 0:t[r],u=J(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,h=J(l)?null==o?void 0:o.variant:"string"==typeof l?l:void 0,c=null==i?void 0:i[r],d=p({},o,{enabled:u,variant:u?null!=h?h:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),h!==(null==o?void 0:o.variant)&&(d.original_variant=null==o?void 0:o.variant),c&&(d.metadata=p({},null==o?void 0:o.metadata,{payload:c,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=d}return this.pd||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.pd=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:tK(s),variant:tY(s),payload:tJ(t[i])}})}getFlagVariants(){var e=this.Wd(iV),t=this.Wd(iX);if(!t)return e||{};for(var i=sF({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.pd||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.pd=!0),i}getFlagPayloads(){var e=this.Wd(iK),t=this.Wd(iQ);if(!t)return e||{};for(var i=sF({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.pd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.pd=!0),i}reloadFeatureFlags(){this.kd||this._n.featureFlagsDisabled||this.Md()||(this._d&&(this.Sd=!0),this.tv||(this.yd.slice().forEach(e=>{try{e()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.tv=setTimeout(()=>{this.ev()},5)))}Ud(){clearTimeout(this.tv),this.tv=void 0}onReloading(e){return this.yd.push(e),()=>{this.yd=this.yd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.bd||this._d||this.tv||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.kd=e}resetFlagCallReported(){this.hi(i7)}ev(e){this.Ud();var t=this.Hs;if(t&&!this._n.remoteRequestsDisabled&&!this.Md())if(this._d)this.Sd=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:p({},t.initialPersonProperties,this.Wd("$stored_person_properties")||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Wd(i1),timezone:nn()};J(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this._n.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.Kd();s.length&&(i.evaluation_contexts=s);var r=this.Xd();J(r)||(i.flag_keys=r);var n=this._n.onlyEvaluateSurveyFeatureFlags,a=this.wd;this._d=!0;var o=()=>{this.Sd&&(this.Sd=!1,this.ev())},l=e=>{this._d=!1,a===this.wd&&(this.ui({[st]:[oH]}),this.A.error("Feature flag request failed",e),this.Gd()&&this.jd(!0)),o()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:this._n.compression,sentAt:"body",timeoutMs:this._n.requestTimeoutMs}).then(e=>{var t,s,r=null!=(t=e.json)?t:{},l=200!==e.statusCode;if(this._d=!1,a===this.wd){if(this.iv(e.statusCode),l||this.Sd||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Sd){this.xd=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?oH:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),r.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(s=r.quotaLimited)||!s.includes("feature_flags"));h&&u.push("quota_limited"),this.ui({[st]:u}),h?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."):i.disable_flags||this.Yd(r,l,{partialResponse:n}),o()}}else o()}).catch(l)}catch(e){l(e)}}}Md(){return r1(this.Td,3)}iv(e){this.Td=r2(e,this.Td,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(void 0===t&&(t={}),!t.fresh||this.xd)if(this.bd||this.getFlags()&&this.getFlags().length>0){if(!this.Qd()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else this.A.warn('getFeatureFlag for key "'+e+oB)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t;return null==(t=this.getFeatureFlagResult(e,{send_event:!1}))?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.xd)if(this.bd||this.getFlags()&&this.getFlags().length>0){if(!this.Qd()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],a=this.getFlagPayloads()[e],o=String(n),l=this.Wd("$feature_flag_request_id")||void 0,u=this.Wd("$feature_flag_evaluated_at")||void 0,h=this.Wd("$flag_call_reported")||{};if(this._n.deduplicateCallsPerSession){var c,d=null==(c=this.Hs)?void 0:c.session.sessionId,v=this.Wd(se);d&&d!==v&&(h={},i=d)}if(!t.send_event&&"send_event"in t)i&&this.ui({[i7]:h,[se]:i});else if(e in h&&h[e].includes(o))i&&this.ui({[i7]:h,[se]:i});else{W(h[e])?h[e].push(o):h[e]=[o],this.ui(p({[i7]:h},i?{[se]:i}:{}));var f,g,_,m,y,b,w,x,k,E,S,P,F,$=this.getFeatureFlagDetails(e),I=[...null!=(f=this.Wd("$feature_flag_errors"))?f:[]];J(n)&&I.push("flag_missing");var C={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!=(g=null==(_=this._n.bootstrap)||null==(_=_.featureFlags)?void 0:_[e])?g:null,$feature_flag_bootstrapped_payload:null!=(m=null==(y=this._n.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])?m:null,$used_bootstrap_value:!this.xd};J(null==$||null==(b=$.metadata)?void 0:b.has_experiment)||(C.$feature_flag_has_experiment=$.metadata.has_experiment),J(null==$||null==(w=$.metadata)?void 0:w.version)||(C.$feature_flag_version=$.metadata.version);var A=null!=(x=null==$||null==(k=$.reason)?void 0:k.description)?x:null==$||null==(E=$.reason)?void 0:E.
vendor: 19,712 bytes, line 1
1code;A&&(C.$feature_flag_reason=A),null!=$&&null!=(S=$.metadata)&&S.id&&(C.$feature_flag_id=$.metadata.id),J(null==$?void 0:$.original_variant)&&J(null==$?void 0:$.original_enabled)||(C.$feature_flag_original_response=J($.original_variant)?$.original_enabled:$.original_variant),null!=$&&null!=(P=$.metadata)&&P.original_payload&&(C.$feature_flag_original_payload=null==$||null==(F=$.metadata)?void 0:F.original_payload),I.length&&(C.$feature_flag_error=I.join(",")),this.rv(C)}if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:tJ(a)}}}else this.A.warn('getFeatureFlagResult for key "'+e+oB)}rv(e){try{var t;null==(t=this.Hs)||t.capture("$feature_flag_called",e).catch(e=>{this.A.error("Failed to capture feature flag call",e)})}catch(e){this.A.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.nv(e,t)}nv(e,t){var i=this;return f(function*(){var s=i.Hs;if(s){var r,n={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},a=i.Kd();a.length&&(n.evaluation_contexts=a);var o,l=i.Xd();J(l)||(n.flag_keys=l);try{o=(null==(r=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i._n.compression,sentAt:"body",timeoutMs:i._n.requestTimeoutMs})).json)||null==(r=r.featureFlagPayloads)?void 0:r[e])||void 0}catch(e){return void i.A.error("Remote config feature flag request failed",e)}try{t(o)}catch(e){i.A.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.xd)return t.defaultValue;if(!(this.bd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+oB),t.defaultValue;var i=this.getFeatureFlag(e,t);return J(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.Yd(e,t,i)}Yd(e,t,i){if(this.Hs){this.bd=!0;var s=function(e,t,i,s,r,n){void 0===t&&(t={}),void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n=oj);var a,o,l=(a=n,(o=e.flags)?p({},e,{featureFlags:Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!=(t=o[e].variant)?t:o[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(o).filter(e=>o[e].enabled).filter(e=>{var t;return!J(null==(t=o[e].metadata)?void 0:t.payload)}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&a.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)),u=l.flags,h=l.featureFlags,c=l.featureFlagPayloads;if(h){var d=e.requestId,v=e.evaluatedAt;if(W(h)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(h)for(var g=0;h.length>g;g++)f[h[g]]=!0;return{[iU]:h,[iV]:f,[iZ]:!1}}var _=h,m=c,y=u;if(null!=r&&r.partialResponse){var b=Object.keys(_),w=m||{};_=p({},t,_),m=p({},i,w),b.forEach(e=>{var t;e in w||null==(t=m)||delete t[e]}),y=p({},s,y)}else if(e.errorsWhileComputingFlags)if(u){var x=new Set(Object.keys(u).filter(e=>{var t;return!(null!=(t=u[e])&&t.failed)}));_=p({},t,Object.fromEntries(Object.entries(_).filter(e=>x.has(e[0]))));var k=Object.fromEntries(Object.entries(m||{}).filter(e=>x.has(e[0])));m=p({},i,k),x.forEach(e=>{var t;e in k||null==(t=m)||delete t[e]}),y=p({},s,Object.fromEntries(Object.entries(y||{}).filter(e=>x.has(e[0]))))}else _=p({},t,_),m=p({},i,m),y=p({},s,y);return p({[iU]:Object.keys(oz(_)),[iV]:_||{},[iK]:m||{},[iJ]:y||{},[iZ]:!0===e.minimalFlagCalledEvents},d?{[iY]:d}:{},v?{[si]:v}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(s)if(!1===(null==i?void 0:i.persist)){var r=!J(this.Hs.kv.get(iV));this.Vd=s,r||this.ui(s)}else this.Nd(),this.Jd(s,e,!(null==i||!i.partialResponse)),this.ui(s);else t&&this.Gd();t||(this.Cd=!1),this.jd(t)}}override(e,t){void 0===t&&(t=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.sv(e)}sv(e){if(this.Hs){if(!1===e)return this.hi([iX,iQ]),this.jd(),void oN.info("All overrides cleared");if(W(e))return this.ui({[iX]:oq(e)}),this.jd(),void oN.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.pd=!!(null!=(t=e.suppressWarning)&&t);var t,i={},s=e.flags,r=e.payloads;return s&&(i[iX]=W(s)?oq(s):s),r&&(i[iQ]=r),Object.keys(i).length&&this.ui(i),!1===s&&!1===r?this.hi([iX,iQ]):!1===s?this.hi(iX):!1===r&&this.hi(iQ),this.jd(),!1===s?oN.info("Flag overrides cleared"):s&&oN.info("Flag overrides set",{flags:s}),void(!1===r?oN.info("Payload overrides cleared"):r&&oN.info("Payload overrides set",{payloads:r}))}if(e&&"object"==typeof e)return this.ui({[iX]:e}),this.jd(),void oN.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.bd){var t=this.ov(),i=t.flags,s=t.flagVariants;try{e(i,s)}catch(e){this.A.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r,n=(this.Wd("$early_access_features")||[]).find(t=>t.flagKey===e),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i);var l=p({},this.getFlagVariants(),{[e]:t});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[iU]:[e],[iV]:[e],[i0]:Object.keys(a)}),this.ui({[iU]:Object.keys(oz(l)),[iV]:l,[i0]:p({},this.Wd("$stored_person_properties")||{},a)}),this.jd();try{null==(s=this.Hs)||s.capture("$feature_enrollment_update",o).catch(e=>{this.A.error("Failed to capture early access feature enrollment",e)})}catch(e){this.A.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.Wd(iG);!s||t?this.av(e,i):e(s)}av(e,t){var i=this;return f(function*(){var s=i.Hs;if(s){var r,n=t?"&"+t.map(e=>"stage="+e).join("&"):"";try{var a=yield s.sendRequest("/api/early_access_features/?token="+s.projectToken+n,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;r=a.json.earlyAccessFeatures,i.ui({[iG]:r})}catch(e){return void i.A.error("Early access feature request failed",e)}try{e(r)}catch(e){i.A.error("Early access feature callback failed",e)}}})()}ov(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}jd(e){this.qd();var t=this.ov(),i=t.flags,s=t.flagVariants;this.featureFlagEventHandlers.forEach(t=>{try{t(i,s,{errorsLoading:e})}catch(e){this.A.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.lv(e,t)}lv(e,t){void 0===t&&(t=!0);var i=this.Wd("$stored_person_properties")||{},s=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),r=null==e?void 0:e.$set_once,n={};if(r)for(var a in r)({}).hasOwnProperty.call(r,a)&&(a in i||(n[a]=r[a]));this.ui({[i0]:p({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=p({},this.Wd("$stored_person_properties")||{});e.forEach(e=>{delete i[e]}),this.ui({[i0]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.hi(i0),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.Wd("$stored_group_properties")||{},s=p({},i);for(var r of Object.keys(e))s[r]=p({},i[r],e[r]);this.ui({[i1]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Wd("$stored_group_properties")||{};this.ui({[i1]:p({},t,{[e]:{}})})}else this.hi(i1)}reset(){this.wd++,this.Sd=!1,this.gd={},this.md={},this.Vd=void 0,this.bd=!1,this.kd=!1,this.xd=!1,this.$anon_distinct_id=void 0,this.Ud(),this.pd=!1,this.Td=0}}},o4=p({productTours:class{get Ya(){return this._instance.persistence}constructor(e){this.xc=null,this.Cc=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,s=e.config;if("productTours"in s){if(this.Ya&&this.Ya.register({[iM]:!!s.productTours}),!ob(this._instance))return!this.xc&&X(null==(t=this.Ya)?void 0:t.props.ph_product_tours)||oy.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.xc)||i.stop(),this.xc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.xc&&ob(this._instance)&&this.do(()=>this.Tc())}do(e){var t,i;null!=(t=$.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=$.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?oy.error("Could not load product tours script",t):e()})}Tc(){var e;!this.xc&&null!=(e=$.__PosthogExtensions__)&&e.generateProductTours&&(this.xc=$.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!W(this.Cc)||t){var i=this.Ya;if(i){var s=i.props[i9];if(W(s)&&!t)return this.Cc=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:t=>{if(ob(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return 0===s?t.error||oy.warn(r):oy.error(r),void e([],{isLoaded:!1,error:r})}var n=W(t.json.product_tours)?t.json.product_tours:[];this.Cc=n,i&&i.register({[i9]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Cc,{isLoaded:!0})}getActiveProductTours(e){X(this.xc)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.xc.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.xc)||t.showTourById(e)}previewTour(e){this.xc?this.xc.previewTour(e):this.do(()=>{var t;this.Tc(),null==(t=this.xc)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.xc)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.xc)||e.nextStep()}previousStep(){var e;null==(e=this.xc)||e.previousStep()}clearCache(){var e;this.Cc=null,null==(e=this.Ya)||e.unregister(i9)}resetTour(e){var t;null==(t=this.xc)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.xc)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.xc)||t.cancelPendingTour(e)}}},o6),o8=p({surveys:class extends oP{constructor(e){super(new oT(e),{get projectToken(){return e.config.token},kv:new oA(e)}),this._instance=e}Yu(e,t){var i=t.query?at(e,t.query):e;return new Promise(e=>{var s;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor(null!=(s=t.target)?s:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})}}},o6),o9=p({experiments:class e{get _n(){return this._instance.config}constructor(t){var i=this;this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),i.getWebExperiments(t=>{e.Gc("retrieved web experiments from the server"),i.Zc=new Map,t.forEach(t=>{if(t.feature_flag_key){i.Zc&&(e.Gc("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(s=i.Zc)||s.set(t.feature_flag_key,t));var s,r=i._instance.getFeatureFlag(t.feature_flag_key);K(r)&&t.variants[r]&&i.Jc(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var a=t.variants[n];e.Qc(a,i._instance)&&i.Jc(t.name,n,a.transforms)}})},t)},this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Gc(oK);else if(!this._n.disable_web_experiments){if(X(this.Zc))return this.Zc=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Gc("applying feature flags",t),t.forEach(e=>{var t;if(this.Zc&&null!=(t=this.Zc)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Zc)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Jc(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var t=e.getWindowLocation();if(null!=t&&t.search){var i=rX(null==t?void 0:t.search,"__experiment_id"),s=rX(null==t?void 0:t.search,"__experiment_variant");i&&s&&(e.Gc("previewing web experiments "+i+" && "+s),this.getWebExperiments(e=>{this.Kc(parseInt(i),s,e)},!1,!0))}}loadIfEnabled(){this._n.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._n.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._n.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Kc(t,i,s){var r=s.filter(e=>e.id===t);r&&r.length>0&&(e.Gc("Previewing web experiment ["+r[0].name+"] with variant ["+i+"]"),this.Jc(r[0].name,i,r[0].variants[i].transforms))}static Qc(t,i){return!X(t.conditions)&&e.Xc(t,i)&&e.Yc(t)}static Xc(t,i){if(X(t.conditions)||X(null==(r=t.conditions)?void 0:r.url))return!0;var s=e.getWindowLocation();if(s){var r,n,a,o,l=re(i,s.href);return null==(n=t.conditions)||!n.url||oY[null!=(a=null==(o=t.conditions)?void 0:o.urlMatchType)?a:"icontains"](t.conditions.url,l)}return!1}static getWindowLocation(){return null==g?void 0:g.location}static Yc(e){if(X(e.conditions)||X(null==(i=e.conditions)?void 0:i.utm))return!0;var t=r8();if(t.utm_source){var i,s,r,n,a,o,l,u,h,c=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==t.utm_term;return c&&p&&v&&d}return!1}static Gc(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];id.info("[WebExperiments] "+e,i)}Jc(t,i,s){this._is_bot()?e.Gc(oK):"control"!==i?s.forEach(s=>{var r;s.selector&&(e.Gc("applying transform of variant "+i+" for experiment "+t+" ",s),null==(r=document)||null==(r=r.querySelectorAll(s.selector))||r.forEach(e=>{s.html&&(e.innerHTML=s.html),s.css&&e.setAttribute("style",s.css)}))}):e.Gc("Control variants leave the page unmodified.")}_is_bot(){return m&&this._instance?ab(m,this._n.custom_blocked_useragents):void 0}}},o6),o7=p({},o6,{sessionRecording:class{get _n(){return this._instance.config}get Ya(){return this._instance.persistence}get started(){var e;return!(null==(e=this.uv)||!e.isStarted)}get status(){var e,t;return"awaiting_config"===this.hv||"missing_config"===this.hv?this.hv:null!=(e=null==(t=this.uv)?void 0:t.status)?e:this.hv}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.hv=ov,this.dv=void 0,this.vv=!1,this.je=(()=>{if(null==y||!y.visibilityState||"visible"===y.visibilityState)return!0;var e,t=null==g||null==(e=g.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.Ze=()=>{var e;"visible"===(null==y?void 0:y.visibilityState)&&(this.je=!0,null==(e=this.uv)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw og.error("started without valid sessionManager"),Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this._n.cookieless_mode)throw Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=y&&y.addEventListener&&sM(y,"visibilitychange",this.Ze)}initialize(){this.startIfEnabledOrStop()}dispose(e){var t=(void 0===e?{}:e).discardBufferedEvents;this.vv=!0,null==y||null==y.removeEventListener||y.removeEventListener("visibilitychange",this.Ze),void 0!==t&&t?this.fv(!0):this.stopRecording()}get pv(){var e,t=!(null==(e=this._instance.get_property(iD))||!e.enabled),i=!this._n.disable_session_recording,s=this._n.disable_session_recording||this._instance.consent.isOptedOut();return g&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!(this.vv||this.pv&&null!=(t=this.uv)&&t.isStarted)){var i=!J(Object.assign)&&!J(Array.from);this.pv&&i?(this.gv(e),og.info("starting")):(this.hv=ov,this.stopRecording())}}gv(e){var t,i;if(this.pv)if("awaiting_config"!==this.hv&&"missing_config"!==this.hv&&(this.hv=of),null!=$&&null!=(t=$.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=$.__PosthogExtensions__)&&i.initSessionRecording)this.mv(e);else{var s,r=this._instance.sessionManager;null==(s=$.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.yv,t=>{if(!this.vv&&this.pv&&this._instance.sessionManager===r)return t?(this._instance.register_for_session({[sv]:!0}),og.error("could not load recorder",t)):void this.mv(e);this.hv=ov})}}stopRecording(){var e,t;null==(e=this.dv)||e.call(this),this.dv=void 0,null==(t=this.uv)||t.stop()}fv(e){var t,i;void 0===e&&(e=!1),null==(t=this.dv)||t.call(this),this.dv=void 0,null==(i=this.uv)||i.discard({discardProducerEvents:e})}bv(){var e,t;null==(e=this.Ya)||e.unregister(iW),null==(t=this.Ya)||t.unregister(ij)}_v(e,t){if(X(e))return null;var i=Q(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(og.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}wv(e){if(this.Ya){var t,i,s=this.Ya,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this._v(null==(t=this._n.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this._v(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;X(a)&&this.bv();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[iD]:p({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:p({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:J(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};r(),null==(t=this.dv)||t.call(this),this.dv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.wv(t),void this.fv()):(this.wv(t),void this.startIfEnabledOrStop()):("awaiting_config"===this.hv&&(this.hv="missing_config",og.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.uv)&&i.log?this.uv.log(e,t):og.warn("log called before recorder was ready")}get yv(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property("$session_recording_remote_config"))||null==(e=e.scriptConfig)?void 0:e.script)||"lazy-recorder"}Sv(){var e,t=this._instance.get_property(iD);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return og.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}return!X(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}mv(e){var t,i,s,r;if(!this.vv&&this.pv&&this._instance.sessionManager){if(null==(t=$.__PosthogExtensions__)||!t.initSessionRecording)return og.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[sv]:!0});if(this.uv||(this.uv=null==(r=$.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.je),this.uv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Sv()){if("missing_config"===this.hv||"awaiting_config"===this.hv)return;return this.hv="awaiting_config",og.info("persisted remote config is stale, requesting fresh config before starting"),void new n$(this._instance).load()}this.hv=of,null==(i=(s=this.uv).setDocumentWasEverVisible)||i.call(s,this.je),this.uv.start(e)}else this.hv=ov}onRRwebEmit(e){var t;null==(t=this.uv)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.uv||null==(e=this.Ya)||e.register({[iB]:!0}),null==(t=this.uv)||t.overrideLinkedFlag()}overrideSampling(){var e,t;this.uv||null==(e=this.Ya)||e.register({[iN]:!0}),null==(t=this.uv)||t.overrideSampling()}overrideTrigger(e){var t,i;this.uv||null==(t=this.Ya)||t.register({["url"===e?iH:iq]:!0}),null==(i=this.uv)||i.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.uv)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.uv)||!i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e;null==(e=this.uv)||null==e.flushBeforeIdentityReset||e.flushBeforeIdentityReset()}}},{autocapture:class extends os{constructor(e){super(new or(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.xv=this.Cv()}initialize(){this.startIfEnabled()}get isEnabled(){var e=this.Tv();return!!(e.path||e.search||this.Mv(e))}startIfEnabled(){this.isEnabled&&(id.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.xv=this.Cv(),this.startIfEnabled()}stop(){this.Iv&&this.Iv(),this.Iv=void 0,this.Ev&&this.Ev(),this.Ev=void 0,id.info("History API monitoring stopped")}monitorHistoryChanges(){g&&g.history&&(this.Rv("pushState"),this.Rv("replaceState"),this.Av(),this.Mv()&&this.Pv())}Rv(e){var t;if(g&&(null==(t=g.history[e])||!t.__posthog_wrapped__)){var i=this;ol(g.history,e,t=>function(s,r,n){t.call(this,s,r,n),i.Fv(e)})}}Cv(){var e=null==g?void 0:g.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Tv(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:U(e)?e:{}}Mv(e){return void 0===e&&(e=this.Tv()),!!e.hash&&!this._instance.config.disable_capture_url_hashes}Ov(e){var t=this.Tv(),i=this.xv;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.Mv(t)&&e.hash!==i.hash))}Fv(e){try{var t=this.Cv();if(!t)return;this.Ov(t)&&this._instance.capture(sw,{navigation_type:e}),this.xv=t}catch(t){id.error("Error capturing "+e+" pageview",t)}}Av(){if(!this.Iv){var e=()=>{this.Fv("popstate")};sM(g,"popstate",e),this.Iv=()=>{g&&g.removeEventListener("popstate",e)}}}Pv(){if(!this.Ev){var e=()=>{this.Fv("hashchange")};sM(g,"hashchange",e),this.Ev=()=>{g&&g.removeEventListener("hashchange",e)}}}},heatmaps:class{get _n(){return this.instance.config}constructor(e){var t;this.$v=!1,this.Ws=!1,this.Dv=null,this.instance=e,this.$v=!(null==(t=this.instance.persistence)||!t.props[i$]),this.rageclicks=new a7(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return U(this._n.capture_heatmaps)&&this._n.capture_heatmaps.flush_interval_milliseconds&&(e=this._n.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return X(this._n.capture_heatmaps)?X(this._n.enable_heatmaps)?this.$v:this._n.enable_heatmaps:!1!==this._n.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Ws||(o_.info("starting..."),this.Lv(),this.Ze());else{var e;clearInterval(null!=(e=this.Dv)?e:void 0),this.Nv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[i$]:i}),this.$v=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.Pe;return this.Pe=void 0,e}qv(e){om(e.originalEvent)&&this.an(e.originalEvent,"deadclick")}Ze(){this.Dv&&clearInterval(this.Dv),this.Dv="visible"===(null==y?void 0:y.visibilityState)?setInterval(this.za.bind(this),this.flushIntervalMilliseconds):null}Lv(){g&&y&&(this.jv=this.za.bind(this),sM(g,sb,this.jv),this.Bv=e=>this.an(e||(null==g?void 0:g.event)),sM(y,"click",this.Bv,{capture:!0}),this.Hv=e=>this.zv(e||(null==g?void 0:g.event)),sM(y,"mousemove",this.Hv,{capture:!0}),this.Uv=new rN(this.instance,rD,this.qv.bind(this)),this.Uv.startIfEnabledOrStop(),this.Wv=this.Ze.bind(this),sM(y,sy,this.Wv),this.Ws=!0)}Nv(){var e;g&&y&&(this.jv&&g.removeEventListener(sb,this.jv),this.Bv&&y.removeEventListener("click",this.Bv,{capture:!0}),this.Hv&&y.removeEventListener("mousemove",this.Hv,{capture:!0}),this.Wv&&y.removeEventListener(sy,this.Wv),clearTimeout(this.Vv),null==(e=this.Uv)||e.stop(),this.Ws=!1)}Gv(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),n=function(e,t,i){for(var s=e;s&&ri(s)&&!rs(s,"body")&&s!==i;){var r,n,a,o=void 0;try{o=null==(r=null!=(n=null==(a=s.ownerDocument)?void 0:a.defaultView)?n:g)?void 0:r.getComputedStyle(s).position}catch(e){break}if(O(t,o))return!0;s=rf(s)}return!1}(rc(e),["fixed","sticky"],r);return{x:e.clientX+(n?0:s),y:e.clientY+(n?0:i),target_fixed:n,type:t}}an(e,t){var i;if(void 0===t&&(t="click"),!rt(e.target)&&om(e)){var s=this.Gv(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rx(rc(e),this.instance.config.rageclick)&&this.Is(p({},s,{type:"rageclick"})),this.Is(s)}}zv(e){!rt(e.target)&&om(e)&&(clearTimeout(this.Vv),this.Vv=setTimeout(()=>{this.Is(this.Gv(e,"mousemove"))},500))}Is(e){if(g){var t=this._n.disable_capture_url_hashes?tg(g.location.href):g.location.href,i=this._n.custom_personal_data_properties,s=rQ(t,this._n.mask_personal_data_properties?[...r3,...i||[]]:[],r6);this.Pe=this.Pe||{},this.Pe[s]||(this.Pe[s]=[]),this.Pe[s].push(e)}}za(){this.Pe&&!G(this.Pe)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rN,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.$v=!1,this.Ws=!1,this.Pe={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Zv=()=>{clearTimeout(this.Jv),this.Jv=void 0,0!==this.Pe.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.Pe.url},this.Pe.metrics.reduce((e,t)=>
vendor: 4,239 bytes, line 1
1p({},e,{["$web_vitals_"+t.name+"_event"]:p({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.Pe={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Qv=e=>{var t;if(this.Pe=this.Pe||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},X(null==e?void 0:e.name)||X(null==e?void 0:e.value))oh.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.Kv(i);if(!J(s)){var r=Q(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.Xv||this.Xv>e.value){this.Pe.navigationKey!==r&&(this.Zv(),this.Jv=setTimeout(this.Zv,this.flushToCaptureTimeoutMs)),J(this.Pe.navigationKey)&&(this.Pe.navigationKey=r,this.Pe.url=s),this.Pe.firstMetricTimestamp=J(this.Pe.firstMetricTimestamp)?Date.now():this.Pe.firstMetricTimestamp;var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=p({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});if(delete a.entries,U(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){var o={};for(var l of op){var u="url"===l&&"string"==typeof e.attribution[l]?this.Kv(e.attribution[l]):e.attribution[l];J(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;J(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.Pe.metrics.push(a),this.Pe.metrics.length===this.allowedMetrics.length&&this.Zv()}else oh.error("Ignoring metric with value >= "+this.Xv,e)}}},this.Yv=()=>{if(!this.Ws){var e,t,i,s,r=!1,n=$.__PosthogExtensions__,a=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.tc])||("web-vitals"===this.tc&&J(a)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(!J(o)){var l=o.withoutAttribution,u=this.attributionMetrics;r=!J(l),e=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,t=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,s=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.onINP}if(e&&t&&i&&s){var h={reportSoftNavs:this.useSoftNavs},c=r&&this.attributionMetrics.indexOf("INP")>-1?p({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&e(this.Qv.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Qv.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Qv.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&s(this.Qv.bind(this),c),this.Ws=!0}else oh.error("web vitals callbacks not loaded - not starting")}},this.$v=!(null==(t=this._instance.persistence)||!t.props[iT]),this.startIfEnabled()}get ec(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=U(this.ec)?null==(e=this.ec)?void 0:e.web_vitals_allowed_metrics:void 0;return X(i)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||oc:i}get flushToCaptureTimeoutMs(){return(U(this.ec)?this.ec.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var e=U(this.ec)?this.ec.web_vitals_attribution:void 0;return et(e)?e?oc:[]:W(e)?e:od}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var e;return null!=(e=U(this.ec)?this.ec.__preview_web_vitals_soft_navs:void 0)&&e}get Xv(){var e=U(this.ec)&&Q(this.ec.__web_vitals_max_value)?this.ec.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==b?void 0:b.protocol;if("http:"!==e&&"https:"!==e)return oh.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=U(this.ec)?this.ec.web_vitals:et(this.ec)?this.ec:void 0;return et(t)?t:this.$v}startIfEnabled(){this.isEnabled&&!this.Ws&&(oh.info("enabled, starting..."),this.do(this.Yv))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=U(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=U(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[iT]:i}),this._instance.persistence.register({[iL]:s})),this.$v=i,this.startIfEnabled()}}}get tc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}
1do(e){var t=$.__PosthogExtensions__,i=this.tc,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&J(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?oh.error("failed to load script",t):e()})}Kv(e){var t=e||(null==g?void 0:g.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tg(t):t,s=this._instance.config.custom_personal_data_properties;return rQ(i,this._instance.config.mask_personal_data_properties?[...r3,...s||[]]:[],r6)}oh.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.Yv=()=>{var e;if(g&&this.isEnabled&&null!=(e=$.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=$.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=$.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=$.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.rc&&this._n.capture_unhandled_errors&&(this.rc=t(this.captureException.bind(this))),!this.nc&&this._n.capture_unhandled_rejections&&(this.nc=i(this.captureException.bind(this))),!this.sc&&this._n.capture_console_errors&&(this.sc=s(this.captureException.bind(this)))}catch(e){on.error("failed to start",e),this.oc()}}},this._instance=e,this.ac=!(null==(t=this._instance.persistence)||!t.props[iI]),this.wt=new ed(p({},function(e){var t,i,s,r;return void 0===e&&(e={}),{refillRate:null!=(t=null!=(i=e.exceptionRateLimiterRefillRate)?i:e.__exceptionRateLimiterRefillRate)?t:1,bucketSize:null!=(s=null!=(r=e.exceptionRateLimiterBucketSize)?r:e.__exceptionRateLimiterBucketSize)?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,A:on})),this._n=this.lc(),this.startIfEnabledOrStop()}lc(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return U(e)?t=p({},t,e):(J(e)?this.ac:e)&&(t=p({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this._n.capture_console_errors||this._n.capture_unhandled_errors||this._n.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(on.info("enabled"),this.oc(),this.do(this.Yv)):this.oc()}do(e){var t,i;null!=(t=$.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=$.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return on.error("failed to load script",t);e()})}oc(){var e,t,i;null==(e=this.rc)||e.call(this),this.rc=void 0,null==(t=this.nc)||t.call(this),this.nc=void 0,null==(i=this.sc)||i.call(this),this.sc=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.ac=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[iI]:this.ac}),this._n=this.lc(),this.startIfEnabledOrStop())}}onConfigChange(){this._n=this.lc()}captureException(e){try{var t,i,s,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";if(this.wt.consumeRateLimit(r))return void on.info("Skipping exception capture because of client rate limiting.",{exception:r});null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}catch(e){}}},exceptions:class{constructor(e){var t,i;this.uc=[],this.hc=new tb([new tA,new tH,new tO,new tT,new tN,new tj,new tR,new tB],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),a=s;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tC.test(o)?o.replace(tC,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}if(!r.length)return[];var c=Array.from(r);return c.reverse(),c.slice(0,50).map(e=>p({},e,{filename:e.filename||(c[c.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tP,tI)),this._instance=e,this.uc=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))?t:[],this.dc=tU(this.vc()),this.cc=new tG(this.dc)}onConfigChange(){this.dc=tU(this.vc()),this.cc.setConfig(this.dc)}onRemoteConfig(e){var t,i,s;if(e.ok){var r=e.config;if("errorTracking"in r){var n=null!=(t=null==(i=r.errorTracking)?void 0:i.suppressionRules)?t:[],a=null==(s=r.errorTracking)?void 0:s.captureExtensionExceptions;this.uc=n,this._instance.persistence&&this._instance.persistence.register({[iC]:this.uc,[iA]:a})}}}get fc(){var e,t,i=!!this._instance.get_property(iA);return null!=(e=null!=(t=this._instance.config.error_tracking.captureExtensionExceptions)?t:i)&&e}buildProperties(e,t){return this.hc.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.dc.enabled)try{if(!K(e)||0===e.trim().length)return void oV.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tW.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.gc(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&oV.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.cc.add(p({[tq]:e,[tz]:(new Date).toISOString()}
1,s))}catch(e){oV.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){var t;try{var i=e.$exception_list;if(this.mc(i)){if(this.yc(i))return this.bc("Exception dropped: matched a suppression rule"),void oV.info("Skipping exception capture because a suppression rule matched");if(!this.fc&&this._c(i))return this.bc("Exception dropped: thrown by a browser extension"),void oV.info("Skipping exception capture because it was thrown by an extension");if(!this.fc&&this.wc(i))return this.bc("Exception dropped: thrown by an injected browser script"),void oV.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.kc(i))return this.bc("Exception dropped: thrown by the PostHog SDK"),void oV.info("Skipping exception capture because it was thrown by the PostHog SDK")}var s=this.dc.enabled&&X(e.$exception_steps)?this.Sc(e):e,r="string"==typeof(t=globalThis._posthogReleaseId)&&t.length>0?t:void 0;r&&(s.$release_id=r);try{var n=this._instance.capture("$exception",s,{_noTruncate:!0,_batchKey:"exceptionEvent",Iu:!0});return n&&this.cc.clear(),n}catch(e){return oW(e)||oV.error("Failed to capture exception event. Dropping this exception.",e),void this.cc.clear()}}catch(e){return void(oW(e)||oV.error("Failed to process exception event. Ignoring this exception.",e))}}Sc(e){try{var t=this.cc.getAttachable();return 0===t.length?e:p({},e,{$exception_steps:t})}catch(t){return oV.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}bc(e){this.dc.enabled&&this.cc.add({[tq]:e,[tz]:(new Date).toISOString()})}gc(e){return U(e)?p({},e):{}}vc(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}yc(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return K(i)&&i.length>0&&e.$exception_types.push(i),K(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.uc.some(e=>{var i=e.values.map(e=>{var i=aS[e.operator],s=t[e.key];if(!i||!s)return!1;var r=W(e.value)?e.value:[e.value];return r.length>0&&i(r,s)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return oV.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}_c(e){var t=e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}),i=t.filter(e=>{var t=e.filename;return!!t&&oG.some(e=>t.startsWith(e))});return 0!==i.length&&(!i.every(e=>{var t=e.filename;return!!t&&t.startsWith(oU)})||e.some(e=>{var t=e.value;return K(t)&&t.includes("isolatedAPI.contexts.topHostname")})&&!t.some(e=>{var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(oU))}))}wc(e){return e.some(e=>{var t=e.value;return K(t)&&oJ.some(e=>t.includes(e))})}kc(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[];return null!=(s=null==(r=n[n.length-1])||null==(r=r.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}mc(e){return!X(e)&&W(e)}}},o4,{siteApps:class{constructor(e){this._instance=e,this.Mc=0,this.Ic=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ec(e,t){if(t){var i=this.globalsForEvent(t);this.Ic.push(i),this.Ic.length>1e3&&(this.Ic=this.Ic.slice(10))}}get siteAppLoaders(){var e;return null==(e=$._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Ec.bind(this));this.Rc=()=>{e(),this.Ic=[],this.Rc=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var h of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var v=h[0];l[v]={id:u[v],type:v,properties:h[1]}}var f=e.$set_once,g=e.$set;return{event:p({},d(e,c),{properties:p({},e.properties,g?{$set:p({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},g)}:{},f?{$set_once:p({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},f)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Ac(e){var t,i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(ow.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(ow.error("prepare_external_dependency_script returned null"),null):e}Pc(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,s,r,n,a,o,l=null==y?void 0:y.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.Mc++,this.Fc)return this.Oc();var h=[],c=this,d=new WeakSet,p=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),h.push(()=>{e[t]=s})}},v=e=>{if(d.has(e))return e;var t=c.Ac(e);return t&&d.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:v(e)).filter(e=>!Z(e));return p(u,"appendChild",e=>function(t){var i=v(t);return i?e.call(this,i):t}),p(u,"insertBefore",e=>function(t,i){var s=v(t);return s?e.call(this,s,i):t}),p(u,"replaceChild",e=>function(t,i){var s=v(t);return s?e.call(this,s,i):i}),[null==(t=l.Element)?void 0:t.prototype,null==(i=l.Document)?void 0:i.prototype,null==(s=l.DocumentFragment)?void 0:s.prototype].forEach(e
vendor: 12,924 bytes, line 1
1=>{p(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))})}),[null==(r=l.Element)?void 0:r.prototype,null==(n=l.CharacterData)?void 0:n.prototype,null==(a=l.DocumentType)?void 0:a.prototype].forEach(e=>{p(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),p(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=f(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),p(null==(o=l.Element)?void 0:o.prototype,"insertAdjacentElement",e=>function(t,i){var s=v(i);return s?e.call(this,t,s):null}),this.Fc=()=>{h.forEach(e=>e()),this.Fc=void 0},this.Oc()}Oc(){var e=!1;return()=>{var t;e||(e=!0,this.Mc--,0===this.Mc&&(null==(t=this.Fc)||t.call(this)))}}$c(e,t){void 0===t&&(t=!0);var i=this.Pc();try{var s=e(i);return t&&i(),s}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.Ic.length&&(ow.info("Processing "+this.Ic.length+" events for site app with id "+e.id),this.Ic.forEach(e=>this.$c(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Rc)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,ow.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.$c(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){ow.error(ox+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){ow.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Dc(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Lc(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.$c(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){ow.error("Error while processing event "+e.event+" for site app "+s.id,t)}};for(var r of Object.values(this.apps))s(r)}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Dc(),void this._instance.on("eventCaptured",e=>this.Lc(e))):void ow.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Rc)||i.call(this),e.ok){var n=e.config;if(null!=(s=n.siteApps)&&s.length)if(this.isEnabled)for(var a of n.siteApps)!function(){var e,t=a.id,i=a.url;$["__$$ph_site_app_"+t]=r._instance,null==(e=$.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,e=>{if(e)return ow.error(ox+t,e)})}();else ow.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},o8,{tracingHeaders:class{constructor(e){this._instance=e,this.Nc=void 0,this.qc=void 0,this.jc=void 0,this.Yv=()=>{var e,t,i=this.Bc();i?(J(this.Nc)&&(this.Nc=null==(e=$.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),J(this.qc)&&(this.qc=null==(t=$.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.oc()}}initialize(){this.startIfEnabledOrStop()}do(e){var t,i;null!=(t=$.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=$.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return ou.error("failed to load script",t);e()})}Hc(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}Bc(){var e=this.Hc();return W(e)?(W(this.jc)?this.jc.splice(0,this.jc.length,...e):this.jc=[...e],e.length>0?this.jc:void 0):(W(this.jc)&&this.jc.splice(0),this.jc=e||void 0,this.jc)}oc(){var e,t;null==(e=this.Nc)||e.call(this),null==(t=this.qc)||t.call(this),this.Nc=void 0,this.qc=void 0}startIfEnabledOrStop(){this.Bc()?this.do(this.Yv):this.oc()}}},{toolbar:class{constructor(e){this.instance=e}zc(e){$.ph_toolbar_state=e}Uc(){var e;return null!=(e=$.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),sR(this.instance.config)||!g||!y)return!1;e=null!=e?e:g.location,i=null!=i?i:g.history;try{if(!t){try{g.localStorage.setItem("test","test"),g.localStorage.removeItem("test")}catch(e){return!1}t=null==g?void 0:g.localStorage}var s,r=oO||r0(e.hash,"__posthog")||r0(e.hash,"state"),n=r?sI(()=>JSON.parse(atob(decodeURIComponent(r))))||sI(()=>JSON.parse(decodeURIComponent(r))):null;return n&&"ph_authorize"===n.action?((s=n).source="url",s&&Object.keys(s).length>0&&(n.desiredHash?e.hash=n.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(oM)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Wc(e){var t=$.ph_load_toolbar||$.ph_load_editor;!X(t)&&V(t)?t(e,this.instance):oR.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==y||!y.getElementById("__POSTHOG_TOOLBAR__"));if(!g||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=p({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(g.localStorage.setItem(oM,JSON.stringify(p({},r,{source:void 0}))),2===this.Uc())?this.Wc(r):0===this.Uc()&&(this.zc(1),null==(t=$.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(oR.error("[Toolbar] Failed to load",e),this.zc(0)):(this.zc(2),this.Wc(r))}),sM(g,"turbolinks:load",()=>{this.zc(0),this.loadToolbar(r)})),!0}Vc(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}},o9,{conversations:class{constructor(e){this._instance=e,this.tf=void 0,this._conversationsManager=null,this.ef=!1,this.zt=null,this.if=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.rf=e.ok,e.ok)){var t=e.config.conversations;X(t)||(et(t)?this.tf=t:(this.tf=t.enabled,this.zt=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.tf=void 0,this.zt=null,this.rf=void 0,this.if=!1}loadIfEnabled(){if(!(this._conversationsManager||this.ef||this._instance.config.disable_conversations||sR(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==$?void 0:$.__PosthogExtensions__;if(e&&!J(this.tf)&&this.tf)if(this.zt&&this.zt.token){this.ef=!0;try{var t=e.initConversations;if(t)return this.nf(t),void(this.ef=!1);var i=e.loadExternalDependency;if(!i)return void this.sf(sf);i(this._instance,"conversations",t=>{t||!e.initConversations?this.sf("Could not load conversations script",t):this.nf(e.initConversations),this.ef=!1})}catch(e){this.sf("Error initializing conversations",e),this.ef=!1}}else oZ.error("Conversations enabled but missing token in remote config.")}}nf(e){if(this.zt)try{this._conversationsManager=e(this.zt,this._instance),this.if=!1,oZ.info("Conversations loaded successfully")}catch(e){this.sf("Error completing conversations initialization",e)}else oZ.error("Cannot complete initialization: remote config is null")}sf(e,t){oZ.error(e,t),this._conversationsManager=null,this.ef=!1,this.if=!0}show(){this._conversationsManager?this._conversationsManager.show():oZ.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.tf&&!Z(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":sR(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.rf?"remote_config_failed":J(this.tf)?this.rf?"disabled_in_project":"remote_config_pending":this.tf?X(this.zt)||!this.zt.token?"missing_token":null!=$&&$.__PosthogExtensions__?this.ef?"initializing":this.if?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return f(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(oZ.warn(oX),null)})()}getMessages(e,t){var i=this;return f(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oZ.warn(oX),null)})()}markAsRead(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oZ.warn(oX),null)})()}getTickets(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oZ.warn(oX),null)})()}requestRestoreLink(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oZ.warn(oX),null)})()}restoreFromToken(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oZ.warn(oX),null)})()}restoreFromUrlToken(){var e=this;return f(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oZ.warn(oX),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}Lu(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Nu(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this._instance=e,this.name="logs",this.af=!1,this.lf=!1,this.uf=!1,this.A=ip("[logs]"),this.hf=p({},this.A,{error(){for(var e=arguments.length,t=Array(e),s=0;e>s;s++)t[s]=arguments[s];t.some(o5)||i.A.error(...t)}}),this.Aa=[],this.df=[],this.Td=0,this.Js=!1,this.vf=[],this.cf=[],this.ff=!1,this.pf=!1,this.gf=()=>{var e,t;this.Js||(this.Td=0,null==(e=this.mf)||e.onReconnect(),null==(t=this.yf)||t.onReconnect())},this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.af=!0),g&&sM(g,"online",this.gf)}bf(e,t,i,s){var r,n=oQ(null==(r=this._instance)||null==(r=r.config)?void 0:r.logs,i);return[new ia(this._f(e,t),n,this.hf,()=>this.wf(),e=>e(),void 0,s),n]}kf(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.mf||this.Sf!==t){null==(i=this.mf)||i.reset(),this.Sf=t;var i,s=this.bf(()=>this.Aa,e=>{this.Aa=e});this.mf=s[0],this.xf=s[1]}return this.mf}Cf(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.yf||this.Tf!==t){null==(i=this.yf)||i.reset(),this.Tf=t;var i,s=this.bf(()=>this.df,e=>{this.df=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},o1);this.yf=s[0],this.Mf=s[1]}return this.yf}setup(e){var t;if(!this.Js){this.Hs=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this.af=!0),(this.af||this.If()&&this.Ef())&&this.Rf();var i=!1,s=e.onRemoteConfig(e=>{var t;i=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),this.onRemoteConfig(e)});this.Js?s.dispose():(this.Xs=s,i||this.loadIfEnabled())}}dispose(){var e,t,i,s;this.Js||(this.Js=!0,this.Af(),null==(e=this.Xs)||e.dispose(),this.Xs=void 0,this.Hs=void 0,this.uf=!1,null==g||g.removeEventListener("online",this.gf),null==(t=this.Pf)||t.call(this),this.Pf=void 0,null==(i=this.mf)||i.reset(),null==(s=this.yf)||s.reset())}onRemoteConfig(e){var t,i;if(!this.Js){var s=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;X(s)?this.Ff():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[iR]:!!s}),s?(this.af=!0,this.lf||this.Rf(),this.loadIfEnabled()):this.Ff())}}reset(){var e,t,i,s;this.Af(),null==(e=this.mf)||e.clearQueue(),this.Aa=[],null==(t=this.mf)||t.reset(),null==(i=this.yf)||i.clearQueue(),this.df=[],null==(s=this.yf)||s.reset(),this.Td=0}captureLog(e){this.Js||this.kf().captureLog(e)}captureConsoleLog(e){this.Js||this.Cf().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.Js||this.Cf().captureLog(e,{context:t,occurredAtMs:i})}Ef(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[iR])}If(){var e,t;
1return null==(e=this._instance)||null==e.Ma||!e.Ma()||!(null==(t=$._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)}ju(){var e;this.Af(),null==(e=this.yf)||e.clearQueue(),this.df=[]}Ff(){this.af||this.Af()}Rf(){var e,t=this;if(!this.ff&&null!=$&&$.console){var i=oQ(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,s=function(e){var s;try{s=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})($.console[e])}catch(e){return 0}if(!s)return 0;t.cf.push(ol($.console,e,r=>{var n=function(){for(var s=arguments.length,n=Array(s),a=0;s>a;a++)n[a]=arguments[a];try{t.Of(e,n,i)}catch(e){}return r.apply($.console,n)};return n.__rrweb_original__=s,n}))};for(var r of o0)s(r);this.ff=!0,this.$f=setTimeout(()=>{this.Af()},3e4)}}Of(e,t,i){var s;if(this.ff&&!this.pf&&0!==t.length)if(null!=(s=this._instance)&&s.is_capturing()){if(i>this.vf.length){this.pf=!0;try{this.vf.push({level:e,args:t,occurredAtMs:Date.now(),context:this.wf()})}finally{this.pf=!1}}}else this.Af()}Af(){if(this.vf=[],this.ff){for(var e of(this.ff=!1,this.$f&&(clearTimeout(this.$f),this.$f=void 0),this.cf))e();this.cf=[]}}Df(){var e=this.vf;return this.Af(),e}get logger(){return this.Lf||(this.Lf={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.Lf}flushLogs(e){e?this.Nf(e):(this.mf&&this.mf.flush().catch(e=>this.qf(e)),this.yf&&this.yf.flush().catch(e=>this.qf(e)))}qf(e){o5(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(!this.Js&&this.af&&!this.lf&&!this.uf){var e=null==$?void 0:$.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.Af();var t=e.loadExternalDependency;if(!t)return this.A.error(sf),void this.Af();this.uf=!0;try{t(this._instance,"logs",t=>{if(this.uf=!1,!this.Js&&this.af){var i=e.logs;if(t||null==i||!i.initializeLogs)this.A.error("Could not load logs script",t),this.Af();else{var s,r,n=this.Df();this.Pf=i.initializeLogs(null!=(s=this.Hs)?s:this._instance),this.lf=!0,n.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!=(r=this.Hs)?r:this._instance,n))}}})}catch(e){throw this.uf=!1,e}}}_f(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===D.LogsQueue?e():void 0,setPersistedProperty(e,i){e===D.LogsQueue&&t(null!=i?i:[])},gs:e=>this.gs(e),getLibraryId:()=>C.LIB_NAME,getLibraryVersion:()=>C.LIB_VERSION}}gs(e){return new Promise(t=>{if(r1(this.Td,3))t({kind:"fatal",error:o3(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:o3(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.jf(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.Bf(i),i>=200&&300>i)?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&408!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):0===i?(e.error||this.A.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:o3(e.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+i)})}})}})}Bf(e){(0!==e||this._instance.__loaded)&&(this.Td=r2(e,this.Td,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.")))}Nf(e){this.Aa.length>0&&this.Hf(e,this.Aa,this.xf,C.LIB_NAME,e=>{this.Aa=e}),this.df.length>0&&this.Hf(e,this.df,this.Mf,o1,e=>{this.df=e})}Hf(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var a=ir(n,ie(i,C.LIB_NAME,C.LIB_VERSION),s,C.LIB_VERSION);this._instance._send_request({method:"POST",url:this.jf(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}jf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}wf(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),s=i.windowId,r=i.sessionStartTimestamp,n=i.lastActivityTimestamp;t.sessionId=i.sessionId,t.windowId=s,X(r)||(t.sessionStartTimestamp=r),X(n)||(t.lastActivityTimestamp=n)}if(null!=$&&null!=(e=$.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tg($.location.href):$.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}},{metrics:class{constructor(e){this._instance=e,this.A=ip("[metrics]")}initialize(){}kf(){var e,t,i,s,r,n,a,o,l=null==(a=this._instance)||null==(a=a.config)?void 0:a.metrics;return this.mf&&this.Sf===l||(null==(o=this.mf)||o.reset(),this.Sf=l,this.mf=new ih(this._f(),{serviceName:null!=(e=null==(n=null==l?void 0:l.resourceAttributes)?void 0:n["service.name"])?e:null==l?void 0:l.serviceName,serviceVersion:null!=(t=null==n?void 0:n["service.version"])?t:null==l?void 0:l.serviceVersion,environment:null!=(i=null==n?void 0:n["deployment.environment"])?i:null==l?void 0:l.environment,resourceAttributes:n,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(s=null==l?void 0:l.flushIntervalMs)?s:1e4,maxSeriesPerFlush:null!=(r=null==l?void 0:l.maxSeriesPerFlush)?r:1e3},this.A)),this.mf}count(e,t,i){void 0===t&&(t=1),this.kf().count(e,t,i)}
1gauge(e,t,i){this.kf().gauge(e,t,i)}histogram(e,t,i){this.kf().histogram(e,t,i)}flush(e){if(!this.mf)return Promise.resolve();if(e){var t=this.mf.drainWindow();return t&&this.Fs(t,e),Promise.resolve()}return this.mf.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.mf)||e.reset()}_f(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Fs:e=>t.Fs(e),getLibraryId:()=>C.LIB_NAME,getLibraryVersion:()=>C.LIB_VERSION}}Fs(e,t){return new Promise(i=>{var s=!1,r=e=>{s||(s=!0,clearTimeout(n),i(e))},n=setTimeout(()=>r({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(p({method:"POST",url:this.zf(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;r(i>=200&&300>i?{kind:"ok"}:413===i?{kind:"too-large"}:0!==i&&408!==i&&429!==i&&500>i?{kind:"fatal",error:Error("metrics request failed with status "+i)}:{kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+i)})}}))})}zf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});a4.__defaultExtensionClasses=p({},o7);var le=(C.SDK_DIST_CHANNEL="npm",s=aW[a0]=new a4,function(){function e(){e.done||(e.done=!0,a1=!1,sP(aW,function(e){e._dom_loaded()}))}null!=y&&y.addEventListener?"complete"===y.readyState?e():sM(y,"DOMContentLoaded",e,{capture:!1}):g&&id.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s);e.s(["default",0,le],669430);var lt=e.i(271645),li=(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),ls=(0,lt.createContext)({get client(){return l},bootstrap:void 0}),lr=function(e){return"function"==typeof e},ln=function(e){return void 0===e},la=function(e){var t=Object.prototype.toString.call(e);return e instanceof Error||"[object Error]"===t||"[object Exception]"===t||"[object DOMException]"===t||"[object DOMError]"===t},lo=function(e,t){for(var i=new WeakSet,s=e;!i.has(s);){if(i.add(s),!la(s.cause)){ln(s.cause)||(t.cause=s.cause),s.cause=t;return}s=s.cause}},ll=function(e,t){if(!t)return e;var i=Error(la(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return(i.name="React ErrorBoundary ".concat(la(e)?e.name:"Error"),i.stack=t,la(e))?(lo(e,i),e):i},lu={componentStack:null,exceptionEvent:null,error:null};n=o=function(e){function t(t){var i=e.call(this,t)||this;return i.state=lu,i}return li(t,e),t.prototype.componentDidCatch=function(e,t){var i,s=this.props.additionalProperties;lr(s)?i=s(e,t):"object"==typeof s&&(i=s);var r=this.context.client,n=t.componentStack,a=r.captureException(ll(e,n),i);this.setState({error:e,componentStack:null!=n?n:null,exceptionEvent:a})},t.prototype.render=function(){var e=this.props,t=e.children,i=e.fallback,s=this.state;if(null==s.componentStack)return lr(t)?t():t;var r=lr(i)?lt.default.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return lt.default.isValidElement(r)?r:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),lt.default.createElement(lt.default.Fragment,null))},t}(lt.default.Component),"symbol"==typeof(a="PostHogErrorBoundary")&&(a=a.description?"[".concat(a.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:a}),o.contextType=ls,l=le,e.s(["PostHogProvider",0,function(e){var t,i,s=e.children,r=e.client,n=e.apiKey,a=e.options,o=(0,lt.useRef)(null),u=(0,lt.useMemo)(function(){if(r)return n&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),r;var e=l;return n||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),e},[r,n,JSON.stringify(a)]);return(0,lt.useEffect)(function(){if(!r&&n){var e=l,t=o.current;t?(n!==t.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!function e(t,i,s){if(void 0===s&&(s=new WeakMap),t===i)return!0;
1if("object"!=typeof t||null===t||"object"!=typeof i||null===i)return!1;if(s.has(t)&&s.get(t)===i)return!0;s.set(t,i);var r=Object.keys(t),n=Object.keys(i);if(r.length!==n.length)return!1;for(var a=0;a<r.length;a++){var o=r[a];if(!n.includes(o)||!e(t[o],i[o],s))return!1}return!0}(a,t.options)&&e.set_config(a)):(e.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),e.init(n,a)),o.current={apiKey:n,options:null!=a?a:{}}}},[r,n,JSON.stringify(a)]),lt.default.createElement(ls.Provider,{value:{client:u,bootstrap:null!=(t=null==a?void 0:a.bootstrap)?t:null==(i=null==r?void 0:r.config)?void 0:i.bootstrap}},s)},"useFeatureFlagEnabled",0,function(e,t){var i,s,r=(0,lt.useContext)(ls),n=r.client,a=r.bootstrap,o=(0,lt.useState)(function(){return n.isFeatureEnabled(e)}),l=o[0],u=o[1];(0,lt.useEffect)(function(){return n.onFeatureFlags(function(){u(n.isFeatureEnabled(e))})},[n,e]);var h=null==(i=null==a?void 0:a.featureFlags)?void 0:i[e];return!(null==(s=null==n?void 0:n.featureFlags)?void 0:s.hasLoadedFlags)&&(null==a?void 0:a.featureFlags)?ln(h)?t:!!h:ln(l)?t:l},"usePostHog",0,function(){return(0,lt.useContext)(ls).client}],720565)}]);

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