PageSourceSearch

https://app.pillar.codes/_next/static/chunks/05z4kg41lypkl.js?dpl=dpl_E5GWfdvqVgYjGap8XcCYs6cV9z7P

js pillar.codes collected 2026-10-05 08:44:42 UTC 285,222 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,669430,e=>{"use strict";var t,i,s,r,n=["retriesPerformedSoFar"],a=["$set_once","$set"];function o(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 l(){return(l=Object.assign.bind()).apply(null,arguments)}function u(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 h(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){u(n,s,r,a,o,"next",e)}function o(e){u(n,s,r,a,o,"throw",e)}a(void 0)})}}var c="u">typeof window?window:void 0,d="u">typeof globalThis?globalThis:c,p=null==d?void 0:d.navigator,v=null==d?void 0:d.document,f=null==d?void 0:d.location,g=null==d?void 0:d.fetch,_=null!=d&&d.XMLHttpRequest&&"withCredentials"in new d.XMLHttpRequest?d.XMLHttpRequest:void 0,m=null==d?void 0:d.AbortController,y=null==d?void 0:d.CompressionStream,b=null==p?void 0:p.userAgent;function w(){return!(!c||!1===c.navigator.onLine)}var x="u">typeof globalThis?globalThis:c;x&&"u"<typeof self&&(x.self=x),x&&"u"<typeof File&&(x.File=function(){});var k=null!=c?c:{},E="0.8.2",S={DEBUG:!1,LIB_VERSION:E,LIB_NAME:"browser-common",JS_SDK_VERSION:E},P=((ts={}).AnonymousId="anonymous_id",ts.DistinctId="distinct_id",ts.Props="props",ts.EnablePersonProcessing="enable_person_processing",ts.PersonMode="person_mode",ts.FeatureFlagDetails="feature_flag_details",ts.FeatureFlags="feature_flags",ts.FeatureFlagPayloads="feature_flag_payloads",ts.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",ts.BootstrapFeatureFlags="bootstrap_feature_flags",ts.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",ts.OverrideFeatureFlags="override_feature_flags",ts.Queue="queue",ts.AiQueue="ai_queue",ts.AiCaptureQueue="ai_capture_queue",ts.LogsQueue="logs_queue",ts.OptedOut="opted_out",ts.SessionId="session_id",ts.SessionStartTimestamp="session_start_timestamp",ts.SessionLastTimestamp="session_timestamp",ts.PersonProperties="person_properties",ts.GroupProperties="group_properties",ts.InstalledAppBuild="installed_app_build",ts.InstalledAppVersion="installed_app_version",ts.SessionReplay="session_replay",ts.PushRegistered="push_registered",ts.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",ts.SurveyLastSeenDate="survey_last_seen_date",ts.SurveysSeen="surveys_seen",ts.Surveys="surveys",ts.RemoteConfig="remote_config",ts.FlagsEndpointWasHit="flags_endpoint_was_hit",ts.DeviceId="device_id",ts),$=((tr={}).GZipJS="gzip-js",tr.Base64="base64",tr),F=["$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"],C=["token"];function I(e,t){return -1!==e.indexOf(t)}var O=function(e){return e.trim()},A=function(e){return e.replace(/^\$/,"")};function R(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 T=Object.prototype,M=T.hasOwnProperty,L=T.toString,D=Array.isArray||function(e){return"[object Array]"===L.call(e)},N=e=>"function"==typeof e,j=e=>e===Object(e)&&!D(e),B=e=>{if(j(e)){for(var t in e)if(M.call(e,t))return!1;return!0}return!1},z=e=>void 0===e,q=e=>"[object String]"==L.call(e),H=e=>q(e)&&0===e.trim().length,U=e=>null===e,V=e=>z(e)||U(e),W=e=>"[object Number]"==L.call(e)&&e==e,G=e=>W(e)&&e>0,K=e=>"[object Boolean]"===L.call(e),Q=e=>I(F,e),X=e=>I(C,e);function J(e){return null===e||"object"!=typeof e}function Z(e,t){return({}).toString.call(e)==="[object "+t+"]"}function Y(e){switch(({}
1).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return et(e,Error)}}function ee(e){return"u">typeof Event&&et(e,Event)}function et(e,t){try{return e instanceof t}catch(e){return!1}}var ei=[!0,"true",1,"1","yes"],es=[!1,"false",0,"0","no"],er=["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"],en=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return er.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function ea(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),W(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),ea(null!=r?r:i,t,i,s))}var eo=class{constructor(e){this.C={},this.I=e.I,this.R=ea(e.bucketSize,0,100,e.A),this.O=ea(e.refillRate,0,this.R,e.A),this.N=ea(e.refillInterval,0,864e5,e.A)}F(e,t){var i=Math.floor((t-e.lastAccess)/this.N);i>0&&(e.tokens=Math.min(e.tokens+i*this.O,this.R),e.lastAccess=e.lastAccess+i*this.N)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.C[s];return r?this.F(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={}}},el="Mobile",eu="Android",eh="Tablet",ec="Android Tablet",ed="iPad",ep="Apple Watch",ev="Safari",ef="BlackBerry",eg="Samsung Internet",e_="Chrome",em="Chrome iOS",ey="Internet Explorer",eb="Internet Explorer Mobile",ew="Opera",ex="Microsoft Edge",ek="Firefox",eE="Firefox iOS",eS="Nintendo",eP="PlayStation",e$="Xbox",eF="Android Mobile",eC="Mobile Safari",eI="Windows",eO="Windows Phone",eA="Nokia",eR="Ouya",eT="Generic "+el.toLowerCase(),eM="Generic "+eh.toLowerCase(),eL="Konqueror",eD="Oculus Browser",eN="Vivaldi",ej="Yandex",eB="Whale",ez="DuckDuckGo",eq="Pale Moon",eH="Waterfox",eU="Brave",eV="Claude",eW="Codex",eG="ChatGPT",eK="Google Search App",eQ=RegExp("Version/(\\d+(\\.\\d+)?)"),eX=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),eJ=RegExp(e$,"i"),eZ=RegExp("PlayStation \\w+","i"),eY=RegExp("Nintendo \\w+","i"),e0=RegExp("BlackBerry|PlayBook|BB10","i"),e1={"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"},e2=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?eU:null)||(null!=s&&s.detectGoogleSearchApp&&I(e,"GSA/")?eK:I(e," OPR/")&&I(e,"Mini")?"Opera Mini":I(e," OPR/")?ew:e0.test(e)?ef:I(e,"IEMobile")||I(e,"WPDesktop")?eb:I(e,"OculusBrowser")?eD:I(e,"SamsungBrowser")?eg:I(e,"Edge")||I(e,"Edg/")?ex:I(e,"Vivaldi/")?eN:I(e,"YaBrowser/")?ej:I(e,"Whale/")?eB:I(e,"DuckDuckGo/")||I(e,"Ddg/")?ez:I(e,"Claude/")?eV:I(e,"Codex/")?eW:I(e,"ChatGPT/")?eG:I(e,"FBIOS")?"Facebook Mobile":I(e,"UCWEB")||I(e,"UCBrowser")?"UC Browser":I(e,"CriOS")?em:I(e,"CrMo")||I(e,e_)?e_:I(e,eu)&&I(e,ev)?eF:I(e,"FxiOS")?eE:I(e.toLowerCase(),eL.toLowerCase())?eL:I(e,"Brave/")?eU:(r=t)&&I(r,"Apple")||I(e,ev)&&!I(e,e_)&&!I(e,eu)?I(e,el)?eC:ev:I(e,"PaleMoon/")?eq:I(e,"Waterfox/")?eH:I(e,ek)?ek:I(e,"MSIE")||I(e,"Trident/")?ey:I(e,"Gecko")?ek:"")},e3={[eb]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[ex]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[e_]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[em]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ev]:[eQ],[eC]:[eQ],[ew]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[ek]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[eE]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[eL]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ef]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),eQ],[eF]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[eg]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[eD]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[eN]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[ej]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[eB]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[eU]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[eV]:[eX],[eW]:[eX],[eG]:[eX],[ez]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[eq]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[eH]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[eK]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[ey]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},e5=function(e,t,i,s){var r=e3[e2(e,t,i,s)];if(z(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},e6=[[RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[e$,e&&e[1]||""]],[RegExp(eS,"i"),[eS,""]],[RegExp(eP,"i"),[eP,""]],[e0,[ef,""]],[RegExp(eI,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eO,""];if(new RegExp(el).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=e1[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eI,s]}return[eI,""]}],[/((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=z(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[eu,[e[2],e[3],e[4]||"0"].join(".")]:[eu,""]],[/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",""]]],e8=function(e){for(var t=0;e6.length>t;t++){var i=e6[t],s=i[1],r=i[0].exec(e),n=r&&(N(s)?s(r,e):s);if(n)return n}return["",""]},e4=function(e){return eY.test(e)?eS:eZ.test(e)?eP:eJ.test(e)?e$:RegExp(eR,"i").test(e)?eR:RegExp("(Windows Phone|WPDesktop)","i").test(e)?eO:/iPad/.test(e)?ed:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ep:e0.test(e)?ef:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eA,"i").test(e)?eA:/(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(el).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)?eu:ec:RegExp("(pda|Mobile)","i").test(e)?eT:RegExp(eh,"i").test(e)&&!RegExp("Tablet pc","i").test(e)?eM:""},e9=/\bFBAV\/(\d+(?:\.\d+)*)/i,e7=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",e9],[/\bFBAN\/EMA\b/i,"Facebook Lite",e9],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",e9],[/\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"]],te="[Truncated]",tt="[Unserializable]";function ti(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 ts,tr,tn,ta,to,tl=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tu(e,t){return"string"==typeof e&&tl.test(e)?e:t()}function th(e,t){var i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function tc(e){return e?e.split("#")[0]:e}function td(e,t){var i=setTimeout(e,t);return null!=i&&i.unref&&(null==i||i.unref()),i}function tp(e,t,i){return tv.apply(this,arguments)}function tv(){return(tv=h(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=td(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var tf=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 h(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&D(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)),l({},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 h(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,l({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return to&&i.length===ta?to:(ta=i.length,to=i.reduce((i,s)=>{tn||(tn={});var r=tn[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,tn[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 l({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}};function tg(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 z(s)||(n.lineno=s),z(r)||(n.colno=r),n}var t_=(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]},tm=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ty=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tb=/\((\S*)(?::(\d+))(?::(\d+))\)/,tw=(e,t)=>{var i=tm.exec(e);if(i)return tg(t,i[1],"?",+i[2],+i[3]);var s=ty.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var r=tb.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=t_(s[1]||"?",s[2]);return tg(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tx=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tk=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tE=(e,t)=>{var i=tx.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tk.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=t_(n,r);return tg(t,r=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tS=/\(error: (.*)\)/;function tP(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function t$(e,t){for(var i=t.start;i>0&&tP(e[i-1],e[i-1+t.length]);)i--;return t.start-i}function tF(e,t){for(var i=t.start+t.length,s=i;e.length>s&&tP(e[s],e[s-t.length]);)s++;return s-i}var tC=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=q(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 Z(e,"DOMException")}isDOMError(e){return Z(e,"DOMError")}},tI=class{match(e){return Y(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!!Z(e,"ErrorEvent")&&(null!=e.error||this.un(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,s=t.apply(e.message);return l({},s,{stack:null!=(i=this.ln(e))?i:s.stack,synthetic:!0})}un(e){return q(e.message)&&e.message.length>0}ln(e){var t,i,s=null!=(t=e.lineno)?t:0,r=null!=(i=e.colno)?i:0;if(q(e.filename)&&0!==e.filename.length&&0!==s)return"Error\n    at "+e.filename+":"+s+":"+r}},tA=/^(?:[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(tA);return s&&(t=s[1],i=s[2]),[t,i]}},tT=["fatal","error","warning","log","info","debug"];function tM(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(", ");
1if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}var tL=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(ee(e))return e.constructor.name;var t="name"in e?e.name:void 0;return q(t)&&!H(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: "+tM(e)}isSeverityLevel(e){return q(e)&&!H(e)&&tT.indexOf(e)>=0}getStack(e){try{return q(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:q(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(Y(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},tD=class{match(e){return ee(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tM(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}},tN=class{match(e){return J(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}}},tj=class{match(e){return Z(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ee(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 J(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}},tB="$message",tz="$timestamp",tq=new Set([tB,tz]),tH={enabled:!0,max_bytes:32768};function tU(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tH.enabled,max_bytes:function(e,t){if(!W(e)||1/0===e||-1/0===e)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tH.max_bytes)}:l({},tH)}var tV=class{constructor(e){this.ts=[],this.es=0,this.xn=tU(e)}setConfig(e){this.xn=tU(e),this.rs()}add(e){var t=function(e){var t;try{t=R(e)}catch(e){return}try{var i=JSON.parse(t);if(!j(i))return;var s=i[tB],r=i[tz];if(!q(s)||0===s.trim().length||!q(r)&&!W(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.xn.max_bytes||(this.ts.push({step:t.step,bytes:i}),this.es+=i,this.rs())}}getAttachable(){return this.ts.map(e=>e.step)}clear(){this.ts=[],this.es=0}size(){return this.ts.length}rs(){for(;this.es>this.xn.max_bytes&&this.ts.length>0;){var e=this.ts.shift();e&&(this.es-=e.bytes)}}},tW=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function tG(e){return"string"==typeof e||e}function tK(e){return"string"==typeof e?e:void 0}var tQ,tX,tJ=["$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"],tZ="NativeGzipValidationError",tY=e=>e.length>=2&&31===e[0]&&139===e[1],t0=(e,t)=>e===$.GZipJS||t===$.GZipJS||"gzip"===t,t1=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),t2=e=>
1{throw th(tZ,"Native gzip produced invalid output: "+e)},t3=(tQ=h(function*(e,t){18>e.size&&t2("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));tY(i)&&8===i[2]||t2("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)&&t2("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&t2("invalid-size")}),function(e,t){return tQ.apply(this,arguments)});function t5(){return(t5=h(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=h(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 t3(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 t6={}.propertyIsEnumerable;function t8(e,t){try{return t4(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function t4(e,t,i,s){var r=[];for(var n in e)if(t6.call(e,n)){if(!n){null==t||t.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>=i.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=e[n];if(U(a)||z(a))continue;r.push({key:ti(n),value:function e(t,i,s,r){if(0>=s.remainingNodes)return{stringValue:te};if(s.remainingNodes--,K(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:ti(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:te};if(t instanceof Date){var l=Number.isFinite(t.getTime())?t.toISOString():String(t);return{stringValue:"string"==typeof l?ti(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 D(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(V(l))continue;n.push(e(l,i,s,r))}catch(e){n.push({stringValue:tt})}return t.length>o&&n.push({stringValue:te}),n}(t,i,s,r+1)}}:{kvlistValue:{values:t4(t,i,s,r+1)}}}finally{s.ancestors.delete(t)}}return{stringValue:ti(String(t))}}(a,t,i,s)})}catch(e){r.push({key:ti(n),value:{stringValue:tt}})}}return r}function t9(e,t,i){return l({},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 t7={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"},ie={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}},it=ie.info;function ii(e,t,i,s){return{resourceLogs:[{resource:{attributes:t8(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}var is=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.xn=t,this.A=i,this.ns=s,this.ss=r,this.ls=n,this.us=a,this.hs=null,this.ds=0,this.vs=0,this.cs=0,this.fs=0,this.ps=0,this.gs=!1,this.ys=t.maxBufferSize,this.bs=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this._s=t.flushIntervalMs,this.ws=t.maxBatchRecordsPerPost,this.ks=t.rateCapWindowMs,this.Ss=t.maxLogsPerInterval}clearQueue(){this.vs++,this._instance.setPersistedProperty(P.LogsQueue,[])}reset(){this.xs(),this.fs=0,this.ps=0,this.gs=!1,this.cs=0,this.ws=this.xn.maxBatchRecordsPerPost}onReconnect(){this.cs=0,this.Cs()}captureLog(e,t){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var s=this.Ts(e);if(null!==s)if(s.body){if(this.Ms()){var r={record:function(e,t,i,s){var r,n=ie[e.level||"info"]||it,a=n.text,o=n.number,u=(void 0===(r=W(s)?s:void 0)&&(r=Date.now()),String(r)+"000000"),h={};t.distinctId&&(h.posthogDistinctId=t.distinctId),t.sessionId&&(h.sessionId=t.sessionId),t.windowId&&(h["window.id"]=t.windowId),V(t.sessionStartTimestamp)||(h.sessionStartTimestamp=String(t.sessionStartTimestamp)),V(t.lastActivityTimestamp)||(h.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(h["url.full"]=t.currentUrl),t.screenName&&(h["screen.name"]=t.screenName),t.appState&&(h["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(h.feature_flags=t.activeFeatureFlags);var c=l({},h),d=e.attributes;if(d){var p=[];try{p=Object.keys(d)}catch(e){p=[]}for(var v of p){var f=void 0;try{f=d[v]}catch(e){f=tt}Object.defineProperty(c,v,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:o,severityText:a,body:{stringValue:function(e){try{return ti(String(e))}catch(e){return tt}}(e.body)},attributes:t8(c,i)};return e.trace_id&&(g.traceId=e.trace_id),e.span_id&&(g.spanId=e.span_id),z(e.trace_flags)||(g.flags=e.trace_flags),g}(s,null!=(i=null==t?void 0:t.context)?i:this.ns(),this.A,null==t?void 0:t.occurredAtMs)};this.ss(()=>this.Is(r))}}else this.A.info("Log was rejected in beforeSend function")}}Ts(e){var t=this.xn.beforeSend;if(!t)return e;var i=D(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}Ms(){if(void 0===this.Ss)return!0;var e=Date.now(),t=e-this.fs;return this.ks>t&&t>=0||(this.fs=e,this.ps=0,this.gs=!1),this.Ss>this.ps?(this.ps++,!0):(this.gs||(this.A.warn("captureLog dropping logs: exceeded "+this.Ss+" logs per "+this.ks+"ms"),this.gs=!0),!1)}flush(){var e=this;return h(function*(){if(!e._instance.isDisabled)return e.hs||(e.hs=e.Es().finally(()=>{e.hs=null})),e.hs})()}Es(){var e=this;return h(function*(){e.xs();var t=null!=(r=e._instance.getPersistedProperty(P.LogsQueue))?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){var r,n,a,o=e.vs;e.ds=0;var l=Math.min(t.length,e.ws),u=t.slice(0,l),h=ii(u.map(e=>e.record),e.Rs(),null!=(n=e.us)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.As(h);if(e.vs!==o)return;if("too-large"===c.kind&&u.length>1)e.ws=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.ws);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.xn.maxBatchRecordsPerPost>e.ws&&(e.ws=Math.min(e.xn.maxBatchRecordsPerPost,e.ws+1)),yield e.Ps(u.length),t=null!=(a=e._instance.getPersistedProperty(P.LogsQueue))?a:[],s+=u.length,"fatal"===c.kind))throw c.error}})()}Ps(e){var t=this;return h(function*(){var i,s=Math.max(0,e-t.ds),r=null!=(i=t._instance.getPersistedProperty(P.LogsQueue))?i:[];t._instance.setPersistedProperty(P.LogsQueue,r.slice(s)),yield t.ls()})()}Rs(){var e;return e=this.xn,t9(e,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Is(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(P.LogsQueue))?t:[];this.bs>i.length||(i.shift(),this.ds++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(P.LogsQueue,i),this.ys>i.length?this.Fs():this.Cs()}}Fs(e){void 0===e&&(e=this._s),this.Os||(this.Os=td(()=>{this.Os=void 0,this.Cs()},e))}$s(){var e=Math.min(Math.max(0,this.cs-1),6);return this._s*Math.pow(2,e)}Ds(){var e=this._instance.getPersistedProperty(P.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return h(function*(){t.xs();var i=t.flush().catch(()=>{});void 0!==e?yield tp(i,e):yield i})()}flushWithTimeout(e){var t=this;return h(function*(){var i=t.flush();yield tp(i,e,()=>{i.catch(()=>{})})})()}Cs(){this.flush().then(()=>{this.cs=0},e=>{this.cs++,this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Ds()&&this.Fs(this.$s())})}xs(){this.Os&&(clearTimeout(this.Os),this.Os=void 0)}},ir=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function ia(e){return String(e)+"000000"}function io(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 il=class{constructor(e,t,i){this._instance=e,this.xn=t,this.A=i,this.Ls=new Map,this.hs=null,this.Ns=!1,this.qs=new Map,this.js=new Set,this.Bs=0}count(e,t,i){void 0===t&&(t=1),this.Hs({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.Hs({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.Hs({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.hs,s=(e=h(function*(){i&&(yield i.catch(()=>{})),yield t.zs()}),function(){return e.apply(this,arguments)})().finally(()=>{this.hs===s&&(this.hs=null)});return this.hs=s,s}drainWindow(){if(0===this.Ls.size)return null;var e=this.Ls;return this.Ls=new Map,this.Ns=!1,this.qs=new Map,this.js=new Set,this.Us(e)}reset(){this.Bs++,this.xs(),this.Ls=new Map,this.hs=null,this.Ns=!1,this.qs=new Map,this.js=new Set}Hs(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.Ts(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?l({},t.attributes):void 0,s=io(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.Ls.get(s);if(!r){if(!this.Ws())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Ls.set(s,r)}var n=this.qs.get(t.name);void 0===n?this.qs.set(t.name,t.type):n===t.type||this.js.has(t.name)||(this.js.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.Vs(r,t.value),this.Fs()}else this.A.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Ws(){return this.xn.maxSeriesPerFlush>this.Ls.size||(this.Ns||(this.Ns=!0,this.A.warn("Metric series cap reached ("+this.xn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Vs(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(ir.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,ir)]+=1}}Ts(e){var t=this.xn.beforeSend;if(!t)return e;var i=D(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}Fs(){this.Os||(this.Os=td(()=>{this.Os=void 0,this.flush().catch(e=>{this.A.error("Metrics flush failed:",e)})},this.xn.flushIntervalMs))}xs(){this.Os&&(clearTimeout(this.Os),this.Os=void 0)}zs(){var e=this;return h(function*(){if(0!==e.Ls.size){var t=e.Ls;e.Ls=new Map,e.Ns=!1,e.qs=new Map,e.js=new Set;var i=e.Bs,s=yield e._instance.Gs(e.Us(t));if(i===e.Bs)switch(s.kind){case"ok":return;case"retry-later":return e.Zs(t),void e.Fs();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)}}})()}Us(e){var t,i,s,r;return t=this.Js(e),i=t9(this.xn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:t8(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}Js(e){var t=ia(Date.now()),i=new Map;for(var s of e.values()){var r,n=io(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=l({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=t8(null!=(r=s.attributes)?r:{},this.A),u=ia(s.windowStartMs);if("count"===s.type){var h,c={attributes:o,startTimeUnixNano:u,timeUnixNano:t,asDouble:null!=(h=s.total)?h:0};a.sum.dataPoints.push(c)}else if("gauge"===s.type){var d,p={attributes:o,timeUnixNano:t,asDouble:null!=(d=s.last)?d:0};a.gauge.dataPoints.push(p)}else s.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:u,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:ir})}return Array.from(i.values())}Zs(e){var t,i;for(var s of e){var r=s[0],n=s[1],a=this.Ls.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.Ws()&&this.Ls.set(r,n)}}},iu=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];c&&(S.DEBUG||c.POSTHOG_DEBUG||i)&&!z(c.console)&&c.console&&("__rrweb_original__"in c.console[t]?c.console[t].__rrweb_original__:c.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)=>iu(e+" "+t,i)};return s},ih=iu("[PostHog.js]"),ic=ih.createLogger,id=ic("[ExternalScriptsLoader]"),ip=e=>{var t=null==v?void 0:v.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]}},iv=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return id.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=ip(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(!v)return i("document not found");if(ip(t))return iv(e,t,i);var s=v.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)v.head.appendChild(s);else{var r,n=v.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):v.body.appendChild(s)}};null!=v&&v.body?n():null==v||v.addEventListener("DOMContentLoaded",n)},ig={},i_=(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)};k.__PosthogExtensions__=k.__PosthogExtensions__||{},k.__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=ig[r];if("fallback"===s&&n){if(ip(n))return void iv(e,n,i);delete ig[r]}iv(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var a,o=i_(e,t);ig[r]=o;var l=ip(r);null==l||null==(a=l.parentNode)||a.removeChild(l),iv(e,o,i)}else i(void 0,n)}:i)}else iv(e,i_(e,t),i)}else iv(e,e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js"),i)},k.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{iv(e,e.requestRouter.endpointFor("api",t),i)},S.DEBUG=!1,S.LIB_VERSION="1.429.0",S.LIB_NAME="web";var im="distinct_id",iy="$device_id",ib="$device_model",iw="__alias",ix="$fbc",ik="$fbc_persistence",iE="__timers",iS="$autocapture_disabled_server_side",iP="$heatmaps_enabled_server_side",i$="$exception_capture_enabled_server_side",iF="$error_tracking_suppression_rules",iC="$error_tracking_capture_extension_exceptions",iI="$web_vitals_enabled_server_side",iO="$dead_clicks_enabled_server_side",iA="$product_tours_enabled_server_side",iR="$logs_capture_enabled_server_side",iT="$web_vitals_allowed_metrics",iM="$session_recording_remote_config",iL="$replay_sample_rate",iD="$replay_override_sampling",iN="$replay_override_linked_flag",ij="$replay_override_url_trigger",iB="$replay_override_event_trigger",iz="$sesid",iq="$session_is_sampled",iH="$enabled_feature_flags",iU="$active_feature_flags",iV="$early_access_features",iW="$feature_flag_details",iG="$feature_flag_payloads",iK="$feature_flag_request_id",iQ="$minimal_flag_called_events",iX="$override_feature_flags",iJ="$override_feature_flag_payloads",iZ="$stored_person_properties",iY="$stored_group_properties",i0="$groups",i1="$surveys",i2="$surveys_loaded_at",i3="$surveys_activated",i5="$surveys_activated_session",i6="$surveys_activated_timestamps",i8="ph_product_tours",i4="$flag_call_reported",i9="$flag_call_reported_session_id",i7="$feature_flag_errors",se="$feature_flag_evaluated_at",st="$user_state",si="$client_session_props",ss="$capture_rate_limit",sr="$initial_campaign_params",sn="$initial_referrer_info",sa="$initial_person_info",so="$epp",sl="$posthog_cookieless",su="$cookieless_mode",sh="$sdk_debug_extensions_init_method",sc="$sdk_debug_extensions_init_time_ms",sd="$sdk_debug_recording_script_not_loaded",sp="PostHog loadExternalDependency extension not found.",sv="anonymous",sf="identified",sg="identified_only",s_="visibilitychange",sm="beforeunload",sy="$pageview",sb="$pageleave",sw="$identify",sx="$groupidentify";function sk(e,t){D(e)&&e.forEach(t)}function sE(e,t){if(!V(e))if(D(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)M.call(e,i)&&t(e[i],i)}var sS=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 sP(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var s$=function(e){try{return e()}catch(e){return}},sF=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){ih.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ih.critical(e)}}},sC=function(e){var t={};return sE(e,function(e,i){(q(e)&&e.length>0||W(e))&&(t[i]=e)}),t};function sI(e){var t=l({},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 sA(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 sT=e=>{if(v){try{for(var t=e+"=",i=v.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 W(e)&&isFinite(e)&&Math.floor(e)===e});var sM=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: 4,280 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}},sL=class{generate(){var e=this.generateOrAbort();if(!z(e))return e;this.Ct=0;var t=this.generateOrAbort();if(z(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e,t=W(e=Date.now())&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0;if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.Tt++,this.Tt>0x3ffffffffff&&(this.Ct++,this.Mt())}return sM.fromFieldsV7(this.Ct,Math.trunc(this.Tt/0x40000000),0x3fffffff&this.Tt,this.It.nextUint32())}Mt(){this.Tt=1024*this.It.nextUint32()+(1023&this.It.nextUint32())}constructor(){this.Ct=0,this.Tt=0,this.It=new sj}},sD=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};c&&!z(c.crypto)&&crypto.getRandomValues&&(sD=e=>crypto.getRandomValues(e));var sN,sj=class{nextUint32(){return this.Rt.length>this.At||(sD(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},sB=()=>sz().toString(),sz=()=>(sN||(sN=new sL)).generate(),sq="",sH=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sU=null,sV={Et(){if(!U(sU))return sU;if(sU=!1,v)try{var e="__ph_cookie_support_"+sB();sV.Ot(e,"xyz"),sU='"xyz"'===sT(e),sV.Dt(e)}catch(e){sU=!1}return sU},Pt(e){ih.error("cookieStore error: "+e)},Lt:sT,Nt(e){var t;try{t=JSON.parse(sV.Lt(e))||{}}catch(e){}return t},Ot(e,t,i,s,r){if(!v)return!1;try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=v),sq)return sq;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sB();!sq&&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",sq=n)}return sq}(e);if(!i){var s,r=(s=e.match(sH))?s[0]:"";r!==i&&ih.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(v.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&&ih.warn("cookieStore warning: large cookie, len="+u.length),v.cookie=u,!0}catch(e){return!1}},Dt(e,t){if(null!=v&&v.cookie)try{sV.Ot(e,"",-1,t)}catch(e){return}}},sW=null,sG={Et(){if(!U(sW))return sW;var e=!0;if(z(c))e=!1;else try{var t="__mplssupport__";sG.Ot(t,"xyz"),'"xyz"'!==sG.Lt(t)&&(e=!1),sG.Dt(t)}catch(t){e=!1}return e||ih.error("localStorage unsupported; falling back to cookie store"),sW=e,e},Pt(e){ih.error("localStorage error: "+e)},Lt(e){try{return null==c?void 0:c.localStorage.getItem(e)}catch(e){sG.Pt(e)}return null},Nt(e){try{return JSON.parse(sG.Lt(e))||{}}catch(e){}return null},Ot(e,t){try{return null==c||c.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sG.Pt(e)}return!1},Dt(e){try{null==c||c.localStorage.removeItem(e)}catch(e){sG.Pt(e)}}},sK=[iZ,iU,iH,iW,iG,iK,se,i7,i4],sQ=[iy,im,iz,iq,so,sa,ik,st],sX=["__proto__","constructor","prototype"],sJ=e=>{if(!j(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===sX.indexOf(i)&&(t[i]=e[i])}),t},sZ=function(e,t){void 0===t&&(t=[]);var i={};return[...sQ,...t].forEach(t=>{var s=e[t];z(s)||U(s)||""===s||(i[t]=s)}),i},sY=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)},s0=(e,t)=>({p:t,f:sY(JSON.stringify(e))}),s1=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=sV.Nt(e+"_cpm"),s=(null==i?void 0:i.f)===sY(t)&&D(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},s2=(e,t)=>
1t+"|"+(sV.Lt(e+"_cpm")||""),s3={},s5={Et:()=>!0,Pt(e){ih.error("memoryStorage error: "+e)},Lt:e=>e in s3?s3[e]:null,Nt:e=>e in s3?s3[e]:null,Ot:(e,t)=>(s3[e]=t,!0),Dt(e){delete s3[e]}},s6=null,s8={Et(){if(!U(s6))return s6;if(s6=!0,z(c))s6=!1;else try{var e="__support__";s8.Ot(e,"xyz"),'"xyz"'!==s8.Lt(e)&&(s6=!1),s8.Dt(e)}catch(e){s6=!1}return s6},Pt(e){ih.error("sessionStorage error: ",e)},Lt(e){try{return null==c?void 0:c.sessionStorage.getItem(e)}catch(e){s8.Pt(e)}return null},Nt(e){try{return JSON.parse(s8.Lt(e))||null}catch(e){}return null},Ot(e,t){try{return null==c||c.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){s8.Pt(e)}return!1},Dt(e){try{null==c||c.sessionStorage.removeItem(e)}catch(e){s8.Pt(e)}}},s4=class{constructor(e){this._instance=e}get xn(){return this._instance.config}get consent(){return this.xo()?0:this.Co}isOptedOut(){return"always"===this.xn.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.xn.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.xn.opt_out_capturing_by_default}optInOut(e){this.To.Ot(this.Mo,+!!e,this.xn.cookie_expiration,this.xn.cross_subdomain_cookie,this.xn.secure_cookie)}reset(){this.To.Dt(this.Mo,this.xn.cross_subdomain_cookie)}get Mo(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get Co(){var e=this.To.Lt(this.Mo);return I(ei,e)?1:I(es,e)?0:-1}get To(){var e=this.xn.opt_out_capturing_persistence_type,t="localStorage"===e?sG:sV,i=t.Et()?t:s5;if(!this.Io||this.Io!==i){this.Io=i;var s="localStorage"===e?sV:sG;s.Lt(this.Mo)&&(this.Io.Lt(this.Mo)||this.optInOut(I(ei,s.Lt(this.Mo))),s.Dt(this.Mo,this.xn.cross_subdomain_cookie))}return this.Io}xo(){return!!this.xn.respect_dnt&&[null==p?void 0:p.doNotTrack,null==p?void 0:p.msDoNotTrack,k.doNotTrack,null==p?void 0:p.globalPrivacyControl].some(e=>I(ei,e))}};function s9(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!N(s))return t;try{var r=s(t);return q(r)&&r?r:t}catch(e){return ih.error("Error in get_current_url, falling back to window.location.href",e),t}}function s7(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function re(e){return!!e&&1===e.nodeType}function rt(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ri(e){return!!e&&3===e.nodeType}function rs(e){return!!e&&11===e.nodeType&&re(e.host)}function rr(e){return e?O(e).split(/\s+/):[]}function rn(e,t){var i,s,r=z(s=null==c||null==(i=c.location)?void 0:i.href)?void 0:s9(t,s);return!!(r&&e&&e.some(e=>r.match(e)))}function ra(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 rr(t)}function ro(e){return V(e)?null:O(e).split(/(\s+)/).filter(e=>rO(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rl(e){var t="";return rk(e)&&!rE(e)&&e.childNodes&&e.childNodes.length&&sE(e.childNodes,function(e){var i;ri(e)&&e.textContent&&(t+=null!=(i=ro(e.textContent))?i:"")}),O(t)}function ru(e){var t;return z(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rh=["a","button","form","input","select","textarea","label"];function rc(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 rd(e,t){if(z(t))return!0;var i,s=function(e){if(t.some(t=>rc(e,t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function rp(e){var t=e.parentNode;return!(!t||!re(t))&&t}var rv=[".ph-no-autocapture","[data-ph-no-autocapture]"],rf=["next","previous","prev",">","<"],rg=[...rf,"+","-","−","–"],r_=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,rm=[".ph-no-rageclick",".ph-no-capture"],ry=["","text","search","email","password","url","tel","number"];function rb(e,t){if(!c||rw(e)||(K(t)?(s=!!t&&rm,r=void 0,n=!1):(s=null!=(a=null==t?void 0:t.css_selector_ignorelist)?a:rm,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)||!re(i))&&(rt(i,"textarea")||(rt(i,"input")?I(ry,(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=rx(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||z(e))return!1;if(!0===e)i=rf;else{if(!D(e))return!1;if(e.length>10)return ih.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=>r_(t,e)||r_(s,e))})}(r,l.map(e=>{var t;return{safeText:rl(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rd(l,s)}var rw=e=>!e||rt(e,"html")||!re(e),rx=(e,t)=>{if(!c||rw(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],r=e;r.parentNode&&!rt(r,"body");)if(rs(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var n=rp(r);if(!n)break;if(t||rh.indexOf(n.tagName.toLowerCase())>-1)i=!0;else try{var a=c.getComputedStyle(n);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(n),r=n}return{parentIsUsefulElement:i,targetElementList:s}};function rk(e){for(var t=new Set,i=0,s=e;s.parentNode&&!rt(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=ra(s);if(I(r,"ph-sensitive")||I(r,"ph-no-capture"))return!1}if(I(ra(e),"ph-include"))return!0;var n=e.type||"";if(q(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
1var a=e.name||e.id||"";return!q(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 rE(e){return!!(rt(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||rt(e,"select")||rt(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rS=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}))$"),rP=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,r$=[16,15,14,13],rF=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),rC=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),rI=/[0-9A-Za-z_]/;function rO(e,t){return void 0===t&&(t=!0),!(V(e)||q(e)&&(e=O(e),(t?rS.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(rP.lastIndex=0;t=rP.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of r$){var a=r+n;if(s.length>=a){var o=s.slice(r,a);if(rS.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?rF.test(e):function(e){var t;for(rC.lastIndex=0;t=rC.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&rI.test(i)&&rI.test(s)))return!0}return!1}(e))))&&!0}function rA(e){var t=rl(e);return rO(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&sE(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=rl(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){ih.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rR(e){return e.replace(/"|\\"/g,'\\"')}var rT=ic("[Dead Clicks]"),rM=()=>!0,rL=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(iO)),s=e.instance.config.capture_dead_clicks;return K(s)?s:!!j(s)||i},rD=class{get lazyLoadedDeadClicksAutocapture(){return this.Eo}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.Ro(()=>{this.Ao()}):this.stop()}Ro(e){var t,i;null!=(t=k.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=k.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rT.error("failed to load script",t):e()})}Ao(){var e;if(v){if(!this.Eo&&null!=(e=k.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=j(this.instance.config.capture_dead_clicks)?l({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Eo=k.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Eo.start(v),rT.info("starting...")}}else rT.error("`document` not found. Cannot start.")}stop(){this.Eo&&(this.Eo.stop(),this.Eo=void 0,rT.info("stopping..."))}},rN=ic("[SegmentIntegration]");function rj(e,t,i){void 0===i&&(i=!0);var s,r,n,a=e.config.segment;if(!a)return t();var o=N(a.register)?{analytics:a}:a,u=o.analytics,h=o.filterProperties;s=i,r=i=>{var r=()=>i.anonymousId()||sB();e.config.get_device_id=r,s&&i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(st,sf)),(i=>{var s,r;u.register((s=i,"u">typeof Promise&&Promise.resolve||rN.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;var r=!!s&&t.event.anonymousId===s&&!t.event.userId;r||t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rN.info("No userId set, resetting PostHog"),e.reset()),r||(s=void 0),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rN.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var n=e.calculateEventProperties(i,t.event.properties);if(!V(h)){var a=t.event.properties||{},o={};for(var u of Object.keys(n))M.call(a,u)||(o[u]=n[u]);var c=((e,t)=>{var i=D(e)?e:[e],s=l({},t);
1for(var r of i)try{if(s=r(s),V(s))return null}catch(e){return rN.error("Error in Segment filterProperties:",e),null}return s})(h,o);if(V(c))return t;n=c}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=>r(e,e.event.event),page:e=>r(e,sy),identify:e=>r(e,sw),screen:e=>r(e,"$screen")})).then(()=>{t()},e=>{rN.error("Failed to register the Segment integration",e),t()})})(s?void 0:i.anonymousId()||void 0)},"then"in(n=u.user())&&N(n.then)?n.then(r):r(n)}var rB="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,u=i.sendExceptionsToPostHog,h=void 0===u||u;return t=>{if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i,a,u,c,d,p,v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+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=>l({},e,{stacktrace:e.stacktrace?l({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>l({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(a=f[0])?void 0:a.value)||t.message,$exception_type:null==(u=f[0])?void 0:u.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:t.tags};return s&&r&&(_.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),h&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}var rq=class{constructor(e,t,i,s,r,n){this.name=rB,this.setupOnce=function(a){a(rz(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}},rH=class{constructor(e){this.Po=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ih.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Fo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Oo()}Oo(){var e;this.$o=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Po)}destroy(){var e;null==(e=this.$o)||e.call(this),this.$o=void 0}doPageView(e,t){var i,s=this.Do(e,t);return this.Fo={pathname:null!=(i=null==c?void 0:c.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Do(e,null==(t=this.Fo)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Fo)?void 0:e.pageViewId}}Do(e,t){var i=this.Fo;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,a=r.lastScrollY,o=r.maxScrollY,l=r.maxContentHeight,u=r.lastContentY,h=r.maxContentY;if(!(z(n)||z(a)||z(o)||z(l)||z(u)||z(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?ea(a/n,0,1,ih):1,d=n>1?ea(o/n,0,1,ih):1,p=l>1?ea(u/l,0,1,ih):1,v=l>1?ea(h/l,0,1,ih):1;s=sS(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"],rV={$people_distinct_id:{exposure:"hidden"},[iw]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[iE]:{exposure:"hidden"},[ik]:{exposure:"hidden"},[iS]:{exposure:"event"},[iP]:{exposure:"hidden"},[iR]:{exposure:"hidden"},[i$]:{exposure:"event"},[iF]:{exposure:"hidden"},[iC]:{exposure:"event"},[iI]:{exposure:"event"},[iO]:{exposure:"event"},[iA]:{exposure:"hidden"},[iT]:{exposure:"event"},[iM]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[iz]:{exposure:"hidden"},[iq]:{exposure:"event"},[iL]:{exposure:"event",shouldSkipFromEventProperties:e=>U(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"}
1,[iH]:{exposure:"hidden",storageGroup:"flags"},[iU]:{exposure:"hidden",storageGroup:"flags"},[iV]:{exposure:"hidden"},[iW]:{exposure:"hidden",storageGroup:"flags"},[iG]:{exposure:"hidden",storageGroup:"flags"},[iK]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iQ]:{exposure:"hidden",storageGroup:"flags"},[iX]:{exposure:"hidden"},[iJ]:{exposure:"hidden"},[iZ]:{exposure:"hidden"},[iY]:{exposure:"hidden"},[i1]:{exposure:"hidden",storageGroup:"surveys"},[i2]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[i3]:{exposure:"event"},[i5]:{exposure:"hidden"},[i6]:{exposure:"hidden"},[i8]:{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"},[i4]:{exposure:"hidden"},[i9]:{exposure:"hidden"},[i0]:{exposure:"event"},[i7]:{exposure:"hidden"},[se]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[st]:{exposure:"hidden"},[si]:{exposure:"hidden"},[ss]:{exposure:"hidden"},[sr]:{exposure:"hidden"},[sn]:{exposure:"hidden"},[sa]:{exposure:"hidden"},[so]:{exposure:"hidden"},[iD]:{exposure:"event"},[iN]:{exposure:"event"},[ij]:{exposure:"event"},[iB]:{exposure:"event"},[sh]:{exposure:"event"},[sc]:{exposure:"event"},[sd]:{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"}},rW=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rG=e=>{var t=rV[e];if(t)return t;for(var i of rW){var s=i[1];if(0===e.indexOf(i[0]))return s}},rK=(e,t)=>{try{var i;return JSON.stringify(e,(e,t)=>Y(t)?(null!=i||(i=new WeakMap),i.has(t)||i.set(t,sI(t)),i.get(t)):"bigint"==typeof t?t.toString():t,t)}catch(t){return R(e)}},rQ=e=>{var t=null==v?void 0:v.createElement("a");return z(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(!D(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){ih.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rJ=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("=");D(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},rZ=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rY=(e,t)=>e>=t&&w(),r0=(e,t,i,s)=>{if(0===e){if(w()){var r=t+1;return r===i&&s(),r}return t}return 0},r1=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],r2=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...r1],r3="<masked>",r5=["li_fat_id"];function r6(e,t,i){if(!v)return{};var s,r=t?[...r1,...i||[]]:[],n=r8(rJ(v.URL,r,r3),e);return sS((s={},sE(r5,function(e){var t=sT(e);s[e]=t||null}),s),n)}function r8(e,t){var i=r2.concat(t||[]),s={};return sE(i,function(t){var i=rX(e,t);s[t]=i||null}),s}function r4(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(!U(t)){i.$search_engine=t;var s=v?rX(v.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function r9(){return navigator.language||navigator.userLanguage}var r7="$direct";function ne(){return(null==v?void 0:v.referrer)||r7}function nt(e,t,i){void 0===i&&(i=!1);var s,r=e?[...r1,...t||[]]:[],n=null==(s=i?tc(null==f?void 0:f.href):null==f?void 0:f.href)?void 0:s.substring(0,1e3);return{r:ne().substring(0,1e3),u:n?rJ(n,r,r3):void 0}}function ni(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?tc(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==r7?r7:null==(i=rQ(s))?void 0:i.host};
vendor: 5,811 bytes, line 1
1if(n){a.$current_url=n;var o=rQ(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,sS(a,r8(n))}return s&&sS(a,r4(s)),a}function ns(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var nr={flags:se,surveys:i2},nn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],na=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},no="main",nl=[iH,iU,iW,iG,iK,se,iQ,iZ],nu=e=>-1!==nl.indexOf(e),nh=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},nc=e=>{if(!e)return{};var t=JSON.parse(e);return j(t)?t:{}},nd=(e,t)=>{sE(e,(i,s)=>{var r=rG(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})},np=class{constructor(e,t,i){if(void 0===i&&(i=!0),this.Lo={},this.No=!1,this.qo=!1,this.jo=!1,this.Bo=!1,this.Ho=!1,this.zo=new Map,this.Uo=!1,this.Wo=!1,this.Vo=!1,this.Go=!1,this.Zo=new Set,this.xn=e,this.Jo=i,this.props={},this.Qo=void 0,this.Ko=(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.To=this.Xo(e),this.jo=this.Yo(e),this.load(),this.ta(),e.debug&&ih.info("Persistence loaded",e.persistence,l({},this.props)),this.update_config(e,e,t),this.save(),c){var s=()=>this.flush();sA(c,"beforeunload",s,{capture:!1}),sA(c,"pagehide",s,{capture:!1}),this.ea=e=>{if(this.No&&(!e.storageArea||e.storageArea===(null==c?void 0:c.localStorage))&&e.key)if(e.key!==this.Ko){if(this.jo){var t=rU.find(t=>e.key===this.ia(t));t&&this.ra(e.key,t)}}else this.ra(e.key,no)},sA(c,"storage",this.ea)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(e=>{var t=e[0],i=e[1],s=this.zo.get(t);if(nu(t)&&!0!==s)if(!0!==i){var r=new Set(s||[]);i.forEach(e=>r.add(e)),r.size&&this.na(t,r)}else this.na(t,!0)})}onCrossTabFeatureFlagChange(e){return this.Zo.add(e),()=>this.Zo.delete(e)}destroy(){this.ea&&c&&(c.removeEventListener("storage",this.ea),this.ea=void 0),this.Zo.clear()}ra(e,t,i){if(void 0===i&&(i=!0),this.gi)return!1;try{if(r=sG.Lt(e),U(r)){var s,r,n=this.sa(t);return n.storageValue=null,t!==no&&(n.persisted=!1),!1}s=nc(r)}catch(e){return!1}var a=t===no?s:sG.Nt(this.Ko);if(a&&this.oa(a))return!1;var o=this.aa(s,t,i);return t===no&&this.jo&&!nh(this.la().main,s)||this.ua(s,t,!0,r),o}oa(e){var t=this.props[im],i=e[im];return!z(t)&&!z(i)&&t!==i}ua(e,t,i,s){var r=this.sa(t);r.storageValue=s,t!==no&&(r.persisted=i);try{r.fingerprint=this.ha(e,t)}catch(e){r.fingerprint=void 0}}aa(e,t,i){var s=!1;return nl.forEach(i=>{var r,n=null==(r=rG(i))?void 0:r.storageGroup;if(!(t===no&&this.jo&&n||t!==no&&n!==t)){var a=i in e,o=this.da(i,a?e[i]:void 0),l=this.zo.has(i)?i in this.props:a;l===i in this.props&&nh(o,this.props[i])||(l?this.va(i,o,!1):this.ca(i,!1),s=!0)}}),s&&i&&this.Zo.forEach(e=>e()),s}fa(){if(!this.No)return!1;try{this.Vo=!1;var e,t=sG.Lt(this.Ko),i=this.sa(no),s=!1,r=!1;if(t!==i.storageValue)if(U(t))i.storageValue=null;else{if(e=nc(t),this.Vo=!this.Wo&&this.oa(e),this.Vo)return!1;r=this.aa(e,no,!1),!this.jo||nh(this.la().main,e)?this.ua(e,no,!0,t):i.storageValue=t,s=!0}return this.jo&&rU.forEach(t=>{var i=sG.Lt(this.ia(t)),n=this.sa(t),a=e||{},o=s&&nl.some(e=>{var i;return(null==(i=rG(e))?void 0:i.storageGroup)===t&&e in a});if(i!==n.storageValue||o){if(U(i))return n.storageValue=null,n.persisted=!1,void(o&&(r=this.aa(a,t,!1)||r));var l=nc(i);r=this.aa(l,t,!1)||r,this.ua(l,t,!0,i)}}),r}catch(e){return!1}}na(e,t){this.zo.set(e,t);var i=rG(e);null!=i&&i.volatile||(this.sa((this.jo?null==i?void 0:i.storageGroup:void 0)||no).fingerprint=void 0,this.pa(e))}ga(){nl.forEach(e=>this.zo.set(e,!0))}ta(){if(this.No)try{var e=sG.Lt(this.Ko),t=nc(e);this.sa(no).storageValue=e,nl.forEach(e=>{var i,s=this.jo?null==(i=rG(e))?void 0:i.storageGroup:void 0,r=s?sG.Lt(this.ia(s)):null;if(s){var n=this.sa(s);n.storageValue=r,n.persisted=!U(r)}var a=s&&!U(r)?nc(r):t;e in this.props?this.ma(e,a[e],this.props[e]):e in a&&this.na(e,!0)})}catch(e){}}da(e,t){var i=this.zo.get(e);if(!i)return t;if(!0===i)return this.props[e];if("$active_feature_flags"===e){var s=new Set(D(t)?t:[]),r=new Set(D(this.props[e])?this.props[e]:[]);return i.forEach(e=>r.has(e)?s.add(e):s.delete(e)),Array.from(s)}var n=j(t)?l({},t):{},a=j(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in a?n[e]=a[e]:delete n[e]}),n}ma(e,t,i){if(nu(e)){var s=this.zo.get(e);if(!0!==s){var r=t;if(this.No)try{var n,a=this.jo?null==(n=rG(e))?void 0:n.storageGroup:void 0,o=a?this.ia(a):this.Ko;r=nc(sG.Lt(o))[e]}catch(e){}var l=new Set(s||[]);if("$active_feature_flags"===e){if(!z(t)&&!D(t)||!z(r)&&!D(r)||!D(i))return void this.na(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(!j(i))return void(nh(r,i)?this.zo.delete(e):this.na(e,!0));if(!z(t)&&!j(t)||z(t)&&B(i)&&z(r))return void this.na(e,!0);var d=j(t)?t:{},p=j(r)?r:{};new Set([...Object.keys(d),...Object.keys(i)]).forEach(e=>{e in d==e in i&&nh(d[e],i[e])||l.add(e)}),l.forEach(e=>{e in p==e in i&&nh(p[e],i[e])&&l.delete(e)})}l.size?this.na(e,l):this.zo.delete(e)}}}ya(){var e,t=null==(e=this.xn)?void 0:e.persistence_save_debounce_ms;return W(t)&&t>0?t:0}ba(e){if(this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase())if(e)try{var t=sZ(e,this.xn.cookie_persisted_properties||[]),i=s0(t,this.xn.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=sV.Lt(this.Ko)||void 0;r&&s2(this.Ko,r)===s&&(this._a=s,this.wa=r)}catch(e){}else try{var n=sV.Lt(this.Ko)||void 0;this._a=n?s2(this.Ko,n):void 0,this.wa=n}catch(e){}}syncCookieProperties(){return this.ka(this.xn)}
1ka(e,t){if(void 0===t&&(t=!1),this.gi&&!t||this.Ho||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=sV.Lt(this.Ko)||void 0}catch(e){}if(!i||i===this.wa)return!1;var i,s,r=s2(this.Ko,i);try{s=sJ(JSON.parse(i))}catch(e){return!1}if((sV.Lt(this.Ko)||void 0)!==i)return!1;this._a=r,this.wa=i;var n=s1(this.Ko,i),a=[...sQ,...n.properties],o={};if(Object.keys(s).forEach(e=>{var t=s[e];(z(t)||U(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(o[e]=!0,delete s[e])}),B(s))return!1;var l="distinct_id"in s||"anonymous"===s.$user_state||"identified"===s.$user_state,u=this.props,h=u[im],c=u[st],d=sS({},u);[...sQ,...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===sQ.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}),this.props=sS(d,s),nl.forEach(e=>{var t=e in this.props;e in u===t&&nh(u[e],this.props[e])||(t?this.ma(e,u[e],this.props[e]):this.na(e,!0))}),!l||"$user_state"in s||"$user_state"in this.props||this.va(st,sv);var p=this.props[im],v=this.props[st];return l&&(p!==h||v!==c)&&(this.Wo=!0,this.Bo=!0,s8.Ot(this.Ko+"_cookie_identity_change_pending",!0),this.ca(iZ),this.ca(iU),this.ca(iH),this.ca(iW),this.ca(iG),this.ca(iK),this.ca(se),this.ca(i7),this.ca(i4),"anonymous"!==v||"identified"!==c&&"anonymous"!==s.$user_state&&(z(h)||p===h)||(nd(this.props,s),this.ca(iY)),"identified"===v?this.props.$user_id=p:delete this.props.$user_id,this.ca(iw)),!0}
1consumeCookieIdentityChange(){var e=this.Ko+"_cookie_identity_change_pending",t=this.Bo||!!s8.Lt(e);return this.Bo=!1,t&&s8.Dt(e),t}Sa(e){return void 0===e&&(e=!1),!(this.Ho||this.gi&&!e||!this.xn.cookieWinsOnConflict||"localstorage+cookie"!==this.xn.persistence.toLowerCase()||(this.Ho=!0,0))}xa(){this.Ho&&(z(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0),delete this.Lo[no],this.Ta(!0))}Ma(e){if(void 0===e&&(e=!0),this.Ho)try{e?this.xa():z(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0)}finally{this.Ho=!1}}isDisabled(){return!!this.gi}Xo(e){-1===nn.indexOf(e.persistence.toLowerCase())&&(ih.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=[...sQ,...t],l({},sG,{Nt(e){try{var t,r={};try{r=(t=sV.Lt(e)||void 0)?sJ(JSON.parse(t)):{}}catch(e){}var n,a=JSON.parse(sG.Lt(e)||"{}");if(i){var o=s1(e,t),l=[...sQ,...o.properties],u={};Object.keys(r).forEach(e=>{var t=r[e];U(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[im],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===sQ.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!h||"$user_state"in r||"$user_state"in a||(a[st]=sv),h&&(("distinct_id"in u?u[im]:a[im])!==d||("$user_state"in u?u[st]:a[st])!==p)&&(sK.forEach(e=>delete a[e]),"identified"===u.$user_state&&"distinct_id"in u?a.$user_id=u[im]:delete a.$user_id,"identified"!==u.$user_state&&(delete a[i0],delete a[iY]),delete a.__alias)}n=sS(a,u)}else n=sS(r,a);return sG.Ot(e,n),n}catch(e){}return null},Ot(e,s,r,n,a,o){var l=sG.Ot(e,s,void 0,void 0,o);try{var u=sZ(s,t);if(Object.keys(u).length){if(i){var h=e+"_cpm",c=s0(u,t);if(sV.Ot(h,c,r,n,a,o),sV.Lt(h)!==JSON.stringify(c)){sV.Dt(h,n);var d=sZ(s);return sV.Ot(e,d,r,n,a,o),l}}sV.Ot(e,u,r,n,a,o)}}catch(e){sG.Pt(e)}return l},Dt(e,t){try{null==c||c.localStorage.removeItem(e),sV.Dt(e,t),sV.Dt(e+"_cpm",t)}catch(e){sG.Pt(e)}}})),a=!1,o=!1,u=e.persistence.toLowerCase();return"localstorage"===u&&sG.Et()?(r=sG,o=!0):"localstorage+cookie"===u&&n.Et()?(r=n,o=!0,a=!0):"sessionstorage"===u&&s8.Et()?r=s8:"memory"===u?r=s5:"cookie"===u&&sV.Et()?(r=sV,a=!0):n.Et()?(r=n,o=!0,a=!0):sV.Et()?(r=sV,a=!0):r=s5,this.No=o,this.qo=a,r}ia(e){return this.Ko+"__"+e}Yo(e){return this.No&&!!e.split_storage}properties(){var e={};return sE(this.props,(t,i)=>{var s=rG(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.gi||e){var t=this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase(),i=t?sG.Nt(this.Ko):null,s={};if(t)try{sE(s=sJ(sV.Nt(this.Ko)),(e,t)=>{(z(e)||U(e)||""===e)&&delete s[t]})}catch(e){}var r=this.To.Nt(this.Ko);if(r&&(this.props=sS({},r)),this.jo&&this.Ia(),t&&r){var n,a,o=null==i?void 0:i[im],l=null!=(n=null==i?void 0:i.$user_state)?n:"anonymous",u=r[im],h=null!=(a=r.$user_state)?a:"anonymous";if(u!==o||h!==l){this.Bo=!0,s8.Ot(this.Ko+"_cookie_identity_change_pending",!0);var c=sS({},this.props);sK.forEach(e=>delete c[e]),"anonymous"!==h||"identified"!==l&&"anonymous"!==s.$user_state&&(z(o)||u===o)||(nd(c,s),delete c[iY]),this.props=c;var d=new Set;sK.forEach(e=>{var t,i=null==(t=rG(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{var t={};sE(this.props,(i,s)=>{var r;(null==(r=rG(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),B(t)?(sG.Dt(this.ia(e)),this.Lo[e]={}):sG.Ot(this.ia(e),t)&&(this.Lo[e]={persisted:!0,fingerprint:this.ha(t,e)})})}}s8.Lt(this.Ko+"_cookie_identity_change_pending")&&(this.Bo=!0)}}Ia(){for(var e of rU){var t=sG.Nt(this.ia(e));if(t&&!B(t)){var i=this.sa(e);i.persisted=!0,this.Ea(e)||(i.fingerprint=this.ha(t,e)),this.Ra(e,t)||sS(this.props,t)}}}Ea(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rG(t))?void 0:i.storageGroup)===e})}Ra(e,t){var i=nr[e];if(!i)return!1;var s=t[i],r=this.props[i];return W(s)&&W(r)&&r>s}refreshKey(e){var t;if(!(this.gi||"$fbc_persistence"===e&&this.Go)){var i=this.jo?null==(t=rG(e))?void 0:t.storageGroup:void 0,s=i?sG.Nt(this.ia(i)):this.To.Nt(this.Ko);if(s&&e in s)this.va(e,s[e],!1);else{if(i){var r=this.To.Nt(this.Ko);if(r&&e in r)return void this.va(e,r[e],!1)}this.ca(e,!1)}}}save(){if(!this.gi){var e=this.ya();e>
vendor: 14,055 bytes, line 1
10?z(this.Ca)&&(this.Ca=setTimeout(()=>{this.Ca=void 0,this.Ta()},e)):this.Ta()}}flush(){z(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0,this.Ta())}Ta(e){if(void 0===e&&(e=!1),!(this.gi||this.Ho&&!e)){e||(this.syncCookieProperties(),this.Go||this.xn.cookieWinsOnConflict&&"localstorage+cookie"===this.xn.persistence.toLowerCase()||this.refreshKey(ik));var t=!e&&!this.Uo;t||(this.Vo=!1);var i=!!t&&this.fa();if(this.Vo)this.xn.debug&&ih.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.jo)return this.Aa(),void(i&&this.Zo.forEach(e=>e()));var s=this.Pa(this.To,this.Ko,this.props,no);"written"===s&&this.ba(this.props),"failed"!==s&&(this.zo.clear(),this.Wo=!1,this.Go=!1),i&&this.Zo.forEach(e=>e())}}}Aa(){var e=this,t=this.la(),i=t.main,s=t.groups,r=this.Pa(this.To,this.Ko,i,no);"written"===r&&this.ba(i),"failed"!==r&&(this.Wo=!1,this.Go=!1,nl.forEach(e=>{var t;null!=(t=rG(e))&&t.storageGroup||this.zo.delete(e)}));var n=function(t){var i,r=s[t];if(B(r)&&(null==(i=e.Lo[t])||!i.persisted))return nl.forEach(i=>{var s;(null==(s=rG(i))?void 0:s.storageGroup)===t&&e.zo.delete(i)}),1;var n=e.Pa(sG,e.ia(t),r,t);"failed"!==n&&nl.forEach(i=>{var s=rG(i);(null==s?void 0:s.storageGroup)!==t||"written"!==n&&s.volatile||e.zo.delete(i)})};for(var a of rU)if(n(a))continue}la(){var e={},t={flags:{},surveys:{}};return sE(this.props,(i,s)=>{var r,n=null==(r=rG(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}ha(e,t){if(t===no)return JSON.stringify(e)+"|"+this.Fa+"|"+this.Oa+"|"+this.$a;var i={};return sE(e,(e,t)=>{var s;i[t]=null!=(s=rG(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}Pa(e,t,i,s){var r,n=this.sa(s);if(s!==no&&!n.dirty&&!z(n.fingerprint))return"skipped";try{if((r=this.ha(i,s))===n.fingerprint)return n.dirty=!1,"skipped"}catch(e){r=void 0}return e.Ot(t,i,this.Fa,this.Oa,this.$a,this.xn.debug)?(n.dirty=!1,s!==no&&(n.persisted=!0),z(r)||(n.fingerprint=r),this.No&&(n.storageValue=sG.Lt(t)),"written"):(this.xn.debug&&ih.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.ga(),z(this.Ca)||(clearTimeout(this.Ca),this.Ca=void 0),this.To.Dt(this.Ko,!1),this.To.Dt(this.Ko,!0),!i&&this.Jo)for(var s of rU)sG.Dt(this.ia(s));i?delete this.Lo[no]:this.Lo={},this._a=void 0,this.wa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(j(e)){this.syncCookieProperties(),z(t)&&(t="None"),this.Fa=z(i)?this.Da:i;var s=!1;if(sE(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.va(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(j(e)){this.syncCookieProperties(),this.Fa=z(t)?this.Da:t;var i=!1;if(sE(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||j(t)||D(t))&&(this.va(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.ca(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==v?void 0:v.URL;if(e!==this.Qo){var t=r6(this.xn.custom_campaign_params,this.xn.mask_personal_data_properties,this.xn.custom_personal_data_properties),i=!B(sC(t));return i&&this.register(t),this.Qo=e,i?t:void 0}}update_search_keyword(){var e;this.register((e=null==v?void 0:v.referrer)?r4(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ne(),$referring_domain:null!=v&&v.referrer&&(null==(e=rQ(v.referrer))?void 0:e.host)||r7},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var e=nt(this.xn.mask_personal_data_properties,this.xn.custom_personal_data_properties,this.xn.disable_capture_url_hashes);this.register_once({[sa]:this.qo?{r:na(e.r),u:e.u?na(e.u):void 0}:e},void 0)}}get_initial_props(){var e,t,i,s={};sE([sn,sr],e=>{var t=this.props[e];t&&sE(t,function(e,t){s["$initial_"+A(t)]=e})});var r=this.props[sa];return r&&sS(s,(void 0===(e=this.xn.disable_capture_url_hashes)&&(e=!1),t=ni(r,e),i={},sE(t,function(e,t){i["$initial_"+A(t)]=e}),i)),s}safe_merge(e){return sE(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,u=!!this.gi&&!o;o||this.ka(t,u),this.xn=e,!o&&(s||r||a)&&(this._a=void 0,this.wa=void 0,this.ka(l({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),u));var h=n||a?this.Xo(e):this.To;this.La();var c=this.Yo(e),d=n||c!==this.jo,p=!o&&(d||e.cross_subdomain_cookie!==this.Oa||e.secure_cookie!==this.$a)&&this.Sa(u);this.Uo=d;try{if(this.Da=this.Fa=e.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),d){var v=this.props;this.clear(),this.To=h,this.jo=c,this.props=v,this.save()}else a&&(this.To=h,o||(delete this.Lo[no],this.Ta()))}finally{this.Uo=!1,p&&this.Ma()}}La(){var e=this.props[sa];if(this.qo&&j(e)&&"string"==typeof e.r){var t=na(e.r),i="string"==typeof e.u?na(e.u):e.u;t===e.r&&i===e.u||this.va(sa,l({},e,{r:t,u:i}))}}set_disabled(e){this.gi=e,this.gi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Oa&&(this.Oa=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.$a&&(this.$a=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props.__timers||{};i[e]=t,this.va(iE,i),this.save()}remove_event_timer(e){var t=this.props.__timers||{},i=t[e];return z(i)||(delete t[e],this.va(iE,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.va(e,t),this.save()}va(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.Wo=!0),"$fbc_persistence"!==e||nh(r,t)||(this.Go=!0),this.ma(e,r,t),null!=(s=rG(e))&&s.volatile||this.pa(e))}ca(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(nu(e)&&this.na(e,!0),"$fbc_persistence"===e&&(this.Go=!0),this.pa(e))}pa(e){var t,i=null==(t=rG(e))?void 0:t.storageGroup;i&&(this.sa(i).dirty=!0)}sa(e){return this.Lo[e]||(this.Lo[e]={})}},nv="gzip-js",nf="base64",ng="events",n_="cancelEvents",nm="survey shown",ny="survey dismissed",nb="survey sent",nw="popover";function nx(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&N(i.then)&&i.then(void 0,()=>{})}}}}var nk=ic("[RateLimiter]"),nE=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=>{nk.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void nk.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=(W(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.Na(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(ss,o),{isRateLimited:l,remainingTokens:o.tokens}}qa(e){var t=this.instance.config.property_denylist;return!D(t)||!t.includes(e)}ja(){var e;if(this.qa("$current_url")&&this.qa("$pathname")&&null!=f&&f.pathname)return""+(null!=(e=f.origin)?e:"")+f.pathname}Na(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.ja(),a=this.qa("$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(Boolean).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}},nS=ic("[RemoteConfig]"),nP=class{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=k._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Ba(e){var t,i;null!=(t=k.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=k.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ha(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return nS.info("Using preloaded remote config",this.remoteConfig),void this.za(this.remoteConfig);if(this._instance.Ua())return void nS.warn("Remote config is disabled. Falling back to local config.");this.Ba(e=>{e?this.za(e):(nS.info("No config found after loading remote JS config. Falling back to JSON."),this.Ha(e=>{this.za(e.json,e)}))})}catch(e){nS.error("Error loading remote config",e),this.za()}}za(e,t){!e&&t&&(0===t.statusCode?t.error||nS.warn("Failed to fetch remote config from PostHog."):nS.error("Failed to fetch remote config from PostHog."));try{this._instance.za(e?{ok:!0,config:e}:{ok:!1})}catch(e){nS.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){nS.error("Error loading feature flags",e)}}},n$=Uint8Array,nF=Uint16Array,nC=Uint32Array,nI=new n$([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 n$([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]),nA=new n$([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 nF(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new nC(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]},nT=nR(nI,2),nM=nT[1];nT[0][28]=258,nM[258]=28;for(var nL=nR(nO,0)[1],nD=new nF(32768),nN=0;32768>nN;++nN){var nj=(43690&nN)>>>1|(21845&nN)<<1;nD[nN]=((65280&(nj=(61680&(nj=(52428&nj)>>>2|(13107&nj)<<2))>>>4|(3855&nj)<<4))>>>8|(255&nj)<<8)>>>1}var nB=function(e,t,i){for(var s=e.length,r=0,n=new nF(t);s>r;++r)++n[e[r]-1];var a,o=new nF(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new nF(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[nD[c]>>>l]=u}else for(a=new nF(s),r=0;s>r;++r)a[r]=nD[o[e[r]-1]++]>>>15-e[r];return a},nz=new n$(288);for(nN=0;144>nN;++nN)nz[nN]=8;for(nN=144;256>nN;++nN)nz[nN]=9;for(nN=256;280>nN;++nN)nz[nN]=7;for(nN=280;288>nN;++nN)nz[nN]=8;var nq=new n$(32);for(nN=0;32>nN;++nN)nq[nN]=5;var nH=nB(nz,9,0),nU=nB(nq,5,0),nV=function(e){return(e/8|0)+(7&e&&1)},nW=function(e,t,i){(null==t||0>t)&&(t=0),(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof nF?nF:e instanceof nC?nC:n$)(i-t);return s.set(e.subarray(t,i)),s},nG=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},nK=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},nQ=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 n$(0),0];if(1==r){var a=new n$(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 nF(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 n$(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},nJ=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new nF(++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]},nZ=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},nY=function(e,t,i){var s=i.length,r=nV(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)},n0=function(e,t,i,s,r,n,a,o,l,u,h){nG(t,h++,i),++r[256];for(var c=nQ(r,15),d=c[0],p=c[1],v=nQ(n,15),f=v[0],g=v[1],_=nJ(d),m=_[0],y=_[1],b=nJ(f),w=b[0],x=b[1],k=new nF(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=nQ(k,7),P=S[0],$=S[1],F=19;F>4&&!P[nA[F-1]];--F);var C,I,O,A,R=u+5<<3,T=nZ(r,nz)+nZ(n,nq)+a,M=nZ(r,d)+nZ(n,f)+a+14+3*F+nZ(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(T>=R&&M>=R)return nY(t,h,e.subarray(l,l+u));if(nG(t,h,1+(T>M)),h+=2,T>M){C=nB(d,p,0),I=d,O=nB(f,g,0),A=f;var L=nB(P,$,0);for(nG(t,h,y-257),nG(t,h+5,x-1),nG(t,h+10,F-4),h+=14,E=0;F>E;++E)nG(t,h+3*E,P[nA[E]]);h+=3*F;for(var D=[m,w],N=0;2>N;++N){var j=D[N];for(E=0;j.length>E;++E)nG(t,h,L[B=31&j[E]]),h+=P[B],B>15&&(nG(t,h,j[E]>>>5&127),h+=j[E]>>>12)}}
1else C=nH,I=nz,O=nU,A=nq;for(E=0;o>E;++E)if(s[E]>255){nK(t,h,C[257+(B=s[E]>>>18&31)]),h+=I[B+257],B>7&&(nG(t,h,s[E]>>>23&31),h+=nI[B]);var B,z=31&s[E];nK(t,h,O[z]),h+=A[z],z>3&&(nK(t,h,s[E]>>>5&8191),h+=nO[z])}else nK(t,h,C[s[E]]),h+=I[s[E]];return nK(t,h,C[256]),h+I[256]},n1=new nC([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),n2=new n$(0),n3=function(){for(var e=new nC(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),n5=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},n6=!!_||!!g,n8="text/plain",n4=!1,n9=(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:"")},n7=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,u=e.split("?"),h=u[0],c=u[1],d=l({},t),p=null!=(o=null==c?void 0:c.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!=(t=d[r])?t:s[1];return delete d[r],r+"="+n}))?o:[],v=(void 0===s&&(s="&"),a=[],sE(d,function(e,t){z(e)||z(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&&p.push(v),p.length>0?h+"?"+p.join("&"):h},ae=e=>{if(e.Wa)return e.Wa;var t=e.data,i=e.compression;if(t){if(i===nv){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 n$(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 n$(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 nW(i,0,s)}(rK(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=n3[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 n$(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=nY(o,l,e.subarray(u,h)):(o[u]=r,l=nY(o,l,e.subarray(u,n)))}else{for(var c=n1[t-1],d=c>>>13,p=8191&c,v=(1<<i)-1,f=new nF(32768),g=new nF(v+1),_=Math.ceil(i/3),m=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<m)&v},b=new nC(25e3),w=new nF(288),x=new nF(32),k=0,E=0,S=(u=0,0),P=0,$=0;n>u;++u){var F=y(u),C=32767&u,I=g[F];if(f[C]=I,g[F]=C,u>=P){var O=n-u;if((k>7e3||S>24576)&&O>423){l=n0(e,o,0,b,w,x,E,S,$,u-$,l),S=k=E=0,$=u;for(var A=0;286>A;++A)w[A]=0;for(A=0;30>A;++A)x[A]=0}var R=2,T=0,M=p,L=C-I&32767;if(O>2&&F==y(u-L))for(var D=Math.min(d,O)-1,N=Math.min(32767,u),j=Math.min(258,O);N>=L&&--M&&C!=I;){if(e[u+R]==e[u+R-L]){for(var B=0;j>B&&e[u+B]==e[u+B-L];++B);if(B>R){if(R=B,T=L,B>D)break;var z=Math.min(L,B-2),q=0;for(A=0;z>A;++A){var H=u-L+A+32768&32767,U=H-f[H]+32768&32767;U>q&&(q=U,I=H)}}}L+=(C=I)-(I=f[C])+32768&32767}if(T){b[S++]=0x10000000|nM[R]<<18|nL[T];var V=31&nM[R],W=31&nL[T];E+=nI[V]+nO[W],++w[257+V],++x[W],P=u+R,++k}else b[S++]=e[u],++w[e[u]]}}l=n0(e,o,r,b,w,x,E,S,$,u-$,l),r||(l=nY(o,l,n2))}return nW(a,0,s+nV(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&&n5(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),n5(h,c-8,a.d()),n5(h,c-4,o),h);return{contentType:n8,body:d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength),estimatedSize:d.byteLength}}if(i===nf){let e;var p,v="data="+encodeURIComponent("string"==typeof(e=(p=rK(t))?btoa(encodeURIComponent(p).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):p)?e:rK(e));return{contentType:"application/x-www-form-urlencoded",body:v,estimatedSize:new Blob([v]).size}}var f=rK(t);return{contentType:"application/json",body:f,estimatedSize:new Blob([f]).size}}},at=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:n7(e.url,{compression:nf}),encodedBody:ae(l({},e,{compression:nf,Wa:void 0}))}:{url:n9(e.url,"compression"),encodedBody:ae(l({},e,{compression:void 0,Wa:void 0}))};try{t=ae(e)}catch(t){if(t0(e.compression,rX(e.url,"compression")))return ih.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&t0(e.compression,rX(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?tY(new Uint8Array(i)):ArrayBuffer.isView(i)&&tY(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(n4=!0,s())},ai=e=>{try{return at(e)}catch(t){return ih.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},as=(t=h(function*(e){var t=yield function(e,t,i){return t5.apply(this,arguments)}(rK(e.data),S.DEBUG,{rethrow:!0});if(!t)return e;var i=yield t.arrayBuffer();return l({},e,{Wa:{contentType:n8,body:i,estimatedSize:i.byteLength}})}),function(e){return t.apply(this,arguments)}),ar=/Failed to fetch|NetworkError|Load failed/i,an=e=>"TypeError"===(null==e?void 0:e.name)&&ar.test((null==e?void 0:e.message)||""),aa=e=>{var t=ai(e);if(t){var i=new _,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,a=r.body;sE(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};
1if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}},ao=e=>{var t=ai(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},a=n.contentType,o=n.body,u=n.estimatedSize,h=new Headers;sE(e.headers,function(e,t){h.append(t,e)}),a&&h.append("Content-Type",a);var c=null,d=!1;if(m){var p=new m;c={signal:p.signal,timeout:setTimeout(()=>{var t;d=!0,p.abort(th("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))},e.timeout)}}var v=t=>{d&&"AbortError"===(null==t?void 0:t.name)||an(t)?ih.warn(t):ih.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{g(s,l({method:(null==e?void 0:e.method)||"GET",headers:h,keepalive:"POST"===e.method&&!e.Va&&52428.8>(u||0),body:o,signal:null==(i=c)?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){ih.error(e)}null==e.callback||e.callback(s)})).catch(v).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),v(e)}}},al=e=>{try{var t,i=at(e),s=i.url,r=i.encodedBody,n=null!=r?r:{},a=n.body,o=n.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:n.contentType});if(p.sendBeacon(s,u))return;var h=D(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(D(h)&&h.length>1&&(null!=o?o:0)>16384){var c=Math.ceil(h.length/2),d=t=>D(e.data)?t:l({},e.data,{batch:t});return al(l({},e,{data:d(h.slice(0,c))})),void al(l({},e,{data:d(h.slice(c))}))}ih.warn("Beacon of ~"+(null!=o?o:0)+" bytes was rejected by the browser, falling back to "+(g?"fetch":"XHR")),g?ao(l({},e,{Va:!0})):aa(e)}catch(e){ih.warn("Beacon send failed",e)}},au=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return n7(i===nv?n9(e,"compression"):e,l({},r?{[r]:Date.now().toString()}:{},i===nv?{}:{compression:i}))},ah=[];g&&ah.push({transport:"fetch",method:ao}),_&&ah.push({transport:"XHR",method:aa}),null!=p&&p.sendBeacon&&ah.push({transport:"sendBeacon",method:al});var ac=class{constructor(e,t){this.Ga=!0,this.Za=[],this.Ja=ea((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,ih.createLogger("flush interval"),3e3),this.Qa=e}enqueue(e){this.Za.push(e),this.Ka||this.Xa()}unload(){this.Ya();var e=Object.values(this.Za.length>0?this.tl():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.el(l({},e,{transport:"sendBeacon"}))})}enable(){this.Ga=!1,this.Xa()}Xa(){var e=this;this.Ga||(this.Ka=setTimeout(()=>{if(this.Ya(),this.Za.length>0){var t=this.tl();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&D(s.data)&&sE(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.el(s)}()}},this.Ja))}el(e){try{this.Qa(e)}catch(e){ih.error(e)}}Ya(){clearTimeout(this.Ka),this.Ka=void 0}tl(){var e={};return sE(this.Za,t=>{var i,s=(t?t.batchKey:null)||t.url;z(e[s])&&(e[s]=l({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Za=[],e}},ad=class{constructor(e){this._instance=e,this.il=!1,this.rl=3e3,this.Za=[],this.Za=[],this.nl=!0,this.resume()}resume(){!z(c)&&"onLine"in c.navigator&&(this.nl=c.navigator.onLine,this.sl||(this.sl=()=>{this.nl=!0,this.ol()},this.al=()=>{this.nl=!1},sA(c,"online",this.sl),sA(c,"offline",this.al)))}get length(){return this.Za.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=o(e,n);G(t)&&(i.url=n7(i.url,{retry_count:t})),this._instance._send_request(l({},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.Is(l({retriesPerformedSoFar:t},i));0===e.statusCode&&ih.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)}}))}Is(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.Za.push({retryAt:a,requestOptions:e});var o="Enqueued failed request for retry in "+n;
vendor: 6,787 bytes, line 1
1navigator.onLine||(o+=" (Browser is offline)"),ih.warn(o),this.il||(this.il=!0,this.ll())}ll(){(this.ul&&clearTimeout(this.ul),0===this.Za.length)?(this.il=!1,this.ul=void 0):this.ul=setTimeout(()=>{this.nl&&this.Za.length>0&&this.ol(),this.ll()},this.rl)}ol(){var e=Date.now(),t=[],i=this.Za.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Za=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ul&&(clearTimeout(this.ul),this.ul=void 0),this.il=!1,z(c)||(this.sl&&(c.removeEventListener("online",this.sl),this.sl=void 0),this.al&&(c.removeEventListener("offline",this.al),this.al=void 0)),this.Za)){var t=e.requestOptions;try{this._instance._send_request(l({},t,{transport:"sendBeacon"}))}catch(e){ih.error(e)}}this.Za=[]}},ap=class{constructor(e){this._instance=e,this.hl=()=>{this.dl||(this.dl={});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.dl.lastScrollY=Math.ceil(n),this.dl.maxScrollY=Math.max(n,null!=(e=this.dl.maxScrollY)?e:0),this.dl.maxScrollHeight=Math.max(a,null!=(t=this.dl.maxScrollHeight)?t:0),this.dl.lastContentY=o,this.dl.maxContentY=Math.max(o,null!=(i=this.dl.maxContentY)?i:0),this.dl.maxContentHeight=Math.max(l,null!=(s=this.dl.maxContentHeight)?s:0)}}get vl(){return this._instance.config.scroll_root_selector}getContext(){return this.dl}resetContext(){var e=this.dl;return setTimeout(this.hl,0),e}startMeasuringScrollPosition(){sA(c,"scroll",this.hl,{capture:!0}),sA(c,"scrollend",this.hl,{capture:!0}),sA(c,"resize",this.hl)}scrollElement(){var e;if(!this.vl)return null==c||null==(e=c.document)?void 0:e.documentElement;for(var t of D(this.vl)?this.vl:[this.vl]){var i,s=null==c||null==(i=c.document)?void 0:i.querySelector(t);if(s)return s}}cl(e){var t,i;if(this.vl){var s=this.scrollElement();return s&&s["y"===e?"scrollTop":"scrollLeft"]||0}return c?"y"===e?c.scrollY||c.pageYOffset||(null==(t=c.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:c.scrollX||c.pageXOffset||(null==(i=c.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.cl("y")}scrollX(){return this.cl("x")}},av=e=>nt(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),af=class{constructor(e,t,i,s){this.Be=e=>{var t=this.fl();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.pl(this._instance)};this.gl.register({[si]:i})}},this._instance=e,this.ml=t,this.gl=i,this.pl=s||av,this.ml.onSessionId(this.Be)}fl(){return this.gl.props[si]}getSetOnceProps(){var e,t=null==(e=this.fl())?void 0:e.props;return t?"r"in t?ni(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 sE(sC(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+A(i)]=t}),e}},ag=class{on(e,t){return this.yl[e]||(this.yl[e]=[]),this.yl[e].push(t),()=>{this.yl[e]=this.yl[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.yl[e]||[])i(t);for(var s of this.yl["*"]||[])s(e,t)}constructor(){this.yl={}}},a_=ic("[SessionId]"),am=class{on(e,t){return this.bl.on(e,t)}constructor(e,t,i){if(this._l=null,this.wl=null,this.kl=[],this.Sl=void 0,this.xl=!1,this.bl=new ag,this.Cl=(e,t)=>!(!G(e)||!G(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.xn=e.config,this.gl=e.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Tl=void 0,this._sessionActivityTimestamp=null,this.Ml=t||sB,this.Il=i||sB;var s,r=this.xn.persistence_name||this.xn.token;if(this._sessionTimeoutMs=1e3*ea(this.xn.session_idle_timeout_seconds||1800,60,36e3,a_.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.El(),this.Rl="ph_"+r+"_window_id",this.Al="ph_"+r+"_primary_window_exists",this.Pl()){var n=s8.Nt(this.Rl),a=s8.Nt(this.Al);n&&!a?this.He=n:s8.Dt(this.Rl),s8.Ot(this.Al,!0)}null!=(s=this.xn.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.xn.bootstrap.sessionID),this.Fl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return z(this.kl)&&(this.kl=[]),this.kl.push(e),this.Xt&&e(this.Xt,this.He),()=>{this.kl=this.kl.filter(t=>t!==e)}}Pl(){return"memory"!==this.xn.persistence&&!this.gl.gi&&s8.Et()}Ol(e){e!==this.He&&(this.He=e,this.Pl()&&s8.Ot(this.Rl,e))}$l(){return this.He?this.He:this.Pl()?s8.Nt(this.Rl):null}Dl(e){var t=this._l;return!U(t)&&!U(e)&&5e3>Math.abs(e-t)}Ll(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.Xt&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,r&&!s||r&&this.Dl(t)||(this._l=t,this.gl.register({[iz]:[t,e,i]}))}Nl(){var e,t=null==(e=this.xn)?void 0:e.persistence_save_debounce_ms;return G(t)&&t>0}ql(){this.Nl()?this.gl.refreshKey(iz):(this.gl.flush(),this.gl.load())}jl(){var e;if(!U(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._l){this.ql();var t=this.Bl();t[1]===this.Xt&&t[2]===this._sessionStartTimestamp&&(this._l=this._sessionActivityTimestamp,this.gl.register({[iz]:[this._sessionActivityTimestamp,null!=(e=this.Xt)?e:null,this._sessionStartTimestamp]}),this.gl.flush())}}Hl(){var e=this.Bl()[0];return Math.max(G(e)?e:0,G(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}zl(e){return this.ql(),this.Cl(e,this.Hl())}Bl(){var e=this.gl.props[iz];return D(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._l=null,this.Tl=void 0,clearTimeout(this.Ul),this.Ul=void 0,this.Ll(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 a_.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void a_.error("Invalid sessionID in bootstrap",e)}}(e);return!z(i)&&(t?this.Tl={sessionId:e,sessionStartTimestamp:i}:this.Ll(e,(new Date).getTime(),i),!0)}destroy(){this.xl=!0,this.jl(),clearTimeout(this.Ul),this.Ul=void 0,this.Sl&&c&&(c.removeEventListener(sm,this.Sl,{capture:!1}),this.Sl=void 0),this.kl=[]}Fl(){this.Sl=()=>{this.jl(),this.Pl()&&s8.Dt(this.Al)},sA(c,sm,this.Sl,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),"always"===this.xn.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),a=this.Xt;i?this.wl=n:(U(this.wl)||this.wl>n||n-this.wl>=1e3)&&(null==(s=(r=this.gl).syncCookieProperties)||s.call(r),this.wl=n);var o=this.Bl(),l=o[1],u=o[2],h=!z(a)&&l!==a,c=this.Hl(),d=this.$l(),p=this.Tl,v=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),f=p?v:G(u)&&Math.abs(n-u)>864e5,g=!1,_=h,m=!l||!!p,y=l,b=!m&&!e&&this.Cl(n,c);if(b){(b=this.zl(n))||a_.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Bl();l=w[1],u=w[2]}if(m||b||f){_=!1;var x=p&&!v;l=x?p.sessionId:this.Ml(),d=this.Il(),a_.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:f}}),u=x?p.sessionStartTimestamp:n,this.Tl=void 0,g=!0}else d||(d=this.Il(),g=!0),(_=_||l!==y)&&(a_.info("adopted cross-tab session id",{sessionId:l,windowId:d}),g=!0);var k=G(c)&&e&&!f?c:n,E=G(u)?u:(new Date).getTime();this.Ol(d),this.Ll(l,k,E),e||this.El();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:f,crossTabAdoption:_};return g&&this.kl.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:g?S:void 0,lastActivityTimestamp:c}}El(){this.xl||(clearTimeout(this.Ul),this.Ul=setTimeout(()=>{if(!this.xl)if(this.zl((new Date).getTime())){var e=this.Xt;this.resetSessionId(),this.bl.emit("forcedIdleReset",{idleSessionId:e})}else this.El()},1.1*this.sessionTimeoutMs))}},ay=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&en(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>en(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function ab(){return(ab=h(function*(){var e=null==p?void 0:p.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t,i=null==(t=yield e.getHighEntropyValues(["model"]))?void 0:t.model;return q(i)&&i.length>0?i:void 0}catch(e){return void ih.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function aw(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var ax=(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}},ak=e=>e.toLowerCase(),aE={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=>ax(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!ax(t,e))),icontains:(e,t)=>t.map(ak).some(t=>e.map(ak).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ak).every(t=>e.map(ak).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 aS(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=aE[i.operator];return!!r&&r(i.values,[String(s)])})}function aP(e,t,i){return rK({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}for(var a$="custom",aF="i.posthog.com",aC=/^\/static\//,aI=["/s/","/e/","/i/"],aO=class{constructor(e){this.Wl={},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("."+aF,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Wl[this.apiHost]||(this.Wl[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.Wl[this.apiHost]}Vl(e){if(aC.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}Gl(e){var t=rQ(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}Zl(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;
1if(r&&(s=r(new URL((null==(a=rQ(i))?void 0:a.href)||i)).toString()),r&&"api"===e&&aI.some(e=>0===t.indexOf(e))){var n=this.Gl(s);if(n){var a,o,l=this.apiHost,u=this.Jl;(null==(o=u)?void 0:o.apiHost)===l&&u.rewriteRequestPath===r||(this.Jl=u={apiHost:l,rewriteRequestPath:r,urls:new Set}),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.Jl,i=this.Gl(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.Zl(e,t,this.uiHost+t);if("flags"===e)return this.Zl(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.Vl(t);if(i)return this.Zl(e,t,""+i+t)}if(this.region===a$)return this.Zl(e,t,this.apiHost+t);var s=aF+t;switch(e){case"assets":return this.Zl(e,t,"https://"+this.region+"-assets."+s);case"api":return this.Zl(e,t,"https://"+this.region+"."+s)}}},aA=ic("[Surveys]"),aR=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){aA.error("Failed to persist survey seen state",e)}},aT=["popover","widget","api"],aM={ignoreConditions:!1,ignoreDelay:!1,displayType:nw},aL=ic("[PostHog ExternalIntegrations]"),aD={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},aN=class{constructor(e){this._instance=e}Ro(e,t){var i;null==(i=k.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return aL.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=k.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Ro(aD[n],()=>{var e;null==(e=k.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!a&&null!=(s=k.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=k.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}},aj=class{constructor(e,t){this.A=e,this.ao=t,this.Ql=new Map,this.fo=!1}add(e){var t=this;return h(function*(){if(t.fo)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.Ql.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.Ql.set(e.name,e);try{var i=e.setup(t.ao);i&&(yield i)}catch(i){var s=t.Ql.get(e.name)===e;s&&t.Ql.delete(e.name),t.A.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.Kl(e)}})()}getExtension(e){return this.Ql.get(e)}dispose(){if(!this.fo){this.fo=!0;var e=Array.from(this.Ql.values()).reverse();for(var t of(this.Ql.clear(),e))this.Kl(t)}}Kl(e){try{var t=null==e.dispose?void 0:e.dispose();t&&N(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)}}},aB=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);z(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)}},az="extensionsRemoteConfig",aq=class{constructor(e){this.instance=e,this.fo=!1,this.A=ih,this.Xl=e.Yl,this.kv=new aB(e),this.onEvent=e=>nx(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.fo)return nx(()=>{});var t=t=>{try{e(t)}catch(e){this.A.error("Browser extension remote config listener failed",e)}},i=this.instance.tu.on(az,t);return this.Xl&&t(this.Xl),nx(i)},this.eu=new aj(ih.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(iy);return"string"==typeof e?e:void 0}get library(){return{name:S.LIB_NAME,version:S.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?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.eu.add(e)}getExtension(e){return this.eu.getExtension(e)}capture(e,t,i){var s=this;return h(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 nx(this.instance.iu(e))}handleRemoteConfig(e){this.fo||(this.Xl=e,this.instance.tu.emit(az,e))}sendRequest(e,t){var i=this;return h(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?n7(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?$.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.fo||(this.fo=!0,this.eu.dispose())}},aH={},aU=0,aV=()=>{}
1,aW='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',aG="Surveys module not available",aK="sanitize_properties is deprecated. Use before_send instead",aQ="Invalid value for property_denylist config: ",aX=/^[A-Za-z0-9_-]{1,400}$/,aJ=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,aZ=["token","distinct_id",su],aY="posthog",a0=!n6&&-1===(null==b?void 0:b.indexOf("MSIE"))&&-1===(null==b?void 0:b.indexOf("Mozilla")),a1=e=>{var t,i;return l({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(!q(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of sO)if(i===s)return!1;return!0}(null==v?void 0:v.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:aV,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:f&&q(null==f?void 0:f.search)&&-1!==f.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==c||null==(t=c.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){ih.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:sg,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:aV},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:rg,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)})},a2=[["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"]],a3=e=>{var t={};for(var i of a2){var s=i[0],r=i[1];z(e[s])||(t[r]=e[s])}var n=sS({},t,e),a=e.__preview_external_dependency_versioned_paths;return z(a)||(z(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),q(a)&&z(e.asset_host)&&(n.asset_host=a)),D(e.property_blacklist)&&(z(e.property_denylist)?n.property_denylist=e.property_blacklist:D(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ih.error(aQ+e.property_denylist)),n},a5=class{constructor(){this.__forceAllowLocalhost=!1}get ru(){return this.__forceAllowLocalhost}set ru(e){ih.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},a6=((r=class e{nu(e){if(e){var t=this.Ql.indexOf(e);-1!==t&&this.Ql.splice(t,1)}}su(e,t){return this.nu(e),this.Ql.push(t),null==t.initialize||t.initialize(),t}ou(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}au(){if(!(this.lu||this.config.reuseAnonymousId||this.config.segment||this.ou())){var e,t,i,s="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(s||this.config.disable_persistence)&&(this.uu||(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.lu=!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)))}}hu(){if(!this.ou()&&"$posthog_cookieless"===this.get_distinct_id()){var e=this.persistence;if(e){this.du()||e.load(!0);var t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){var i=this.config.get_device_id(sB());this.register({distinct_id:i,$device_id:i}),e.set_property(st,sv)}this.vu()}}}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.cu=!1,this.fu=!1,this.webPerformance=new a5,this.pu=!1,this.version=S.LIB_VERSION,this.gu=new Set,this.mu="",this.tu=new ag,this.Ql=[],this.yu=[],this.uu=!1,this.lu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=a1(),this.SentryIntegration=rq,this.sentryIntegration=e=>{var t;return t=rz(this,e),{name:rB,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bu=!1,this._u=null,this.wu=null,this.ku=null,this.scrollManager=new ap(this),this.pageViewM
vendor: 9,753 bytes, line 1
1anager=new rH(this),this.rateLimiter=new nE(this),this.requestRouter=new aO(this),this.consent=new s4(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=q(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=q(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>ih.info('send "'+(null==e?void 0:e.event)+'"',e))}init(t,i,s){if(s&&s!==aY){var r,n=null!=(r=aH[s])?r:new e;return n._init(t,i,s),aH[s]=n,aH[aY][s]=n,n}return this._init(t,i,s)}_init(e,t,i){void 0===t&&(t={});var s,r,n,a,o=q(e)?e.trim():"";if(!o)return ih.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=a1(t.defaults),t.debug=this.Su(t.debug),this.xu=t,this.Cu=[],t.person_profiles?this.wu=t.person_profiles:t.process_person&&(this.wu=t.process_person);var u=a1(t.defaults),h=a3(t),d=sS({},u,h,{name:i,token:o});j(u.rageclick)&&j(h.rageclick)&&(d.rageclick=sS({},u.rageclick,h.rageclick)),j(u.session_recording)&&j(h.session_recording)&&(d.session_recording=sS({},u.session_recording,h.session_recording)),this.set_config(d),this.config.on_xhr_error&&ih.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:nv;var p=this.du();if(this.persistence=new np(this.config,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new np(l({},this.config,{persistence:"sessionStorage"}),p,!1),this.mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!p&&s8.Et()){var v=s8.Nt(this.mu);D(v)&&v.forEach(e=>{q(e)&&this.gu.add(e)})}else s8.Dt(this.mu);var f=l({},this.persistence.props),g=l({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Tu=new ac(e=>this.Mu(e),this.config.request_queue_config),this.Iu=new ad(this),this.__request_queue=[];var _=this.ou();_||(this.sessionManager=new am(this),this.sessionPropsManager=new af(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Eu()})),this.Ru(),this.config.__preview_deferred_init_extensions?(ih.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Au(_)},0)):(ih.info("Initializing extensions synchronously"),this.Au(_)),S.DEBUG=S.DEBUG||this.config.debug,S.DEBUG&&ih.info("Starting in debug mode",{this:this,config:t,thisC:l({},this.config),p:f,s:g}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=l({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var m=null==(r=t.bootstrap)?void 0:r.distinctID;if(this.uu=!!m&&!H(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(st);if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"anonymous"===w)this.identify(y);else if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"identified"===w)ih.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(sB()),k=t.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(st,t.bootstrap.isIdentifiedID?sf:sv),this.register({distinct_id:y,$device_id:k})}}if(_)this.register_once({distinct_id:sl,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(sB());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(st,sv)}return sA(c,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),sA(c,"pageshow",()=>{var e;this.cu=!1,this.fu||null==(e=this.Iu)||e.resume()}),t.segment?rj(this,()=>this.Pu()):this.Pu(),N(this.config._onCapture)&&this.config._onCapture!==aV&&(ih.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&ih.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 ab.apply(this,arguments)})().then(e=>{e&&this.register({[ib]:e})}).catch(aV),this}Fu(e){return q(e.name)&&N(e.setup)}Ou(e,t){this.Fu(e)?t.push(()=>{this.$u().add(e).catch(()=>null==e.dispose?void 0:e.dispose()).catch(t=>{ih.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this.Ql.push(e)}Ru(){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.Du)||a.call(this),this.Du=void 0,this.featureFlags=new o(this)),N(this.featureFlags.onReloading)&&N(this.featureFlags.setup)?this.Du||(this.Du=this.featureFlags.onReloading(()=>{this.tu.emit("featureFlagsReloading",!0)}),this.$u().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}Au(t){var i,s,r,n,a,o,u,h=performance.now(),c=l({},e.__defaultExtensionClasses,this.config.__extensionClasses),d=[];c.exceptions&&this.Ql.push(this.exceptions=null!=(i=this.exceptions)?i:new c.exceptions(this)),c.historyAutocapture&&this.Ql.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.Ql.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.Ql.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!t&&this.Ql.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.Ou(this.autocapture=new c.autocapture(this),d),c.surveys&&this.Ou(this.surveys=null!=(s=this.surveys)?s:new c.surveys(this),d),c.logs&&this.Ou(this.logs=null!=(r=this.logs)?r:new c.logs(this),d),c.metrics&&this.Ql.push(this.metrics=null!=(n=this.metrics)?n:new c.metrics(this)),c.conversations&&this.Ql.push(this.conversations=null!=(a=this.conversations)?a:new c.conversations(this)),c.productTours&&this.Ql.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.Ql.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.Ql.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.Ql.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.Ql.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,rL)),c.toolbar&&this.Ql.push(this.toolbar=null!=(o=this.toolbar)?o:new c.toolbar(this)),c.experiments&&this.Ql.push(this.experiments=null!=(u=this.experiments)?u:new c.experiments(this)),this.Ql.forEach(e=>{e.initialize&&d.push(()=>{null==e.initialize||e.initialize()})}),d.push(()=>{if(this.Lu){var e=this.Lu;this.Lu=void 0,this.Ql.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.Nu(d,h)}Nu(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Nu(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){ih.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[sh]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[sc]:s}),this.config.__preview_deferred_init_extensions&&ih.info("PostHog extensions initialized ("+s+"ms)")}za(e){var t;if(!v||!v.body)return ih.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.za(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Lu=e),this.Yl=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=I(s.supportedCompression,nv)?nv:I(s.supportedCompression,nf)?nf:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.wu?this.wu:sg}),null==(t=this.qu)||t.handleRemoteConfig(e),this.Ql.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Pu(){try{this.config.loaded(this)}catch(e){ih.critical("`loaded` function failed",e)}if(this.ju(),this.config.internal_or_test_user_hostname&&null!=f&&f.hostname){var e=f.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>
1{(this.consent.isOptedIn()||this.ou())&&this.Bu()},1),this.Hu=new nP(this),this.Hu.load()}ju(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Tu)||e.enable())}_dom_loaded(){this.is_capturing()&&sk(this.__request_queue,e=>this.Mu(e)),this.__request_queue=[],this.ju()}_handle_unload(){var e,t,i,s,r;this.cu=!0,null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.zu()&&this.capture(sb),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.Tu)||s.unload(),null==(r=this.Iu)||r.unload()):this.zu()&&this.capture(sb,null,{transport:"sendBeacon"})}_send_request(e){var t;this.__loaded?a0?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=l({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!=(t=this.compression)?t:e.compressionFallback:e.compression,(z(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=l({},e);a.timeout=a.timeout||6e4;var o,u,h,c,d,p=null!=(s=a.transport)?s:"fetch";"sendBeacon"===p&&z(a.compression)&&a.data&&(a.compression=nf),"POST"===a.method&&a.data&&("capture-body"===a.timestampMode?a.data={api_key:null!=(u=null==(d=(c=(D(o=a.data)?o:[o]).map(e=>l({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(h=d.properties)?void 0:h.token)?u:null==d?void 0:d.token,batch:c,sent_at:(new Date).toISOString()}:"body"===a.timestampMode&&(t=a.data,void 0===i&&(i=(new Date).toISOString()),a.data=D(t)?t.map(e=>l({},e,{sent_at:i})):l({},t,{sent_at:i}))),a.url=au(a.url,a.method,a.compression,a.timestampMode);var v=ah.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===p))?void 0:n.method)?r:v[0].method;if(!f)throw Error("No available transport method");var g=e=>{try{f(e)}catch(e){an(e)?ih.warn(e):ih.error(e),null==a.callback||a.callback({statusCode:0,error:e})}};"sendBeacon"!==p&&a.data&&a.compression===nv&&y&&"u">typeof Promise&&!n4?as(a).then(e=>{g(e)}).catch(t=>{t1(t)?(n4=!0,g(l({},a,{compression:void 0,url:au(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 t1(e)||t===tZ})(t)&&(n4=!0),g(a))}):f(a)})(l({},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}))}Mu(e){this.Iu?this.Iu.retriableRequest(e):this._send_request(e)}_execute_array(e){aU++;try{var t,i=[],s=[],r=[];sk(e,e=>{if(e)if(D(t=e[0]))r.push(e);else if(N(e))try{e.call(this)}catch(t){ih.error("Error executing queued PostHog call",e,t)}else D(e)&&"alias"===t?i.push(e):D(e)&&-1!==t.indexOf("capture")&&N(this[t])?r.push(e):s.push(e)});var n=function(e,t){sk(e,function(e){try{if(D(e[0])){var i=t;sE(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){ih.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{aU--}}push(t){if(aU>0&&D(t)&&q(t[0])){var i=e.prototype[t[0]];N(i)&&i.apply(this,t.slice(1))}else this._execute_array([t])}Uu(){var e,t=null==(e=this.persistence)?void 0:e.get_property(ik);return q(t)&&aJ.test(t)?{value:t,delivered:!1}:j(t)&&q(t.value)&&aJ.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0}Wu(e,t,i,s){if(this.persistence){this.persistence.refreshKey(ik);var r=this.Uu();if(!s){if(i)return q(t)&&aJ.test(t)?(t!==(null==r?void 0:r.value)&&this.persistence.register({[ik]:{value:t,delivered:!1}}),{value:t,pending:t!==(null==r?void 0:r.value)||!r.delivered}):void this.persistence.unregister(ik);if(q(e)&&aX.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({[ik]:{value:n,delivered:!1}}),{value:n,pending:!0}}return r?{value:r.value,pending:!r.delivered}:void 0}this.persistence.unregister(ik)}}Vu(e){if(this.persistence){this.persistence.refreshKey(ik);var t=this.Uu();(null==t?void 0:t.value)!==e||t.delivered||this.persistence.register({[ik]:{value:e,delivered:!0}})}}capture(e,t,i){var s,r,n,a,o,u,h,c,d,p;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Tu){if(this.is_capturing())if(!z(e)&&q(e)){this.hu();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&&!q(null==t?void 0:t.$current_url)&&(ih.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.Gu||ih.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&&(J=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,_=(null==i?void 0:i.timestamp)||g,m=tu(null==i?void 0:i.uuid,sB),y={uuid:m,event:e,properties:this.calculateEventProperties(e,t||{},_,m)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&v&&(y.event="$bot_pageview",y.properties.$browser_type="bot"),f&&(y.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);var b="$feature_flag_called"===e&&!1===y.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!b&&(y.$set=null==i?void 0:i.$set);var w=j(null==t?void 0:t.$set)?t.$set:void 0,x=!(null==i||!i.$set)&&"$fbc"in i.$set,k=x||!!w&&"$fbc"in w,E=x?null==i||null==(s=i.$set)?void 0:s[ix]:null==w?void 0:w[ix],S=D(null==t?void 0:t.$unset)?t.$unset:[],P=(null==i?void 0:i.$unset)||[],$=-1!==S.indexOf("$fbc")||-1!==P.indexOf("$fbc"),F=this.Wu(null==(r=J)?void 0:r.fbclid,E,k,$);F&&!0===y.properties.$process_person_profile&&F.pending&&!k&&!b&&(y.$set=l({[ix]:F.value},y.$set));
1var C=null==i?void 0:i.$unset;C&&(y.$unset=C);var I=b?void 0:this.Zu(null==i?void 0:i.$set_once,e!==sx,e===sw);if(I&&(y.$set_once=I),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,c=y,d=e=>q(e)?e.slice(0,h):e,p=new Set,y=function e(t,i){if(t!==Object(t))return d?d(t):t;if(!p.has(t)){var s;if(p.add(t),D(t))s=[],sk(t,t=>{s.push(e(t))});else{var r={};sE(Y(t)?sI(t):t,(t,i)=>{p.has(t)||(r[i]=e(t,i))}),s=r}return s}}(c)),y.timestamp=_,z(null==i?void 0:i.timestamp)||(y.properties.$event_time_override_provided=!0,y.properties.$event_time_override_system_time=g),b&&(y.properties=(O=y.properties,void 0===(A=aZ)&&(A=[]),R={},T=e=>{void 0!==O[e]&&(R[e]=O[e])},tJ.forEach(T),A.forEach(T),R)),e===ny||e===nb){var O,A,R,T,M,L,N,H=null==t?void 0:t.$survey_id,U=null==t?void 0:t.$survey_iteration;aR({id:H,current_iteration:U}),y.$set=l({},y.$set,{[(M={id:H,current_iteration:U},N="$survey_"+(L=e===nb?"responded":"dismissed")+"/"+M.id,M.current_iteration&&M.current_iteration>0&&(N="$survey_"+L+"/"+M.id+"/"+M.current_iteration),N)]:!0})}else e===nm&&(y.$set=l({},y.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var W=null==t?void 0:t.$product_tour_type;W&&(y.$set=l({},y.$set,{["$product_tour_last_seen_date/"+W]:(new Date).toISOString()}))}var G=l({},y.properties.$set,y.$set);if(B(G)||this.setPersonPropertiesForFlags(G),!V(this.config.before_send)){var K=this.Ts(y);if(!K)return;(y=K).uuid=tu(y.uuid,sB)}var Q=null!=(n=null==(a=y.$set)?void 0:a.$fbc)?n:j(null==(o=y.properties)?void 0:o.$set)?y.properties.$set.$fbc:void 0,X=null!=F&&F.pending&&Q===F.value?F.value:void 0;this.tu.emit("eventCaptured",y);var J,Z,ee=null!=(u=null==i?void 0:i._url)?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),et=l({method:"POST",url:ee,data:y,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(ee)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},X?{fireCallbackOnDrop:!0,callback:e=>{e.statusCode>=200&&300>e.statusCode&&this.Vu(X)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||X?(!et.transport&&!et.callback&&B(null!=(Z=this.config.request_headers)?Z:{})&&this.cu&&(et.transport="sendBeacon"),this.Mu(et)):this.Tu.enqueue(et),y}ih.critical("This capture call is ignored due to client rate limiting.")}}else ih.error("No event name provided to posthog.capture")}else ih.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.qu)?void 0:t.getExtension(e)}$u(){var e;return null!=(e=this.qu)?e:this.qu=new aq(this)}iu(e){this.yu.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.yu.indexOf(e);-1!==i&&this.yu.splice(i,1)}}}Ju(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.ku=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(s=this.sessionPersistence)||s.clear(),this.gu.clear(),this.Qu()),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.Ju();var n,a=r?void 0:this.persistence.remove_event_timer(e),o=l({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.ou()&&(o[su]=!0),"$snapshot"===e){var u=l({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=u.distinct_id,(!q(o.distinct_id)&&!W(o.distinct_id)||H(o.distinct_id))&&ih.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var h,d=function(e,t,i,s){if(void 0===s&&(s=!1),!b)return{};var r,n,a,o,l,u=e?[...r1,...t||[]]:[],h=e8(b),d=h[0],p=h[1],v=function(e){for(var t=0;e7.length>t;t++){var i,s=e7[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])||""]}return["",""]}(b),g=v[0],_=v[1],m=null!=(l="u">typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},y={};z(i)||(y.detectGoogleSearchApp=i);var w={},x=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,k=null==(n=navigator)?void 0:n.maxTouchPoints,E=null==c||null==(a=c.screen)?void 0:a.width,P=null==c||null==(o=c.screen)?void 0:o.height,$=null==c?void 0:c.devicePixelRatio;z(x)||(w.userAgentDataPlatform=x),z(k)||(w.maxTouchPoints=k),z(E)||(w.screenWidth=E),z(P)||(w.screenHeight=P),z($)||(w.devicePixelRatio=$);var F,C,I,O,A,R,T=sS(sC({$os:d,$os_version:p,$browser:e2(b,navigator.vendor,m,y),$webview_app:g,$webview_app_version:_,$device:e4(b),$device_type:(R=e4(b))===ed||R===ec||"Kobo"===R||"Kindle Fire"===R||R===eM?eh:R===eS||R===e$||R===eP||R===eR?"Console":R===ep?"Wearable":R?el:"Android"===(null==w?void 0:w.userAgentDataPlatform)&&(null!=(C=null==w?void 0:w.maxTouchPoints)?C:0)>0?600>Math.min(null!=(I=null==w?void 0:w.screenWidth)?I:0,null!=(O=null==w?void 0:w.screenHeight)?O:0)/(null!=(A=null==w?void 0:w.devicePixelRatio)?A:1)?el:eh:"Desktop",$timezone:ns(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rJ(s?tc(null==f?void 0:f.href):null==f?void 0:f.href,u,r3),$host:null==f?void 0:f.host,$pathname:null==f?void 0:f.pathname,$raw_user_agent:b.length>1e3?b.substring(0,997)+"...":b,$browser_version:e5(b,navigator.vendor,m,y),$browser_language:r9(),$browser_language_prefix:"string"==typeof(F=r9())?F.split("-")[0]:void 0,$screen_height:null==c?void 0:c.screen.height,$screen_width:null==c?void 0:c.screen.width,$viewport_height:null==c?void 0:c.innerHeight,$viewport_width:null==c?void 0:c.innerWidth,$lib:S.LIB_NAME,$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return S.SDK_DIST_CHANNEL&&(T.$sdk_dist_channel=S.SDK_DIST_CHANNEL),T}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
vendor: 5,417 bytes, line 1
1);if(this.sessionManager){var p=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime(),!0),g=p.windowId;o.$session_id=p.sessionId,o.$window_id=g}this.sessionPropsManager&&sS(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&sS(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(n=this.Iu)?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),h="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=sS(o,h),"$pageview"===e&&v&&(o.title=v.title),!z(a)){var _=i.getTime()-a;o.$duration=parseFloat((_/1e3).toFixed(3))}b&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var m=this.persistence.properties(),y=this.sessionPersistence.properties(),w=o.$groups,x=m.$groups;j(w)&&!B(w)&&(o.$groups=l({},j(x)?x:{},w)),sE(["$referrer","$referring_domain"],e=>{e in m&&delete y[e]});var k={};if(this.yu.length>0)for(var E of this.yu.slice())try{sS(k,E())}catch(e){ih.error("Failed to produce browser extension event properties",e)}(o=sS({},d,m,y,l({},k,o))).$is_identified=this._isIdentified(),D(this.config.property_denylist)?sE(this.config.property_denylist,function(e){delete o[e]}):ih.error(aQ+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var P=this.config.sanitize_properties;P&&(ih.error(aK),o=P(o,e));var $=this.Ku();return o.$process_person_profile=$,$&&!r&&this.Xu("_calculate_event_properties"),o}Zu(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Ku()||this.pu&&!i)return e;var s,r=sS({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(ih.error(aK),r=n(r,"$set_once")),t&&(this.pu=!0),B(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.Ju(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.gu.add(e)),this.Qu()}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.gu.delete(e),this.Qu()}Yu(e,t){this.register({[e]:t})}Eu(){this.gu.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.gu.clear(),this.Qu()}Qu(){var e;if(this.mu)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.gi||!s8.Et())s8.Dt(this.mu);else{var t=[];this.gu.forEach(e=>t.push(e)),t.length>0?s8.Ot(this.mu,t):s8.Dt(this.mu)}}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.tu.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:aG}),()=>{})}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:aG})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:aG})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=aM),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:aG}}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:aG})}th(e){return!e||H(e)?(ih.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(ih.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())||(ih.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 ih.uninitializedWarning("posthog.identify");if(W(e)&&(e=e.toString(),ih.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.th(e)&&this.Xu("posthog.identify")){this.hu();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.Ju(!1),a=this.persistence.Sa(),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(iw),this.register({distinct_id:e}));var u=(this.persistence.get_property("$user_state")||"anonymous")===sv,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(st,sf),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture(sw,p,{$set:t||{},$set_once:i||{}}),this.ku=aP(e,t,i),null==(d=this.featureFlags)||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(c){this.persistence.set_property(st,sf);var v=t||{},f=i||{};this.setPersonPropertiesForFlags({$set:v,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture("$set",{$set:v,$set_once:f}),this.ku=aP(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);h||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(i4)):c&&(t||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.Ma(o)}}}setPersonProperties(e,t){if((e||t)&&this.Xu("posthog.setPersonProperties")){var i=aP(this.get_distinct_id(),e,t);this.ku!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.ku=i):ih.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(D(e)?e:[e]).filter(e=>q(e)&&e.length>0);0!==i.length&&this.Xu("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.ku=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.Ju();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:l({},r,{[e]:t})}),(n||i)&&this.Ku()){var a={$group_type:e,$group_key:t};i&&(a.$group_set=i),this.capture(sx,a)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else ih.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.Xu("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=K(e)?e:null==e?void 0:e.resetDeviceID,i=K(e)||null==e?void 0:e.bootstrap;this.eh(t,!1,i)}eh(e,t,i){if(void 0===t&&(t=!1),ih.info("reset"),!this.__loaded)return ih.uninitializedWarning("posthog.reset");var s,r,n,a,o,u,h,c,d,p,v,f,g,_,m,y,b,w,x=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.xu)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ua());var k=this.get_property(iy),E=this.get_property(ib),S=this.get_property(iM);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 $=null==(a=this.persistence)||null==a.Sa?void 0:a.Sa(),F=!1;try{if(null==(o=this.persistence)||o.clear(),null==(u=this.sessionPersistence)||u.clear(),this.gu.clear(),this.Qu(),z(S)||null==(h=this.persistence)||h.register({[iM]:S}),null==(c=this.surveys)||c.reset(),null==(d=this.featureFlags)||d.reset(),null==(p=this.conversations)||p.reset(),null==(v=this.logs)||v.reset(),null==(f=this.metrics)||f.reset(),null==(g=this.persistence)||g.set_property(st,
1sv),null==(_=this.sessionManager)||_.resetSessionId(),this.ku=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:sl,$device_id:null},"");else{var C=this.config.get_device_id(sB());this.register_once({distinct_id:C,$device_id:e?C:k},""),e||z(E)||this.register({[ib]:E})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.ou()||(null==(b=this.persistence)||b.set_property(st,i.isIdentifiedID?sf:sv),this.register({distinct_id:i.distinctID})),null==(m=this.featureFlags)||m.initialize(),!(z(x)||null!=(y=this.sessionManager)&&y.setBootstrapSessionId(x,!0)))){var I=l({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,F=!0}finally{$&&(null==(w=this.persistence)||null==w.Ma||w.Ma(F))}this.reloadFeatureFlags()}shutdown(e){var t=this;return h(function*(){var e,i,s,r,n,a,o,l;if(t.__loaded){t.fu=!0,t.$u().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(i=t.logs)||i.flushLogs("sendBeacon"),null==(s=t.metrics)||s.flush("sendBeacon"),null==(r=t.Tu)||r.unload(),null==(n=t.Iu)||n.unload();try{null==(l=t.featureFlags)||l.destroy()}catch(e){ih.error("Error while destroying feature flags",e)}null==(a=t.persistence)||a.destroy(),null==(o=t.sessionPersistence)||o.destroy()}else ih.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.ih()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e.rh()}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")?(ih.critical("Attempting to create alias for existing People user - aborting."),-2):this.Xu("posthog.alias")?(z(t)&&(t=this.get_distinct_id()),e!==t?(this.Yu(iw,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ih.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=l({},this.config);if(j(e)){sS(this.config,a3(e));var i,s,r,n,a,o,u,h,c,d,p,v,f,g=this.du();null==(i=this.persistence)||i.update_config(this.config,t,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new np(l({},this.config,{persistence:"sessionStorage"}),g,!1);var _=this.Su(this.config.debug);K(_)&&(this.config.debug=_),K(this.config.debug)&&(this.config.debug?(S.DEBUG=!0,sG.Et()&&sG.Ot("ph_debug",!0),ih.info("set_config",{config:e,oldConfig:t,newConfig:l({},this.config)})):(S.DEBUG=!1,sG.Et()&&sG.Dt("ph_debug"))),null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Ua()),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==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(c=this.historyAutocapture)||c.startIfEnabledOrStop()),null==(d=this.exceptionObserver)||d.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.vu(),null==(f=this.externalIntegrations)||f.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&rj(this,aV,!1)}}_overrideSDKInfo(e,t){S.LIB_NAME=e,S.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(l({},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.nh}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:aY;return t!==aY&&(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"))}Ku(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&
1!this._isIdentified()&&B(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e.__alias)&&(null==(t=this.persistence)||null==(t=t.props)||!t.$epp))}zu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Ku()||this.Xu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Xu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Xu(e){return"never"===this.config.person_profiles?(ih.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.au(),this.Yu(so,!0),!0)}du(){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)}vu(){var e,t,i,s,r,n=this.du();return this.is_capturing()||null==(e=this.logs)||e.sh(),(null==(t=this.persistence)?void 0:t.gi)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(s=this.sessionPersistence)?void 0:s.gi)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.gu.clear(),this.Qu()),n}opt_in_capturing(t){var i,s,r;if("always"!==this.config.cookieless_mode){if(this.ou()){null==(n=this.sessionRecording)||n.dispose({discardBufferedEvents:!0}),this.eh(!0,!0),null==(a=this.sessionManager)||a.destroy(),null==(o=this.pageViewManager)||o.destroy(),this.sessionManager=new am(this),this.pageViewManager=new rH(this),this.persistence&&(this.sessionPropsManager=new af(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.su(this.sessionRecording,new d(this)),this.Yl&&(null==(c=this.sessionRecording)||null==c.onRemoteConfig||c.onRemoteConfig(this.Yl)))}this.consent.optInOut(!0),this.vu(),this.ju(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(s=this.surveys)||s.loadIfEnabled()),(z(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.Bu()}else ih.warn(aW)}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.eh(!0,!0),this.consent.optInOut(!1),this.vu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:sl,$device_id:null}),this.nu(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.Bu(),this.ju())}else ih.warn(aW)}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.vu()}_is_bot(){return p?ay(p,this.config.custom_blocked_useragents):void 0}Bu(){v&&("visible"===v.visibilityState?this.bu||(this.bu=!0,this.capture(sy,{title:v.title},{send_instantly:!0}),this._u&&(v.removeEventListener(s_,this._u),this._u=null)):this._u||(this._u=this.Bu.bind(this),sA(v,s_,this._u)))}debug(e){!1===e?(null==c||c.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==c||c.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}))}Ua(){var e,t,i,s,r=this.xu||{};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?(ih.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&&!V(r[e]),s=t in r&&!V(r[t]),i?r[e]:!!s&&(ih&&ih.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}Ts(e){if(V(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(X),s=D(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;
1for(var n of s)try{if(r=n(r),V(r)){var a="Event '"+e.event+"' was rejected in beforeSend function";return Q(e.event)?ih.warn(a+". This can cause unexpected behavior."):ih.info(a),null}r.properties&&!B(r.properties)||ih.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return ih.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var o of i)if(r.properties&&V(r.properties[o]))return ih.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)})}Su(e){var t=K(e)&&!e,i=sG.Et()&&"true"===sG.Lt("ph_debug");return!t&&(!!i||e)}}).__defaultExtensionClasses={},r.nh={trace:i=()=>{},debug:i,info:i,warn:i,error:i,fatal:i},r),a8=["identify"],a4=0;a8.length>a4;a4++)a6.prototype[a8[a4]]=sF(a6.prototype[a8[a4]]);var a9=class{constructor(e){this.disabled=!1===e;var t=j(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;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}},a7="$copy_autocapture",oe=ic("[AutoCapture]");function ot(e,t){return t.length>e?t.slice(0,e)+"...":t}var oi=class{Qs(){this.Ks=void 0,clearTimeout(this.Xs),this.Xs=void 0}Ys(e){var t;if(!rk(e))return!0;for(var i,s=null!=(t=this.so().css_selector_ignorelist)?t:rv,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=ra(e);if(I(t,"ph-no-capture")||I(t,"ph-sensitive")||rE(e)||s.some(t=>rc(e,t)))return{v:!0};var i=n.parentNode;n=rs(i)?i.host:i&&re(i)?i:null}())return i.v;return!1}oo(e){if(this.isEnabled&&"pointercancel"!==e.type)if("pointerdown"!==e.type){var t=this.Ks;t&&(e.pointerId!==t.id||Math.abs(e.clientX-t.x)>5||Math.abs(e.clientY-t.y)>5?this.Qs():"pointerup"===e.type&&(t.released=!0,this.Xs=setTimeout(()=>this.Qs(),0)))}else{this.Qs();var i,s=ru(e);e.isPrimary&&0===e.button&&!e.ctrlKey&&s&&re(s)&&(this.Ks={target:s,excluded:this.Ys(s),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(i=this.ao)?void 0:i.distinctId})}else this.Qs()}lo(e){var t,i=this.Ks;this.Qs();var s=ru(e);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(t=this.ao)?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&&(rt(s,"html")||rt(s,"body"))){if(i.excluded)return null;var r,n=null!=(r=this.so().css_selector_ignorelist)?r:rv;return[s,null==v?void 0:v.documentElement,null==v?void 0:v.body].some(e=>{if(!e)return!1;var t=ra(e);return I(t,"ph-no-capture")||I(t,"ph-sensitive")||!rk(e)||rE(e)||n.some(t=>rc(e,t))})?null:i.target}}constructor(e){this.uo=e,this.name="autocapture",this.ho=!1,this.do=null,this.vo=!1,this.co=!1,this.xn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.fo=!1,this.uo.refresh(this.xn),this.rageclicks=new a9(this.xn.rageclick),this.po=null}setup(e){this.mo(),this.ao=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.fo?t.dispose():(this.yo=t,this.startIfEnabled())}dispose(){var e;this.fo||(this.fo=!0,this.ao=void 0,null==(e=this.yo)||e.dispose(),this.yo=void 0,this.bo())}so(){return this.uo.refresh(this.xn),this.xn}mo(){var e,t;return this.so(),this.xn.url_allowlist=null==(e=this.xn.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this.xn.url_ignorelist=null==(t=this.xn.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this.xn}
vendor: 5,037 bytes, line 1
1_o(){if(this.isBrowserSupported()){if(c&&v){var e=this.wo=e=>{e=e||(null==c?void 0:c.event);try{if("blur"===e.type)return void this.Qs();if(0===e.type.indexOf("pointer"))return void this.oo(e);var t="click"===e.type?this.lo(e):void 0;if(U(t))return;this.ko(e,"$autocapture",t)}catch(e){oe.error("Failed to capture event",e)}};if(sA(c,"blur",e),sA(v,"submit",e,{capture:!0}),sA(v,"change",e,{capture:!0}),sA(v,"click",e,{capture:!0}),sE(["pointerdown","pointermove","pointerup","pointercancel"],t=>{sA(v,t,e,{capture:!0})}),this.so().capture_copied_text){var t=this.So=e=>{e=e||(null==c?void 0:c.event);try{this.ko(e,a7)}catch(e){oe.error("Failed to capture clipboard event",e)}};sA(v,"copy",t,{capture:!0}),sA(v,"cut",t,{capture:!0}),sA(v,"paste",t,{capture:!0})}}}else oe.info("Disabling Automatic Event Collection because this browser is not supported")}bo(){this.Qs(),this.wo&&(null==c||c.removeEventListener("blur",this.wo),sE(["pointerdown","pointermove","pointerup","pointercancel"],e=>{null==v||v.removeEventListener(e,this.wo,!0)}),null==v||v.removeEventListener("submit",this.wo,!0),null==v||v.removeEventListener("change",this.wo,!0),null==v||v.removeEventListener("click",this.wo,!0),this.wo=void 0),this.So&&(null==v||v.removeEventListener("copy",this.So,!0),null==v||v.removeEventListener("cut",this.So,!0),null==v||v.removeEventListener("paste",this.So,!0),this.So=void 0),this.ho=!1}startIfEnabled(){this.isEnabled||this.Qs(),!this.fo&&this.ao&&this.isEnabled&&!this.ho&&(this._o(),this.ho=!0)}onRemoteConfig(e){if(!this.fo)if(this.vo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.co=t.elementsChainAsString);var i,s=t.autocapture_opt_out;K(s)&&(null==(i=this.ao)||i.kv.set(iS,s),this.do=s),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.po=e}getElementSelectors(e,t){var i,s=[];return null==(i=this.po)||i.forEach(i=>{var r;null==v||null==(r=v.querySelectorAll(i))||r.forEach(r=>{e!==r&&t!==r||I(s,i)||s.push(i)})}),s}get isEnabled(){if(this.fo)return!1;var e,t,i=null==(e=this.ao)?void 0:e.kv.get(iS),s=this.do,r=this.so();if(!r.remoteRequestsDisabled&&!this.vo)return!1;var n=r.remoteRequestsDisabled&&!this.vo;if(U(s)&&!K(i)&&!n)return!1;var a=null!=(t=this.do)?t:!!i;return!!r.enabled&&!a}ko(e,t,i){if(void 0===t&&(t="$autocapture"),this.isEnabled){var s=i||ru(e);ri(s)&&(s=s.parentNode||null);var r,n=this.mo();"$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())&&rb(s,n.rageclick)&&this.ko(e,"$rageclick",i);var a=t===a7,o=a?l({},n,{dom_event_allowlist:void 0}):n;if(s&&function(e,t,i,s,r,n){if(!c||rw(e)||null!=i&&i.url_allowlist&&!rn(i.url_allowlist,n)||null!=i&&i.url_ignorelist&&rn(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=rx(e,s),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(z(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)||!rd(h,null==i?void 0:i.css_selector_allowlist)||rd(h,null!=(a=null==i?void 0:i.css_selector_ignorelist)?a:rv))return!1;try{var d=c.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var p=e.tagName.toLowerCase();switch(p){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&&(rh.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:n.getCurrentUrl}})){var u,h=function(e,t){var i,s,r=t.e,n=t.maskAllElementAttributes,a=t.maskAllText,o=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!re(e))return{props:{}};for(var d=[e],p=new Set([e]),v=e;v.parentNode&&!rt(v,"body")&&1e3>d.length;)if(rs(v.parentNode)){var f=v.parentNode.host;if(p.has(f))break;p.add(f),d.push(f),v=f}else{if(!re(v.parentNode)||p.has(v.parentNode))break;p.add(v.parentNode),d.push(v.parentNode),v=v.parentNode}var g="click"===r.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?d.findIndex(e=>rt(e,"button")||rt(e,"a")):-1;g>0&&(a=a||d.slice(0,g+1).some(e=>!rk(e)||rE(e)));var _,m=[],y={},b=!1,w=!1;if(sE(d,e=>{var t=rk(e);if(rt(e,"a")){var i=e.getAttribute("href");b=!!(t&&i&&rO(i))&&(h?tc(i):i)}I(ra(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};rh.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?ot(1024,rA(e)):ot(1024,rl(e)));var o=ra(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),sE(e.attributes,function(i){var n;if((!rE(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&
1!t&&rO(i.value)&&(!q(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=rr(o).join(" ")),a["attr__"+i.name]=ot(1024,"href"===i.name&&r?tc(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&&!re(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,h)),sE(function(e){if(!rk(e))return{};var t={};return sE(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(g>0&&(e=d[g],m.splice(0,g)),a||(m[0].$el_text=rt(e,"a")||rt(e,"button")?rA(e):rl(e)),b){m[0].attr__href=b;var x,k,E=null==(x=rQ(b))?void 0:x.host,S=null==c||null==(k=c.location)?void 0:k.host;E&&S&&E!==S&&(_=b)}return{props:sS({$event_type:r.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:D(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 D(t)?t:rr(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sP(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=l({},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 sP(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+=":")+sP(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.co,disableCaptureUrlHashes:n.disableCaptureUrlHashes}),d=h.props;if(h.explicitNoCapture)return!1;var p=this.getElementSelectors(s,h.target);if(p&&p.length>0&&(d.$element_selectors=p),t===a7){var v=e.type||"clipboard";if("paste"!==v){var f,g,_=null==c||null==(f=c.getSelection())?void 0:f.toString(),m=ro(_);if(!m)return!1;d.$selected_content=m,d.$clipboard_text_length=null!=(g=null==_?void 0:_.length)?g:0}d.$copy_type=v}return null==(u=this.ao)||u.capture(t,d).catch(e=>oe.error("Failed to capture event",e)),!0}}else this.Qs()}isBrowserSupported(){return N(null==v?void 0:v.querySelectorAll)}},os=class{constructor(e){this._instance=e}refresh(e){var t=this._instance.config,i=j(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.Ua(),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}},or=ic("[ExceptionAutocapture]"),on=()=>{},oa=e=>{var t;if(N(e))return null!=(t=e.__posthog_layer__)?t:e.__rrweb_layer__};function oo(e,t,i){try{if(!(t in e))return on;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 N(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=oa(i);n;){if(n.next===r)return void(n.next=s.next);n=oa(i=n.next)}else e[t]=s.next}}catch(e){return on}}var ol=ic("[TracingHeaders]"),ou=ic("[Web Vitals]"),oh=["CLS","FCP","INP","LCP"],oc=["INP","LCP"],od=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],op="disabled",ov="lazy_loading",of=ic("[SessionRecording]"),og=ic("[Heatmaps]");function o_(e){return j(e)&&"clientX"in e&&"clientY"in e&&W(e.clientX)&&W(e.clientY)}var om=ic("[Product Tours]"),oy=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(iA))},ob=ic("[SiteApps]"),ow="Error while initializing PostHog app with config id ",ox=(e,t)=>null!=e&&e.then?e.then(t):t(e),ok="SDK is not enabled or survey functionality is not yet loaded",oE="Disabled. Not loading surveys.",oS=class{constructor(e,t){this.uo=e,this.oh=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ah=!1,this.uh=[],this.hh=null,this.dh=null,this.fo=!1,this.fh=new Set,this.onRemoteConfig=e=>{if(!this.fo&&!this.xn.disableSurveys){if(!e.ok)return aA.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(V(t))return aA.warn("Flags not loaded yet. Not loading surveys.");this.ph=K(t)?t:t.length>0,aA.info("flags response received, isSurveysEnabled: "+this.ph),this.loadIfEnabled()}}}setup(e){if(!this.fo)return this.gh=e,ox(e.kv.initialize(),()=>{if(this.gh===e&&!this.fo){this.gh=void 0,this.ao=e;var t=e.onRemoteConfig(this.onRemoteConfig);this.fo?t.dispose():(this.yo=t,this.loadIfEnabled())}})}dispose(){var e,t,i;this.fo||(this.fo=!0,this.gh=void 0,this.ao=void 0,null==(e=this.yo)||e.dispose(),this.yo=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.uh=[],this.hh=null,this.fh.forEach(e
1=>clearTimeout(e)),this.fh.clear())}get xn(){return this.uo.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.fo&&this.ao){var e=this.xn;if(!this._surveyManager)if(this.ah)aA.info("Already initializing surveys, skipping...");else if(e.disableSurveys)aA.info(oE);else if(e.cookielessMode&&this.uo.isOptedOut())aA.info("Not loading surveys in cookieless mode without consent.");else{var t=this.uo.getExtensions();if(t){if(!z(this.ph)||e.advancedEnableSurveys){var i=this.ph||e.advancedEnableSurveys;this.ah=!0;try{var s=t.generateSurveys;if(s)return this.mh(s,i),void(this.ah=!1);var r=t.loadExternalDependency;if(!r)return this.yh(sp),void(this.ah=!1);r(e=>{try{if(this.fo)return;var t=this.uo.getExtensions();e||null==t||!t.generateSurveys?this.yh("Could not load surveys script",e):this.mh(t.generateSurveys,i)}finally{this.ah=!1}})}catch(e){throw this.ah=!1,this.yh("Error initializing surveys",e),e}}}else aA.error("PostHog Extensions not found.")}}}mh(e,t){this.fo||(this._surveyManager=e(t),this._surveyEventReceiver=this.uo.createEventReceiver(),aA.info("Surveys loaded successfully"),this.bh({isLoaded:!0}))}yh(e,t){aA.error(e,t),this.bh({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.uh.push(e),this._surveyManager&&this.bh({isLoaded:!0}),()=>{this.uh=this.uh.filter(t=>t!==e)}}getSurveys(e,t){void 0===t&&(t=!1);var i,s=null!=(i=this.ao)?i:this.oh;if(s&&!this.fo){if(this.xn.disableSurveys)return aA.info(oE),e([]);var r=s.kv.get(i1);if(r&&!t)return e(r,{isLoaded:!0}),void(this._h()&&this.getSurveys(()=>{},!0));if(this.hh)this.hh.then(t=>{this.fo||e(t.surveys,t.context)}).catch(e=>aA.error("Error in survey callback",e));else{var n=this.wh("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.xn.requestTimeoutMs}).then(e=>{try{return this.kh(s,e)}catch(e){return aA.error("Error processing surveys response",e),this.kh(s,{statusCode:0,error:e})}},e=>this.kh(s,{statusCode:0,error:e}));this.hh=n;var a=()=>{this.hh===n&&(this.hh=null)};n.then(t=>{a(),this.fo||e(t.surveys,t.context)},a).catch(e=>aA.error("Error in survey callback",e))}}}wh(e,t){var i=this.ao;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(ok)}))}kh(e,t){if(this.fo)return{surveys:[],context:{isLoaded:!1,error:ok}};var i,s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;return 0!==s?aA.error(r):t.error||aA.warn(r),this.dh=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.dh=null;var n=t.json.surveys||[],a=n.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(aw(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({[i1]:n,[i2]:Date.now()}),{surveys:n,context:{isLoaded:!0}}}_h(){return this.Sh()&&!this.hh&&!this.xh()}Sh(){var e,t,i=null==(e=null!=(t=this.ao)?t:this.oh)?void 0:e.kv.get(i2);return W(i)&&Date.now()-i>3e5}xh(){return W(this.dh)&&3e5>Date.now()-this.dh}markSurveyAsSeen(e,t){var i;aR({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}bh(e){for(var t of this.uh)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){aA.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!V(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);aA.warn("init was not called")}Ch(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}Th(e){if(V(this._surveyManager))return{eligible:!1,reason:ok};var t="string"==typeof e?this.Ch(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Mh(e){if(!this.uo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};
vendor: 10,445 bytes, line 1
1if(V(this._surveyManager))return{eligible:!1,reason:ok};var t="string"==typeof e?this.Ch(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(V(this._surveyManager))return aA.warn("init was not called"),{visible:!1,disabledReason:ok};var t=this.Mh(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return V(this._surveyManager)?(aA.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ok})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.Mh(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(this.uo.isCapturing())if(V(this._surveyManager))aA.warn("init was not called");else{var r="string"==typeof e?this.Ch(e):e;if(null!=r&&r.id)if(aT.includes(r.type)){var n=null==v?void 0:v.querySelector(t);if(n)if(null!=(s=r.appearance)&&s.surveyPopupDelaySeconds){aA.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var e,t;this.fh.delete(a),!this.fo&&this.uo.isCapturing()&&(aA.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),aA.info("Survey "+r.id+" rendered"))},1e3*r.appearance.surveyPopupDelaySeconds);this.fh.add(a)}else this._surveyManager.renderSurvey(r,n,i);else aA.warn("Survey element not found")}else aA.warn("Surveys of type "+r.type+" cannot be rendered in the app");else aA.warn("Survey not found")}}displaySurvey(e,t){var i;if(this.uo.isCapturing())if(V(this._surveyManager))aA.warn("init was not called");else{var s=this.Ch(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=l({},s,{appearance:l({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==nw&&t.initialResponses&&aA.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.Th(s);if(!n.eligible)return void aA.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 aA.warn("Survey not found")}}cancelPendingSurvey(e){V(this._surveyManager)?aA.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}};function oP(e,t,i){if(V(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.Ih=new Set,this.Eh=new Set,this.Rh=new ag,this.Ah=(e,t)=>this.Ph(e,t)&&this.Fh(e,t)&&this.Oh(e,t)&&this.$h(e,t),this.Ph=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)}init(){var e,t;z(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Dh=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e;null==(e=this.Dh)||e.call(this),this.Dh=void 0,this.Rh=new ag}register(e){var t,i;if(!z(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.Ih.add(e),null==(t=e.steps)||t.forEach(e=>{this.Eh.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s=new Set;this.Ih.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.Ih.clear(),this.Eh.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.Eh.has(e)||this.Eh.has(t.event))&&this.Ih.forEach(e=>{this.Lh(t,e)&&this.Rh.emit("actionCaptured",e.name)})}Nh(e){this.onAction("actionCaptured",t=>e(t))}Lh(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Ah(e,i))return!0;return!1}onAction(e,t){return this.Rh.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||!oP(s,t.url,t.url_matching||"contains"))return!1}return!0}Oh(e,t){return!!this.qh(e,t)&&!!this.jh(e,t)&&!!this.Bh(e,t)}qh(e,t){if(null==t||!t.href)return!0;var i=this.Hh(e);if(i.length>0)return i.some(e=>oP(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&&oP((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}jh(e,t){if(null==t||!t.text)return!0;var i=this.Hh(e);if(i.length>0)return i.some(e=>oP(e.text,t.text,t.text_matching||"exact")||oP(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;!V(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=>oP(e,n,a)))}Bh(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}Hh(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}$h(e,t){return null==t||!t.properties||0===t.properties.length||aS(t.properties.reduce((e,t)=>{var i=D(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)}},oF=class{constructor(e){var t;this.zh=[],this._instance=e,this.Uh=new Map,this.Wh=new Map,this.Vh=new Map,this.Gh=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId(e=>this.Zh(e))}Jh(e){return!1}Qh(){return null}Kh(e){}Xh(){}Yh(e,t){return!!e&&aS(e.propertyFilters,null==t?void 0:t.properties)}td(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}ed(e,t,i){var s=(i===ng?this.Uh:this.Wh).get(e),r=[];return this.rd(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.Yh(n,t)})}register(e){this.nd(e,!1)}replace(e){this.nd(e,!0)}nd(e,t){var i;z(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.sd(e,t),this.od(e,t))}od(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.Vh.clear(),0!==s.length){this.ad||(this.ad=new o$(this._instance),this.ad.init(),this.ad.Nh(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.Vh.get(t.name))?i:[];s.includes(e.id)||s.push(e.id),this.Vh.set(t.name,s)}})}),t?this.ad.replace(r):this.ad.register(r)}else t&&(null==(i=this.ad)||i.replace([]))}ld(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)})}sd(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.td(e,ng),a=this.td(e,n_);t?(this.Uh=n,this.Wh=a):(this.ld(this.Uh,n),this.ld(this.Wh,a)),(0!==s.length||0!==r.length)&&(null!=this.Dh||(this.Dh=null==(i=this._instance)?void 0:i._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,s,r=this.ud(),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.hd(e,n);if("consume"===a)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.dd([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.vd(n),void this.fd([n])}if(this.Wh.has(e)){var o=this.ed(e,t,n_);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.dd(o.map(e=>e.id)),o.forEach(e=>this.pd(e.id)))}if(this.Uh.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Uh.get(e)});var l=this.ed(e,t,ng);this.gd(l.map(e=>e.id))}}onAction(e){this.Vh.has(e)&&this.gd(this.Vh.get(e)||[])}gd(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.Jh(r)?this.vd(r)&&this.md(r):s.push(r);s.length>0&&(this.zh=[...new Set([...this.zh,...s])]),this.ud().info("updating activated items",{activatedItems:this.getActivatedIds()})}}vd(e){this.zh=this.zh.filter(t=>t!==e);var t=this.yd();return!t.includes(e)&&(this.bd([...t,e]),this._d(),!0)}dd(e){var t=new Set(e);this.zh=this.zh.filter(e=>!t.has(e));var i=this.wd(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.bd(s),0===s.length&&this.kd()),this.fd(e)}Sd(){var e,t=this.Qh();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}md(e){if(this.Qh()){var t=this.Sd();this.Kh(l({},t,{[e]:Date.now()}))}}fd(e){if(this.Qh()){var t=this.Sd(),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&&(B(i)?this.Xh():this.Kh(i))}}xd(){this.Qh()&&this.Xh()}getActivationTimestamp(e){if(this.yd().includes(e)){var t=this.Sd()[e];return W(t)?t:void 0}}wd(){var e,t=this.Cd();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}yd(){var e,t,i=this.wd();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Td()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}_d(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.Md(t)}kd(){this.Id()}Zh(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Td()];if(i&&i!==e){var s=this.wd(),r=this.Sd();s.length>0&&(this.bd([]),s.filter(e=>
1W(r[e])).forEach(e=>this.pd(e))),this.kd(),this.xd()}}getActivatedIds(){return[...new Set([...this.yd(),...this.zh])].filter(e=>!this.Ed(e))}dispose(){var e,t,i;null==(e=this.Gh)||e.call(this),this.Gh=void 0,null==(t=this.Dh)||t.call(this),this.Dh=void 0,null==(i=this.ad)||i.dispose(),this.ad=void 0}reset(){this.zh=[],this.wd().length>0&&this.bd([]),this.kd(),this.xd()}getEventToItemsMap(){return this.Uh}Rd(){return this.ad}},oC=class extends oF{constructor(e){super(e)}Cd(){return i3}Td(){return i5}Qh(){return i6}Kh(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i6]:e})}Xh(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(i6)}Jh(e){this.rd(t=>{i=t.find(t=>t.id===e)});var t,i,s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return W(s)&&s>0}Ad(){return nm}rd(e){var t;null==(t=this._instance)||t.getSurveys(e)}pd(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}ud(){return aA}bd(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i3]:e})}Md(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i5]:e})}Id(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(i5)}Ed(){return!1}hd(e,t){var i,s,r;return this.rd(e=>{i=e.find(e=>e.id===t)}),!i||aw(s=i)&&!(null==(r=s.conditions)||null==(r=r.events)||!r.repeatedActivation)||"always"===s.schedule?e===nm?"consume":"ignore":e===nm?"persist":e===ny||e===nb?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},oI=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);z(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)}},oO=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()}isCapturing(){return this._instance.is_capturing()}getExtensions(){var e=null==k?void 0:k.__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)}}
1,oA=null!=c&&c.location?rZ(c.location.hash,"__posthog")||rZ(location.hash,"state"):null,oR="_postHogToolbarParams",oT=ic("[Toolbar]"),oM=ic("[FeatureFlags]"),oL=class{constructor(e,t){void 0===t&&(t=!1),this.Pd=!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:D(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.Pd||(oM.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Pd=!0),z(e.flag_keys)||D(e.flag_keys)||oM.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Fd}},oD=ic("[FeatureFlags]"),oN=ic("[FeatureFlags]",{debugEnabled:!0}),oj="\" failed. Feature flags didn't load in time.",oB="connection_error",oz=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},oq=e=>{var t={};for(var i of sP(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},oH=e=>Y(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message),oU=ic("[Error tracking]"),oV="webkit-masked-url:",oW=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],oG=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",oV],oK=["__firefox__","__gCrWeb"],oQ="Refusing to render web experiment since the viewer is a likely bot",oX={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>ax(t,e),not_regex:(e,t)=>!ax(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},oJ=ic("[Conversations]"),oZ="Conversations not available yet.";function oY(e,t){var i,s,r,n,a,o,u,h=null!=(i=null==e?void 0:e.flushIntervalMs)?i:3e3,c=null!=(s=null==e?void 0:e.maxBufferSize)?s:100,d=null!=t&&t.consoleCapture?void 0:null!=(r=null==e?void 0:e.maxLogsPerInterval)?r:1e3,v=z(d)?Math.max(c,2048):Math.max(c,d),f=l({},function(){var e,t,i,s="",r="";try{var n=null==p?void 0:p.userAgent;if(n){var a=e8(n);s=a[0],r=a[1]}}catch(e){}return e=s,t=r,i=function(e){if(e)return({}).hasOwnProperty.call(t7,e)?t7[e]:e}(e),l({},i?{"os.name":i}:{},t?{"os.version":t}:{})}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!=(n=null!=(a=null==f?void 0:f["service.name"])?a:null==e?void 0:e.serviceName)?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!=(o=null==f?void 0:f["service.version"])?o:null==e?void 0:e.serviceVersion,environment:null!=(u=null==f?void 0:f["deployment.environment"])?u:null==e?void 0:e.environment,resourceAttributes:f,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:h,maxBufferSize:c,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:h,maxLogsPerInterval:d,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.Od=!1,this.featureFlagEventHandlers=[],this.A=oD,this.$d={},this.Dd={},this.Ld=[],this.Nd=!1,this.qd=!1,this.jd=0,this.Bd=!1,this.Hd=!1,this.zd=!1,this.Ud=!1,this.Wd=0,this.nr=()=>{var e=this.Vd();this.Wd=0,e&&this.reloadFeatureFlags()},this.Gd=()=>{var e,t=this.Zd;z(t)||this.xn.remoteRequestsDisabled||!v||"hidden"===v.visibilityState||Date.now()-(null!=(e=this.Jd)?e:0)<t||(this.reloadFeatureFlags(),this.Qd())},this.ar=()=>{"visible"===(null==v?void 0:v.visibilityState)&&this.Gd()},"get"in e?this.uo=e:(this._instance=e,this.Kd=new oL(e.config,e.Ua()),this.uo=this.Kd)}updateConfig(e,t){var i;null==(i=this.Kd)||i.update(e,t),this.ao&&this.Xd()}setup(e){return this.gh=e,this.A=e.logger.createLogger("[FeatureFlags]"),ox(e.kv.initialize(),()=>{this.gh===e&&(this.gh=void 0,this.ao=e,this.Yd(e))})}Yd(e){var t;if(this.ao===e)return c&&sA(c,"online",this.nr),this.Xd(),this.tv=e.registerDynamicEventProperties(()=>this.ev()?this.$d:this.Dd),this.iv=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange(()=>{this.rv(),this.nv(),this.sv()}),this.nv(),this.initialize()}Xd(){var e=this.xn.refreshIntervalMs,t=!this.xn.remoteRequestsDisabled&&v&&!z(e)&&e>0?e:void 0;t!==this.Zd&&(this.ov(),z(t)||(this.Zd=t,this.Qd(),null!=v&&v.addEventListener&&sA(v,s_,this.ar)))}Qd(){z(this.Zd)||(z(this.av)||clearInterval(this.av),this.Jd=Date.now(),this.av=setInterval(this.Gd,this.Zd))}ov(){z(this.av)||(clearInterval(this.av),this.av=void 0,null==v||null==v.removeEventListener||v.removeEventListener(s_,this.ar)),this.Zd=void 0,this.Jd=void 0}destroy(){this.lv()}dispose(){this.lv()}lv(){var e,t;this.ov(),this.jd++,this.Hd=!1,this.gh=void 0,this.ao&&(this.uv(),null==(e=this.tv)||e.dispose(),this.tv=void 0,null==(t=this.iv)||t.call(this),this.iv=void 0,this.Ld=[],null==c||c.removeEventListener("online",this.nr),this.ao=void 0)}get xn(){return this.uo.get()}hv(e){var t;return this.dv&&e in this.dv?this.dv[e]:null==(t=this.ao)?void 0:t.kv.get(e)}rv(){return!!this.dv&&(this.dv=void 0,!0)}vv(){var e;return!z(null==(e=this.ao)?void 0:e.kv.get("$enabled_feature_flags"))&&this.rv()}Ot(e){this.fv(()=>{var t;return null==(t=this.ao)?void 0:t.kv.set(e)})}pv(e,t,i){var s;if(null!=(s=this._instance)&&s.persistence&&e.$enabled_feature_flags){var r=this.hv("$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&&!D(a)?Object.keys(a||{}):Array.from(new Set([...Object.keys(r),...Object.keys(n)])),h=this.hv("$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,[iH]:v,[iG]:!!p||d};for(var g of(e.$feature_flag_details&&(f[iW]=v),[iK,se,iQ]))z(e[g])||(f[g]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(f)}}Dt(e){this.fv(()=>{var t;return null==(t=this.ao)?void 0:t.kv.remove(e)})}fv(e){try{e()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}nv(){var e={};for(var t of[iU,iG,iK,iX]){var i=this.hv(t);z(i)||(e[t]=i)}this.$d=e;var s=l({},e),r=this.hv(iH);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.Dd=s}ev(){var e=this.xn.cacheTtlMs;
1if(!e||0>=e)return!1;var t=this.hv(se);return"number"!=typeof t||Date.now()-t>e}gv(){return!!this.ev()&&(this.Ud||this.qd||(this.Ud=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}mv(){var e=this.xn.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}):[]}yv(){var e=this.xn.flagKeys;if(!z(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.xn,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=>!z(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.bv({featureFlags:o,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!=(s=this.hv("$enabled_feature_flags"))?s:{},a=null!=i&&i.merge&&null!=(r=this.hv("$feature_flag_payloads"))?r:{},o=l({},n,e),u=l({},a,t),h={};for(var c of Object.entries(o)){var d=c[0],p=c[1];h[d]={key:d,enabled:tG(p),variant:tK(p),reason:void 0,metadata:z(null==u?void 0:u[d])?void 0:{id:0,version:void 0,description:void 0,payload:u[d]}}}this.bv({flags:h})}get hasLoadedFlags(){return this.Nd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.hv(iW),t=this.hv(iX),i=this.hv(iJ);if(!i&&!t)return e||{};var s=sS({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],u=null==t?void 0:t[r],h=z(u)?null!=(n=null==o?void 0:o.enabled)&&n:!!u,c=z(u)?null==o?void 0:o.variant:"string"==typeof u?u:void 0,d=null==i?void 0:i[r],p=l({},o,{enabled:h,variant:h?null!=c?c:null==o?void 0:o.variant:void 0});h!==(null==o?void 0:o.enabled)&&(p.original_enabled=null==o?void 0:o.enabled),c!==(null==o?void 0:o.variant)&&(p.original_variant=null==o?void 0:o.variant),d&&(p.metadata=l({},null==o?void 0:o.metadata,{payload:d,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=p}return this.Od||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.Od=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:tG(s),variant:tK(s),payload:tW(t[i])}})}getFlagVariants(){var e=this.hv(iH),t=this.hv(iX);if(!t)return e||{};for(var i=sS({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Od||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Od=!0),i}getFlagPayloads(){var e=this.hv(iG),t=this.hv(iJ);if(!t)return e||{};for(var i=sS({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Od||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Od=!0),i}reloadFeatureFlags(){this.Bd||this.xn.featureFlagsDisabled||this.Vd()||(this.qd&&(this.Hd=!0),this._v||(this.Ld.slice().forEach(e=>{try{e()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this._v=setTimeout(()=>{this.wv()},5)))}uv(){clearTimeout(this._v),this._v=void 0}onReloading(e){return this.Ld.push(e),()=>{this.Ld=this.Ld.filter(t=>t!==e)}}ensureFlagsLoaded(){this.Nd||this.qd||this._v||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Bd=e}resetFlagCallReported(){this.Dt(i4)}wv(e){this.uv();var t=this.ao;if(t&&!this.xn.remoteRequestsDisabled&&!this.Vd())if(this.qd)this.Hd=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:l({},t.initialPersonProperties,this.hv("$stored_person_properties")||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.hv(iY),timezone:ns()};z(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.xn.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.mv();s.length&&(i.evaluation_contexts=s);var r=this.yv();z(r)||(i.flag_keys=r);var n=this.xn.onlyEvaluateSurveyFeatureFlags,a=this.jd;this.qd=!0;var o=()=>{this.Hd&&(this.Hd=!1,this.wv())},u=e=>{this.qd=!1,a===this.jd&&(this.Ot({[i7]:[oB]}),this.A.error("Feature flag request failed",e),this.vv()&&this.sv(!0)),o()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:this.xn.compression,sentAt:"body",timeoutMs:this.xn.requestTimeoutMs}).then(e=>{var t,s,r=null!=(t=e.json)?t:{},l=200!==e.statusCode;if(this.qd=!1,a===this.jd){if(this.Sv(e.statusCode),l||this.Hd||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Hd){this.zd=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?oB:"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.Ot({[i7]: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.bv(r,l,{partialResponse:n}),o()}}else o()}).catch(u)}catch(e){u(e)}}}Vd(){return rY(this.Wd,3)}Sv(e){this.Wd=r0(e,this.Wd,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.zd)if(this.Nd||this.getFlags()&&this.getFlags().length>0){if(!this.gv()){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+oj)}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.zd)if(this.Nd||this.getFlags()&&this.getFlags().length>0){if(!this.gv()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],a=this.getFlagPayloads()[e],o=String(n),u=this.hv("$feature_flag_request_id")||void 0,h=this.hv("$feature_flag_evaluated_at")||void 0,c=this.hv("$flag_call_reported")||{};if(this.xn.deduplicateCallsPerSession){var d,p=null==(d=this.ao)?void 0:d.session.sessionId,v=this.hv(i9);p&&p!==v&&(c={},i=p)}if(!t.send_event&&"send_event"in t)i&&this.Ot({[i4]:c,[i9]:i});else if(e in c&&c[e].includes(o))i&&this.Ot({[i4]:c,[i9]:i});else{D(c[e])?c[e].push(o):c[e]=[o],this.Ot(l({[i4]:c},i?{[i9]:i}:{}));var f,g,_,m,y,b,w,x,k,E,S,P,$,F=this.getFeatureFlagDetails(e),C=[...null!=(f=this.hv("$feature_flag_errors"))?f:[]];z(n)&&C.push("flag_missing");var I={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!=(g=null==(_=this.xn.bootstrap)||null==(_=_.featureFlags)?void 0:_[e])?g:null,$feature_flag_bootstrapped_payload:null!=(m=null==(y=this.xn.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])?m:null,$used_bootstrap_value:!this.zd};z(null==F||null==(b=F.metadata)?void 0:b.has_experiment)||(I.$feature_flag_has_experiment=F.metadata.has_experiment),z(null==F||null==(w=F.metadata)?void 0:w.version)||(I.$feature_flag_version=F.metadata.version);var O=null!=(x=null==F||null==(k=F.reason)?void 0:k.description)?x:null==F||null==(E=F.reason)?void 0:E.
1code;O&&(I.$feature_flag_reason=O),null!=F&&null!=(S=F.metadata)&&S.id&&(I.$feature_flag_id=F.metadata.id),z(null==F?void 0:F.original_variant)&&z(null==F?void 0:F.original_enabled)||(I.$feature_flag_original_response=z(F.original_variant)?F.original_enabled:F.original_variant),null!=F&&null!=(P=F.metadata)&&P.original_payload&&(I.$feature_flag_original_payload=null==F||null==($=F.metadata)?void 0:$.original_payload),C.length&&(I.$feature_flag_error=C.join(",")),this.xv(I)}if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:tW(a)}}}else this.A.warn('getFeatureFlagResult for key "'+e+oj)}xv(e){try{var t;null==(t=this.ao)||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.Cv(e,t)}Cv(e,t){var i=this;return h(function*(){var s=i.ao;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.mv();a.length&&(n.evaluation_contexts=a);var o,l=i.yv();z(l)||(n.flag_keys=l);try{o=(null==(r=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.xn.compression,sentAt:"body",timeoutMs:i.xn.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.zd)return t.defaultValue;if(!(this.Nd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+oj),t.defaultValue;var i=this.getFeatureFlag(e,t);return z(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.bv(e,t,i)}bv(e,t,i){if(this.ao){this.Nd=!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=oD);var a,o,u=(a=n,(o=e.flags)?l({},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!z(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)),h=u.flags,c=u.featureFlags,d=u.featureFlagPayloads;if(c){var p=e.requestId,v=e.evaluatedAt;if(D(c)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(c)for(var g=0;c.length>g;g++)f[c[g]]=!0;return{[iU]:c,[iH]:f,[iQ]:!1}}var _=c,m=d,y=h;if(null!=r&&r.partialResponse){var b=Object.keys(_),w=m||{};_=l({},t,_),m=l({},i,w),b.forEach(e=>{var t;e in w||null==(t=m)||delete t[e]}),y=l({},s,y)}else if(e.errorsWhileComputingFlags)if(h){var x=new Set(Object.keys(h).filter(e=>{var t;return!(null!=(t=h[e])&&t.failed)}));_=l({},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=l({},i,k),x.forEach(e=>{var t;e in k||null==(t=m)||delete t[e]}),y=l({},s,Object.fromEntries(Object.entries(y||{}).filter(e=>x.has(e[0]))))}else _=l({},t,_),m=l({},i,m),y=l({},s,y);return l({[iU]:Object.keys(oq(_)),[iH]:_||{},[iG]:m||{},[iW]:y||{},[iQ]:!0===e.minimalFlagCalledEvents},p?{[iK]:p}:{},v?{[se]:v}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(s)if(!1===(null==i?void 0:i.persist)){var r=!z(this.ao.kv.get(iH));this.dv=s,r||this.Ot(s)}else this.rv(),this.pv(s,e,!(null==i||!i.partialResponse)),this.Ot(s);else t&&this.vv();t||(this.Ud=!1),this.sv(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.Tv(e)}
vendor: 9,394 bytes, line 1
1Tv(e){if(this.ao){if(!1===e)return this.Dt([iX,iJ]),this.sv(),void oN.info("All overrides cleared");if(D(e))return this.Ot({[iX]:oz(e)}),this.sv(),void oN.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.Od=!!(null!=(t=e.suppressWarning)&&t);var t,i={},s=e.flags,r=e.payloads;return s&&(i[iX]=D(s)?oz(s):s),r&&(i[iJ]=r),Object.keys(i).length&&this.Ot(i),!1===s&&!1===r?this.Dt([iX,iJ]):!1===s?this.Dt(iX):!1===r&&this.Dt(iJ),this.sv(),!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.Ot({[iX]:e}),this.sv(),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.Nd){var t=this.Mv(),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.hv("$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 u=l({},this.getFlagVariants(),{[e]:t});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[iU]:[e],[iH]:[e],[iZ]:Object.keys(a)}),this.Ot({[iU]:Object.keys(oq(u)),[iH]:u,[iZ]:l({},this.hv("$stored_person_properties")||{},a)}),this.sv();try{null==(s=this.ao)||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.hv(iV);!s||t?this.Iv(e,i):e(s)}Iv(e,t){var i=this;return h(function*(){var s=i.ao;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.Ot({[iV]: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)}}})()}Mv(){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),{})}}sv(e){this.nv();var t=this.Mv(),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.Ev(e,t)}Ev(e,t){void 0===t&&(t=!0);var i=this.hv("$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.Ot({[iZ]:l({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=l({},this.hv("$stored_person_properties")||{});e.forEach(e=>{delete i[e]}),this.Ot({[iZ]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.Dt(iZ),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.hv("$stored_group_properties")||{},s=l({},i);for(var r of Object.keys(e))s[r]=l({},i[r],e[r]);this.Ot({[iY]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.hv("$stored_group_properties")||{};this.Ot({[iY]:l({},t,{[e]:{}})})}else this.Dt(iY)}reset(){this.jd++,this.Hd=!1,this.$d={},this.Dd={},this.dv=void 0,this.Nd=!1,this.Bd=!1,this.zd=!1,this.$anon_distinct_id=void 0,this.uv(),this.Od=!1,this.Wd=0}}},o8=l({productTours:class{get gl(){return this._instance.persistence}constructor(e){this.zc=null,this.Uc=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,s=e.config;if("productTours"in s){if(this.gl&&this.gl.register({[iA]:!!s.productTours}),!oy(this._instance))return!this.zc&&V(null==(t=this.gl)?void 0:t.props.ph_product_tours)||om.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.zc)||i.stop(),this.zc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.zc&&oy(this._instance)&&this.Ro(()=>this.Wc())}Ro(e){var t,i;null!=(t=k.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=k.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?om.error("Could not load product tours script",t):e()})}Wc(){var e;!this.zc&&null!=(e=k.__PosthogExtensions__)&&e.generateProductTours&&(this.zc=k.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!D(this.Uc)||t){var i=this.gl;if(i){var s=i.props[i8];if(D(s)&&!t)return this.Uc=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(oy(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||om.warn(r):om.error(r),void e([],{isLoaded:!1,error:r})}var n=D(t.json.product_tours)?t.json.product_tours:[];this.Uc=n,i&&i.register({[i8]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Uc,{isLoaded:!0})}getActiveProductTours(e){V(this.zc)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.zc.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.zc)||t.showTourById(e)}previewTour(e){this.zc?this.zc.previewTour(e):this.Ro(()=>{var t;this.Wc(),null==(t=this.zc)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.zc)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.zc)||e.nextStep()}previousStep(){var e;null==(e=this.zc)||e.previousStep()}clearCache(){var e;this.Uc=null,null==(e=this.gl)||e.unregister(i8)}resetTour(e){var t;null==(t=this.zc)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.zc)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.zc)||t.cancelPendingTour(e)}}},o6),o4=l({surveys:class extends oS{constructor(e){super(new oO(e),{get projectToken(){return e.config.token},kv:new oI(e)}),this._instance=e}wh(e,t){var i=t.query?n7(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=l({experiments:class e{get xn(){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.cf("retrieved web experiments from the server"),i.ff=new Map,t.forEach(t=>{if(t.feature_flag_key){i.ff&&(e.cf("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(s=i.ff)||s.set(t.feature_flag_key,t));var s,r=i._instance.getFeatureFlag(t.feature_flag_key);q(r)&&t.variants[r]&&i.pf(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var a=t.variants[n];e.gf(a,i._instance)&&i.pf(t.name,n,a.transforms)}})},t)},this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(t){if(this._is_bot())e.cf(oQ);else if(!this.xn.disable_web_experiments){if(V(this.ff))return this.ff=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.cf("applying feature flags",t),t.forEach(e=>{var t;if(this.ff&&null!=(t=this.ff)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.ff)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.pf(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.cf("previewing web experiments "+i+" && "+s),this.getWebExperiments(e=>{this.mf(parseInt(i),s,e)},!1,!0))}}loadIfEnabled(){this.xn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.xn.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.xn.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}mf(t,i,s){var r=s.filter(e=>e.id===t);r&&r.length>0&&(e.cf("Previewing web experiment ["+r[0].name+"] with variant ["+i+"]"),this.pf(r[0].name,i,r[0].variants[i].transforms))}static gf(t,i){return!V(t.conditions)&&e.yf(t,i)&&e.bf(t)}static yf(t,i){if(V(t.conditions)||V(null==(r=t.conditions)?void 0:r.url))return!0;var s=e.getWindowLocation();if(s){var r,n,a,o,l=s9(i,s.href);return null==(n=t.conditions)||!n.url||oX[null!=(a=null==(o=t.conditions)?void 0:o.urlMatchType)?a:"icontains"](t.conditions.url,l)}return!1}
1static getWindowLocation(){return null==c?void 0:c.location}static bf(e){if(V(e.conditions)||V(null==(i=e.conditions)?void 0:i.utm))return!0;var t=r6();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 cf(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];ih.info("[WebExperiments] "+e,i)}pf(t,i,s){this._is_bot()?e.cf(oQ):"control"!==i?s.forEach(s=>{var r;s.selector&&(e.cf("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.cf("Control variants leave the page unmodified.")}_is_bot(){return p&&this._instance?ay(p,this.xn.custom_blocked_useragents):void 0}}},o6),o7=l({},o6,{sessionRecording:class{get xn(){return this._instance.config}get gl(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Rv)||!e.isStarted)}get status(){var e,t;return"awaiting_config"===this.Av||"missing_config"===this.Av?this.Av:null!=(e=null==(t=this.Rv)?void 0:t.status)?e:this.Av}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.Av=op,this.Pv=void 0,this.Fv=!1,this.Ke=(()=>{if(null==v||!v.visibilityState||"visible"===v.visibilityState)return!0;var e,t=null==c||null==(e=c.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.ar=()=>{var e;"visible"===(null==v?void 0:v.visibilityState)&&(this.Ke=!0,null==(e=this.Rv)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw of.error("started without valid sessionManager"),Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.xn.cookieless_mode)throw Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=v&&v.addEventListener&&sA(v,"visibilitychange",this.ar)}initialize(){this.startIfEnabledOrStop()}dispose(e){var t=(void 0===e?{}:e).discardBufferedEvents;this.Fv=!0,null==v||null==v.removeEventListener||v.removeEventListener("visibilitychange",this.ar),void 0!==t&&t?this.Ov(!0):this.stopRecording()}get $v(){var e,t=!(null==(e=this._instance.get_property(iM))||!e.enabled),i=!this.xn.disable_session_recording,s=this.xn.disable_session_recording||this._instance.consent.isOptedOut();return c&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!(this.Fv||this.$v&&null!=(t=this.Rv)&&t.isStarted)){var i=!z(Object.assign)&&!z(Array.from);this.$v&&i?(this.Dv(e),of.info("starting")):(this.Av=op,this.stopRecording())}}Dv(e){var t,i;if(this.$v)if("awaiting_config"!==this.Av&&"missing_config"!==this.Av&&(this.Av=ov),null!=k&&null!=(t=k.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=k.__PosthogExtensions__)&&i.initSessionRecording)this.Lv(e);else{var s,r=this._instance.sessionManager;null==(s=k.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Nv,t=>{if(!this.Fv&&this.$v&&this._instance.sessionManager===r)return t?(this._instance.register_for_session({[sd]:!0}),of.error("could not load recorder",t)):void this.Lv(e);this.Av=op})}}stopRecording(){var e,t;null==(e=this.Pv)||e.call(this),this.Pv=void 0,null==(t=this.Rv)||t.stop()}Ov(e){var t,i;void 0===e&&(e=!1),null==(t=this.Pv)||t.call(this),this.Pv=void 0,null==(i=this.Rv)||i.discard({discardProducerEvents:e})}qv(){var e,t;null==(e=this.gl)||e.unregister(iq),null==(t=this.gl)||t.unregister(iL)}jv(e,t){if(V(e))return null;var i=W(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(of.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Bv(e){if(this.gl){var t,i,s=this.gl,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.jv(null==(t=this.xn.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.jv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;V(a)&&this.qv();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[iM]:l({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:l({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:z(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.Pv)||t.call(this),this.Pv=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.Bv(t),void this.Ov()):(this.Bv(t),void this.startIfEnabledOrStop()):("awaiting_config"===this.Av&&(this.Av="missing_config",of.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.Rv)&&i.log?this.Rv.log(e,t):of.warn("log called before recorder was ready")}get Nv(){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"}Hv(){var e,t=this._instance.get_property(iM);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return of.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}return!V(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}Lv(e){var t,i,s,r;if(!this.Fv&&this.$v&&this._instance.sessionManager){if(null==(t=k.__PosthogExtensions__)||!t.initSessionRecording)return of.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[sd]:!0});if(this.Rv||(this.Rv=null==(r=k.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.Ke),this.Rv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Hv()){if("missing_config"===this.Av||"awaiting_config"===this.Av)return;return this.Av="awaiting_config",of.info("persisted remote config is stale, requesting fresh config before starting"),void new nP(this._instance).load()}this.Av=ov,null==(i=(s=this.Rv).setDocumentWasEverVisible)||i.call(s,this.Ke),this.Rv.start(e)}else this.Av=op}onRRwebEmit(e){var t;null==(t=this.Rv)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Rv||null==(e=this.gl)||e.register({[iN]:!0}),null==(t=this.Rv)||t.overrideLinkedFlag()}overrideSampling(){var e,t;this.Rv||null==(e=this.gl)||e.register({[iD]:!0}),null==(t=this.Rv)||t.overrideSampling()}overrideTrigger(e){var t,i;this.Rv||null==(t=this.gl)||t.register({["url"===e?ij:iB]:!0}),null==(i=this.Rv)||i.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Rv)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Rv)||!i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e;null==(e=this.Rv)||null==e.flushBeforeIdentityReset||e.flushBeforeIdentityReset()}}},{autocapture:class extends oi{constructor(e){super(new os(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.zv=this.Uv()}initialize(){this.startIfEnabled()}get isEnabled(){var e=this.Wv();return!!(e.path||e.search||this.Vv(e))}startIfEnabled(){this.isEnabled&&(ih.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.zv=this.Uv(),this.startIfEnabled()}stop(){this.Gv&&this.Gv(),this.Gv=void 0,this.Zv&&this.Zv(),this.Zv=void 0,ih.info("History API monitoring stopped")}monitorHistoryChanges(){c&&c.history&&(this.Jv("pushState"),this.Jv("replaceState"),this.Qv(),this.Vv()&&this.Kv())}Jv(e){var t;if(c&&(null==(t=c.history[e])||!t.__posthog_wrapped__)){var i=this;oo(c.history,e,t=>function(s,r,n){t.call(this,s,r,n),i.Xv(e)})}}Uv(){var e=null==c?void 0:c.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Wv(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:j(e)?e:{}}Vv(e){return void 0===e&&(e=this.Wv()),!!e.hash&&!this._instance.config.disable_capture_url_hashes}Yv(e){var t=this.Wv(),i=this.zv;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.Vv(t)&&e.hash!==i.hash))}Xv(e){try{var t=this.Uv();if(!t)return;this.Yv(t)&&this._instance.capture(sy,{navigation_type:e}),this.zv=t}catch(t){ih.error("Error capturing "+e+" pageview",t)}}Qv(){if(!this.Gv){var e=()=>{this.Xv("popstate")};sA(c,"popstate",e),this.Gv=()=>{c&&c.removeEventListener("popstate",e)}}}Kv(){if(!this.Zv){var e=()=>{this.Xv("hashchange")};sA(c,"hashchange",e),this.Zv=()=>{c&&c.removeEventListener("hashchange",e)}}}},heatmaps:class{get xn(){return this.instance.config}constructor(e){var t;this.tc=!1,this.ho=!1,this.ec=null,this.instance=e,this.tc=!(null==(t=this.instance.persistence)||!t.props[iP]),this.rageclicks=new a9(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return j(this.xn.capture_heatmaps)&&this.xn.capture_heatmaps.flush_interval_milliseconds&&(e=this.xn.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return V(this.xn.capture_heatmaps)?V(this.xn.enable_heatmaps)?this.tc:this.xn.enable_heatmaps:!1!==this.xn.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.ho||(og.info("starting..."),this.rc(),this.ar());else{var e;clearInterval(null!=(e=this.ec)?e:void 0),this.nc(),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({[iP]:i}),this.tc=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.Rt;return this.Rt=void 0,e}sc(e){o_(e.originalEvent)&&this.Sn(e.originalEvent,"deadclick")}ar(){this.ec&&clearInterval(this.ec),this.ec="visible"===(null==v?void 0:v.visibilityState)?setInterval(this.ol.bind(this),this.flushIntervalMilliseconds):null}rc(){c&&v&&(this.oc=this.ol.bind(this),sA(c,sm,this.oc),this.ac=e=>this.Sn(e||(null==c?void 0:c.event)),sA(v,"click",this.ac,{capture:!0}),this.lc=e=>this.uc(e||(null==c?void 0:c.event)),sA(v,"mousemove",this.lc,{capture:!0}),this.hc=new rD(this.instance,rM,this.sc.bind(this)),this.hc.startIfEnabledOrStop(),this.dc=this.ar.bind(this),sA(v,s_,this.dc),this.ho=!0)}nc(){var e;c&&v&&(this.oc&&c.removeEventListener(sm,this.oc),this.ac&&v.removeEventListener("click",this.ac,{capture:!0}),this.lc&&v.removeEventListener("mousemove",this.lc,{capture:!0}),this.dc&&v.removeEventListener(s_,this.dc),clearTimeout(this.vc),null==(e=this.hc)||e.stop(),this.ho=!1)}cc(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&&re(s)&&!rt(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:c)?void 0:r.getComputedStyle(s).position}catch(e){break}if(I(t,o))return!0;s=rp(s)}return!1}(ru(e),["fixed","sticky"],r);return{x:e.clientX+(n?0:s),y:e.clientY+(n?0:i),target_fixed:n,type:t}}Sn(e,t){var i;if(void 0===t&&(t="click"),!s7(e.target)&&o_(e)){var s=this.cc(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rb(ru(e),this.instance.config.rageclick)&&this.Hs(l({}
vendor: 5,127 bytes, line 1
1,s,{type:"rageclick"})),this.Hs(s)}}uc(e){!s7(e.target)&&o_(e)&&(clearTimeout(this.vc),this.vc=setTimeout(()=>{this.Hs(this.cc(e,"mousemove"))},500))}Hs(e){if(c){var t=this.xn.disable_capture_url_hashes?tc(c.location.href):c.location.href,i=this.xn.custom_personal_data_properties,s=rJ(t,this.xn.mask_personal_data_properties?[...r1,...i||[]]:[],r3);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(e)}}ol(){this.Rt&&!B(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rD,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.tc=!1,this.ho=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.fc=()=>{clearTimeout(this.gc),this.gc=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",l({$current_url:this.Rt.url},this.Rt.metrics.reduce((e,t)=>l({},e,{["$web_vitals_"+t.name+"_event"]:l({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.mc=e=>{var t;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},V(null==e?void 0:e.name)||V(null==e?void 0:e.value))ou.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.yc(i);if(!z(s)){var r=W(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.bc||this.bc>e.value){this.Rt.navigationKey!==r&&(this.fc(),this.gc=setTimeout(this.fc,this.flushToCaptureTimeoutMs)),z(this.Rt.navigationKey)&&(this.Rt.navigationKey=r,this.Rt.url=s),this.Rt.firstMetricTimestamp=z(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=l({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});if(delete a.entries,j(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){var o={};for(var u of od){var h="url"===u&&"string"==typeof e.attribution[u]?this.yc(e.attribution[u]):e.attribution[u];z(h)||(o[u]=h)}a.attribution=o}else delete a.attribution;z(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.Rt.metrics.push(a),this.Rt.metrics.length===this.allowedMetrics.length&&this.fc()}else ou.error("Ignoring metric with value >= "+this.bc,e)}}},this._c=()=>{if(!this.ho){var e,t,i,s,r=!1,n=k.__PosthogExtensions__,a=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.wc])||("web-vitals"===this.wc&&z(a)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(!z(o)){var u=o.withoutAttribution,h=this.attributionMetrics;r=!z(u),e=h.indexOf("LCP")>-1?o.onLCP:(null==u?void 0:u.onLCP)||o.onLCP,t=h.indexOf("CLS")>-1?o.onCLS:(null==u?void 0:u.onCLS)||o.onCLS,i=h.indexOf("FCP")>-1?o.onFCP:(null==u?void 0:u.onFCP)||o.onFCP,s=h.indexOf("INP")>-1?o.onINP:(null==u?void 0:u.onINP)||o.onINP}if(e&&t&&i&&s){var c={reportSoftNavs:this.useSoftNavs},d=r&&this.attributionMetrics.indexOf("INP")>-1?l({},c,{includeProcessedEventEntries:!1}):c;this.allowedMetrics.indexOf("LCP")>-1&&e(this.mc.bind(this),c),this.allowedMetrics.indexOf("CLS")>-1&&t(this.mc.bind(this),c),this.allowedMetrics.indexOf("FCP")>-1&&i(this.mc.bind(this),c),this.allowedMetrics.indexOf("INP")>-1&&s(this.mc.bind(this),d),this.ho=!0}else ou.error("web vitals callbacks not loaded - not starting")}},this.tc=!(null==(t=this._instance.persistence)||!t.props[iI]),this.startIfEnabled()}get kc(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=j(this.kc)?null==(e=this.kc)?void 0:e.web_vitals_allowed_metrics:void 0;return V(i)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||oh:i}get flushToCaptureTimeoutMs(){return(j(this.kc)?this.kc.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var e=j(this.kc)?this.kc.web_vitals_attribution:void 0;return K(e)?e?oh:[]:D(e)?e:oc}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var e;return null!=(e=j(this.kc)?this.kc.__preview_web_vitals_soft_navs:void 0)&&e}get bc(){var e=j(this.kc)&&W(this.kc.__web_vitals_max_value)?this.kc.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==f?void 0:f.protocol;if("http:"!==e&&"https:"!==e)return ou.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=j(this.kc)?this.kc.web_vitals:K(this.kc)?this.kc:void 0;return K(t)?t:this.tc}startIfEnabled(){this.isEnabled&&!this.ho&&(ou.info("enabled, starting..."),this.Ro(this._c))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=j(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=j(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[iI]:i}),this._instance.persistence.register({[iT]:s})),this.tc=i,this.startIfEnabled()}}}get wc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}
1Ro(e){var t=k.__PosthogExtensions__,i=this.wc,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&z(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?ou.error("failed to load script",t):e()})}yc(e){var t=e||(null==c?void 0:c.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tc(t):t,s=this._instance.config.custom_personal_data_properties;return rJ(i,this._instance.config.mask_personal_data_properties?[...r1,...s||[]]:[],r3)}ou.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this._c=()=>{var e;if(c&&this.isEnabled&&null!=(e=k.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=k.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=k.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=k.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Sc&&this.xn.capture_unhandled_errors&&(this.Sc=t(this.captureException.bind(this))),!this.xc&&this.xn.capture_unhandled_rejections&&(this.xc=i(this.captureException.bind(this))),!this.Cc&&this.xn.capture_console_errors&&(this.Cc=s(this.captureException.bind(this)))}catch(e){or.error("failed to start",e),this.Tc()}}},this._instance=e,this.Mc=!(null==(t=this._instance.persistence)||!t.props[i$]),this.wt=new eo(l({},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:or})),this.xn=this.Ic(),this.startIfEnabledOrStop()}Ic(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return j(e)?t=l({},t,e):(z(e)?this.Mc:e)&&(t=l({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.xn.capture_console_errors||this.xn.capture_unhandled_errors||this.xn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(or.info("enabled"),this.Tc(),this.Ro(this._c)):this.Tc()}Ro(e){var t,i;null!=(t=k.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=k.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return or.error("failed to load script",t);e()})}Tc(){var e,t,i;null==(e=this.Sc)||e.call(this),this.Sc=void 0,null==(t=this.xc)||t.call(this),this.xc=void 0,null==(i=this.Cc)||i.call(this),this.Cc=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Mc=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[i$]:this.Mc}),this.xn=this.Ic(),this.startIfEnabledOrStop())}}onConfigChange(){this.xn=this.Ic()}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 or.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.Ec=[],this.Rc=new tf([new tC,new tj,new tO,new tI,new tD,new tL,new tR,new tN],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=Math.min(n.length,s+1e3),o=[],u=s;a>u;u++){var h=n[u];if(1024>=h.length){var c=tS.test(h)?h.replace(tS,"$1"):h;if(!c.match(/\S*Error: /)){for(var d of i){var p=d(c,e);if(p){r.push(p);var v=function(e){for(var t=1;10>=t;t++){var i=e.length-2*t;if(0>i)break;for(var s=!0,r=0;t>r;r++)if(!tP(e[i+r],e[i+t+r])){s=!1;break}if(s){for(var n=0;t>n;n++)e[i+n]=e[i+t+n];return e.length=i+t,{start:i,length:t}}}}(r);if(v){for(var f=o.length-1;f>=0;f--){var g=o[f];if(v.start>=g.start+g.length)break;o.pop()}o.push(v)}break}}if(function(e,t){var i=t[0],s=e.length-(i?t$(e,i):0);for(var r of t)s-=tF(e,r);return s}(r,o)>=50)break}}}var _=[...o].sort((e,t)=>
1t.start-e.start),m=_[_.length-1];if(m){var y=t$(r,m);for(var b of(r.splice(m.start-y,y),_))b.start-=y}for(var w of _)!function(e,t){var i=t.start+t.length,s=tF(e,t);s&&e.splice(i+s===e.length?i:t.start,s)}(r,w);return o.some(e=>0===e.start&&r.length===e.length)&&function(e){for(var t=e.map(e=>e.function+"|"+e.filename+"|"+e.lineno+"|"+e.colno+"|"+e.module),i=0,s=1;t.length>s;s++)(function(e,t,i){for(var s=0;e.length>s;s++){var r=e[(t+s)%e.length],n=e[(i+s)%e.length];if(r!==n)return n>r}return!1})(t,s,i)&&(i=s);e.push(...e.splice(0,i))}(r),function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>l({},e,{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(r)}}("web:javascript",tw,tE)),this._instance=e,this.Ec=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))?t:[],this.Ac=tU(this.Pc()),this.Fc=new tV(this.Ac)}onConfigChange(){this.Ac=tU(this.Pc()),this.Fc.setConfig(this.Ac)}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.Ec=n,this._instance.persistence&&this._instance.persistence.register({[iF]:this.Ec,[iC]:a})}}}get Oc(){var e,t,i=!!this._instance.get_property(iC);return null!=(e=null!=(t=this._instance.config.error_tracking.captureExtensionExceptions)?t:i)&&e}buildProperties(e,t){return this.Rc.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Ac.enabled)try{if(!q(e)||0===e.trim().length)return void oU.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)=>(tq.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.$c(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&oU.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Fc.add(l({[tB]:e,[tz]:(new Date).toISOString()},s))}catch(e){oU.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){var t;try{var i=e.$exception_list;if(this.Dc(i)){if(this.Lc(i))return this.Nc("Exception dropped: matched a suppression rule"),void oU.info("Skipping exception capture because a suppression rule matched");if(!this.Oc&&this.qc(i))return this.Nc("Exception dropped: thrown by a browser extension"),void oU.info("Skipping exception capture because it was thrown by an extension");if(!this.Oc&&this.jc(i))return this.Nc("Exception dropped: thrown by an injected browser script"),void oU.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Bc(i))return this.Nc("Exception dropped: thrown by the PostHog SDK"),void oU.info("Skipping exception capture because it was thrown by the PostHog SDK")}var s=this.Ac.enabled&&V(e.$exception_steps)?this.Hc(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",Gu:!0});return n&&this.Fc.clear(),n}catch(e){return oH(e)||oU.error("Failed to capture exception event. Dropping this exception.",e),void this.Fc.clear()}}catch(e){return void(oH(e)||oU.error("Failed to process exception event. Ignoring this exception.",e))}}Hc(e){try{var t=this.Fc.getAttachable();return 0===t.length?e:l({},e,{$exception_steps:t})}catch(t){return oU.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Nc(e){this.Ac.enabled&&this.Fc.add({[tB]:e,[tz]:(new Date).toISOString()})}$c(e){return j(e)?l({},e):{}}Pc(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}Lc(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return q(i)&&i.length>0&&e.$exception_types.push(i),q(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.Ec.some(e=>{var i=e.values.map(e=>{var i=aE[e.operator],s=t[e.key];if(!i||!s)return!1;var r=D(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 oU.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}qc(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=>
1t.startsWith(e))});return 0!==i.length&&(!i.every(e=>{var t=e.filename;return!!t&&t.startsWith(oV)})||e.some(e=>{var t=e.value;return"NoResponse"===e.type||q(t)&&oW.some(e=>{var i=e.value;return e.exact?t===i:t.includes(i)})})&&!t.some(e=>{var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(oV))}))}jc(e){return e.some(e=>{var t=e.value;return q(t)&&oK.some(e=>t.includes(e))})}Bc(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}Dc(e){return!V(e)&&D(e)}}},o8,{siteApps:class{constructor(e){this._instance=e,this.Vc=0,this.Gc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Zc(e,t){if(t){var i=this.globalsForEvent(t);this.Gc.push(i),this.Gc.length>1e3&&(this.Gc=this.Gc.slice(10))}}get siteAppLoaders(){var e;return null==(e=k._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Zc.bind(this));this.Jc=()=>{e(),this.Gc=[],this.Jc=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,u,h,c={},d=this._instance.get_property("$groups")||[];for(var p of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var v=p[0];c[v]={id:d[v],type:v,properties:p[1]}}var f=e.$set_once,g=e.$set;return{event:l({},o(e,a),{properties:l({},e.properties,g?{$set:l({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},g)}:{},f?{$set_once:l({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},f)}:{}),elements_chain:null!=(n=null==(u=e.properties)?void 0:u.$elements_chain)?n:"",distinct_id:null==(h=e.properties)?void 0:h.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}Qc(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)||(ob.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)||(ob.error("prepare_external_dependency_script returned null"),null):e}Kc(){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==v?void 0:v.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.Vc++,this.Xc)return this.Yc();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})}},f=e=>{if(d.has(e))return e;var t=c.Qc(e);return t&&d.add(t),t},g=e=>e.map(e=>"string"==typeof e?e:f(e)).filter(e=>!U(e));return p(u,"appendChild",e=>function(t){var i=f(t);return i?e.call(this,i):t}),p(u,"insertBefore",e=>function(t,i){var s=f(t);return s?e.call(this,s,i):t}),p(u,"replaceChild",e=>function(t,i){var s=f(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=>{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,g(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,g(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,g(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,g(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=g(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=f(i);return s?e.call(this,t,s):null}),this.Xc=()=>
vendor: 11,724 bytes, line 1
1{h.forEach(e=>e()),this.Xc=void 0},this.Yc()}Yc(){var e=!1;return()=>{var t;e||(e=!0,this.Vc--,0===this.Vc&&(null==(t=this.Xc)||t.call(this)))}}tf(e,t){void 0===t&&(t=!0);var i=this.Kc();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.Gc.length&&(ob.info("Processing "+this.Gc.length+" events for site app with id "+e.id),this.Gc.forEach(e=>this.tf(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Jc)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,ob.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.tf(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){ob.error(ow+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){ob.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ef(){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)}if(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.tf(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){ob.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.ef(),void this._instance.on("eventCaptured",e=>this.if(e))):void ob.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Jc)||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;k["__$$ph_site_app_"+t]=r._instance,null==(e=k.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,e=>{if(e)return ob.error(ow+t,e)})}();else ob.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},o4,{tracingHeaders:class{constructor(e){this._instance=e,this.rf=void 0,this.nf=void 0,this.sf=void 0,this._c=()=>{var e,t,i=this.af();i?(z(this.rf)&&(this.rf=null==(e=k.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),z(this.nf)&&(this.nf=null==(t=k.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Tc()}}initialize(){this.startIfEnabledOrStop()}Ro(e){var t,i;null!=(t=k.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=k.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return ol.error("failed to load script",t);e()})}lf(){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}af(){var e=this.lf();return D(e)?(D(this.sf)?this.sf.splice(0,this.sf.length,...e):this.sf=[...e],e.length>0?this.sf:void 0):(D(this.sf)&&this.sf.splice(0),this.sf=e||void 0,this.sf)}Tc(){var e,t;null==(e=this.rf)||e.call(this),null==(t=this.nf)||t.call(this),this.rf=void 0,this.nf=void 0}startIfEnabledOrStop(){this.af()?this.Ro(this._c):this.Tc()}}},{toolbar:class{constructor(e){this.instance=e}uf(e){k.ph_toolbar_state=e}hf(){var e;return null!=(e=k.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)||!c||!v)return!1;e=null!=e?e:c.location,i=null!=i?i:c.history;try{if(!t){try{c.localStorage.setItem("test","test"),c.localStorage.removeItem("test")}catch(e){return!1}t=null==c?void 0:c.localStorage}var s,r=oA||rZ(e.hash,"__posthog")||rZ(e.hash,"state"),n=r?s$(()=>JSON.parse(atob(decodeURIComponent(r))))||s$(()=>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(oR)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}df(e){var t=k.ph_load_toolbar||k.ph_load_editor;!V(t)&&N(t)?t(e,this.instance):oT.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==v||!v.getElementById("__POSTHOG_TOOLBAR__"));if(!c||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=l({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(c.localStorage.setItem(oR,JSON.stringify(l({},r,{source:void 0}))),2===this.hf())?this.df(r):0===this.hf()&&(this.uf(1),null==(t=k.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(oT.error("[Toolbar] Failed to load",e),this.uf(0)):(this.uf(2),this.df(r))}),sA(c,"turbolinks:load",()=>{this.uf(0),this.loadToolbar(r)})),!0}vf(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._f=void 0,this._conversationsManager=null,this.wf=!1,this.re=null,this.kf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.Sf=e.ok,e.ok)){var t=e.config.conversations;V(t)||(K(t)?this._f=t:(this._f=t.enabled,this.re=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._f=void 0,this.re=null,this.Sf=void 0,this.kf=!1}loadIfEnabled(){if(!(this._conversationsManager||this.wf||this._instance.config.disable_conversations||sR(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==k?void 0:k.__PosthogExtensions__;if(e&&!z(this._f)&&this._f)if(this.re&&this.re.token){this.wf=!0;try{var t=e.initConversations;if(t)return this.xf(t),void(this.wf=!1);var i=e.loadExternalDependency;if(!i)return void this.Cf(sp);i(this._instance,"conversations",t=>{t||!e.initConversations?this.Cf("Could not load conversations script",t):this.xf(e.initConversations),this.wf=!1})}catch(e){this.Cf("Error initializing conversations",e),this.wf=!1}}else oJ.error("Conversations enabled but missing token in remote config.")}}xf(e){if(this.re)try{this._conversationsManager=e(this.re,this._instance),this.kf=!1,oJ.info("Conversations loaded successfully")}catch(e){this.Cf("Error completing conversations initialization",e)}else oJ.error("Cannot complete initialization: remote config is null")}Cf(e,t){oJ.error(e,t),this._conversationsManager=null,this.wf=!1,this.kf=!0}show(){this._conversationsManager?this._conversationsManager.show():oJ.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._f&&!U(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.Sf?"remote_config_failed":z(this._f)?this.Sf?"disabled_in_project":"remote_config_pending":this._f?V(this.re)||!this.re.token?"missing_token":null!=k&&k.__PosthogExtensions__?this.wf?"initializing":this.kf?"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 h(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(oJ.warn(oZ),null)})()}getMessages(e,t){var i=this;return h(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oJ.warn(oZ),null)})()}markAsRead(e){var t=this;return h(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oJ.warn(oZ),null)})()}getTickets(e){var t=this;return h(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oJ.warn(oZ),null)})()}requestRestoreLink(e){var t=this;return h(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oJ.warn(oZ),null)})()}restoreFromToken(e){var t=this;return h(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oJ.warn(oZ),null)})()}restoreFromUrlToken(){var e=this;return h(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oJ.warn(oZ),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}ih(){var e;null==(e=this._conversationsManager)||e.setIdentity()}rh(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this._instance=e,this.name="logs",this.Tf=!1,this.Mf=!1,this.If=!1,this.A=ic("[logs]"),this.Ef=l({},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.Za=[],this.Rf=[],this.Wd=0,this.fo=!1,this.Af=[],this.Pf=[],this.Ff=!1,this.Of=!1,this.$f=()=>{var e,t;this.fo||(this.Wd=0,null==(e=this.Df)||e.onReconnect(),null==(t=this.Lf)||t.onReconnect())},this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Tf=!0),c&&sA(c,"online",this.$f)}Nf(e,t,i,s){var r,n=oY(null==(r=this._instance)||null==(r=r.config)?void 0:r.logs,i);return[new is(this.qf(e,t),n,this.Ef,()=>this.jf(),e=>e(),void 0,s),n]}Bf(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Df||this.Hf!==t){null==(i=this.Df)||i.reset(),this.Hf=t;var i,s=this.Nf(()=>this.Za,e=>{this.Za=e});this.Df=s[0],this.zf=s[1]}return this.Df}Uf(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Lf||this.Wf!==t){null==(i=this.Lf)||i.reset(),this.Wf=t;var i,s=this.Nf(()=>this.Rf,e=>{this.Rf=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},o1);this.Lf=s[0],this.Vf=s[1]}return this.Lf}setup(e){var t;if(!this.fo){this.ao=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this.Tf=!0),(this.Tf||this.Gf()&&this.Zf())&&this.Jf();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.fo?s.dispose():(this.yo=s,i||this.loadIfEnabled())}}dispose(){var e,t,i,s;this.fo||(this.fo=!0,this.Qf(),null==(e=this.yo)||e.dispose(),this.yo=void 0,this.ao=void 0,this.If=!1,null==c||c.removeEventListener("online",this.$f),null==(t=this.Kf)||t.call(this),this.Kf=void 0,null==(i=this.Df)||i.reset(),null==(s=this.Lf)||s.reset())}onRemoteConfig(e){var t,i;if(!this.fo){var s=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;V(s)?this.Xf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[iR]:!!s}),s?(this.Tf=!0,this.Mf||this.Jf(),this.loadIfEnabled()):this.Xf())}}reset(){var e,t,i,s;this.Qf(),null==(e=this.Df)||e.clearQueue(),this.Za=[],null==(t=this.Df)||t.reset(),null==(i=this.Lf)||i.clearQueue(),this.Rf=[],null==(s=this.Lf)||s.reset(),this.Wd=0}captureLog(e){this.fo||this.Bf().captureLog(e)}
1captureConsoleLog(e){this.fo||this.Uf().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.fo||this.Uf().captureLog(e,{context:t,occurredAtMs:i})}Zf(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[iR])}Gf(){var e,t;return null==(e=this._instance)||null==e.Ua||!e.Ua()||!(null==(t=k._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)}sh(){var e;this.Qf(),null==(e=this.Lf)||e.clearQueue(),this.Rf=[]}Xf(){this.Tf||this.Qf()}Jf(){var e,t=this;if(!this.Ff&&null!=k&&k.console){var i=oY(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})(k.console[e])}catch(e){return 0}if(!s)return 0;t.Pf.push(oo(k.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.Yf(e,n,i)}catch(e){}return r.apply(k.console,n)};return n.__rrweb_original__=s,n}))};for(var r of o0)s(r);this.Ff=!0,this.tp=setTimeout(()=>{this.Qf()},3e4)}}Yf(e,t,i){var s;if(this.Ff&&!this.Of&&0!==t.length)if(null!=(s=this._instance)&&s.is_capturing()){if(i>this.Af.length){this.Of=!0;try{this.Af.push({level:e,args:t,occurredAtMs:Date.now(),context:this.jf()})}finally{this.Of=!1}}}else this.Qf()}Qf(){if(this.Af=[],this.Ff){for(var e of(this.Ff=!1,this.tp&&(clearTimeout(this.tp),this.tp=void 0),this.Pf))e();this.Pf=[]}}ep(){var e=this.Af;return this.Qf(),e}get logger(){return this.rp||(this.rp={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.rp}flushLogs(e){e?this.np(e):(this.Df&&this.Df.flush().catch(e=>this.sp(e)),this.Lf&&this.Lf.flush().catch(e=>this.sp(e)))}sp(e){o5(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(!this.fo&&this.Tf&&!this.Mf&&!this.If){var e=null==k?void 0:k.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.Qf();var t=e.loadExternalDependency;if(!t)return this.A.error(sp),void this.Qf();this.If=!0;try{t(this._instance,"logs",t=>{if(this.If=!1,!this.fo&&this.Tf){var i=e.logs;if(t||null==i||!i.initializeLogs)this.A.error("Could not load logs script",t),this.Qf();else{var s,r,n=this.ep();this.Kf=i.initializeLogs(null!=(s=this.ao)?s:this._instance),this.Mf=!0,n.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!=(r=this.ao)?r:this._instance,n))}}})}catch(e){throw this.If=!1,e}}}qf(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===P.LogsQueue?e():void 0,setPersistedProperty(e,i){e===P.LogsQueue&&t(null!=i?i:[])},As:e=>this.As(e),getLibraryId:()=>S.LIB_NAME,getLibraryVersion:()=>S.LIB_VERSION}}As(e){return new Promise(t=>{if(rY(this.Wd,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.op(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.ap(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)})}})}})}ap(e){(0!==e||this._instance.__loaded)&&(this.Wd=r0(e,this.Wd,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.")))}np(e){this.Za.length>0&&this.lp(e,this.Za,this.zf,S.LIB_NAME,e=>{this.Za=e}),this.Rf.length>0&&this.lp(e,this.Rf,this.Vf,o1,e=>{this.Rf=e})}lp(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var a=ii(n,t9(i,S.LIB_NAME,S.LIB_VERSION),s,S.LIB_VERSION);this._instance._send_request({method:"POST",url:this.op(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}op(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}jf(){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,V(r)||(t.sessionStartTimestamp=r),V(n)||(t.lastActivityTimestamp=n)}if(null!=k&&null!=(e=k.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tc(k.location.href):k.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=ic("[metrics]")}initialize(){}Bf(){var e,t,i,s,r,n,a,o,l=null==(a=this._instance)||null==(a=a.config)?void 0:a.metrics;return this.Df&&this.Hf===l||(null==(o=this.Df)||o.reset(),this.Hf=l,this.Df=new il(this.qf(),{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.Df}count(e,t,i){void 0===t&&(t=1),this.Bf().count(e,t,i)}
1gauge(e,t,i){this.Bf().gauge(e,t,i)}histogram(e,t,i){this.Bf().histogram(e,t,i)}flush(e){if(!this.Df)return Promise.resolve();if(e){var t=this.Df.drainWindow();return t&&this.Gs(t,e),Promise.resolve()}return this.Df.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.Df)||e.reset()}qf(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Gs:e=>t.Gs(e),getLibraryId:()=>S.LIB_NAME,getLibraryVersion:()=>S.LIB_VERSION}}Gs(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(l({method:"POST",url:this.up(),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)})}}))})}up(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});a6.__defaultExtensionClasses=l({},o7);var le=(S.SDK_DIST_CHANNEL="npm",s=aH[aY]=new a6,function(){function e(){e.done||(e.done=!0,a0=!1,sE(aH,function(e){e._dom_loaded()}))}null!=v&&v.addEventListener?"complete"===v.readyState?e():sA(v,"DOMContentLoaded",e,{capture:!1}):c&&ih.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s);e.s(["default",0,le])}]);

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.