PageSourceSearch

https://www.myjobhunter.ai/_next/static/chunks/0wr3i_zl46icn.js?dpl=dpl_7QE3o1WeNRW2nyNLaetbZUfH3oj3

js myjobhunter.ai collected 2026-10-02 01:11:45 UTC 254,577 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="8a516e6e-0f70-eabe-58d1-f382f7408937")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,605164,604570,e=>{"use strict";var t,i,s,r,n="u">typeof window?window:void 0,a="u">typeof globalThis?globalThis:n,o=null==a?void 0:a.navigator,l=null==a?void 0:a.document,u=null==a?void 0:a.location,h=null==a?void 0:a.fetch,c=null!=a&&a.XMLHttpRequest&&"withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:void 0,d=null==a?void 0:a.AbortController,p=null==a?void 0:a.CompressionStream,v=null==o?void 0:o.userAgent;function g(){return!(!n||!1===n.navigator.onLine)}var f="u">typeof globalThis?globalThis:n;f&&"u"<typeof self&&(f.self=f),f&&"u"<typeof File&&(f.File=function(){});var _=null!=n?n:{},m={DEBUG:!1,LIB_VERSION:"0.5.0",LIB_NAME:"browser-common"};function y(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 b(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){y(n,s,r,a,o,"next",e)}function o(e){y(n,s,r,a,o,"throw",e)}a(void 0)})}}function w(){return(w=Object.assign.bind()).apply(null,arguments)}function x(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}var k=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function E(e){return"string"==typeof e||e}function S(e){return"string"==typeof e?e:void 0}var P,F,C,$,I=["$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"],T=((P={}).AnonymousId="anonymous_id",P.DistinctId="distinct_id",P.Props="props",P.EnablePersonProcessing="enable_person_processing",P.PersonMode="person_mode",P.FeatureFlagDetails="feature_flag_details",P.FeatureFlags="feature_flags",P.FeatureFlagPayloads="feature_flag_payloads",P.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",P.BootstrapFeatureFlags="bootstrap_feature_flags",P.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",P.OverrideFeatureFlags="override_feature_flags",P.Queue="queue",P.AiQueue="ai_queue",P.AiCaptureQueue="ai_capture_queue",P.LogsQueue="logs_queue",P.OptedOut="opted_out",P.SessionId="session_id",P.SessionStartTimestamp="session_start_timestamp",P.SessionLastTimestamp="session_timestamp",P.PersonProperties="person_properties",P.GroupProperties="group_properties",P.InstalledAppBuild="installed_app_build",P.InstalledAppVersion="installed_app_version",P.SessionReplay="session_replay",P.PushRegistered="push_registered",P.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",P.SurveyLastSeenDate="survey_last_seen_date",P.SurveysSeen="surveys_seen",P.Surveys="surveys",P.RemoteConfig="remote_config",P.FlagsEndpointWasHit="flags_endpoint_was_hit",P.DeviceId="device_id",P),R=((F={}).GZipJS="gzip-js",F.Base64="base64",F),M=["$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"],O=["token"],A="NativeGzipValidationError",q=e=>e.length>=2&&31===e[0]&&139===e[1],L=(e,t)=>e===R.GZipJS||t===R.GZipJS||"gzip"===t,D=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),j=e=>
2{var t=Error("Native gzip produced invalid output: "+e);throw t.name=A,t},N=(C=b(function*(e,t){18>e.size&&j("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));q(i)&&8===i[2]||j("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if($)return $;$=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;$[e]=t>>>0}return $})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&j("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&j("invalid-size")}),function(e,t){return C.apply(this,arguments)});function H(){return(H=b(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=b(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 N(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 B=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],z=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return B.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function U(e,t){return -1!==e.indexOf(t)}var V=function(e){return e.trim()},W=function(e){return e.replace(/^\$/,"")};function G(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 K=Object.prototype,J=K.hasOwnProperty,Y=K.toString,X=Array.isArray||function(e){return"[object Array]"===Y.call(e)},Q=e=>"function"==typeof e,Z=e=>e===Object(e)&&!X(e),ee=e=>{if(Z(e)){for(var t in e)if(J.call(e,t))return!1;return!0}return!1},et=e=>void 0===e,ei=e=>"[object String]"==Y.call(e),es=e=>ei(e)&&0===e.trim().length,er=e=>null===e,en=e=>et(e)||er(e),ea=e=>"[object Number]"==Y.call(e)&&e==e,eo=e=>ea(e)&&e>0,el=e=>"[object Boolean]"===Y.call(e),eu=e=>U(M,e),eh=e=>U(O,e);function ec(e){return null===e||"object"!=typeof e}function ed(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ep(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return eg(e,Error)}}function ev(e){return"u">typeof Event&&eg(e,Event)}function eg(e,t){try{return e instanceof t}catch(e){return!1}}var ef=[!0,"true",1,"1","yes"],e_=[!1,"false",0,"0","no"];function em(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),ea(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),em(r||i,t,i,s))}class ey{constructor(e){this.it={},this.rt=e.rt,this.nt=em(e.bucketSize,0,100,e.st),this.ot=em(e.refillRate,0,this.nt,e.
2st),this.ut=em(e.refillInterval,0,864e5,e.st)}ht(e,t){var i=Math.floor((t-e.lastAccess)/this.ut);i>0&&(e.tokens=Math.min(e.tokens+i*this.ot,this.nt),e.lastAccess=e.lastAccess+i*this.ut)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.it[s];return r?this.ht(r,i):this.it[s]=r={tokens:this.nt,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.rt)||t.call(this,e)),0===r.tokens)}stop(){this.it={}}}var eb="Mobile",ew="Android",ex="Tablet",ek=ew+" "+ex,eE="iPad",eS="Apple",eP=eS+" Watch",eF="Safari",eC="BlackBerry",e$="Samsung",eI=e$+"Browser",eT=e$+" Internet",eR="Chrome",eM=eR+" OS",eO=eR+" iOS",eA="Internet Explorer",eq=eA+" "+eb,eL="Opera",eD=eL+" Mini",ej="Edge",eN="Microsoft "+ej,eH="Firefox",eB=eH+" iOS",ez="Nintendo",eU="PlayStation",eV="Xbox",eW=ew+" "+eb,eG=eb+" "+eF,eK="Windows",eJ=eK+" Phone",eY="Nokia",eX="Ouya",eQ="Generic",eZ=eQ+" "+eb.toLowerCase(),e0=eQ+" "+ex.toLowerCase(),e1="Konqueror",e2="Oculus Browser",e3="Vivaldi",e5="Yandex",e6="Whale",e8="DuckDuckGo",e4="Pale Moon",e9="Waterfox",e7="Brave",te="Google Search App",tt="(\\d+(\\.\\d+)?)",ti=RegExp("Version/"+tt),ts=RegExp(eV,"i"),tr=RegExp(eU+" \\w+","i"),tn=RegExp(ez+" \\w+","i"),ta=RegExp(eC+"|PlayBook|BB10","i"),to={"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"},tl=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?e7:null)||(null!=s&&s.detectGoogleSearchApp&&U(e,"GSA/")?te:U(e," OPR/")&&U(e,"Mini")?eD:U(e," OPR/")?eL:ta.test(e)?eC:U(e,"IE"+eb)||U(e,"WPDesktop")?eq:U(e,"OculusBrowser")?e2:U(e,eI)?eT:U(e,ej)||U(e,"Edg/")?eN:U(e,e3+"/")?e3:U(e,"YaBrowser/")?e5:U(e,e6+"/")?e6:U(e,e8+"/")||U(e,"Ddg/")?e8:U(e,"FBIOS")?"Facebook "+eb:U(e,"UCWEB")||U(e,"UCBrowser")?"UC Browser":U(e,"CriOS")?eO:U(e,"CrMo")||U(e,eR)?eR:U(e,ew)&&U(e,eF)?eW:U(e,"FxiOS")?eB:U(e.toLowerCase(),e1.toLowerCase())?e1:U(e,e7+"/")?e7:(r=t)&&U(r,eS)||U(e,eF)&&!U(e,eR)&&!U(e,ew)?U(e,eb)?eG:eF:U(e,"PaleMoon/")?e4:U(e,e9+"/")?e9:U(e,eH)?eH:U(e,"MSIE")||U(e,"Trident/")?eA:U(e,"Gecko")?eH:"")},tu={[eq]:[RegExp("rv:"+tt)],[eN]:[RegExp(ej+"?\\/"+tt)],[eR]:[RegExp("("+eR+"|CrMo)\\/"+tt)],[eO]:[RegExp("CriOS\\/"+tt)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+tt)],[eF]:[ti],[eG]:[ti],[eL]:[RegExp("(Opera|OPR)\\/"+tt)],[eH]:[RegExp(eH+"\\/"+tt)],[eB]:[RegExp("FxiOS\\/"+tt)],[e1]:[RegExp("Konqueror[:/]?"+tt,"i")],[eC]:[RegExp(eC+" "+tt),ti],[eW]:[RegExp("android\\s"+tt,"i")],[eT]:[RegExp(eI+"\\/"+tt)],[e2]:[RegExp("OculusBrowser\\/"+tt)],[e3]:[RegExp(e3+"\\/"+tt)],[e5]:[RegExp("YaBrowser\\/"+tt)],[e6]:[RegExp(e6+"\\/"+tt)],[e7]:[RegExp(e7+"\\/"+tt)],[e8]:[RegExp("(DuckDuckGo|Ddg)\\/"+tt)],[e4]:[RegExp("PaleMoon\\/"+tt)],[e9]:[RegExp(e9+"\\/"+tt)],[te]:[RegExp("GSA\\/"+tt)],[eA]:[RegExp("(rv:|MSIE )"+tt)],Mozilla:[RegExp("rv:"+tt)]},th=function(e,t,i,s){var r=tu[tl(e,t,i,s)];if(et(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},tc=[[RegExp(eV+"; "+eV+" (.*?)[);]","i"),e=>[eV,e&&e[1]||""]],[RegExp(ez,"i"),[ez,""]],[RegExp(eU,"i"),[eU,""]],[ta,[eC,""]],[RegExp(eK,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eJ,""];if(new RegExp(eb).test(t)&&!/IEMobile\b/.test(t))return[eK+" "+eb,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=to[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eK,s]}return[eK,""]}],[/((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=et(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ew+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ew+")","i"),e=>e&&e[2]?[ew,[e[2],e[3],e[4]||"0"].join(".")]:[ew,""]],[/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/,[eM,""]],[/Linux|debian/i,["Linux",""]]],td=function(e){return tn.test(e)?ez:tr.test(e)?eU:ts.test(e)?eV:RegExp(eX,"i").test(e)?eX:RegExp("("+eJ+"|WPDesktop)","i").test(e)?eJ:/iPad/.test(e)?eE:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?eP:ta.test(e)?eC:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eY,"i").test(e)?eY:/(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(eb).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)?ew:ek:RegExp("(pda|"+eb+")","i").test(e)?eZ:RegExp(ex,"i").test(e)&&!RegExp(ex+" pc","i").test(e)?e0:""},tp=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tv(e,t){return"string"==typeof e&&tp.test(e)?e:t()}function tg(e){return e?e.split("#")[0]:e}function tf(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function t_(e,t,i){return tm.apply(this,arguments)}function tm(){return(tm=b(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=tf(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var ty={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}},tb=ty.info;function tw(e){var t=[];for(var i in e){var s=e[i];er(s)||et(s)||t.push({key:i,value:function e(t){if(el(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(X(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(s)})}return t}function tx(e,t,i){return w({},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})}function tk(e,t,i,s){return{resourceLogs:[{resource:{attributes:tw(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let tE=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.qe=t,this.st=i,this.dt=s,this.vt=r,this.ct=n,this.ft=a,this.yt=null,this.bt=0,this._t=0,this.wt=0,this.kt=0,this.xt=!1,this.St=t.maxBufferSize,this.Ct=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.Mt=t.flushIntervalMs,this.Tt=t.maxBatchRecordsPerPost,this.Et=t.rateCapWindowMs,this.It=t.maxLogsPerInterval}reset(){this.Pt(),this.yt=null,this.wt=0,this.kt=0,this.xt=!1,this.bt=0,this._t=0,this.Tt=this.qe.maxBatchRecordsPerPost}onReconnect(){this._t=0,this.Rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.At(e);if(null!==t)if(t.body){if(this.Ft()){var i,s,r,n,a,o,l,u,h={record:(i=this.dt(),r=(s=ty[t.level||"info"]||tb).text,n=s.number,a=String(Date.now())+"000000",o={},i.distinctId&&(o.posthogDistinctId=i.distinctId),i.sessionId&&(o.sessionId=i.sessionId),i.windowId&&(o["window.id"]=i.windowId),en(i.sessionStartTimestamp)||(o.sessionStartTimestamp=String(i.sessionStartTimestamp)),en(i.lastActivityTimestamp)||(o.lastActivityTimestamp=String(i.lastActivityTimestamp)),i.currentUrl&&(o["url.full"]=i.currentUrl),i.screenName&&(o["screen.name"]=i.screenName),i.appState&&(o["app.state"]=i.appState),i.activeFeatureFlags&&i.activeFeatureFlags.length>0&&(o.feature_flags=i.activeFeatureFlags),l=w({},o,t.attributes||{}),u={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:n,severityText:r,body:{stringValue:t.body},attributes:tw(l)},t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),et(t.trace_flags)||(u.flags=t.trace_flags),u)};this.vt(()=>this.Ot(h))}}else this.st.info("Log was rejected in beforeSend function")}}At(e){var t=this.qe.beforeSend;if(!t)return e;var i=X(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.st.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.st.error("Error in beforeSend function for log:",e),null}return s}Ft(){if(void 0===this.It)return!0;var e=Date.now(),t=e-this.wt;return this.Et>t&&t>=0||(this.wt=e,this.kt=0,this.xt=!1),this.It>this.kt?(this.kt++,!0):(this.xt||(this.st.warn("captureLog dropping logs: exceeded "+this.It+" logs per "+this.Et+"ms"),this.xt=!0),!1)}flush(){var e=this;return b(function*(){if(!e._instance.isDisabled)return e.yt||(e.yt=e.Lt().finally(()=>{e.yt=null})),e.yt})()}Lt(){var e=this;return b(function*(){e.Pt();var t=null!=(r=e._instance.getPersistedProperty(T.LogsQueue))?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){e.bt=0;var r,n,a,o=Math.min(t.length,e.Tt),l=t.slice(0,o),u=tk(l.map(e=>e.record),e.Dt(),null!=(n=e.ft)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),h=yield e._instance.$t(u);
2if("too-large"===h.kind&&l.length>1)e.Tt=Math.max(1,Math.floor(l.length/2)),e.st.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Tt);else if("retry-later"===h.kind||("too-large"===h.kind?e.st.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===h.kind&&e.qe.maxBatchRecordsPerPost>e.Tt&&(e.Tt=Math.min(e.qe.maxBatchRecordsPerPost,e.Tt+1)),yield e.Nt(l.length),t=null!=(a=e._instance.getPersistedProperty(T.LogsQueue))?a:[],s+=l.length,"fatal"===h.kind))throw h.error}})()}Nt(e){var t=this;return b(function*(){var i,s=Math.max(0,e-t.bt),r=null!=(i=t._instance.getPersistedProperty(T.LogsQueue))?i:[];t._instance.setPersistedProperty(T.LogsQueue,r.slice(s)),yield t.ct()})()}Dt(){return tx(this.qe,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(T.LogsQueue))?t:[];this.Ct>i.length||(i.shift(),this.bt++,this.st.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(T.LogsQueue,i),this.St>i.length?this.qt():this.Rt()}}qt(e){void 0===e&&(e=this.Mt),this.jt||(this.jt=tf(()=>{this.jt=void 0,this.Rt()},e))}Bt(){var e=Math.min(Math.max(0,this._t-1),6);return this.Mt*Math.pow(2,e)}Ht(){var e=this._instance.getPersistedProperty(T.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return b(function*(){t.Pt();var i=t.flush().catch(()=>{});void 0!==e?yield t_(i,e):yield i})()}flushWithTimeout(e){var t=this;return b(function*(){var i=t.flush();yield t_(i,e,()=>{i.catch(()=>{})})})()}Rt(){this.flush().then(()=>{this._t=0},e=>{this._t++,this.st.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Ht()&&this.qt(this.Bt())})}Pt(){this.jt&&(clearTimeout(this.jt),this.jt=void 0)}};var tS=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function tP(e){return String(e)+"000000"}function tF(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}let tC=class{constructor(e,t,i){this._instance=e,this.qe=t,this.st=i,this.Ut=new Map,this.yt=null,this.zt=!1,this.Wt=new Map,this.Vt=new Set,this.Zt=0}count(e,t,i){void 0===t&&(t=1),this.Gt({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.Gt({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.Gt({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.yt,s=(e=b(function*(){i&&(yield i.catch(()=>{})),yield t.Qt()}),function(){return e.apply(this,arguments)})().finally(()=>{this.yt===s&&(this.yt=null)});return this.yt=s,s}drainWindow(){if(0===this.Ut.size)return null;var e=this.Ut;return this.Ut=new Map,this.zt=!1,this.Wt=new Map,this.Vt=new Set,this.Jt(e)}reset(){this.Zt++,this.Pt(),this.Ut=new Map,this.yt=null,this.zt=!1,this.Wt=new Map,this.Vt=new Set}Gt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.At(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.st.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?w({},t.attributes):void 0,s=tF(t.type,t.name,t.unit,i)}catch(e){return void this.st.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,s,r=this.Ut.get(s);if(!r){if(!this.Kt())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Ut.set(s,r)}var n=this.Wt.get(t.name);void 0===n?this.Wt.set(t.name,t.type):n===t.type||this.Vt.has(t.name)||(this.Vt.add(t.name),this.st.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.Yt(r,t.value),this.qt()}else this.st.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.st.warn("Dropping metric with empty name")}}Kt(){return this.qe.maxSeriesPerFlush>this.Ut.size||(this.zt||(this.zt=!0,this.st.warn("Metric series cap reached ("+this.qe.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Yt(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(tS.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,tS)]+=1}}At(e){var t=this.qe.beforeSend;if(!t)return e;var i=X(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.st.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.st.error("Error in beforeSend function for metric:",e),null}return s}qt(){this.jt||(this.jt=tf(()=>{this.jt=void 0,this.flush().catch(e=>{this.st.error("Metrics flush failed:",e)})},this.qe.flushIntervalMs))}Pt(){this.jt&&(clearTimeout(this.jt),this.jt=void 0)}Qt(){var e=this;return b(function*(){if(0!==e.Ut.size){var t=e.Ut;e.Ut=new Map,e.zt=!1,e.Wt=new Map,e.Vt=new Set;var i=e.Zt,s=yield e._instance.Xt(e.Jt(t));if(i===e.Zt)switch(s.kind){case"ok":return;case"retry-later":return e.ti(t),void e.qt();case"too-large":return void e.st.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.st.error("Failed to send metrics batch:",s.error)}}})()}Jt(e){var t,i,s,r,n,a,o;return t=this.ei(e),n=this.qe,a=this._instance.getLibraryId(),o=this._instance.getLibraryVersion(),i=w({},n.resourceAttributes,{"service.name":n.serviceName||"unknown_service"},n.environment&&{"deployment.environment":n.environment},n.serviceVersion&&{"service.version":n.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":o}),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:tw(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}ei(e){var t=tP(Date.now()),i=new Map;for(var s of e.values()){var r,n=tF(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=w({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=tw(null!=(r=s.attributes)?r:{}),l=tP(s.windowStartMs);if("count"===s.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(u=s.total)?u:0};a.sum.dataPoints.push(h)}else if("gauge"===s.type){var c,d={attributes:o,timeUnixNano:t,asDouble:null!=(c=s.last)?c:0};a.gauge.dataPoints.push(d)}else s.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:tS})}return Array.from(i.values())}ti(e){var t,i;for(var s of e){var r=s[0],n=s[1],a=this.Ut.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.Kt()&&this.Ut.set(r,n)}}};class t${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 b(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&X(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.ski
2pFirstLines:0),t.chunkIdMap)),w({},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 b(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,w({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return sk&&i.length===sx||(sx=i.length,sk=i.reduce((i,s)=>{sw||(sw={});var r=sw[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[s];if(l&&u){i[l]=u,sw[s]=[l,u];break}}return i},{})),sk}}(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 w({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function tI(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))};return et(s)||(n.lineno=s),et(r)||(n.colno=r),n}var tT=(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]},tR=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tM=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tO=/\((\S*)(?::(\d+))(?::(\d+))\)/,tA=(e,t)=>{var i=tR.exec(e);if(i)return tI(t,i[1],"?",+i[2],+i[3]);var s=tM.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var r=tO.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=tT(s[1]||"?",s[2]);return tI(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tq=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tD=(e,t)=>{var i=tq.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tL.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=tT(n,r);return tI(t,r=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tj=/\(error: (.*)\)/;class tN{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=ei(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 ed(e,"DOMException")}isDOMError(e){return ed(e,"DOMError")}}class tH{match(e){return ep(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var 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}}class tB{match(e){return!!ed(e,"ErrorEvent")&&(null!=e.error||this.fe(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,s=t.apply(e.message);return w({},s,{stack:null!=(i=this.pe(e))?i:s.stack,synthetic:!0})}fe(e){return ei(e.message)&&e.message.length>0}pe(e){if(ei(e.filename)&&e.filename.length>0){var t,i,s=null!=(t=e.lineno)?t:0,r=null!=(i=e.colno)?i:0;return"Error\n    at "+e.filename+":"+s+":"+r}}}var tz=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tU{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(tz);return s&&(t=s[1],i=s[2]),[t,i]}}var tV=["fatal","error","warning","log","info","debug"];function tW(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(", ");
2if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class tG{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(ev(e))return e.constructor.name;var t="name"in e?e.name:void 0;return ei(t)&&!es(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: "+tW(e)}isSeverityLevel(e){return ei(e)&&!es(e)&&tV.indexOf(e)>=0}getStack(e){try{return ei(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ei(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(ep(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tK{match(e){return ev(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tW(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tJ{match(e){return ec(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}}}class tY{match(e){return ed(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ev(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 ec(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}}var tX="$message",tQ="$timestamp",tZ=new Set([tX,tQ]),t0={enabled:!0,max_bytes:32768};function t1(e){var t;return e?{enabled:null!=(t=e.enabled)?t:t0.enabled,max_bytes:function(e,t){if(!ea(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,t0.max_bytes)}:w({},t0)}class t2{constructor(e){this.ii=[],this.ri=0,this.qe=t1(e)}setConfig(e){this.qe=t1(e),this.ni()}add(e){var t=function(e){var t;try{t=G(e)}catch(e){return}try{var i=JSON.parse(t);if(!Z(i))return;var s=i[tX],r=i[tQ];if(!ei(s)||0===s.trim().length||!ei(r)&&!ea(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.qe.max_bytes||(this.ii.push({step:t.step,bytes:i}),this.ri+=i,this.ni())}}getAttachable(){return this.ii.map(e=>e.step)}clear(){this.ii=[],this.ri=0}size(){return this.ii.length}ni(){for(;this.ri>this.qe.max_bytes&&this.ii.length>0;){var e=this.ii.shift();e&&(this.ri-=e.bytes)}}}var t3=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={k(t){if(n&&(m.DEBUG||n.POSTHOG_DEBUG||i)&&!et(n.console)&&n.console){for(var s=("__rrweb_original__"in n.console[t])?n.console[t].__rrweb_original__:n.console[t],r=arguments.length,a=Array(r>1?r-1:0),o=1;r>o;o++)a[o-1]=arguments[o];s(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("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)=>t3(e+" "+t,i)};return s},t5=t3("[PostHog.js]"),t6=t5.createLogger,t8=t6("[ExternalScriptsLoader]"),t4=e=>{var t=null==l?void 0:l.querySelectorAll("script");
2if(t){for(var i=0;t.length>i;i++)if(t[i].src===e)return t[i]}},t9=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return t8.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=t4(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(!l)return i("document not found");if(t4(t))return t9(e,t,i);var s=l.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)l.head.appendChild(s);else{var r,n=l.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):l.body.appendChild(s)}};null!=l&&l.body?n():null==l||l.addEventListener("DOMContentLoaded",n)},t7={},ie=(e,t)=>{var i="/static/"+t+".js?v="+e.version;return"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),e.requestRouter.endpointFor("assets",i)};_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s=e.config.strict_script_versioning;if(s){var r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=t7[r];if("fallback"===s&&n){if(t4(n))return void t9(e,n,i);delete t7[r]}t9(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var a,o=ie(e,t);t7[r]=o;var l=t4(r);null==l||null==(a=l.parentNode)||a.removeChild(l),t9(e,o,i)}else i(void 0,n)}:i)}else t9(e,ie(e,t),i)}else{var a=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");t9(e,a,i)}},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);t9(e,s,i)},m.DEBUG=!1,m.LIB_VERSION="1.418.1",m.LIB_NAME="web";var it="$people_distinct_id",ii="distinct_id",is="$device_id",ir="$device_model",ia="__alias",io="__timers",il="$autocapture_disabled_server_side",iu="$heatmaps_enabled_server_side",ih="$exception_capture_enabled_server_side",ic="$error_tracking_suppression_rules",id="$error_tracking_capture_extension_exceptions",ip="$web_vitals_enabled_server_side",iv="$dead_clicks_enabled_server_side",ig="$product_tours_enabled_server_side",i_="$web_vitals_allowed_metrics",im="$session_recording_remote_config",iy="$replay_sample_rate",ib="$replay_override_sampling",iw="$replay_override_linked_flag",ix="$replay_override_url_trigger",ik="$replay_override_event_trigger",iE="$sesid",iS="$session_is_sampled",iP="$enabled_feature_flags",iF="$active_feature_flags",iC="$early_access_features",i$="$feature_flag_details",iI="$feature_flag_payloads",iT="$feature_flag_request_id",iR="$minimal_flag_called_events",iM="$override_feature_flags",iO="$override_feature_flag_payloads",iA="$stored_person_properties",iq="$stored_group_properties",iL="$groups",iD="$surveys",ij="$surveys_loaded_at",iN="$surveys_activated",iH="$surveys_activated_session",iB="$surveys_activated_timestamps",iz="ph_product_tours",iU="$flag_call_reported",iV="$flag_call_reported_session_id",iW="$feature_flag_errors",iG="$feature_flag_evaluated_at",iK="$user_state",iJ="$client_session_props",iY="$capture_rate_limit",iX="$initial_campaign_params",iQ="$initial_referrer_info",iZ="$initial_person_info",i0="$epp",i1="$posthog_cookieless",i2="$cookieless_mode",i3="$sdk_debug_extensions_init_method",i5="$sdk_debug_extensions_init_time_ms",i6="$sdk_debug_recording_script_not_loaded",i8="PostHog loadExternalDependency extension not found.",i4="on_reject",i9="always",i7="anonymous",se="identified",st="identified_only",si="visibilitychange",ss="beforeunload",sr="$pageview",sn="$pageleave",sa="$identify",so="$groupidentify";function sl(e,t){X(e)&&e.forEach(t)}function su(e,t){if(!en(e))if(X(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)J.call(e,i)&&t(e[i],i)}var sh=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 sc(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var sd=function(e){try{return e()}catch(e){return}},sp=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){t5.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t5.critical(e)}}},sv=function(e){var t={};return su(e,function(e,i){(ei(e)&&e.length>0||ea(e))&&(t[i]=e)}),t},sg=["herokuapp.com","vercel.app","netlify.app"];function sf(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 s_(e){return"ph_toolbar_internal"===e.name}var sm=e=>{if(l){try{for(var t=e+"=",i=l.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 ea(e)&&isFinite(e)&&Math.floor(e)===e});class sy{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");
2var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new sy(r)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new sy(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class sb{generate(){var e=this.generateOrAbort();if(!et(e))return e;this.S=0;var t=this.generateOrAbort();if(et(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>0x3ffffffffff&&(this.S++,this.C())}return sy.fromFieldsV7(this.S,Math.trunc(this.I/0x40000000),0x3fffffff&this.I,this.A.nextUint32())}C(){this.I=1024*this.A.nextUint32()+(1023&this.A.nextUint32())}constructor(){this.S=0,this.I=0,this.A=new sP}}var sw,sx,sk,sE,sS=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};n&&!et(n.crypto)&&crypto.getRandomValues&&(sS=e=>crypto.getRandomValues(e));class sP{nextUint32(){return this.R.length>this.O||(sS(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var sF=()=>sC().toString(),sC=()=>(sE||(sE=new sb)).generate(),s$="",sI=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sT={N:()=>!!l,j(e){t5.error("cookieStore error: "+e)},P:sm,H(e){var t;try{t=JSON.parse(sT.P(e))||{}}catch(e){}return t},F(e,t,i,s,r){if(!l)return!1;try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=l),s$)return s$;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sF();!s$&&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",s$=n)}return s$}(e);if(!i){var s,r=(s=e.match(sI))?s[0]:"";r!==i&&t5.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(l.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}r&&(a="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+o+a;return h.length>3686.4&&t5.warn("cookieStore warning: large cookie, len="+h.length),l.cookie=h,!0}catch(e){return!1}},q(e,t){if(null!=l&&l.cookie)try{sT.F(e,"",-1,t)}catch(e){return}}}
2,sR=null,sM={N(){if(!er(sR))return sR;var e=!0;if(et(n))e=!1;else try{var t="__mplssupport__";sM.F(t,"xyz"),'"xyz"'!==sM.P(t)&&(e=!1),sM.q(t)}catch(t){e=!1}return e||t5.error("localStorage unsupported; falling back to cookie store"),sR=e,e},j(e){t5.error("localStorage error: "+e)},P(e){try{return null==n?void 0:n.localStorage.getItem(e)}catch(e){sM.j(e)}return null},H(e){try{return JSON.parse(sM.P(e))||{}}catch(e){}return null},F(e,t){try{return null==n||n.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sM.j(e)}return!1},q(e){try{null==n||n.localStorage.removeItem(e)}catch(e){sM.j(e)}}},sO=[iA,iF,iP,i$,iI,iT,iG,iW,iU],sA=[is,ii,iE,iS,i0,iZ,iK],sq=["__proto__","constructor","prototype"],sL=e=>{if(!Z(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===sq.indexOf(i)&&(t[i]=e[i])}),t},sD=function(e,t){void 0===t&&(t=[]);var i={};return[...sA,...t].forEach(t=>{var s=e[t];et(s)||er(s)||""===s||(i[t]=s)}),i},sj=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)},sN=(e,t)=>({p:t,f:sj(JSON.stringify(e))}),sH=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=sT.H(e+"_cpm"),s=(null==i?void 0:i.f)===sj(t)&&X(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},sB=(e,t)=>t+"|"+(sT.P(e+"_cpm")||""),sz={},sU={N:()=>!0,j(e){t5.error("memoryStorage error: "+e)},P:e=>sz[e]||null,H:e=>sz[e]||null,F:(e,t)=>(sz[e]=t,!0),q(e){delete sz[e]}},sV=null,sW={N(){if(!er(sV))return sV;if(sV=!0,et(n))sV=!1;else try{var e="__support__";sW.F(e,"xyz"),'"xyz"'!==sW.P(e)&&(sV=!1),sW.q(e)}catch(e){sV=!1}return sV},j(e){t5.error("sessionStorage error: ",e)},P(e){try{return null==n?void 0:n.sessionStorage.getItem(e)}catch(e){sW.j(e)}return null},H(e){try{return JSON.parse(sW.P(e))||null}catch(e){}return null},F(e,t){try{return null==n||n.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sW.j(e)}return!1},q(e){try{null==n||n.sessionStorage.removeItem(e)}catch(e){sW.j(e)}}};class sG{constructor(e){this._instance=e}get qe(){return this._instance.config}get consent(){return this.si()?0:this.ai}isOptedOut(){return this.qe.cookieless_mode===i9||this.isRejected()||-1===this.consent&&this.qe.cookieless_mode===i4}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.qe.opt_out_capturing_by_default}optInOut(e){this.oi.F(this.li,+!!e,this.qe.cookie_expiration,this.qe.cross_subdomain_cookie,this.qe.secure_cookie)}reset(){this.oi.q(this.li,this.qe.cross_subdomain_cookie)}get li(){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 ai(){var e=this.oi.P(this.li);return U(ef,e)?1:U(e_,e)?0:-1}get oi(){var e=this.qe.opt_out_capturing_persistence_type,t="localStorage"===e?sM:sT;if(!this.ui||this.ui!==t){this.ui=t;var i="localStorage"===e?sT:sM;i.P(this.li)&&(this.ui.P(this.li)||this.optInOut(U(ef,i.P(this.li))),i.q(this.li,this.qe.cross_subdomain_cookie))}return this.ui}si(){return!!this.qe.respect_dnt&&[null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,_.doNotTrack].some(e=>U(ef,e))}}function sK(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!Q(s))return t;try{var r=s(t);return ei(r)&&r?r:t}catch(e){return t5.error("Error in get_current_url, falling back to window.location.href",e),t}}var sJ="__POSTHOG_TOOLBAR__";function sY(e){return e instanceof Element&&(e.id===sJ||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sX(e){return!!e&&1===e.nodeType}function sQ(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function sZ(e){return!!e&&3===e.nodeType}function s0(e){return!!e&&11===e.nodeType&&sX(e.host)}function s1(e){return e?V(e).split(/\s+/):[]}function s2(e,t){var i,s,r=et(s=null==n||null==(i=n.location)?void 0:i.href)?void 0:sK(t,s);return!!(r&&e&&e.some(e=>r.match(e)))}function s3(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 s1(t)}function s5(e){return en(e)?null:V(e).split(/(\s+)/).filter(e=>r_(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function s6(e){var t="";return ru(e)&&!rh(e)&&e.childNodes&&e.childNodes.length&&su(e.childNodes,function(e){var i;sZ(e)&&e.textContent&&(t+=null!=(i=s5(e.textContent))?i:"")}),V(t)}function s8(e){var t;return et(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var s4=["a","button","form","input","select","textarea","label"];function s9(e,t){if(et(t))return!0;var i,s=function(e){if(t.some(t=>(function(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}})(e,t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function s7(e){var t=e.parentNode;return!(!t||!sX(t))&&t}var re=[".ph-no-autocapture","[data-ph-no-autocapture]"],rt=["next","previous","prev",">","<"],ri=[...rt,"+","-","−","–"],rs=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,rr=[".ph-no-rageclick",".ph-no-capture"],rn=["","text","search","email","password","url","tel","number"];function ra(e,t){if(!n||ro(e)||(el(t)?(s=!!t&&rr,r=void 0,a=!1):(s=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:rr,r=null==t?void 0:t.content_ignorelist,a=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===s)||a&&!(!(i=e)||!sX(i))&&(sQ(i,"textarea")||(sQ(i,"input")?U(rn,(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,a,o,l,u=rl(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||et(e))return!1;if(!0===e)i=rt;else{if(!X(e))return!1;if(e.length>10)return t5.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=>rs(t,e)||rs(s,e))})}(r,u.map(e=>{var t;return{safeText:s6(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!s9(u,s)}var ro=e=>!e||sQ(e,"html")||!sX(e),rl=(e,t)=>
2{if(!n||ro(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],r=e;r.parentNode&&!sQ(r,"body");)if(s0(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var a=s7(r);if(!a)break;if(t||s4.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var o=n.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(a),r=a}return{parentIsUsefulElement:i,targetElementList:s}};function ru(e){for(var t=new Set,i=0,s=e;s.parentNode&&!sQ(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=s3(s);if(U(r,"ph-sensitive")||U(r,"ph-no-capture"))return!1}if(U(s3(e),"ph-include"))return!0;var n=e.type||"";if(ei(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!ei(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 rh(e){return!!(sQ(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||sQ(e,"select")||sQ(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rc=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}))$"),rd=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,rp=[16,15,14,13],rv=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),rg=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),rf=/[0-9A-Za-z_]/;function r_(e,t){return void 0===t&&(t=!0),!(en(e)||ei(e)&&(e=V(e),(t?rc.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(rd.lastIndex=0;t=rd.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of rp){var a=r+n;if(s.length>=a){var o=s.slice(r,a);if(rc.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?rv.test(e):function(e){var t;for(rg.lastIndex=0;t=rg.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&rf.test(i)&&rf.test(s)))return!0}return!1}(e))))&&!0}function rm(e){var t=s6(e);return r_(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&su(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=s6(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){t5.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function ry(e){return e.replace(/"|\\"/g,'\\"')}var rb=t6("[Dead Clicks]"),rw=()=>!0,rx=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(iv)),s=e.instance.config.capture_dead_clicks;return el(s)?s:!!Z(s)||i};class rk{get lazyLoadedDeadClicksAutocapture(){return this.hi}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({[iv]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.di(()=>{this.vi()}):this.stop()}di(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rb.error("failed to load script",t):e()})}vi(){var e;if(l){if(!this.hi&&null!=(e=_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Z(this.instance.config.capture_dead_clicks)?w({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.hi=_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.hi.start(l),rb.info("starting...")}}else rb.error("`document` not found. Cannot start.")}stop(){this.hi&&(this.hi.stop(),this.hi=void 0,rb.info("stopping..."))}}var rE=t6("[SegmentIntegration]"),rS="posthog-js";function rP(e,t){var i=void 0===t?{}:t,s=i.organization,r=i.projectId,n=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
2on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=i,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var a,l,h,c,d,p,v=(null==(a=t.exception)?void 0:a.values)||[],g=v.map(e=>w({},e,{stacktrace:e.stacktrace?w({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>w({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(l=v[0])?void 0:l.value)||t.message,$exception_type:null==(h=v[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=v[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return s&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(f)),t}}class rF{constructor(e,t,i,s,r,n){this.name=rS,this.setupOnce=function(a){a(rP(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class rC{constructor(e){this.ci=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(t5.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.fi=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.pi()}pi(){var e;this.gi=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.ci)}destroy(){var e;null==(e=this.gi)||e.call(this),this.gi=void 0}doPageView(e,t){var i,s=this.mi(e,t);return this.fi={pathname:null!=(i=null==n?void 0:n.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.mi(e,null==(t=this.fi)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.fi)?void 0:e.pageViewId}}mi(e,t){var i=this.fi;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(!(et(n)||et(a)||et(o)||et(l)||et(u)||et(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?em(a/n,0,1,t5):1,d=n>1?em(o/n,0,1,t5):1,p=l>1?em(u/l,0,1,t5):1,v=l>1?em(h/l,0,1,t5):1;s=sh(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}}var r$=["flags","surveys"],rI={[it]:{exposure:"hidden"},[ia]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[io]:{exposure:"hidden"},[il]:{exposure:"event"},[iu]:{exposure:"hidden"},[ih]:{exposure:"event"},[ic]:{exposure:"hidden"},[id]:{exposure:"event"},[ip]:{exposure:"event"},[iv]:{exposure:"event"},[ig]:{exposure:"hidden"},[i_]:{exposure:"event"},[im]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[iE]:{exposure:"hidden"},[iS]:{exposure:"event"},[iy]:{exposure:"event",shouldSkipFromEventProperties:e=>er(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"},[iP]:{exposure:"hidden",storageGroup:"flags"}
2,[iF]:{exposure:"hidden",storageGroup:"flags"},[iC]:{exposure:"hidden"},[i$]:{exposure:"hidden",storageGroup:"flags"},[iI]:{exposure:"hidden",storageGroup:"flags"},[iT]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iR]:{exposure:"hidden",storageGroup:"flags"},[iM]:{exposure:"hidden"},[iO]:{exposure:"hidden"},[iA]:{exposure:"hidden"},[iq]:{exposure:"hidden"},[iD]:{exposure:"hidden",storageGroup:"surveys"},[ij]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iN]:{exposure:"event"},[iH]:{exposure:"hidden"},[iB]:{exposure:"hidden"},[iz]:{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"},[iU]:{exposure:"hidden"},[iV]:{exposure:"hidden"},[iL]:{exposure:"event"},[iW]:{exposure:"hidden"},[iG]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iK]:{exposure:"hidden"},[iJ]:{exposure:"hidden"},[iY]:{exposure:"hidden"},[iX]:{exposure:"hidden"},[iQ]:{exposure:"hidden"},[iZ]:{exposure:"hidden"},[i0]:{exposure:"hidden"},[ib]:{exposure:"event"},[iw]:{exposure:"event"},[ix]:{exposure:"event"},[ik]:{exposure:"event"},[i3]:{exposure:"event"},[i5]:{exposure:"event"},[i6]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rT=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rR=e=>{var t=rI[e];if(t)return t;for(var i of rT){var s=i[1];if(0===e.indexOf(i[0]))return s}},rM=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return G(e)}},rO=e=>{var t=null==l?void 0:l.createElement("a");return et(t)?null:(t.href=e,t)},rA=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(!X(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){t5.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rq=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");X(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},rL=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rD=(e,t)=>e>=t&&g(),rj=(e,t,i,s)=>{if(0===e){if(g()){var r=t+1;return r===i&&s(),r}return t}return 0},rN="https?://(.*)",rH=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rB=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rH],rz="<masked>",rU=["li_fat_id"];function rV(e,t,i){if(!l)return{};var s,r=t?[...rH,...i||[]]:[],n=rW(rq(l.URL,r,rz),e);return sh((s={},su(rU,function(e){var t=sm(e);s[e]=t||null}),s),n)}function rW(e,t){var i=rB.concat(t||[]),s={};return su(i,function(t){var i=rA(e,t);s[t]=i||null}),s}function rG(e){var t=e?0===e.search(rN+"google.([^/?]*)")?"google":0===e.search(rN+"bing.com")?"bing":0===e.search(rN+"yahoo.com")?"yahoo":0===e.search(rN+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!er(t)){i.$search_engine=t;var s=l?rA(l.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rK(){return navigator.language||navigator.userLanguage}var rJ="$direct";function rY(){return(null==l?void 0:l.referrer)||rJ}function rX(e,t,i){void 0===i&&(i=!1);var s=e?[...rH,...t||[]]:[],r=i?tg(null==u?void 0:u.href):null==u?void 0:u.href,n=null==r?void 0:r.substring(0,1e3);return{r:rY().substring(0,1e3),u:n?rq(n,s,rz):void 0}}function rQ(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?tg(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==rJ?rJ:null==(i=rO(s))?void 0:i.host};
2if(n){a.$current_url=n;var o=rO(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,sh(a,rW(n))}return s&&sh(a,rG(s)),a}function rZ(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var r0={flags:iG,surveys:ij},r1=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],r2="main",r3=(e,t)=>{su(e,(i,s)=>{var r=rR(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})};class r5{constructor(e,t,i){if(void 0===i&&(i=!0),this.yi={},this.bi=!1,this.wi=!1,this.ki=!1,this.xi=!1,this.qe=e,this.Si=i,this.props={},this.Ci=void 0,this.Mi=(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.oi=this.Ti(e),this.wi=this.Ei(e),this.load(),e.debug&&t5.info("Persistence loaded",e.persistence,w({},this.props)),this.update_config(e,e,t),this.save(),n){var s=()=>this.flush();sf(n,"beforeunload",s,{capture:!1}),sf(n,"pagehide",s,{capture:!1})}}Ii(){var e,t=null==(e=this.qe)?void 0:e.persistence_save_debounce_ms;return ea(t)&&t>0?t:0}Pi(e){if(this.qe.cookieWinsOnConflict&&"localstorage+cookie"===this.qe.persistence.toLowerCase())if(e)try{var t=sD(e,this.qe.cookie_persisted_properties||[]),i=sN(t,this.qe.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=sT.P(this.Mi)||void 0;r&&sB(this.Mi,r)===s&&(this.Ri=s,this.Ai=r)}catch(e){}else try{var n=sT.P(this.Mi)||void 0;this.Ri=n?sB(this.Mi,n):void 0,this.Ai=n}catch(e){}}syncCookieProperties(){return this.Fi(this.qe)}Fi(e,t){if(void 0===t&&(t=!1),this.Oi&&!t||this.xi||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=sT.P(this.Mi)||void 0}catch(e){}if(!i||i===this.Ai)return!1;var i,s,r=sB(this.Mi,i);try{s=sL(JSON.parse(i))}catch(e){return!1}if((sT.P(this.Mi)||void 0)!==i)return!1;this.Ri=r,this.Ai=i;var n=sH(this.Mi,i),a=[...sA,...n.properties],o={};if(Object.keys(s).forEach(e=>{var t=s[e];(et(t)||er(t)||""===t||e===iK&&t!==i7&&t!==se)&&(o[e]=!0,delete s[e])}),ee(s))return!1;var l=ii in s||s[iK]===i7||s[iK]===se,u=this.props[ii],h=this.props[iK],c=sh({},this.props);[...sA,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==a.indexOf(e)&&!(e in s)&&!o[e]&&(l||e!==ii&&e!==iK)){var t=c[e];(n.isValid||-1===sA.indexOf(e)||!1!==t&&0!==t)&&delete c[e]}}),this.props=sh(c,s),!l||iK in s||iK in this.props||this.Li(iK,i7);var d=this.props[ii],p=this.props[iK];return l&&(d!==u||p!==h)&&(this.ki=!0,sW.F(this.Mi+"_cookie_identity_change_pending",!0),this.Di(iA),this.Di(iF),this.Di(iP),this.Di(i$),this.Di(iI),this.Di(iT),this.Di(iG),this.Di(iW),this.Di(iU),p!==i7||h!==se&&s[iK]!==i7&&(et(u)||d===u)||(r3(this.props,s),this.Di(iq)),p===se?this.props.$user_id=d:delete this.props.$user_id,this.Di(ia)),!0}
2consumeCookieIdentityChange(){var e=this.Mi+"_cookie_identity_change_pending",t=this.ki||!!sW.P(e);return this.ki=!1,t&&sW.q(e),t}$i(e){return void 0===e&&(e=!1),!(this.xi||this.Oi&&!e||!this.qe.cookieWinsOnConflict||"localstorage+cookie"!==this.qe.persistence.toLowerCase()||(this.xi=!0,0))}Ni(){this.xi&&(et(this.qi)||(clearTimeout(this.qi),this.qi=void 0),delete this.yi[r2],this.ji(!0))}Bi(e){if(void 0===e&&(e=!0),this.xi)try{e?this.Ni():et(this.qi)||(clearTimeout(this.qi),this.qi=void 0)}finally{this.xi=!1}}isDisabled(){return!!this.Oi}Ti(e){-1===r1.indexOf(e.persistence.toLowerCase())&&(t5.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,r,a=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...sA,...t],w({},sM,{H(e){try{var t,r={};try{r=(t=sT.P(e)||void 0)?sL(JSON.parse(t)):{}}catch(e){}var n,a=JSON.parse(sM.P(e)||"{}");if(i){var o=sH(e,t),l=[...sA,...o.properties],u={};Object.keys(r).forEach(e=>{var t=r[e];er(t)||""===t||e===iK&&t!==i7&&t!==se||(u[e]=t)});var h=ii in u||u[iK]===i7||u[iK]===se;if(Object.keys(u).length>0){var c,d=a[ii],p=null!=(c=a[iK])?c:i7;s.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in r)&&(h||e!==ii&&e!==iK)){var t=a[e];(o.isValid||-1===sA.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!h||iK in r||iK in a||(a[iK]=i7),h&&((ii in u?u[ii]:a[ii])!==d||(iK in u?u[iK]:a[iK])!==p)&&(sO.forEach(e=>delete a[e]),u[iK]===se&&ii in u?a.$user_id=u[ii]:delete a.$user_id,u[iK]!==se&&(delete a[iL],delete a[iq]),delete a.__alias)}n=sh(a,u)}else n=sh(r,a);return sM.F(e,n),n}catch(e){}return null},F(e,s,r,n,a,o){var l=sM.F(e,s,void 0,void 0,o);try{var u=sD(s,t);if(Object.keys(u).length){if(i){var h=e+"_cpm",c=sN(u,t);if(sT.F(h,c,r,n,a,o),sT.P(h)!==JSON.stringify(c)){sT.q(h,n);var d=sD(s);return sT.F(e,d,r,n,a,o),l}}sT.F(e,u,r,n,a,o)}}catch(e){sM.j(e)}return l},q(e,t){try{null==n||n.localStorage.removeItem(e),sT.q(e,t),sT.q(e+"_cpm",t)}catch(e){sM.j(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sM.N()?(r=sM,o=!0):"localstorage+cookie"===l&&a.N()?(r=a,o=!0):"sessionstorage"===l&&sW.N()?r=sW:"memory"===l?r=sU:"cookie"===l?r=sT:a.N()?(r=a,o=!0):r=sT,this.bi=o,r}Hi(e){return this.Mi+"__"+e}Ei(e){return this.bi&&!!e.split_storage}properties(){var e={};return su(this.props,(t,i)=>{var s=rR(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(){if(!this.Oi){var e=this.qe.cookieWinsOnConflict&&"localstorage+cookie"===this.qe.persistence.toLowerCase(),t=e?sM.H(this.Mi):null,i={};if(e)try{su(i=sL(sT.H(this.Mi)),(e,t)=>{(et(e)||er(e)||""===e)&&delete i[t]})}catch(e){}var s=this.oi.H(this.Mi);if(s&&(this.props=sh({},s)),this.wi&&this.Ui(),e&&s){var r,n,a=null==t?void 0:t[ii],o=null!=(r=null==t?void 0:t[iK])?r:i7,l=s[ii],u=null!=(n=s[iK])?n:i7;if(l!==a||u!==o){this.ki=!0,sW.F(this.Mi+"_cookie_identity_change_pending",!0);var h=sh({},this.props);sO.forEach(e=>delete h[e]),u!==i7||o!==se&&i[iK]!==i7&&(et(a)||l===a)||(r3(h,i),delete h[iq]),this.props=h;var c=new Set;sO.forEach(e=>{var t,i=null==(t=rR(e))?void 0:t.storageGroup;i&&c.add(i)}),c.forEach(e=>{var t={};su(this.props,(i,s)=>{var r;(null==(r=rR(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),ee(t)?(sM.q(this.Hi(e)),this.yi[e]={}):sM.F(this.Hi(e),t)&&(this.yi[e]={persisted:!0,fingerprint:this.zi(t,e)})})}}sW.P(this.Mi+"_cookie_identity_change_pending")&&(this.ki=!0)}}Ui(){for(var e of r$){var t=sM.H(this.Hi(e));if(t&&!ee(t)){var i=this.Wi(e);i.persisted=!0,this.Vi(e)||(i.fingerprint=this.zi(t,e)),this.Zi(e,t)||sh(this.props,t)}}}Vi(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rR(t))?void 0:i.storageGroup)===e})}Zi(e,t){var i=r0[e];if(!i)return!1;var s=t[i],r=this.props[i];return ea(s)&&ea(r)&&r>s}refreshKey(e){var t;if(!this.Oi){var i=this.wi?null==(t=rR(e))?void 0:t.storageGroup:void 0,s=i?sM.H(this.Hi(i)):this.oi.H(this.Mi);if(s&&e in s)this.Li(e,s[e]);else{if(i){var r=this.oi.H(this.Mi);if(r&&e in r)return void this.Li(e,r[e])}this.Di(e)}}}save(){if(!this.Oi){var e=this.Ii();e>0?et(this.qi)&&(this.qi=setTimeout(()=>{this.qi=void 0,this.ji()},e)):this.ji()}}
2flush(){et(this.qi)||(clearTimeout(this.qi),this.qi=void 0,this.ji())}ji(e){void 0===e&&(e=!1),this.Oi||this.xi&&!e||(e||this.syncCookieProperties(),this.wi?this.Gi():this.Qi(this.oi,this.Mi,this.props,r2)&&this.Pi(this.props))}Gi(){var e=this.Ji(),t=e.main,i=e.groups;for(var s of(this.Qi(this.oi,this.Mi,t,r2)&&this.Pi(t),r$)){var r,n=i[s];(!ee(n)||null!=(r=this.yi[s])&&r.persisted)&&this.Qi(sM,this.Hi(s),n,s)}}Ji(){var e={},t={flags:{},surveys:{}};return su(this.props,(i,s)=>{var r,n=null==(r=rR(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}zi(e,t){if(t===r2)return JSON.stringify(e)+"|"+this.Ki+"|"+this.Yi+"|"+this.Xi;var i={};return su(e,(e,t)=>{var s;i[t]=null!=(s=rR(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}Qi(e,t,i,s){var r,n=this.Wi(s);if(s!==r2&&!n.dirty&&!et(n.fingerprint))return!1;try{if((r=this.zi(i,s))===n.fingerprint)return n.dirty=!1,!1}catch(e){r=void 0}return e.F(t,i,this.Ki,this.Yi,this.Xi,this.qe.debug)?(n.dirty=!1,s!==r2&&(n.persisted=!0),et(r)||(n.fingerprint=r),!0):(this.qe.debug&&t5.warn('failed to persist storage entry "'+t+'"; will retry on next save'),!1)}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(et(this.qi)||(clearTimeout(this.qi),this.qi=void 0),this.oi.q(this.Mi,!1),this.oi.q(this.Mi,!0),!i&&this.Si)for(var s of r$)sM.q(this.Hi(s));i?delete this.yi[r2]:this.yi={},this.Ri=void 0,this.Ai=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(Z(e)){this.syncCookieProperties(),et(t)&&(t="None"),this.Ki=et(i)?this.tr:i;var s=!1;if(su(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Li(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(Z(e)){this.syncCookieProperties(),this.Ki=et(t)?this.tr:t;var i=!1;if(su(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||Z(t)||X(t))&&(this.Li(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.Di(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==l?void 0:l.URL;if(e!==this.Ci){var t=rV(this.qe.custom_campaign_params,this.qe.mask_personal_data_properties,this.qe.custom_personal_data_properties);ee(sv(t))||this.register(t),this.Ci=e}}update_search_keyword(){var e;this.register((e=null==l?void 0:l.referrer)?rG(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rY(),$referring_domain:null!=l&&l.referrer&&(null==(e=rO(l.referrer))?void 0:e.host)||rJ},void 0)}set_initial_person_info(){this.props[iX]||this.props[iQ]||this.register_once({[iZ]:rX(this.qe.mask_personal_data_properties,this.qe.custom_personal_data_properties,this.qe.disable_capture_url_hashes)},void 0)}get_initial_props(){var e,t,i,s={};su([iQ,iX],e=>{var t=this.props[e];t&&su(t,function(e,t){s["$initial_"+W(t)]=e})});var r=this.props[iZ];return r&&sh(s,(void 0===(e=this.qe.disable_capture_url_hashes)&&(e=!1),t=rQ(r,e),i={},su(t,function(e,t){i["$initial_"+W(t)]=e}),i)),s}safe_merge(e){return su(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var s=e.persistence!==t.persistence,r=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=s||r,a=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,o=e.disable_persistence||!!i,l=!!this.Oi&&!o;o||this.Fi(t,l),this.qe=e,!o&&(s||r||a)&&(this.Ri=void 0,this.Ai=void 0,this.Fi(w({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var u=n||a?this.Ti(e):this.oi,h=this.Ei(e),c=n||h!==this.wi,d=!o&&(c||e.cross_subdomain_cookie!==this.Yi||e.secure_cookie!==this.Xi)&&this.$i(l);try{if(this.tr=this.Ki=e.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var p=this.props;this.clear(),this.oi=u,this.wi=h,this.props=p,this.save()}else a&&(this.oi=u,o||(delete this.yi[r2],this.ji()))}finally{d&&this.Bi()}}set_disabled(e){this.Oi=e,this.Oi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Yi&&(this.Yi=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Xi&&(this.Xi=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[io]||{};i[e]=t,this.Li(io,i),this.save()}remove_event_timer(e){var t=this.props[io]||{},i=t[e];return et(i)||(delete t[e],this.Li(io,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Li(e,t),this.save()}Li(e,t){var i;this.props[e]=t,null!=(i=rR(e))&&i.volatile||this.er(e)}Di(e){delete this.props[e],this.er(e)}er(e){var t,i=null==(t=rR(e))?void 0:t.storageGroup;i&&(this.Wi(i).dirty=!0)}Wi(e){return this.yi[e]||(this.yi[e]={})}}function r6(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&Q(i.then)&&i.then(void 0,()=>{})}}}}var r8="gzip-js",r4="base64",r9="events",r7="cancelEvents",ne="survey shown",nt="survey dismissed",ni="survey sent",ns="popover",nr=t6("[RateLimiter]");class nn{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
vendor: 7,918 bytes, line 2
2if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{nr.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void nr.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(iY))?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=(ea(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.ir(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(iY,o),{isRateLimited:l,remainingTokens:o.tokens}}rr(e){var t=this.instance.config.property_denylist;return!X(t)||!t.includes(e)}nr(){var e;if(this.rr("$current_url")&&this.rr("$pathname")&&null!=u&&u.pathname)return""+(null!=(e=u.origin)?e:"")+u.pathname}ir(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.nr(),a=this.rr("$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}}var na=t6("[RemoteConfig]");class no{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}sr(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}ar(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 na.info("Using preloaded remote config",this.remoteConfig),this.lr(this.remoteConfig),void this.ur();if(this._instance.hr())return void na.warn("Remote config is disabled. Falling back to local config.");this.sr(e=>{e?(this.lr(e),this.ur()):(na.info("No config found after loading remote JS config. Falling back to JSON."),this.ar(e=>{this.lr(e.json,e),this.ur()}))})}catch(e){na.error("Error loading remote config",e),this.lr()}}stop(){this.dr&&(clearInterval(this.dr),this.dr=void 0)}refresh(){!this._instance.hr()&&l&&"hidden"!==l.visibilityState&&this._instance.reloadFeatureFlags()}ur(){var e;if(!this.dr){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.dr=setInterval(()=>{this.refresh()},t))}}lr(e,t){!e&&t&&(0===t.statusCode?t.error||na.warn("Failed to fetch remote config from PostHog."):na.error("Failed to fetch remote config from PostHog."));try{this._instance.lr(e?{ok:!0,config:e}:{ok:!1})}catch(e){na.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){na.error("Error loading feature flags",e)}}}var nl=Uint8Array,nu=Uint16Array,nh=Uint32Array,nc=new nl([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]),nd=new nl([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]),np=new nl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nv=function(e,t){for(var i=new nu(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new nh(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]},ng=nv(nc,2),nf=ng[1];ng[0][28]=258,nf[258]=28;for(var n_=nv(nd,0)[1],nm=new nu(32768),ny=0;32768>ny;++ny){var nb=(43690&ny)>>>1|(21845&ny)<<1;nm[ny]=((65280&(nb=(61680&(nb=(52428&nb)>>>2|(13107&nb)<<2))>>>4|(3855&nb)<<4))>>>8|(255&nb)<<8)>>>1}var nw=function(e,t,i){for(var s=e.length,r=0,n=new nu(t);s>r;++r)++n[e[r]-1];var a,o=new nu(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new nu(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[nm[c]>>>l]=u}else for(a=new nu(s),r=0;s>r;++r)a[r]=nm[o[e[r]-1]++]>>>15-e[r];return a},nx=new nl(288);for(ny=0;144>ny;++ny)nx[ny]=8;for(ny=144;256>ny;++ny)nx[ny]=9;for(ny=256;280>ny;++ny)nx[ny]=7;for(ny=280;288>ny;++ny)nx[ny]=8;var nk=new nl(32);for(ny=0;32>ny;++ny)nk[ny]=5;var nE=nw(nx,9,0),nS=nw(nk,5,0),nP=function(e){return(e/8|0)+(7&e&&1)},nF=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof nu?nu:e instanceof nh?nh:nl)(i-t);return s.set(e.subarray(t,i)),s},nC=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},n$=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},nI=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 nl(0),0];if(1==r){var a=new nl(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 nu(d+1),v=nT(i[h-1],p,0);if(v>t){s=0;var g=0,f=v-t,_=1<<f;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;g+=_-(1<<v-p[m]),p[m]=t}for(g>>>=f;g>0;){var y=n[s].s;t>p[y]?g-=1<<t-p[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;p[b]==t&&(--p[b],++g)}v=t}return[new nl(p),v]},nT=function(e,t,i){return -1==e.s?Math.max(nT(e.l,t,i+1),nT(e.r,t,i+1)):t[e.s]=i},nR=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new nu(++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]},nM=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},nO=function(e,t,i){var s=i.length,r=nP(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)},nA=function(e,t,i,s,r,n,a,o,l,u,h){nC(t,h++,i),++r[256];for(var c=nI(r,15),d=c[0],p=c[1],v=nI(n,15),g=v[0],f=v[1],_=nR(d),m=_[0],y=_[1],b=nR(g),w=b[0],x=b[1],k=new nu(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=nI(k,7),P=S[0],F=S[1],C=19;C>4&&!P[np[C-1]];--C);var $,I,T,R,M=u+5<<3,O=nM(r,nx)+nM(n,nk)+a,A=nM(r,d)+nM(n,g)+a+14+3*C+nM(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(O>=M&&A>=M)return nO(t,h,e.subarray(l,l+u));if(nC(t,h,1+(O>A)),h+=2,O>A){$=nw(d,p,0),I=d,T=nw(g,f,0),R=g;var q=nw(P,F,0);for(nC(t,h,y-257),nC(t,h+5,x-1),nC(t,h+10,C-4),h+=14,E=0;C>E;++E)nC(t,h+3*E,P[np[E]]);h+=3*C;for(var L=[m,w],D=0;2>D;++D){var j=L[D];for(E=0;j.length>E;++E)nC(t,h,q[N=31&j[E]]),h+=P[N],N>15&&(nC(t,h,j[E]>>>5&127),h+=j[E]>>>12)}}else $=nE,I=nx,T=nS,R=nk;for(E=0;o>E;++E)if(s[E]>255){n$(t,h,$[257+(N=s[E]>>>18&31)]),h+=I[N+257],N>7&&(nC(t,h,s[E]>>>23&31),h+=nc[N]);var N,H=31&s[E];n$(t,h,T[H]),h+=R[H],H>
23&&(n$(t,h,s[E]>>>5&8191),h+=nd[H])}else n$(t,h,$[s[E]]),h+=I[s[E]];return n$(t,h,$[256]),h+I[256]},nq=new nh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nL=function(){for(var e=new nh(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),nD=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nj=!!c||!!h,nN="text/plain",nH=!1,nB=(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:"")},nz=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,l=e.split("?"),u=l[0],h=l[1],c=w({},t),d=null!=(o=null==h?void 0:h.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!=(t=c[r])?t:s[1];return delete c[r],r+"="+n}))?o:[],p=(void 0===s&&(s="&"),a=[],su(c,function(e,t){et(e)||et(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return p&&d.push(p),d.length>0?u+"?"+d.join("&"):u},nU=e=>{if(e.vr)return e.vr;var t=e.data,i=e.compression;if(t){if(i===r8){var s,r,n,a,o,l,u,h,c=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new nl(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 nl(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 nF(i,0,s)}(rM(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=nL[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},o=s.length,a.p(s),h=(l=10+(r.filename&&r.filename.length+1||0),u=function(e,t,i,s){var r=e.length,n=new nl(s+r+5*(1+Math.floor(r/7e3))+8),a=n.subarray(s,n.length-8),o=0;if(!t||8>r)for(var l=0;r>=l;l+=65535){var u=l+65535;r>u?o=nO(a,o,e.subarray(l,u)):(a[l]=!0,o=nO(a,o,e.subarray(l,r)))}else{for(var h=nq[t-1],c=h>>>13,d=8191&h,p=(1<<i)-1,v=new nu(32768),g=new nu(p+1),f=Math.ceil(i/3),_=2*f,m=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<_)&p},y=new nh(25e3),b=new nu(288),w=new nu(32),x=0,k=0,E=(l=0,0),S=0,P=0;r>l;++l){var F=m(l),C=32767&l,$=g[F];if(v[C]=$,g[F]=C,l>=S){var I=r-l;if((x>7e3||E>24576)&&I>423){o=nA(e,a,0,y,b,w,k,E,P,l-P,o),E=x=k=0,P=l;for(var T=0;286>T;++T)b[T]=0;for(T=0;30>T;++T)w[T]=0}var R=2,M=0,O=d,A=C-$&32767;if(I>2&&F==m(l-A))for(var q=Math.min(c,I)-1,L=Math.min(32767,l),D=Math.min(258,I);L>=A&&--O&&C!=$;){if(e[l+R]==e[l+R-A]){for(var j=0;D>j&&e[l+j]==e[l+j-A];++j);if(j>R){if(R=j,M=A,j>q)break;var N=Math.min(A,j-2),H=0;for(T=0;N>T;++T){var B=l-A+T+32768&32767,z=B-v[B]+32768&32767;z>H&&(H=z,$=B)}}}A+=(C=$)-($=v[C])+32768&32767}if(M){y[E++]=0x10000000|nf[R]<<18|n_[M];var U=31&nf[R],V=31&n_[M];k+=nc[U]+nd[V],++b[257+U],++w[V],S=l+R,++x}else y[E++]=e[l],++b[e[l]]}}o=nA(e,a,!0,y,b,w,k,E,P,l-P,o)}return nF(n,0,s+nP(o)+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)).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&&nD(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)}}(u,r),nD(u,h-8,a.d()),nD(u,h-4,o),u);return{contentType:nN,body:c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength),estimatedSize:c.byteLength}}if(i===r4){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=rM(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:rM(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=rM(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},nV=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:nz(e.url,{compression:r4}),encodedBody:nU(w({},e,{compression:r4,vr:void 0}))}:{url:nB(e.url,"compression"),encodedBody:nU(w({},e,{compression:void 0,vr:void 0}))};try{t=nU(e)}catch(t){if(L(e.compression,rA(e.url,"compression")))return t5.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&L(e.compression,rA(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?q(new 
2Uint8Array(i)):ArrayBuffer.isView(i)&&q(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nH=!0,s())},nW=e=>{try{return nV(e)}catch(t){return t5.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nG=(t=b(function*(e){var t=rM(e.data),i=yield function(e,t,i){return H.apply(this,arguments)}(t,m.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return w({},e,{vr:{contentType:nN,body:s,estimatedSize:s.byteLength}})}),function(e){return t.apply(this,arguments)}),nK=/Failed to fetch|NetworkError|Load failed/i,nJ=e=>"TypeError"===(null==e?void 0:e.name)&&nK.test((null==e?void 0:e.message)||""),nY=e=>{var t=nW(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},a=n.contentType,o=n.body,l=n.estimatedSize,u=new Headers;su(e.headers,function(e,t){u.append(t,e)}),a&&u.append("Content-Type",a);var c=null,p=!1;if(d){var v=new d;c={signal:v.signal,timeout:setTimeout(()=>{var t,i;p=!0,v.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}var g=t=>{p&&"AbortError"===(null==t?void 0:t.name)||nJ(t)?t5.warn(t):t5.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{h(s,w({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.cr&&52428.8>(l||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){t5.error(e)}null==e.callback||e.callback(s)})).catch(g).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),g(e)}}},nX=e=>{try{var t,i=nV(e),s=i.url,r=i.encodedBody,n=null!=r?r:{},a=n.body,l=n.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:n.contentType});if(o.sendBeacon(s,u))return;var h=X(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(X(h)&&h.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(h.length/2),d=t=>X(e.data)?t:w({},e.data,{batch:t});return nX(w({},e,{data:d(h.slice(0,c))})),void nX(w({},e,{data:d(h.slice(c))}))}t5.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),nY(w({},e,{cr:!0}))}catch(e){t5.warn("Beacon send failed",e)}},nQ=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return nz(i===r8?nB(e,"compression"):e,w({},r?{[r]:Date.now().toString()}:{},i===r8?{}:{compression:i}))},nZ=[];h&&nZ.push({transport:"fetch",method:nY}),c&&nZ.push({transport:"XHR",method(e){var t=nW(e);if(t){var i=new c,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,a=r.body;su(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=o&&o.sendBeacon&&nZ.push({transport:"sendBeacon",method:nX});class n0{constructor(e,t){this.pr=!0,this.gr=[],this.mr=em((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,t5.createLogger("flush interval"),3e3),this.yr=e}enqueue(e){this.gr.push(e),this.br||this._r()}unload(){this.wr();var e=Object.values(this.gr.length>0?this.kr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Sr(w({},e,{transport:"sendBeacon"}))})}enable(){this.pr=!1,this._r()}_r(){var e=this;this.pr||(this.br=setTimeout(()=>{if(this.wr(),this.gr.length>0){var t=this.kr();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&X(s.data)&&su(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Sr(s)}()}},this.mr))}Sr(e){try{this.yr(e)}catch(e){t5.error(e)}}wr(){clearTimeout(this.br),this.br=void 0}kr(){var e={};return su(this.gr,t=>{var i,s=(t?t.batchKey:null)||t.url;et(e[s])&&(e[s]=w({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.gr=[],e}}var n1=["retriesPerformedSoFar"];class n2{constructor(e){this.Cr=!1,this.Mr=3e3,this.gr=[],this._instance=e,this.gr=[],this.Tr=!0,!et(n)&&"onLine"in n.navigator&&(this.Tr=n.navigator.onLine,this.Er=()=>{this.Tr=!0,this.Ir()},this.Pr=()=>{this.Tr=!1},sf(n,"online",this.Er),sf(n,"offline",this.Pr))}get length(){return this.gr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=x(e,n1);eo(t)&&(i.url=nz(i.url,{retry_count:t})),this._instance._send_request(w({},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.Ot(w({retriesPerformedSoFar:t},i));0===e.statusCode&&t5.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)}}))}Ot(e){var t,i,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var r=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,s)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+r;this.gr.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+r;navigator.onLine||(a+=" (Browser is offline)"),t5.warn(a),this.Cr||(this.Cr=!0,this.Rr())}Rr(){(this.Ar&&clearTimeout(this.Ar),0===this.gr.length)?(this.Cr=!1,this.Ar=void 0):this.Ar=setTimeout(()=>{this.Tr&&this.gr.length>0&&this.Ir(),this.Rr()},this.Mr)}Ir(){var e=Date.now(),t=[],i=this.gr.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.gr=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Ar&&(clearTimeout(this.Ar),this.Ar=void 0),this.Cr=!1,et(n)||(this.Er&&(n.removeEventListener("online",this.Er),this.Er=void 0),this.Pr&&(n.removeEventListener("offline",this.Pr),this.Pr=void 0)),this.gr)){var t=e.requestOptions;try{this._instance._send_request(w({},t,{transport:"sendBeacon"}))}catch(e){t5.error(e)}}this.gr=[]}}class n3{constructor(e){this.Fr=()=>{this.Or||(this.Or={});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.Or.lastScrollY=Math.ceil(n),this.Or.maxScrollY=Math.max(n,null!=(e=this.Or.maxScrollY)?e:0),this.Or.maxScrollHeight=Math.max(a,null!=(t=this.Or.maxScrollHeight)?t:0),this.Or.lastContentY=o,this.Or.maxContentY=Math.max(o,null!=(i=this.Or.maxContentY)?i:0),this.Or.maxContentHeight=Math.max(l,null!=(s=this.Or.maxContentHeight)?s:0)},this._instance=e}get Lr(){return this._instance.config.scroll_root_selector}getContext(){return this.Or}resetContext(){var e=this.Or;return setTimeout(this.Fr,0),e}startMeasuringScrollPosition(){sf(n,"scroll",this.Fr,{capture:!0}),sf(n,"scrollend",this.Fr,{capture:!0}),sf(n,"resize",this.Fr)}scrollElement(){if(!this.Lr)return null==n?void 0:n.document.documentElement;for(var e of X(this.Lr)?this.Lr:[this.Lr]){var t=null==n?void 0:n.document.querySelector(e);
2if(t)return t}}Dr(e){if(this.Lr){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return n?"y"===e?n.scrollY||n.pageYOffset||n.document.documentElement.scrollTop||0:n.scrollX||n.pageXOffset||n.document.documentElement.scrollLeft||0:0}scrollY(){return this.Dr("y")}scrollX(){return this.Dr("x")}}var n5=e=>rX(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class n6{constructor(e,t,i,s){this.$r=e=>{var t=this.Nr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.qr(this._instance)};this.jr.register({[iJ]:i})}},this._instance=e,this.Br=t,this.jr=i,this.qr=s||n5,this.Br.onSessionId(this.$r)}Nr(){return this.jr.props[iJ]}getSetOnceProps(){var e,t=null==(e=this.Nr())?void 0:e.props;return t?"r"in t?rQ(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 su(sv(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+W(i)]=t}),e}}class n8{on(e,t){return this.Hr[e]||(this.Hr[e]=[]),this.Hr[e].push(t),()=>{this.Hr[e]=this.Hr[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Hr[e]||[])i(t);for(var s of this.Hr["*"]||[])s(e,t)}constructor(){this.Hr={}}}var n4=t6("[SessionId]");class n9{on(e,t){return this.Ur.on(e,t)}constructor(e,t,i){if(this.zr=null,this.Wr=null,this.Vr=[],this.Zr=void 0,this.Gr=!1,this.Ur=new n8,this.Qr=(e,t)=>!(!eo(e)||!eo(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===i9)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qe=e.config,this.jr=e.persistence,this.Jr=void 0,this.Kr=void 0,this._sessionStartTimestamp=null,this.Yr=void 0,this._sessionActivityTimestamp=null,this.Xr=t||sF,this.tn=i||sF;var s,r=this.qe.persistence_name||this.qe.token;if(this._sessionTimeoutMs=1e3*em(this.qe.session_idle_timeout_seconds||1800,60,36e3,n4.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.en(),this.rn="ph_"+r+"_window_id",this.nn="ph_"+r+"_primary_window_exists",this.sn()){var n=sW.H(this.rn),a=sW.H(this.nn);n&&!a?this.Jr=n:sW.q(this.rn),sW.F(this.nn,!0)}null!=(s=this.qe.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.qe.bootstrap.sessionID),this.an()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return et(this.Vr)&&(this.Vr=[]),this.Vr.push(e),this.Kr&&e(this.Kr,this.Jr),()=>{this.Vr=this.Vr.filter(t=>t!==e)}}sn(){return"memory"!==this.qe.persistence&&!this.jr.Oi&&sW.N()}ln(e){e!==this.Jr&&(this.Jr=e,this.sn()&&sW.F(this.rn,e))}un(){return this.Jr?this.Jr:this.sn()?sW.H(this.rn):null}hn(e){var t=this.zr;return!er(t)&&!er(e)&&5e3>Math.abs(e-t)}dn(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.Kr&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Kr=e,r&&!s||r&&this.hn(t)||(this.zr=t,this.jr.register({[iE]:[t,e,i]}))}vn(){var e,t=null==(e=this.qe)?void 0:e.persistence_save_debounce_ms;return eo(t)&&t>0}cn(){this.vn()?this.jr.refreshKey(iE):(this.jr.flush(),this.jr.load())}fn(){var e;if(!er(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.zr){this.cn();var t=this.pn();t[1]===this.Kr&&t[2]===this._sessionStartTimestamp&&(this.zr=this._sessionActivityTimestamp,this.jr.register({[iE]:[this._sessionActivityTimestamp,null!=(e=this.Kr)?e:null,this._sessionStartTimestamp]}),this.jr.flush())}}gn(){var e=this.pn()[0];return Math.max(eo(e)?e:0,eo(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}mn(e){return this.cn(),this.Qr(e,this.gn())}pn(){var e=this.jr.props[iE];return X(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.zr=null,this.Yr=void 0,clearTimeout(this.yn),this.yn=void 0,this.dn(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 n4.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void n4.error("Invalid sessionID in bootstrap",e)}}(e);return!et(i)&&(t?this.Yr={sessionId:e,sessionStartTimestamp:i}:this.dn(e,(new Date).getTime(),i),!0)}destroy(){this.Gr=!0,this.fn(),clearTimeout(this.yn),this.yn=void 0,this.Zr&&n&&(n.removeEventListener(ss,this.Zr,{capture:!1}),this.Zr=void 0),this.Vr=[]}
2an(){this.Zr=()=>{this.fn(),this.sn()&&sW.q(this.nn)},sf(n,ss,this.Zr,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this.qe.cookieless_mode===i9)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),a=this.Kr;i?this.Wr=n:(er(this.Wr)||this.Wr>n||n-this.Wr>=1e3)&&(null==(s=(r=this.jr).syncCookieProperties)||s.call(r),this.Wr=n);var o=this.pn(),l=o[1],u=o[2],h=!et(a)&&l!==a,c=this.gn(),d=this.un(),p=this.Yr,v=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),g=p?v:eo(u)&&Math.abs(n-u)>864e5,f=!1,_=h,m=!l||!!p,y=l,b=!m&&!e&&this.Qr(n,c);if(b){(b=this.mn(n))||n4.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.pn();l=w[1],u=w[2]}if(m||b||g){_=!1;var x=p&&!v;l=x?p.sessionId:this.Xr(),d=this.tn(),n4.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g}}),u=x?p.sessionStartTimestamp:n,this.Yr=void 0,f=!0}else d||(d=this.tn(),f=!0),(_=_||l!==y)&&(n4.info("adopted cross-tab session id",{sessionId:l,windowId:d}),f=!0);var k=eo(c)&&e&&!g?c:n,E=eo(u)?u:(new Date).getTime();this.ln(d),this.dn(l,k,E),e||this.en();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g,crossTabAdoption:_};return f&&this.Vr.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:f?S:void 0,lastActivityTimestamp:c}}en(){this.Gr||(clearTimeout(this.yn),this.yn=setTimeout(()=>{if(!this.Gr)if(this.mn((new Date).getTime())){var e=this.Kr;this.resetSessionId(),this.Ur.emit("forcedIdleReset",{idleSessionId:e})}else this.en()},1.1*this.sessionTimeoutMs))}}var n7=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&z(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>z(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function ae(){return(ae=b(function*(){var e=null==o?void 0:o.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return ei(i)&&i.length>0?i:void 0}catch(e){return void t5.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var at=function(e,t){if(!function(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}};function ai(e,t,i){return rM({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var as={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>at(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!at(t,e))),icontains:(e,t)=>t.map(ar).some(t=>e.map(ar).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ar).every(t=>e.map(ar).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))})},ar=e=>e.toLowerCase();function an(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],s=null==t?void 0:t[e[0]];if(et(s)||er(s))return!1;var r=[String(s)],n=as[i.operator];return!!n&&n(i.values,r)})}var aa="custom",ao="i.posthog.com",al=/^\/static\//,au=["/s/","/e/","/i/"];class ah{constructor(e){this.bn={},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("."+ao,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.bn[this.apiHost]||(this.bn[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":aa),this.bn[this.apiHost]}_n(e){if(al.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}wn(e){var t=rO(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}kn(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;
2if(r&&(s=r(new URL((null==(a=rO(i))?void 0:a.href)||i)).toString()),r&&"api"===e&&au.some(e=>0===t.indexOf(e))){var n=this.wn(s);if(n){var a,o,l=this.apiHost,u=this.xn;(null==(o=u)?void 0:o.apiHost)===l&&u.rewriteRequestPath===r||(u={apiHost:l,rewriteRequestPath:r,urls:new Set},this.xn=u),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.xn,i=this.wn(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.kn(e,t,this.uiHost+t);if("flags"===e)return this.kn(e,t,this.flagsApiHost+t);if("assets"===e){var i=this._n(t);if(i)return this.kn(e,t,""+i+t)}if(this.region===aa)return this.kn(e,t,this.apiHost+t);var s=ao+t;switch(e){case"assets":return this.kn(e,t,"https://"+this.region+"-assets."+s);case"api":return this.kn(e,t,"https://"+this.region+"."+s)}}}function ac(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var ad=t6("[Surveys]"),ap="seenSurvey_",av=e=>{try{var t=""+ap+(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){ad.error("Failed to persist survey seen state",e)}},ag=["popover","widget","api"],af={ignoreConditions:!1,ignoreDelay:!1,displayType:ns},a_=t6("[PostHog ExternalIntegrations]"),am={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ay{constructor(e){this._instance=e}di(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return a_.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,s,r,n=i[0],a=i[1];!a||null!=(e=_.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.di(am[n],()=>{var e;null==(e=_.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!a&&null!=(s=_.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=_.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}}class ab{constructor(e,t){this.st=e,this.Sn=t,this.Cn=new Map,this.Mn=!1}add(e){var t=this;return b(function*(){if(t.Mn)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.Cn.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.Cn.set(e.name,e);try{var i=e.setup(t.Sn);i&&(yield i)}catch(i){var s=t.Cn.get(e.name)===e;s&&t.Cn.delete(e.name),t.st.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.Tn(e)}})()}dispose(){if(!this.Mn){this.Mn=!0;var e=Array.from(this.Cn.values()).reverse();for(var t of(this.Cn.clear(),e))this.Tn(t)}}Tn(e){try{var t=null==e.dispose?void 0:e.dispose();t&&Q(t.then)&&t.then(void 0,t=>{this.st.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.st.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class aw{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);et(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var ax="extensionsRemoteConfig";class ak{constructor(e){this.Mn=!1,this.instance=e,this.st=t5,this.En=e.In,this.kv=new aw(e),this.onEvent=e=>r6(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.st.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.Mn)return r6(()=>{});var t=t=>{try{e(t)}catch(e){this.st.error("Browser extension remote config listener failed",e)}},i=this.instance.Pn.on(ax,t);return this.En&&t(this.En),r6(i)},this.Rn=new ab(t5.createLogger("[BrowserExtensions]"),this)}get logger(){return this.st}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property(is))?e:this.distinctId}get deviceId(){var e=this.instance.get_property(is);return"string"==typeof e?e:void 0}get library(){return{name:m.LIB_NAME,version:m.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 projectToken(){return this.instance.config.token}add(e){return this.Rn.add(e)}capture(e,t,i){var s=this;return b(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 r6(this.instance.An(e))}handleRemoteConfig(e){this.Mn||(this.En=e,this.instance.Pn.emit(ax,e))}sendRequest(e,t){var i=this;return b(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?nz(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,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.Mn||(this.Mn=!0,this.Rn.dispose())}}var aE={},aS=0,aP=()=>{}
2,aF='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',aC="Surveys module not available",a$="sanitize_properties is deprecated. Use before_send instead",aI="Invalid value for property_denylist config: ",aT=["token","distinct_id",i2],aR="posthog",aM=!nj&&-1===(null==v?void 0:v.indexOf("MSIE"))&&-1===(null==v?void 0:v.indexOf("Mozilla")),aO=e=>{var t;return w({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(!ei(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of sg)if(i===s)return!1;return!0}(null==l?void 0:l.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:aP,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:u&&ei(null==u?void 0:u.search)&&-1!==u.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==n||null==(t=n.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){t5.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:st,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:aP},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:ri,ignore_text_selection:!0}
2:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},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)})},aA=[["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"]],aq=e=>{var t={};for(var i of aA){var s=i[0],r=i[1];et(e[s])||(t[r]=e[s])}var n=sh({},t,e),a=e.__preview_external_dependency_versioned_paths;return et(a)||(et(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),ei(a)&&et(e.asset_host)&&(n.asset_host=a)),X(e.property_blacklist)&&(et(e.property_denylist)?n.property_denylist=e.property_blacklist:X(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:t5.error(aI+e.property_denylist)),n};class aL{constructor(){this.__forceAllowLocalhost=!1}get Fn(){return this.__forceAllowLocalhost}set Fn(e){t5.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class aD{On(e,t){if(e){var i=this.Cn.indexOf(e);-1!==i&&this.Cn.splice(i,1)}return this.Cn.push(t),null==t.initialize||t.initialize(),t}Ln(){return this.config.cookieless_mode===i9||this.config.cookieless_mode===i4&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new aL,this.Dn=!1,this.version=m.LIB_VERSION,this.$n=new Set,this.Nn="",this.Pn=new n8,this.Cn=[],this.qn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=aO(),this.SentryIntegration=rF,this.sentryIntegration=e=>{var t;return t=rP(this,e),{name:rS,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.jn=!1,this.Bn=null,this.Hn=null,this.Un=null,this.scrollManager=new n3(this),this.pageViewManager=new rC(this),this.rateLimiter=new nn(this),this.requestRouter=new ah(this),this.consent=new sG(this),this.externalIntegrations=new ay(this);var e,t=null!=(e=aD.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=ei(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=ei(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>t5.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==aR){var s,r=null!=(s=aE[i])?s:new aD;return r._init(e,t,i),aE[i]=r,aE[aR][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,r,a,o=ei(e)?e.trim():"";if(!o)return t5.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=aO(t.defaults),t.debug=this.zn(t.debug),this.Wn=t,this.Vn=[],t.person_profiles?this.Hn=t.person_profiles:t.process_person&&(this.Hn=t.process_person);
2var l=aO(t.defaults),u=aq(t),h=sh({},l,u,{name:i,token:o});Z(l.rageclick)&&Z(u.rageclick)&&(h.rageclick=sh({},l.rageclick,u.rageclick)),Z(l.session_recording)&&Z(u.session_recording)&&(h.session_recording=sh({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&t5.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:r8;var c=this.Zn();if(this.persistence=new r5(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r5(w({},this.config,{persistence:"sessionStorage"}),c,!1),this.Nn="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&sW.N()){var d=sW.H(this.Nn);X(d)&&d.forEach(e=>{ei(e)&&this.$n.add(e)})}else sW.q(this.Nn);var p=w({},this.persistence.props),v=w({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Gn=new n0(e=>this.Qn(e),this.config.request_queue_config),this.Jn=new n2(this),this.__request_queue=[];var g=this.Ln();if(g||(this.sessionManager=new n9(this),this.sessionPropsManager=new n6(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Kn()})),this.Yn(),this.config.__preview_deferred_init_extensions?(t5.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Xn(g)},0)):(t5.info("Initializing extensions synchronously"),this.Xn(g)),m.DEBUG=m.DEBUG||this.config.debug,m.DEBUG&&t5.info("Starting in debug mode",{this:this,config:t,thisC:w({},this.config),p:p,s:v}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=w({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(r=t.bootstrap)?void 0:r.distinctID)){var f=t.bootstrap.distinctID,_=this.get_distinct_id(),y=this.persistence.get_property(iK);if(t.bootstrap.isIdentifiedID&&null!=_&&_!==f&&y===i7)this.identify(f);else if(t.bootstrap.isIdentifiedID&&null!=_&&_!==f&&y===se)t5.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 b=this.config.get_device_id(sF()),x=t.bootstrap.isIdentifiedID?b:f;this.persistence.set_property(iK,t.bootstrap.isIdentifiedID?se:i7),this.register({distinct_id:f,$device_id:x})}}if(g)this.register_once({distinct_id:i1,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(sF());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(iK,i7)}return sf(n,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||sF();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(iK,se)),t()},r=i.user();"then"in r&&Q(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register(("u">typeof Promise&&Promise.resolve||rE.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rE.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rE.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,sr),identify:e=>s(e,sa),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.ts()):this.ts(),Q(this.config._onCapture)&&this.config._onCapture!==aP&&(t5.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&t5.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 ae.apply(this,arguments)})().then(e=>{e&&this.register({[ir]:e})}).catch(aP),this}Yn(){var e,t,i,s,r,n,a=null!=(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)?e:null==(i=aD.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(s=this.es)||s.call(this),this.es=void 0,this.featureFlags=new a(this)),Q(this.featureFlags.onReloading)&&Q(this.featureFlags.setup)?this.es||(this.es=this.featureFlags.onReloading(()=>{this.Pn.emit("featureFlagsReloading",!0)}),this.rs().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}Xn(e){var t,i,s,r,n,a,o,l=performance.now(),u=w({},aD.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.Cn.push(this.exceptions=null!=(t=this.exceptions)?t:new u.exceptions(this)),u.historyAutocapture&&this.Cn.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Cn.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Cn.push(this.siteApps=new u.
2siteApps(this)),u.sessionRecording&&!e&&this.Cn.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Cn.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Cn.push(this.surveys=null!=(i=this.surveys)?i:new u.surveys(this)),u.logs&&this.Cn.push(this.logs=null!=(s=this.logs)?s:new u.logs(this)),u.metrics&&this.Cn.push(this.metrics=null!=(r=this.metrics)?r:new u.metrics(this)),u.conversations&&this.Cn.push(this.conversations=null!=(n=this.conversations)?n:new u.conversations(this)),u.productTours&&this.Cn.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Cn.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Cn.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Cn.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Cn.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,rx)),u.toolbar&&this.Cn.push(this.toolbar=null!=(a=this.toolbar)?a:new u.toolbar(this)),u.experiments&&this.Cn.push(this.experiments=null!=(o=this.experiments)?o:new u.experiments(this)),this.Cn.forEach(e=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.ns){var e=this.ns;this.ns=void 0,this.Cn.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.ss(h,l)}ss(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.ss(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){t5.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[i3]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[i5]:s}),this.config.__preview_deferred_init_extensions&&t5.info("PostHog extensions initialized ("+s+"ms)")}lr(e){var t;if(!l||!l.body)return t5.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.lr(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.ns=e),this.In=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=U(s.supportedCompression,r8)?r8:U(s.supportedCompression,r4)?r4:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Hn?this.Hn:st}),null==(t=this.os)||t.handleRemoteConfig(e),this.Cn.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}ts(){try{this.config.loaded(this)}catch(e){t5.critical("`loaded` function failed",e)}if(this.ls(),this.config.internal_or_test_user_hostname&&null!=u&&u.hostname){var e=u.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Ln())&&this.us()},1),this.hs=new no(this),this.hs.load()}ls(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Gn)||e.enable())}_dom_loaded(){this.is_capturing()&&sl(this.__request_queue,e=>this.Qn(e)),this.__request_queue=[],this.ls()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.ds()&&this.capture(sn),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.Gn)||s.unload(),null==(r=this.Jn)||r.unload()):this.ds()&&this.capture(sn,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?aM?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=w({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(et(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
2(e=>{var t,i,s,r,n,a=w({},e);a.timeout=a.timeout||6e4;var o,l,u,h,c,d=null!=(s=a.transport)?s:"fetch";"sendBeacon"===d&&et(a.compression)&&a.data&&(a.compression=r4),"POST"===a.method&&a.data&&("capture-body"===a.timestampMode?a.data={api_key:null!=(l=null==(c=(h=(X(o=a.data)?o:[o]).map(e=>w({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(u=c.properties)?void 0:u.token)?l:null==c?void 0:c.token,batch:h,sent_at:(new Date).toISOString()}:"body"===a.timestampMode&&(t=a.data,void 0===i&&(i=(new Date).toISOString()),a.data=X(t)?t.map(e=>w({},e,{sent_at:i})):w({},t,{sent_at:i}))),a.url=nQ(a.url,a.method,a.compression,a.timestampMode);var v=nZ.filter(e=>!a.disableTransport||!e.transport||!a.disableTransport.includes(e.transport)),g=null!=(r=null==(n=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===d)return e[t]}(v))?void 0:n.method)?r:v[0].method;if(!g)throw Error("No available transport method");var f=e=>{try{g(e)}catch(e){nJ(e)?t5.warn(e):t5.error(e),null==a.callback||a.callback({statusCode:0,error:e})}};"sendBeacon"!==d&&a.data&&a.compression===r8&&p&&"u">typeof Promise&&!nH?nG(a).then(e=>{f(e)}).catch(t=>{D(t)?(nH=!0,f(w({},a,{compression:void 0,url:nQ(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 D(e)||t===A})(t)&&(nH=!0),f(a))}):g(a)})(w({},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}))}Qn(e){this.Jn?this.Jn.retriableRequest(e):this._send_request(e)}_execute_array(e){aS++;try{var t,i=[],s=[],r=[];sl(e,e=>{if(e)if(X(t=e[0]))r.push(e);else if(Q(e))try{e.call(this)}catch(t){t5.error("Error executing queued PostHog call",e,t)}else X(e)&&"alias"===t?i.push(e):X(e)&&-1!==t.indexOf("capture")&&Q(this[t])?r.push(e):s.push(e)});var n=function(e,t){sl(e,function(e){try{if(X(e[0])){var i=t;su(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){t5.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{aS--}}push(e){if(aS>0&&X(e)&&ei(e[0])){var t=aD.prototype[e[0]];Q(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Gn){if(this.is_capturing())if(!et(e)&&ei(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!ei(null==t?void 0:t.$current_url)&&(t5.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.vs||t5.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h,c,d,p,v=new Date,g=(null==i?void 0:i.timestamp)||v,f=tv(null==i?void 0:i.uuid,sF),_={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},g,f)};e===sr&&this.config.__preview_capture_bot_pageviews&&l&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),u&&(_.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var m="$feature_flag_called"===e&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property(iR);(null==i?void 0:i.$set)&&!m&&(_.$set=null==i?void 0:i.$set);var y=null==i?void 0:i.$unset;y&&(_.$unset=y);var b,x,k,E=m?void 0:this.cs(null==i?void 0:i.$set_once,e!==so,e===sa);if(E&&(_.$set_once=E),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=_,a=e=>ei(e)?e.slice(0,r):e,o=new Set,_=function e(t,i){if(t!==Object(t))return a?a(t):t;if(!o.has(t)){var s;if(o.add(t),X(t))s=[],sl(t,t=>{s.push(e(t))});else{var r={};su(t,(t,i)=>{o.has(t)||(r[i]=e(t,i))}),s=r}return s}}(n)),_.timestamp=g,et(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=v),m&&(_.properties=(h=_.properties,void 0===(c=aT)&&(c=[]),d={},p=e=>{void 0!==h[e]&&(d[e]=h[e])}
2,I.forEach(p),c.forEach(p),d)),e===nt||e===ni){var S=null==t?void 0:t.$survey_id,P=null==t?void 0:t.$survey_iteration;av({id:S,current_iteration:P}),_.$set=w({},_.$set,{[(b={id:S,current_iteration:P},k="$survey_"+(x=e===ni?"responded":"dismissed")+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(k="$survey_"+x+"/"+b.id+"/"+b.current_iteration),k)]:!0})}else e===ne&&(_.$set=w({},_.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var F=null==t?void 0:t.$product_tour_type;F&&(_.$set=w({},_.$set,{["$product_tour_last_seen_date/"+F]:(new Date).toISOString()}))}var C=w({},_.properties.$set,_.$set);if(ee(C)||this.setPersonPropertiesForFlags(C),!en(this.config.before_send)){var $=this.At(_);if(!$)return;(_=$).uuid=tv(_.uuid,sF)}this.Pn.emit("eventCaptured",_);var T=null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),R={method:"POST",url:T,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(T)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Qn(R):this.Gn.enqueue(R),_}t5.critical("This capture call is ignored due to client rate limiting.")}}else t5.error("No event name provided to posthog.capture")}else t5.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}rs(){var e;return null!=(e=this.os)?e:this.os=new ak(this)}An(e){this.qn.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.qn.indexOf(e);-1!==i&&this.qn.splice(i,1)}}}fs(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.Un=null,this.persistence.get_property(iK)===i7&&(null==(s=this.sessionPersistence)||s.clear(),this.$n.clear(),this.ps()),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.fs();var a,o=r?void 0:this.persistence.remove_event_timer(e),h=w({},t);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Ln()&&(h[i2]=!0),"$snapshot"===e){var c=w({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=c.distinct_id,(!ei(h.distinct_id)&&!ea(h.distinct_id)||es(h.distinct_id))&&t5.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var d,p=function(e,t,i,s){if(void 0===s&&(s=!1),!v)return{};var r,a,o,l,h,c=e?[...rH,...t||[]]:[],d=function(e){for(var t=0;tc.length>t;t++){var i=tc[t],s=i[1],r=i[0].exec(e),n=r&&(Q(s)?s(r,e):s);if(n)return n}return["",""]}(v),p=d[0],g=d[1],f=null!=(h="u">typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},_={};et(i)||(_.detectGoogleSearchApp=i);var y={},b=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,w=null==(a=navigator)?void 0:a.maxTouchPoints,x=null==n||null==(o=n.screen)?void 0:o.width,k=null==n||null==(l=n.screen)?void 0:l.height,E=null==n?void 0:n.devicePixelRatio;et(b)||(y.userAgentDataPlatform=b),et(w)||(y.maxTouchPoints=w),et(x)||(y.screenWidth=x),et(k)||(y.screenHeight=k),et(E)||(y.devicePixelRatio=E);var S,P,F,C,$,I,T=sh(sv({$os:p,$os_version:g,$browser:tl(v,navigator.vendor,f,_),$device:td(v),$device_type:(I=td(v))===eE||I===ek||"Kobo"===I||"Kindle Fire"===I||I===e0?ex:I===ez||I===eV||I===eU||I===eX?"Console":I===eP?"Wearable":I?eb:"Android"===(null==y?void 0:y.userAgentDataPlatform)&&(null!=(P=null==y?void 0:y.maxTouchPoints)?P:0)>0?600>Math.min(null!=(F=null==y?void 0:y.screenWidth)?F:0,null!=(C=null==y?void 0:y.screenHeight)?C:0)/(null!=($=null==y?void 0:y.devicePixelRatio)?$:1)?eb:ex:"Desktop",$timezone:rZ(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rq(s?tg(null==u?void 0:u.href):null==u?void 0:u.href,c,rz),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:v.length>1e3?v.substring(0,997)+"...":v,$browser_version:th(v,navigator.vendor,f,_),$browser_language:rK(),$browser_language_prefix:"string"==typeof(S=rK())?S.split("-")[0]:void 0,$screen_height:null==n?void 0:n.screen.height,$screen_width:null==n?void 0:n.screen.width,$viewport_height:null==n?void 0:n.innerHeight,$viewport_width:null==n?void 0:n.innerWidth,$lib:m.LIB_NAME,$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return m.SDK_DIST_CHANNEL&&(T.$sdk_dist_channel=m.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
2);if(this.sessionManager){var g=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime(),!0),f=g.windowId;h.$session_id=g.sessionId,h.$window_id=f}this.sessionPropsManager&&sh(h,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&sh(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(a=this.Jn)?void 0:a.length}catch(e){h.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===aa&&(h.$lib_custom_api_host=this.config.api_host),d=e!==sr||r?e!==sn||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),h=sh(h,d),e===sr&&l&&(h.title=l.title),!et(o)){var _=i.getTime()-o;h.$duration=parseFloat((_/1e3).toFixed(3))}v&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),b=this.sessionPersistence.properties();su(["$referrer","$referring_domain"],e=>{e in y&&delete b[e]});var x={};if(this.qn.length>0)for(var k of this.qn.slice())try{sh(x,k())}catch(e){t5.error("Failed to produce browser extension event properties",e)}(h=sh({},p,y,b,w({},x,h))).$is_identified=this._isIdentified(),X(this.config.property_denylist)?su(this.config.property_denylist,function(e){delete h[e]}):t5.error(aI+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(t5.error(a$),h=E(h,e));var S=this.gs();return h.$process_person_profile=S,S&&!r&&this.ys("_calculate_event_properties"),h}cs(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.gs()||this.Dn&&!i)return e;var s,r=sh({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(t5.error(a$),r=n(r,"$set_once")),t&&(this.Dn=!0),ee(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.fs(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.$n.add(e)),this.ps()}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.$n.delete(e),this.ps()}bs(e,t){this.register({[e]:t})}Kn(){this.$n.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.$n.clear(),this.ps()}ps(){var e;if(this.Nn)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.Oi||!sW.N())sW.q(this.Nn);else{var t=[];this.$n.forEach(e=>t.push(e)),t.length>0?sW.F(this.Nn,t):sW.q(this.Nn)}}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.Pn.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:aC}),()=>{})}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:aC})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:aC})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=af),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:aC}}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:aC})}_s(e){return!e||es(e)?(t5.critical("Unique user id has not been set in posthog.identify"),!1):e===i1?(t5.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())||(t5.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
2ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return t5.uninitializedWarning("posthog.identify");if(ea(e)&&(e=e.toString(),t5.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._s(e)&&this.ys("posthog.identify")){var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.fs(!1),a=this.persistence.$i(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property(is)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property(ia)&&(this.unregister(ia),this.register({distinct_id:e}));var u,h=(this.persistence.get_property(iK)||i7)===i7,c=e!==l,d=!c&&h;if(c&&h)this.persistence.set_property(iK,se),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ni(),this.capture(sa,{distinct_id:e,$anon_distinct_id:l},{$set:t||{},$set_once:i||{}}),this.Un=ai(e,t,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(d){this.persistence.set_property(iK,se);var p=t||{},v=i||{};this.setPersonPropertiesForFlags({$set:p,$set_once:v},!1),this.config.cookieWinsOnConflict&&this.persistence.Ni(),this.capture("$set",{$set:p,$set_once:v}),this.Un=ai(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);c||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(iU)):d&&(t||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.Bi(o)}}}setPersonProperties(e,t){if((e||t)&&this.ys("posthog.setPersonProperties")){var i=ai(this.get_distinct_id(),e,t);this.Un!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Un=i):t5.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(X(e)?e:[e]).filter(e=>ei(e)&&e.length>0);0!==i.length&&this.ys("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Un=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.fs();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:w({},r,{[e]:t})}),n||i){var a={$group_type:e,$group_key:t};i&&(a.$group_set=i),this.capture(so,a)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else t5.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.ys("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=el(e)?e:null==e?void 0:e.resetDeviceID,i=el(e)||null==e?void 0:e.bootstrap;this.ws(t,!1,i)}ws(e,t,i){if(void 0===t&&(t=!1),t5.info("reset"),!this.__loaded)return t5.uninitializedWarning("posthog.reset");var s,r,n,a,o,l,u,h,c,d,p,v,g,f,_,m,y,b,x=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.Wn)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.hr());var k=this.get_property(is),E=this.get_property(ir),S=this.get_property(im),P=this.is_capturing();this.consent.reset(),t||!P||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var F=null==(n=this.persistence)||null==n.$i?void 0:n.$i(),C=!1;try{if(null==(a=this.persistence)||a.clear(),null==(o=this.sessionPersistence)||o.clear(),this.$n.clear(),this.ps(),et(S)||null==(f=this.persistence)||f.register({[im]:S}),null==(l=this.surveys)||l.reset(),null==(u=this.hs)||u.stop(),null==(h=this.featureFlags)||h.reset(),null==(c=this.conversations)||c.reset(),null==(d=this.logs)||d.reset(),null==(p=this.metrics)||p.reset(),null==(v=this.persistence)||v.set_property(iK,i7),null==(g=this.sessionManager)||g.resetSessionId(),this.Un=null,this.config.cookieless_mode===i9)this.register_once({distinct_id:i1,$device_id:null},"");else{var $=this.config.get_device_id(sF());this.register_once({distinct_id:$,$device_id:e?$:k},""),e||et(E)||this.register({[ir]:E})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.Ln()||(null==(y=this.persistence)||y.set_property(iK,i.isIdentifiedID?se:i7),this.register({distinct_id:i.distinctID})),null==(_=this.featureFlags)||_.initialize(),!(et(x)||null!=(m=this.sessionManager)&&m.setBootstrapSessionId(x,!0)))){var I=w({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,C=!0}finally{F&&(null==(b=this.persistence)||null==b.Bi||b.Bi(C))}this.reloadFeatureFlags()}shutdown(e){var t=this;return b(function*(){var e,i,s,r,n,a,o,l;if(t.__loaded){null==(e=t.hs)||e.stop(),null==(i=t.os)||i.dispose(),null==(s=t.sessionRecording)||s.dispose(),null==(r=t.logs)||r.flushLogs("sendBeacon"),null==(n=t.metrics)||n.flush("sendBeacon"),null==(a=t.Gn)||a.unload(),null==(o=t.Jn)||o.unload();try{null==(l=t.featureFlags)||l.destroy()}catch(e){t5.error("Error while destroying feature flags",e)}}else t5.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.ks()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.xs()}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(it)?(t5.critical("Attempting to create alias for existing People user - aborting."),-2):this.ys("posthog.alias")?(et(t)&&(t=this.get_distinct_id()),e!==t?(this.bs(ia,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(t5.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=w({},this.config);if(Z(e)){sh(this.config,aq(e));var i,s,r,n,a,o,l,u,h,c,d,p,v=this.Zn();null==(i=this.persistence)||i.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r5(w({},this.config,{persistence:"sessionStorage"}),v,!1);var g=this.zn(this.config.debug);el(g)&&(this.config.debug=g),el(this.config.debug)&&(this.config.debug?(m.DEBUG=!0,sM.N()&&sM.F("ph_debug",!0),t5.info("set_config",{config:e,oldConfig:t,newConfig:w({},this.config)})):(m.DEBUG=!1,sM.N()&&sM.q("ph_debug"))),null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.hr()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||
2c.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.Ss(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){m.LIB_NAME=e,m.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){if(this.exceptions){var i=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(w({},s,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:aD.Cs}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:aR;return t!==aR&&(t=aR+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iK))===se||(null==(t=this.sessionPersistence)?void 0:t.get_property(iK))===se}gs(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===st&&!this._isIdentified()&&ee(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[ia])&&(null==(t=this.persistence)||null==(t=t.props)||!t[i0]))}ds(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.gs()||this.ys("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ys("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ys(e){return"never"===this.config.person_profiles?(t5.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.bs(i0,!0),!0)}Zn(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==i4)}Ss(){var e,t,i,s,r=this.Zn();return(null==(e=this.persistence)?void 0:e.Oi)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Oi)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r&&(this.$n.clear(),this.ps()),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==i9){if(this.Ln()){this.ws(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new n9(this),this.pageViewManager=new rC(this),this.persistence&&(this.sessionPropsManager=new n6(this,this.sessionManager,this.persistence));var i,s,r,n,a,o,l,u,h=null!=(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)?a:null==(l=aD.__defaultExtensionClasses)?void 0:l.sessionRecording;h&&(this.sessionRecording=this.On(this.sessionRecording,new h(this)),this.In&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.In)))}this.consent.optInOut(!0),this.Ss(),this.ls(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==i4&&(null==(i=this.surveys)||i.loadIfEnabled()),(et(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.us()}else t5.warn(aF)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==i9?(this.config.cookieless_mode===i4&&this.consent.isOptedIn()&&this.ws(!0,!0),this.consent.optInOut(!1),this.Ss(),this.config.cookieless_mode===i4&&(this.register({distinct_id:i1,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewM
2anager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.us(),this.ls())):t5.warn(aF)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===i9||(this.config.cookieless_mode===i4?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Ss()}_is_bot(){return o?n7(o,this.config.custom_blocked_useragents):void 0}us(){l&&("visible"===l.visibilityState?this.jn||(this.jn=!0,this.capture(sr,{title:l.title},{send_instantly:!0}),this.Bn&&(l.removeEventListener(si,this.Bn),this.Bn=null)):this.Bn||(this.Bn=this.us.bind(this),sf(l,si,this.Bn)))}debug(e){!1===e?(null==n||n.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==n||n.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}))}hr(){var e,t,i,s,r=this.Wn||{};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?(t5.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&&!en(r[e]),s=t in r&&!en(r[t]),i?r[e]:!!s&&(t5&&t5.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}At(e){if(en(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(eh),s=X(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s){if(en(r=n(r))){var a="Event '"+e.event+"' was rejected in beforeSend function";return eu(e.event)?t5.warn(a+". This can cause unexpected behavior."):t5.info(a),null}r.properties&&!ee(r.properties)||t5.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(r.properties&&en(r.properties[o]))return t5.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.fi)?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)})}zn(e){var t=el(e)&&!e,i=sM.N()&&"true"===sM.P("ph_debug");return!t&&(!!i||e)}}aD.__defaultExtensionClasses={},aD.Cs={trace:i=()=>{},debug:i,info:i,warn:i,error:i,fatal:i},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=sp(e.prototype[t[i]])}(aD,["identify"]);class aj{constructor(e){this.disabled=!1===e;var t=Z(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}}var aN="$copy_autocapture",aH=t6("[AutoCapture]");function aB(e,t){return t.length>e?t.slice(0,e)+"...":t}var az=t6("[ExceptionAutocapture]"),aU=()=>{},aV=t6("[TracingHeaders]"),aW=t6("[Web Vitals]"),aG="disabled",aK="lazy_loading",aJ="awaiting_config",aY="missing_config";t6("[SessionRecording]"),t6("[SessionRecording]");var aX="[SessionRecording]",aQ=t6(aX),aZ=t6("[Heatmaps]");function a0(e){return Z(e)&&"clientX"in e&&"clientY"in e&&ea(e.clientX)&&ea(e.clientY)}var a1=t6("[Product Tours]"),a2=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(ig))},a3=["$set_once","$set"],a5=t6("[SiteApps]"),a6="Error while initializing PostHog app with config id ";function a8(e,t,i){if(en(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}}class a4{constructor(e){this.Ms=new n8,this.Ts=(e,t)=>this.Es(e,t)&&this.Is(e,t)&&this.Ps(e,t)&&this.Rs(e,t),this.Es=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.As=new Set,this.Fs=new Set}init(){var e,t;et(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!et(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
2=>{var t,i;null==(t=this.Fs)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.As)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.As.has(e)||this.As.has(t.event))&&this.Fs&&(null==(i=this.Fs)?void 0:i.size)>0&&this.Fs.forEach(e=>{this.Os(t,e)&&this.Ms.emit("actionCaptured",e.name)})}Ls(e){this.onAction("actionCaptured",t=>e(t))}Os(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Ts(e,i))return!0;return!1}onAction(e,t){return this.Ms.on(e,t)}Is(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||!a8(s,t.url,t.url_matching||"contains"))return!1}return!0}Ps(e,t){return!!this.Ds(e,t)&&!!this.$s(e,t)&&!!this.Ns(e,t)}Ds(e,t){if(null==t||!t.href)return!0;var i=this.qs(e);if(i.length>0)return i.some(e=>a8(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&&a8((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}$s(e,t){if(null==t||!t.text)return!0;var i=this.qs(e);if(i.length>0)return i.some(e=>a8(e.text,t.text,t.text_matching||"exact")||a8(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;!en(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=>a8(e,n,a)))}Ns(e,t){if(null==t||!t.selector)return!0;var i,s,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}qs(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Rs(e,t){return null==t||!t.properties||0===t.properties.length||an(t.properties.reduce((e,t)=>{var i=X(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)}}class a9{constructor(e){var t;this.js=[],this._instance=e,this.Bs=new Map,this.Hs=new Map,this.Us=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId(e=>this.zs(e))}Ws(e){return!1}Vs(){return null}Zs(e){}Gs(){}Qs(e,t){return!!e&&an(e.propertyFilters,null==t?void 0:t.properties)}Js(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}Ks(e,t,i){var s=(i===r9?this.Bs:this.Hs).get(e),r=[];return this.Ys(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.Qs(n,t)})}register(e){var t;et(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Xs(e),this.ta(e))}ta(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.ea&&(this.ea=new a4(this._instance),this.ea.init(),this.ea.Ls(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.ea)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.Us.get(t.name);i&&i.push(e.id),this.Us.set(t.name,i||[e.id])}}))}))}Xs(e){var t,i=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}),s=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});0===i.length&&0===s.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.Bs=this.Js(e,r9),this.Hs=this.Js(e,r7))}onEvent(e,t){var i,s,r=this.ia(),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.ra(e,n);if("consume"===a)return r.info("event consumed activated item, remov
2ing it",{event:e,itemId:n}),void this.na([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.sa(n),void this.aa([n])}if(this.Hs.has(e)){var o=this.Ks(e,t,r7);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.na(o.map(e=>e.id)),o.forEach(e=>this.oa(e.id)))}if(this.Bs.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Bs.get(e)});var l=this.Ks(e,t,r9);this.la(l.map(e=>e.id))}}onAction(e){this.Us.has(e)&&this.la(this.Us.get(e)||[])}la(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.Ws(r)?this.sa(r)&&this.ua(r):s.push(r);s.length>0&&(this.js=[...new Set([...this.js,...s])]),this.ia().info("updating activated items",{activatedItems:this.getActivatedIds()})}}sa(e){this.js=this.js.filter(t=>t!==e);var t=this.ha();return!t.includes(e)&&(this.da([...t,e]),this.va(),!0)}na(e){var t=new Set(e);this.js=this.js.filter(e=>!t.has(e));var i=this.ca(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.da(s),0===s.length&&this.fa()),this.aa(e)}pa(){var e,t=this.Vs();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}ua(e){if(this.Vs()){var t=this.pa();this.Zs(w({},t,{[e]:Date.now()}))}}aa(e){if(this.Vs()){var t=this.pa(),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&&(ee(i)?this.Gs():this.Zs(i))}}ga(){this.Vs()&&this.Gs()}getActivationTimestamp(e){if(this.ha().includes(e)){var t=this.pa()[e];return ea(t)?t:void 0}}ca(){var e,t=this.ma();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}ha(){var e,t,i=this.ca();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.ya()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}va(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.ba(t)}fa(){this._a()}zs(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.ya()];if(i&&i!==e){var s=this.ca(),r=this.pa();s.length>0&&(this.da([]),s.filter(e=>ea(r[e])).forEach(e=>this.oa(e))),this.fa(),this.ga()}}getActivatedIds(){return[...new Set([...this.ha(),...this.js])].filter(e=>!this.wa(e))}reset(){this.js=[],this.ca().length>0&&this.da([]),this.fa(),this.ga()}getEventToItemsMap(){return this.Bs}ka(){return this.ea}}class a7 extends a9{constructor(e){super(e)}ma(){return iN}ya(){return iH}Vs(){return iB}Zs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iB]:e})}Gs(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iB)}Ws(e){this.Ys(t=>{i=t.find(t=>t.id===e)});var t,i,s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return ea(s)&&s>0}xa(){return ne}Ys(e){var t;null==(t=this._instance)||t.getSurveys(e)}oa(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}ia(){return ad}da(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iN]:e})}ba(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iH]:e})}_a(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iH)}wa(){return!1}ra(e,t){var i,s,r;return this.Ys(e=>{r=e.find(e=>e.id===t)}),!r||ac(i=r)&&!(null==(s=i.conditions)||null==(s=s.events)||!s.repeatedActivation)||"always"===i.schedule?e===ne?"consume":"ignore":e===ne?"persist":e===nt||e===ni?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var oe="SDK is not enabled or survey functionality is not yet loaded",ot="Disabled. Not loading surveys.",oi=null!=n&&n.location?rL(n.location.hash,"__posthog")||rL(location.hash,"state"):null,os="_postHogToolbarParams",or=t
26("[Toolbar]"),on=t6("[FeatureFlags]");class oa{constructor(e,t){void 0===t&&(t=!1),this.Sa=!1,this.update(e,t)}update(e,t){var i,s,r,n;this.Ca={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,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?"none":"base64",evaluationContexts:null!=(r=null!=(n=e.evaluation_contexts)?n:e.evaluation_environments)?r:[],flagKeys:X(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.Sa||(on.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Sa=!0),et(e.flag_keys)||X(e.flag_keys)||on.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Ca}}var oo=t6("[FeatureFlags]"),ol=t6("[FeatureFlags]",{debugEnabled:!0}),ou="\" failed. Feature flags didn't load in time.",oh="connection_error",oc=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},od=e=>{var t={};for(var i of sc(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},op=t6("[Error tracking]"),ov=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],og="Refusing to render web experiment since the viewer is a likely bot",of={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>at(t,e),not_regex:(e,t)=>!at(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class o_{get qe(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{o_.Ma("retrieved web experiments from the server"),t.Ta=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Ta&&(o_.Ma("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Ta)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);ei(s)&&e.variants[s]&&t.Ea(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];o_.Ia(n,t._instance)&&t.Ea(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())o_.Ma(og);else if(!this.qe.disable_web_experiments){if(en(this.Ta))return this.Ta=new Map,this.loadIfEnabled(),void this.previewWebExperiment();o_.Ma("applying feature flags",e),e.forEach(e=>{var t;if(this.Ta&&null!=(t=this.Ta)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Ta)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Ea(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=o_.getWindowLocation();if(null!=e&&e.search){var t=rA(null==e?void 0:e.search,"__experiment_id"),i=rA(null==e?void 0:e.search,"__experiment_variant");t&&i&&(o_.Ma("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Pa(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.qe.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.qe.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.qe.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Pa(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(o_.Ma("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Ea(s[0].name,t,s[0].variants[t].transforms))}static Ia(e,t){return!en(e.conditions)&&o_.Ra(e,t)&&o_.Aa(e)}static Ra(e,t){if(en(e.conditions)||en(null==(s=e.conditions)?void 0:s.url))return!0;var i=o_.getWindowLocation();if(i){var s,r,n,a,o=sK(t,i.href);return null==(r=e.conditions)||!r.url||of[null!=(n=null==(a=e.conditions)?void 0:a.urlMatchType)?n:"icontains"](e.conditions.url,o)}return!1}
2static getWindowLocation(){return null==n?void 0:n.location}static Aa(e){if(en(e.conditions)||en(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rV();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 Ma(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];t5.info("[WebExperiments] "+e,i)}Ea(e,t,i){this._is_bot()?o_.Ma(og):"control"!==t?i.forEach(i=>{if(i.selector){o_.Ma("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):o_.Ma("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?n7(o,this.qe.custom_blocked_useragents):void 0}}var om=t6("[Conversations]"),oy="Conversations not available yet.",ob="console",ow="__posthogHandledLogsRequestError",ox=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[ow]=!0,i},ok=e=>!!e&&"object"==typeof e&&!0===e[ow],oE={featureFlags:class{constructor(e){this.name="featureFlags",this.Fa=!1,this.featureFlagEventHandlers=[],this.st=oo,this.Oa={},this.La={},this.Da=[],this.$a=!1,this.Na=!1,this.qa=0,this.ja=!1,this.Ba=!1,this.Ha=!1,this.Ua=!1,this.za=0,this.Wa=()=>{var e=this.Va();this.za=0,e&&this.reloadFeatureFlags()},"get"in e?this.Za=e:(this.Ga=new oa(e.config,e.hr()),this.Za=this.Ga)}updateConfig(e,t){var i;null==(i=this.Ga)||i.update(e,t)}setup(e){var t,i;return this.Qa=e,this.st=e.logger.createLogger("[FeatureFlags]"),i=()=>{this.Qa===e&&(this.Qa=void 0,this.Sn=e,this.Ja(e))},null!=(t=e.kv.initialize())&&t.then?t.then(i):i()}Ja(e){if(this.Sn===e)return n&&sf(n,"online",this.Wa),this.Ka=e.registerDynamicEventProperties(()=>this.Ya()?this.Oa:this.La),this.Xa(),this.initialize()}destroy(){null==n||n.removeEventListener("online",this.Wa)}dispose(){var e;this.qa++,this.Ba=!1,this.Qa=void 0,this.Sn&&(this.eo(),null==(e=this.Ka)||e.dispose(),this.Ka=void 0,this.Da=[],null==n||n.removeEventListener("online",this.Wa),this.Sn=void 0)}get qe(){return this.Za.get()}io(e){var t;return null==(t=this.Sn)?void 0:t.kv.get(e)}F(e){this.ro(()=>{var t;return null==(t=this.Sn)?void 0:t.kv.set(e)})}q(e){this.ro(()=>{var t;return null==(t=this.Sn)?void 0:t.kv.remove(e)})}ro(e){try{e()}catch(e){this.st.error("Failed to update feature flag persistence",e)}}Xa(){var e={};for(var t of[iF,iI,iT,iM]){var i=this.io(t);et(i)||(e[t]=i)}this.Oa=e;var s=w({},e),r=this.io(iP);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.La=s}Ya(){var e=this.qe.cacheTtlMs;if(!e||0>=e)return!1;var t=this.io(iG);return"number"!=typeof t||Date.now()-t>e}no(){return!!this.Ya()&&(this.Ua||this.Na||(this.Ua=!0,this.st.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}so(){var e=this.qe.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.st.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}ao(){var e=this.qe.flagKeys;if(!et(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.st.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this.qe,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=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(e[t]=a[t],e),{});return this.oo({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!=(s=this.io(iP))?s:{},a=null!=i&&i.merge&&null!=(r=this.io(iI))?r:{},o=w({},n,e),l=w({},a,t),u={};for(var h of Object.entries(o)){var c=h[0],d=h[1];u[c]={key:c,enabled:E(d),variant:S(d),reason:void 0,metadata:et(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.oo({flags:u})}get hasLoadedFlags(){return this.$a}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.io(i$),t=this.io(iM),i=this.io(iO);if(!i&&!t)return e||{};var s=sh({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],l=null==t?void 0:t[r],u=et(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,h=et(l)?null==o?void 0:o.variant:"string"==typeof l?l:void 0,c=null==i?void 0:i[r],d=w({},o,{enabled:u,variant:u?null!=h?h:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),h!==(null==o?void 0:o.variant)&&(
2d.original_variant=null==o?void 0:o.variant),c&&(d.metadata=w({},null==o?void 0:o.metadata,{payload:c,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=d}return this.Fa||(this.st.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.Fa=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:E(s),variant:S(s),payload:k(t[i])}})}getFlagVariants(){var e=this.io(iP),t=this.io(iM);if(!t)return e||{};for(var i=sh({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Fa||(this.st.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Fa=!0),i}getFlagPayloads(){var e=this.io(iI),t=this.io(iO);if(!t)return e||{};for(var i=sh({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Fa||(this.st.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Fa=!0),i}reloadFeatureFlags(){this.ja||this.qe.featureFlagsDisabled||this.Va()||this.lo||(this.Da.slice().forEach(e=>{try{e()}catch(e){this.st.error("Error while running feature flags reloading callback",e)}}),this.lo=setTimeout(()=>{this.uo()},5))}eo(){clearTimeout(this.lo),this.lo=void 0}onReloading(e){return this.Da.push(e),()=>{this.Da=this.Da.filter(t=>t!==e)}}ensureFlagsLoaded(){this.$a||this.Na||this.lo||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ja=e}resetFlagCallReported(){this.q(iU)}uo(e){this.eo();var t=this.Sn;if(t&&!this.qe.remoteRequestsDisabled&&!this.Va())if(this.Na)this.Ba=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:w({},t.initialPersonProperties,this.io(iA)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.io(iq),timezone:rZ()};et(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.qe.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.so();s.length&&(i.evaluation_contexts=s);var r=this.ao();et(r)||(i.flag_keys=r);var n=this.qe.onlyEvaluateSurveyFeatureFlags,a=this.qa;this.Na=!0;var o=()=>{this.Ba&&(this.Ba=!1,this.uo())},l=e=>{this.Na=!1,a===this.qa&&(this.F({[iW]:[oh]}),this.st.error("Feature flag request failed",e)),o()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:"base64"===this.qe.compression?r4:void 0,sentAt:"body",timeoutMs:this.qe.requestTimeoutMs}).then(e=>{var t,s,r=null!=(t=e.json)?t:{},l=200!==e.statusCode;if(this.Na=!1,a===this.qa){if(this.ho(e.statusCode),l||this.Ba||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Ba){this.Ha=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?oh:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),r.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(s=r.quotaLimited)||!s.includes("feature_flags"));h&&u.push("quota_limited"),this.F({[iW]:u}),h?this.st.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.oo(r,l,{partialResponse:n}),o()}}else o()}).catch(l)}catch(e){l(e)}}}Va(){return rD(this.za,3)}ho(e){this.za=rj(e,this.za,3,()=>this.st.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.Ha)if(this.$a||this.getFlags()&&this.getFlags().length>0){if(!this.no()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else this.st.warn('getFeatureFlag for key "'+e+ou)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.Ha)if(this.$a||this.getFlags()&&this.getFlags().length>0){if(!this.no()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],a=this.getFlagPayloads()[e],o=String(n),l=this.io(iT)||void 0,u=this.io(iG)||void 0,h=this.io(iU)||{};if(this.qe.deduplicateCallsPerSession){var c,d=null==(c=this.Sn)?void 0:c.session.sessionId,p=this.io(iV);d&&d!==p&&(h={},i=d)}if(!t.send_event&&"send_event"in t)i&&this.F({[iU]:h,[iV]:i});else if(e in h&&h[e].includes(o))i&&this.F({[iU]:h,[iV]:i});else{X(h[e])?h[e].push(o):h[e]=[o],this.F(w({[iU]:h},i?{[iV]:i}:{}));var v=this.getFeatureFlagDetails(e),g=[...null!=(_=this.io(iW))?_:[]];et(n)&&g.push("flag_missing");var f={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!=(m=null==(y=this.qe.bootstrap)||null==(y=y.featureFlags)?void 0:y[e])?m:null,$feature_flag_bootstrapped_payload:null!=(b=null==(x=this.qe.bootstrap)||null==(x=x.featureFlagPayloads)?void 0:x[e])?b:null,$used_bootstrap_value:!this.Ha};et(null==v||null==(E=v.metadata)?void 0:E.has_experiment)||(f.$feature_flag_has_experiment=v.metadata.has_experiment),et(null==v||null==(S=v.metadata)?void 0:S.version)||(f.$feature_flag_version=v.metadata.version);var _,m,y,b,x,E,S,P,F,C,$,I,T,R=null!=(P=null==v||null==(F=v.reason)?void 0:F.description)?P:null==v||null==(C=v.reason)?void 0:C.code;R&&(f.$feature_flag_reason=R),null!=v&&null!=($=v.metadata)&&$.id&&(f.$feature_flag_id=v.metadata.id),et(null==v?void 0:v.original_variant)&&et(null==v?void 0:v.original_enabled)||(f.$feature_flag_original_response=et(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(I=v.metadata)&&I.original_payload&&(f.$feature_flag_original_payload=null==v||null==(T=v.metadata)?void 0:T.original_payload),g.length&&(f.$feature_flag_error=g.join(",")),this.do(f)}if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k(a)}}}else this.st.warn('getFeatureFlagResult for key "'+e+ou)}do(e){try{var t;null==(t=this.Sn)||t.capture("$feature_flag_called",e).catch(e=>{this.st.error("Failed to capture feature flag call",e)}
2)}catch(e){this.st.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.vo(e,t)}vo(e,t){var i=this;return b(function*(){var s=i.Sn;if(s){var r={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},n=i.so();n.length&&(r.evaluation_contexts=n);var a,o=i.ao();et(o)||(r.flag_keys=o);try{var l,u=null==(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:"base64"===i.qe.compression?r4:void 0,sentAt:"body",timeoutMs:i.qe.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[e])||void 0}catch(e){return void i.st.error("Remote config feature flag request failed",e)}try{t(a)}catch(e){i.st.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.Ha)return t.defaultValue;if(!(this.$a||this.getFlags()&&this.getFlags().length>0))return this.st.warn('isFeatureEnabled for key "'+e+ou),t.defaultValue;var i=this.getFeatureFlag(e,t);return et(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.oo(e,t,i)}oo(e,t,i){if(this.Sn){this.$a=!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=oo);var a,o,l=(a=n,(o=e.flags)?w({},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 null==(t=o[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&a.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)),u=l.flags,h=l.featureFlags,c=l.featureFlagPayloads;if(h){var d=e.requestId,p=e.evaluatedAt;if(X(h)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(h)for(var g=0;h.length>g;g++)v[h[g]]=!0;return{[iF]:h,[iP]:v,[iR]:!1}}var f=h,_=c,m=u;if(null!=r&&r.partialResponse)f=w({},t,f),_=w({},i,_),m=w({},s,m);else if(e.errorsWhileComputingFlags)if(u){var y=new Set(Object.keys(u).filter(e=>{var t;return!(null!=(t=u[e])&&t.failed)}));f=w({},t,Object.fromEntries(Object.entries(f).filter(e=>y.has(e[0])))),_=w({},i,Object.fromEntries(Object.entries(_||{}).filter(e=>y.has(e[0])))),m=w({},s,Object.fromEntries(Object.entries(m||{}).filter(e=>y.has(e[0]))))}else f=w({},t,f),_=w({},i,_),m=w({},s,m);return w({[iF]:Object.keys(od(f)),[iP]:f||{},[iI]:_||{},[i$]:m||{},[iR]:!0===e.minimalFlagCalledEvents},d?{[iT]:d}:{},p?{[iG]:p}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.st);s&&this.F(s),t||(this.Ua=!1),this.co(t)}}override(e,t){void 0===t&&(t=!1),this.st.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.fo(e)}fo(e){if(this.Sn){if(!1===e)return this.q([iM,iO]),this.co(),void ol.info("All overrides cleared");if(X(e))return this.F({[iM]:oc(e)}),this.co(),void ol.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.Fa=!!(null!=(t=e.suppressWarning)&&t);var t,i={},s=e.flags,r=e.payloads;return s&&(i[iM]=X(s)?oc(s):s),r&&(i[iO]=r),Object.keys(i).length&&this.F(i),!1===s&&!1===r?this.q([iM,iO]):!1===s?this.q(iM):!1===r&&this.q(iO),this.co(),!1===s?ol.info("Flag overrides cleared"):s&&ol.info("Flag overrides set",{flags:s}),void(!1===r?ol.info("Payload overrides cleared"):r&&ol.info("Payload overrides set",{payloads:r}))}if(e&&"object"==typeof e)return this.F({[iM]:e}),this.co(),void ol.info("Flag overrides set",{flags:e});this.st.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.st.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.$a){var t=this.po(),i=t.flags,s=t.flagVariants;try{e(i,s)}catch(e){this.st.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.io(iC)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(a.$early_access_feature_name=r.name),i&&(a.$feature_enrollment_stage=i);var o=w({},this.getFlagVariants(),{[e]:t});this.F({[iF]:Object.keys(od(o)),[iP]:o,[iA]:w({},this.io(iA)||{},n)}),this.co();try{null==(s=this.Sn)||s.capture("$feature_enrollment_update",a).catch(e=>{this.st.error("Failed to capture early access feature enrollment",e)})}catch(e){this.st.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.io(iC);!s||t?this.mo(e,i):e(s)}mo(e,t){var i=this;return b(function*(){var s=i.Sn;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;i.F({[iC]:r=a.json.earlyAccessFeatures})}catch(e){return void i.st.error("Early access feature request failed",e)}try{e(r)}catch(e){i.st.error("Early access feature callback failed",e)}}})()}po(){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),{})}}co(e){this.Xa();var t=this.po(),i=t.flags,s=t.flagVariants;
2this.featureFlagEventHandlers.forEach(t=>{try{t(i,s,{errorsLoading:e})}catch(e){this.st.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.yo(e,t)}yo(e,t){void 0===t&&(t=!0);var i=this.io(iA)||{},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.F({[iA]:w({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=w({},this.io(iA)||{});e.forEach(e=>{delete i[e]}),this.F({[iA]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.q(iA),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.io(iq)||{},s=w({},i);for(var r of Object.keys(e))s[r]=w({},i[r],e[r]);this.F({[iq]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.io(iq)||{};this.F({[iq]:w({},t,{[e]:{}})})}else this.q(iq)}reset(){this.qa++,this.Ba=!1,this.Oa={},this.La={},this.$a=!1,this.ja=!1,this.Ha=!1,this.$anon_distinct_id=void 0,this.eo(),this.Fa=!1,this.za=0}}},oS=w({productTours:class{get jr(){return this._instance.persistence}constructor(e){this.Al=null,this.Fl=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,s=e.config;if("productTours"in s){if(this.jr&&this.jr.register({[ig]:!!s.productTours}),!a2(this._instance))return!this.Al&&en(null==(t=this.jr)?void 0:t.props[iz])||a1.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.Al)||i.stop(),this.Al=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Al&&a2(this._instance)&&this.di(()=>this.Ol())}di(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?a1.error("Could not load product tours script",t):e()})}Ol(){var e;!this.Al&&null!=(e=_.__PosthogExtensions__)&&e.generateProductTours&&(this.Al=_.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!X(this.Fl)||t){var i=this.jr;if(i){var s=i.props[iz];if(X(s)&&!t)return this.Fl=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(a2(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||a1.warn(r):a1.error(r),void e([],{isLoaded:!1,error:r})}var n=X(t.json.product_tours)?t.json.product_tours:[];this.Fl=n,i&&i.register({[iz]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Fl,{isLoaded:!0})}getActiveProductTours(e){en(this.Al)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Al.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Al)||t.showTourById(e)}previewTour(e){this.Al?this.Al.previewTour(e):this.di(()=>{var t;this.Ol(),null==(t=this.Al)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Al)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Al)||e.nextStep()}previousStep(){var e;null==(e=this.Al)||e.previousStep()}clearCache(){var e;this.Fl=null,null==(e=this.jr)||e.unregister(iz)}resetTour(e){var t;null==(t=this.Al)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Al)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Al)||t.cancelPendingTour(e)}}},oE),oP=w({surveys:class{get qe(){return this._instance.config}constructor(e){this.Kl=void 0,this._surveyManager=null,this.Yl=!1,this.Xl=[],this.tu=null,this.eu=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qe.disable_surveys){if(!e.ok)return ad.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(en(t))return ad.warn("Flags not loaded yet. Not loading surveys.");var i=X(t);this.Kl=i?t.length>0:t,ad.info("flags response received, isSurveysEnabled: "+this.Kl),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(ap)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}
2t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.Yl)ad.info("Already initializing surveys, skipping...");else if(this.qe.disable_surveys)ad.info(ot);else if(this.qe.cookieless_mode&&this._instance.consent.isOptedOut())ad.info("Not loading surveys in cookieless mode without consent.");else{var e=null==_?void 0:_.__PosthogExtensions__;if(e){if(!et(this.Kl)||this.qe.advanced_enable_surveys){var t=this.Kl||this.qe.advanced_enable_surveys;this.Yl=!0;try{var i=e.generateSurveys;if(i)return void this.iu(i,t);var s=e.loadExternalDependency;if(!s)return void this.ru(i8);s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.ru("Could not load surveys script",i):this.iu(e.generateSurveys,t)})}catch(e){throw this.ru("Error initializing surveys",e),e}finally{this.Yl=!1}}}else ad.error("PostHog Extensions not found.")}}iu(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new a7(this._instance),ad.info("Surveys loaded successfully"),this.nu({isLoaded:!0})}ru(e,t){ad.error(e,t),this.nu({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Xl.push(e),this._surveyManager&&this.nu({isLoaded:!0}),()=>{this.Xl=this.Xl.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.qe.disable_surveys)return ad.info(ot),e([]);var i,s=this._instance.get_property(iD);s&&!t?(e(s,{isLoaded:!0}),this.su()&&this.getSurveys(()=>{},!0)):"u">typeof Promise&&this.tu?this.tu.then(t=>e(t.surveys,t.context)):("u">typeof Promise&&(this.tu=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qe.token),method:"GET",timestampMode:"query",timeout:this.qe.surveys_request_timeout_ms,callback:t=>{this.tu=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;0!==s?ad.error(r):t.error||ad.warn(r),this.eu=Date.now();var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}this.eu=null;var a,o,l=t.json.surveys||[],u=l.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(ac(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(a=this._instance.persistence)||a.register({[iD]:l,[ij]:Date.now()});var h={isLoaded:!0};e(l,h),null==i||i({surveys:l,context:h})}}))}su(){return this.au()&&!this.tu&&!this.ou()}au(){var e=this._instance.get_property(ij);return ea(e)&&Date.now()-e>3e5}ou(){return ea(this.eu)&&3e5>Date.now()-this.eu}markSurveyAsSeen(e,t){var i;av({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}nu(e){for(var t of this.Xl)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){ad.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!en(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);ad.warn("init was not called")}lu(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}uu(e){if(en(this._surveyManager))return{eligible:!1,reason:oe};var t="string"==typeof e?this.lu(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}hu(e){if(en(this._surveyManager))return{eligible:!1,reason:oe};var t="string"==typeof e?this.lu(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(en(this._surveyManager))return ad.warn("init was not called"),{visible:!1,disabledReason:oe};var t=this.hu(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return en(this._surveyManager)?(ad.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:oe})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.hu(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(en(this._surveyManager))ad.warn("init was not called");else{var r="string"==typeof e?this.lu(e):e;if(null!=r&&r.id)if(ag.includes(r.type)){var n=null==l?void 0:l.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(ad.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;ad.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),ad.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);ad.warn("Survey element not found")}else ad.warn("Surveys of type "+r.type+" cannot be rendered in the app");else ad.warn("Survey not found")}}displaySurvey(e,t){var i;if(en(this._surveyManager))ad.warn("init was not called");else{var s=this.lu(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=w({},s,{appearance:w({},s.appearance,{surveyPopupDelaySeconds:0})}
2)),t.displayType!==ns&&t.initialResponses&&ad.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.uu(s);if(!n.eligible)return void ad.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 ad.warn("Survey not found")}}cancelPendingSurvey(e){en(this._surveyManager)?ad.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},oE),oF=w({experiments:o_},oE),oC=w({},oE,{sessionRecording:class{get qe(){return this._instance.config}get jr(){return this._instance.persistence}get started(){var e;return!(null==(e=this.bo)||!e.isStarted)}get status(){var e,t;return this._o===aJ||this._o===aY?this._o:null!=(e=null==(t=this.bo)?void 0:t.status)?e:this._o}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._o=aG,this.wo=void 0,this.ko=!1,this.xo=(()=>{if(null==l||!l.visibilityState||"visible"===l.visibilityState)return!0;var e,t=null==n||null==(e=n.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.Ee=()=>{var e;"visible"===(null==l?void 0:l.visibilityState)&&(this.xo=!0,null==(e=this.bo)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw aQ.error("started without valid sessionManager"),Error(aX+" started without valid sessionManager. This is a bug.");if(this.qe.cookieless_mode===i9)throw Error(aX+' cannot be used with cookieless_mode="always"');null!=l&&l.addEventListener&&sf(l,"visibilitychange",this.Ee)}initialize(){this.startIfEnabledOrStop()}dispose(){this.ko=!0,null==l||null==l.removeEventListener||l.removeEventListener("visibilitychange",this.Ee),this.stopRecording()}get So(){var e,t=!(null==(e=this._instance.get_property(im))||!e.enabled),i=!this.qe.disable_session_recording,s=this.qe.disable_session_recording||this._instance.consent.isOptedOut();return n&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!(this.ko||this.So&&null!=(t=this.bo)&&t.isStarted)){var i=!et(Object.assign)&&!et(Array.from);this.So&&i?(this.Co(e),aQ.info("starting")):(this._o=aG,this.stopRecording())}}Co(e){var t,i,s;this.So&&(this._o!==aJ&&this._o!==aY&&(this._o=aK),null!=_&&null!=(t=_.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=_.__PosthogExtensions__)&&i.initSessionRecording?this.Mo(e):null==(s=_.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.To,t=>{if(t)return aQ.error("could not load recorder",t);this.Mo(e)}))}stopRecording(){var e,t;null==(e=this.wo)||e.call(this),this.wo=void 0,null==(t=this.bo)||t.stop()}Eo(){var e,t;null==(e=this.wo)||e.call(this),this.wo=void 0,null==(t=this.bo)||t.discard()}Io(){var e,t;null==(e=this.jr)||e.unregister(iS),null==(t=this.jr)||t.unregister(iy)}Po(e,t){if(en(e))return null;var i=ea(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(aQ.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Ro(e){if(this.jr){var t,i,s=this.jr,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Po(null==(t=this.qe.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Po(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;en(a)&&this.Io();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[im]:w({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:w({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:et(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.wo)||t.call(this),this.wo=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.Ro(t),void this.Eo()):(this.Ro(t),void this.startIfEnabledOrStop()):(this._o===aJ&&(this._o=aY,aQ.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.bo)&&i.log?this.bo.log(e,t):aQ.warn("log called before recorder was ready")}get To(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(im);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Ao(){var e,t=this._instance.get_property(im);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return aQ.warn("persisted remote config for session recording is invali
2d and will be ignored",e),!1}return!en(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}Mo(e){var t,i,s,r;if(!this.ko){if(null==(t=_.__PosthogExtensions__)||!t.initSessionRecording)return aQ.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[i6]:!0});if(this.bo||(this.bo=null==(r=_.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.xo),this.bo._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ao()){if(this._o===aY||this._o===aJ)return;return this._o=aJ,aQ.info("persisted remote config is stale, requesting fresh config before starting"),void new no(this._instance).load()}this._o=aK,null==(i=(s=this.bo).setDocumentWasEverVisible)||i.call(s,this.xo),this.bo.start(e)}}onRRwebEmit(e){var t;null==(t=this.bo)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.bo||null==(t=this.jr)||t.register({[iw]:!0}),null==(e=this.bo)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.bo||null==(t=this.jr)||t.register({[ib]:!0}),null==(e=this.bo)||e.overrideSampling()}overrideTrigger(e){var t,i;this.bo||null==(i=this.jr)||i.register({["url"===e?ix:ik]:!0}),null==(t=this.bo)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.bo)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.bo)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Fo=!1,this.Oo=null,this.Lo=!1,this.Do=!1,this.instance=e,this.rageclicks=new aj(e.config.rageclick),this.$o=null}initialize(){this.startIfEnabled()}get qe(){var e,t,i=Z(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}No(){if(this.isBrowserSupported()){if(n&&l){var e=e=>{e=e||(null==n?void 0:n.event);try{this.qo(e)}catch(e){aH.error("Failed to capture event",e)}};if(sf(l,"submit",e,{capture:!0}),sf(l,"change",e,{capture:!0}),sf(l,"click",e,{capture:!0}),this.qe.capture_copied_text){var t=e=>{e=e||(null==n?void 0:n.event);try{this.qo(e,aN)}catch(e){aH.error("Failed to capture copy/cut event",e)}};sf(l,"copy",t,{capture:!0}),sf(l,"cut",t,{capture:!0})}}}else aH.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Fo&&(this.No(),this.Fo=!0)}onRemoteConfig(e){if(this.Lo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.Do=t.elementsChainAsString);var i=t.autocapture_opt_out;el(i)&&(this.instance.persistence&&this.instance.persistence.register({[il]:i}),this.Oo=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.$o=e}getElementSelectors(e){var t,i=[];return null==(t=this.$o)||t.forEach(t=>{var s=null==l?void 0:l.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[il],s=this.Oo,r=this.instance.hr()&&!this.Lo;if(er(s)&&!el(i)&&!r)return!1;var n=null!=(t=this.Oo)?t:!!i;return!!this.instance.config.autocapture&&!n}qo(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=s8(e);sZ(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&ra(s,this.instance.config.rageclick)&&this.qo(e,"$rageclick");var r=t===aN;if(s&&function(e,t,i,s,r,a){if(!n||ro(e)||null!=i&&i.url_allowlist&&!s2(i.url_allowlist,a)||null!=i&&i.url_ignorelist&&s2(i.url_ignorelist,a))return!1;if(null!=i&&i.dom_event_allowlist){var o,l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=rl(e,s),h=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(et(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}(c,i)||!s9(c,null==i?void 0:i.css_selector_allowlist)||s9(c,null!=(o=null==i?void 0:i.css_selector_ignorelist)?o:re))return!1;try{var d=n.getComputedStyle(e);
2if(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 h?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(s4.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.qe,r,r?["copy","cut"]:void 0,this.instance)){var a=function(e,t){var i,s,r=t.e,a=t.maskAllElementAttributes,o=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!sX(e))return{props:{}};for(var c=[e],d=new Set([e]),p=e;p.parentNode&&!sQ(p,"body")&&1e3>c.length;)if(s0(p.parentNode)){var v=p.parentNode.host;if(d.has(v))break;d.add(v),c.push(v),p=v}else{if(!sX(p.parentNode)||d.has(p.parentNode))break;d.add(p.parentNode),c.push(p.parentNode),p=p.parentNode}var g,f=[],_={},m=!1,y=!1;if(su(c,e=>{var t=ru(e);if(sQ(e,"a")){var i=e.getAttribute("href");m=!!(t&&i&&r_(i))&&(h?tg(i):i)}U(s3(e),"ph-no-capture")&&(y=!0),f.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};s4.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?aB(1024,rm(e)):aB(1024,s6(e)));var o=s3(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),su(e.attributes,function(i){var n;if((!rh(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&r_(i.value)&&(!ei(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=s1(o).join(" ")),a["attr__"+i.name]=aB(1024,"href"===i.name&&r?tg(o):o)}});for(var l=1,u=1,h=e;h=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!sX(t))return t}(h);)l++,h.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,a,o,l,h)),sh(_,function(e){if(!ru(e))return{};var t={};return su(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&&r_(s)&&(t[i]=s)}}),t}(e))}),y)return{props:{},explicitNoCapture:y};if(o||(f[0].$el_text=sQ(e,"a")||sQ(e,"button")?rm(e):s6(e)),m){f[0].attr__href=m;var b,x,k=null==(b=rO(m))?void 0:b.host,E=null==n||null==(x=n.location)?void 0:x.host;k&&E&&k!==E&&(g=m)}return{props:sh({$event_type:r.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:f.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 X(t)?t:s1(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sc(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=w({},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 sc(n).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return a[ry(e[0].toString())]=ry(t.toString())}),(s+=":")+sc(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")},null!=(i=f[0])&&i.$el_text?{$el_text:null==(s=f[0])?void 0:s.$el_text}:{},g&&"click"===r.type?{$external_click_url:g}:{},_)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qe.element_attribute_ignorelist,elementsChainAsString:this.Do,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=a.props;if(a.explicitNoCapture)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===aN){var u,h=s5(null==n||null==(u=n.getSelection())?void 0:u.toString()),c=e.type||"clipboard";if(!h)return!1;o.$selected_content=h,o.$copy_type=c}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Q(null==l?void 0:l.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.jo=(null==n||null==(t=n.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(t5.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Bo&&this.Bo(),this.Bo=void 0,t5.info("History API monitoring stopped")}monitorHistoryChanges(){n&&n.history&&(this.Ho("pushState"),this.Ho("replaceState"),this.Uo())}Ho(e){var t;if(n&&(null==(t=n.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return aU;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)});Q(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r}catch(e){return aU}}(n.history,e,t=>
2function(s,r,n){t.call(this,s,r,n),i.zo(e)})}}zo(e){try{var t,i=null==n||null==(t=n.location)?void 0:t.pathname;if(!i)return;i!==this.jo&&this.isEnabled&&this._instance.capture(sr,{navigation_type:e}),this.jo=i}catch(t){t5.error("Error capturing "+e+" pageview",t)}}Uo(){if(!this.Bo){var e=()=>{this.zo("popstate")};sf(n,"popstate",e),this.Bo=()=>{n&&n.removeEventListener("popstate",e)}}}},heatmaps:class{get qe(){return this.instance.config}constructor(e){var t;this.Wo=!1,this.Fo=!1,this.Vo=null,this.instance=e,this.Wo=!(null==(t=this.instance.persistence)||!t.props[iu]),this.rageclicks=new aj(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Z(this.qe.capture_heatmaps)&&this.qe.capture_heatmaps.flush_interval_milliseconds&&(e=this.qe.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return en(this.qe.capture_heatmaps)?en(this.qe.enable_heatmaps)?this.Wo:this.qe.enable_heatmaps:!1!==this.qe.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Fo||(aZ.info("starting..."),this.Zo(),this.Ee());else{var e;clearInterval(null!=(e=this.Vo)?e:void 0),this.Go(),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({[iu]:i}),this.Wo=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Qo(e){a0(e.originalEvent)&&this.ke(e.originalEvent,"deadclick")}Ee(){this.Vo&&clearInterval(this.Vo),this.Vo="visible"===(null==l?void 0:l.visibilityState)?setInterval(this.Ir.bind(this),this.flushIntervalMilliseconds):null}Zo(){n&&l&&(this.Jo=this.Ir.bind(this),sf(n,ss,this.Jo),this.Ko=e=>this.ke(e||(null==n?void 0:n.event)),sf(l,"click",this.Ko,{capture:!0}),this.Yo=e=>this.Xo(e||(null==n?void 0:n.event)),sf(l,"mousemove",this.Yo,{capture:!0}),this.tl=new rk(this.instance,rw,this.Qo.bind(this)),this.tl.startIfEnabledOrStop(),this.el=this.Ee.bind(this),sf(l,si,this.el),this.Fo=!0)}Go(){var e;n&&l&&(this.Jo&&n.removeEventListener(ss,this.Jo),this.Ko&&l.removeEventListener("click",this.Ko,{capture:!0}),this.Yo&&l.removeEventListener("mousemove",this.Yo,{capture:!0}),this.el&&l.removeEventListener(si,this.el),clearTimeout(this.il),null==(e=this.tl)||e.stop(),this.Fo=!1)}rl(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var s=e;s&&sX(s)&&!sQ(s,"body")&&s!==i;){var r,a,o,l=void 0;try{l=null==(r=null!=(a=null==(o=s.ownerDocument)?void 0:o.defaultView)?a:n)?void 0:r.getComputedStyle(s).position}catch(e){break}if(U(t,l))return!0;s=s7(s)}return!1}(s8(e),["fixed","sticky"],r);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}ke(e,t){var i;if(void 0===t&&(t="click"),!sY(e.target)&&a0(e)){var s=this.rl(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&ra(s8(e),this.instance.config.rageclick)&&this.Gt(w({},s,{type:"rageclick"})),this.Gt(s)}}Xo(e){!sY(e.target)&&a0(e)&&(clearTimeout(this.il),this.il=setTimeout(()=>{this.Gt(this.rl(e,"mousemove"))},500))}Gt(e){if(n){var t=this.qe.disable_capture_url_hashes?tg(n.location.href):n.location.href,i=this.qe.custom_personal_data_properties,s=rq(t,this.qe.mask_personal_data_properties?[...rH,...i||[]]:[],rz);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(e)}}Ir(){this.R&&!ee(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rk,webVitalsAutocapture:class{constructor(e){var t;this.Wo=!1,this.Fo=!1,this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.nl=()=>{clearTimeout(this.sl),this.sl=void 0,0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",w({$current_url:this.R.url},this.R.metrics.reduce((e,t)=>w({},e,{["$web_vitals_"+t.name+"_event"]:w({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.al=e=>{var t;if(this.R=this.R||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},en(null==e?void 0:e.name)||en(null==e?void 0:e.value))aW.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.ol(i);if(!et(s)){var r=ea(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.ll||this.ll>e.value){this.R.navigationKey!==r&&(this.nl(),this.sl=setTimeout(this.nl,this.flushToCaptureTimeoutMs)),et(this.R.navigationKey)&&(this.R.navigationKey=r,this.R.url=s),this.R.firstMetricTimestamp=et(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=w({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});et(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.nl()}else aW.error("Ignoring metric with value >= "+this.ll,e)}}},this.ul=()=>{if(!this.Fo){var e,t,i,s,r=_.__PosthogExtensions__,n=null==r?void 0:r.postHogWebVitalsCallbacksByFlavor,a=(null==n?void 0:n[this.hl])||("web-vitals"===this.hl&&et(n)?null==r?void 0:r.postHogWebVitalsCallbacks:void 0);if(et(a)||(e=a.onLCP,t=a.onCLS,i=a.onFCP,s=a.onINP),e&&t&&i&&s){var o={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&e(this.al.bind(this),o),this.allowedMetrics.indexOf("CLS")>-1&&t(this.al.bind(this),o),this.allowedMetrics.indexOf("FCP")>-1&&i(this.al.bind(this),o),this.allowedMetrics.indexOf("INP")>-1&&s(this.al.bind(this),o),this.Fo=!0}else aW.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Wo=!(null==(t=this._instance.persistence)||!t.props[ip]),this.startIfEnabled()}get dl(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=Z(this.dl)?null==(e=this.dl)?void 0:e.web_vitals_allowed_metrics:void 0;return en(i)?(null==(t=this._instance.persistence)?void 0:t.props[i_])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Z(this.dl)?this.dl.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Z(this.dl)?this.dl.web_vitals_attribution:void 0;return null!=e&&e}get useSoftNavs(){var e=Z(this.dl)?this.dl.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get ll(){var e=Z(this.dl)&&ea(this.dl.__web_vitals_max_value)?this.dl.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return aW.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Z(this.dl)?this.dl.web_vitals:el(this.dl)?this.dl:void 0;return el(t)?t:this.Wo}startIfEnabled(){this.isEnabled&&!this.Fo&&(aW.info("enabled, starting..."),this.di(this.ul))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=Z(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=Z(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ip]:i}),this._instance.persistence.register({[i_]:s})),this.Wo=i,this.startIfEnabled()}}}get hl(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}
2di(e){var t=_.__PosthogExtensions__,i=this.hl,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&et(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?aW.error("failed to load script",t):e()})}ol(e){var t=e||(null==n?void 0:n.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tg(t):t,s=this._instance.config.custom_personal_data_properties;return rq(i,this._instance.config.mask_personal_data_properties?[...rH,...s||[]]:[],rz)}aW.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.ul=()=>{var e;if(n&&this.isEnabled&&null!=(e=_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.vl&&this.qe.capture_unhandled_errors&&(this.vl=t(this.captureException.bind(this))),!this.cl&&this.qe.capture_unhandled_rejections&&(this.cl=i(this.captureException.bind(this))),!this.fl&&this.qe.capture_console_errors&&(this.fl=s(this.captureException.bind(this)))}catch(e){az.error("failed to start",e),this.pl()}}},this._instance=e,this.gl=!(null==(t=this._instance.persistence)||!t.props[ih]),this.ml=new ey(w({},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,st:az})),this.qe=this.yl(),this.startIfEnabledOrStop()}yl(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Z(e)?t=w({},t,e):(et(e)?this.gl:e)&&(t=w({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qe.capture_console_errors||this.qe.capture_unhandled_errors||this.qe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(az.info("enabled"),this.pl(),this.di(this.ul)):this.pl()}di(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return az.error("failed to load script",t);e()})}pl(){var e,t,i;null==(e=this.vl)||e.call(this),this.vl=void 0,null==(t=this.cl)||t.call(this),this.cl=void 0,null==(i=this.fl)||i.call(this),this.fl=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.gl=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[ih]:this.gl}),this.qe=this.yl(),this.startIfEnabledOrStop())}}onConfigChange(){this.qe=this.yl()}captureException(e){var t,i,s,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.ml.consumeRateLimit(r)?az.info("Skipping exception capture because of client rate limiting.",{exception:r}):null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.bl=[],this._l=new t$([new tN,new tY,new tB,new tH,new tK,new tG,new tU,new tJ],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),a=s;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tj.test(o)?o.replace(tj,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}if(!r.length)return[];var c=Array.from(r);return c.reverse(),c.slice(0,50).map(e=>w({},e,{filename:e.filename||(c[c.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tA,tD)),this._instance=e,this.bl=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(ic))?t:[],this.wl=t1(this.kl()),this.xl=new t2(this.wl)}onConfigChange(){this.wl=t1(this.kl()),this.xl.setConfig(this.wl)}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.bl=n,this._instance.persistence&&this._instance.persistence.register({[ic]:this.bl,[id]:a})}}}get Sl(){var e,t=!!this._instance.get_property(id),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this._l.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.wl.enabled)try{if(!ei(e)||0===e.trim().length)return void op.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)=>(tZ.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.Cl(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&op.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.xl.add(w({[tX]:e,[tQ]:(new Date).toISOString()}
2,s))}catch(e){op.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){var t;try{var i=e.$exception_list;if(this.Ml(i)){if(this.Tl(i))return this.El("Exception dropped: matched a suppression rule"),void op.info("Skipping exception capture because a suppression rule matched");if(!this.Sl&&this.Il(i))return this.El("Exception dropped: thrown by a browser extension"),void op.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Pl(i))return this.El("Exception dropped: thrown by the PostHog SDK"),void op.info("Skipping exception capture because it was thrown by the PostHog SDK")}var s=this.wl.enabled&&en(e.$exception_steps)?this.Rl(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",vs:!0});return n&&this.xl.clear(),n}catch(e){return op.error("Failed to capture exception event. Dropping this exception.",e),void this.xl.clear()}}catch(e){return void op.error("Failed to process exception event. Ignoring this exception.",e)}}Rl(e){try{var t=this.xl.getAttachable();return 0===t.length?e:w({},e,{$exception_steps:t})}catch(t){return op.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}El(e){this.wl.enabled&&this.xl.add({[tX]:e,[tQ]:(new Date).toISOString()})}Cl(e){return Z(e)?w({},e):{}}kl(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}Tl(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return ei(i)&&i.length>0&&e.$exception_types.push(i),ei(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.bl.some(e=>{var i=e.values.map(e=>{var i=as[e.operator],s=t[e.key];if(!i||!s)return!1;var r=X(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 op.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Il(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>{var t=e.filename;return!!t&&ov.some(e=>t.startsWith(e))})}Pl(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(s=null==a||null==(r=a.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}Ml(e){return!en(e)&&X(e)}}},oS,{siteApps:class{constructor(e){this.Ll=0,this._instance=e,this.Dl=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}$l(e,t){if(t){var i=this.globalsForEvent(t);this.Dl.push(i),this.Dl.length>1e3&&(this.Dl=this.Dl.slice(10))}}get siteAppLoaders(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.$l.bind(this));this.Nl=()=>{e(),this.Dl=[],this.Nl=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var h of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var c=h[0];l[c]={id:u[c],type:c,properties:h[1]}}var d=e.$set_once,p=e.$set;return{event:w({},x(e,a3),{properties:w({},e.properties,p?{$set:w({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:w({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}ql(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)||(a5.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)||(a5.error("prepare_external_dependency_script returned null"),null):e}jl(){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,u=null==l?void 0:l.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.Ll++,this.Bl)return this.Hl();var c=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),c.push(()=>{e[t]=s})}},g=e=>{if(p.has(e))return e;var t=d.ql(e);return t&&p.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!er(e));return v(h,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(h,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),v(h,"replaceChild",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(s=u.DocumentFragment)?void 0:s.prototype].forEach(e
2=>{v(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))})}),[null==(r=u.Element)?void 0:r.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(a=u.DocumentType)?void 0:a.prototype].forEach(e=>{v(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=f(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),v(null==(o=u.Element)?void 0:o.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this.Bl=()=>{c.forEach(e=>e()),this.Bl=void 0},this.Hl()}Hl(){var e=!1;return()=>{var t;e||(e=!0,this.Ll--,0===this.Ll&&(null==(t=this.Bl)||t.call(this)))}}Ul(e,t){void 0===t&&(t=!0);var i=this.jl();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.Dl.length&&(a5.info("Processing "+this.Dl.length+" events for site app with id "+e.id),this.Dl.forEach(e=>this.Ul(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Nl)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,a5.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.Ul(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){a5.error(a6+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){a5.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}zl(){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)}Wl(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.Ul(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){a5.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.zl(),void this._instance.on("eventCaptured",e=>this.Wl(e))):void a5.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Nl)||i.call(this),e.ok){var n=e.config;if(null!=(s=n.siteApps)&&s.length)if(this.isEnabled)for(var a of n.siteApps)!function(){var e,t=a.id,i=a.url;_["__$$ph_site_app_"+t]=r._instance,null==(e=_.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,e=>{if(e)return a5.error(a6+t,e)})}();else a5.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},oP,{tracingHeaders:class{constructor(e){this.Vl=void 0,this.Zl=void 0,this.Gl=void 0,this.ul=()=>{var e,t,i=this.Ql();i?(et(this.Vl)&&(this.Vl=null==(e=_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),et(this.Zl)&&(this.Zl=null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.pl()},this._instance=e}initialize(){this.startIfEnabledOrStop()}di(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return aV.error("failed to load script",t);e()})}Jl(){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}Ql(){var e=this.Jl();return X(e)?(X(this.Gl)?this.Gl.splice(0,this.Gl.length,...e):this.Gl=[...e],e.length>0?this.Gl:void 0):(X(this.Gl)&&this.Gl.splice(0),this.Gl=e||void 0,this.Gl)}pl(){var e,t;null==(e=this.Vl)||e.call(this),null==(t=this.Zl)||t.call(this),this.Vl=void 0,this.Zl=void 0}startIfEnabledOrStop(){this.Ql()?this.di(this.ul):this.pl()}}},{toolbar:class{constructor(e){this.instance=e}du(e){_.ph_toolbar_state=e}vu(){var e;return null!=(e=_.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),s_(this.instance.config)||!n||!l)return!1;e=null!=e?e:n.location,i=null!=i?i:n.history;try{if(!t){try{n.localStorage.setItem("test","test"),n.localStorage.removeItem("test")}catch(e){return!1}t=null==n?void 0:n.localStorage}var s,r=oi||rL(e.hash,"__posthog")||rL(e.hash,"state"),a=r?sd(()=>JSON.parse(atob(decodeURIComponent(r))))||sd(()=>JSON.parse(decodeURIComponent(r))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(os)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}cu(e){var t=_.ph_load_toolbar||_.ph_load_editor;!en(t)&&Q(t)?t(e,this.instance):or.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==l||!l.getElementById(sJ));if(!n||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=w({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(n.localStorage.setItem(os,JSON.stringify(w({},r,{source:void 0}))),2===this.vu())?this.cu(r):0===this.vu()&&(this.du(1),null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(or.error("[Toolbar] Failed to load",e),this.du(0)):(this.du(2),this.cu(r))}),sf(n,"turbolinks:load",()=>{this.du(0),this.loadToolbar(r)})),!0}fu(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)}}},oF,{conversations:class{constructor(e){this.pu=void 0,this._conversationsManager=null,this.gu=!1,this.mu=null,this.yu=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.bu=e.ok,e.ok)){var t=e.config.conversations;en(t)||(el(t)?this.pu=t:(this.pu=t.enabled,this.mu=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.pu=void 0,this.mu=null,this.bu=void 0,this.yu=!1}loadIfEnabled(){if(!(this._conversationsManager||this.gu||this._instance.config.disable_conversations||s_(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==_?void 0:_.__PosthogExtensions__;if(e&&!et(this.pu)&&this.pu)if(this.mu&&this.mu.token){this.gu=!0;try{var t=e.initConversations;if(t)return this._u(t),void(this.gu=!1);var i=e.loadExternalDependency;if(!i)return void this.wu(i8);i(this._instance,"conversations",t=>{t||!e.initConversations?this.wu("Could not load conversations script",t):this._u(e.initConversations),this.gu=!1})}catch(e){this.wu("Error initializing conversations",e),this.gu=!1}}else om.error("Conversations enabled but missing token in remote config.")}}_u(e){if(this.mu)try{this._conversationsManager=e(this.mu,this._instance),this.yu=!1,om.info("Conversations loaded successfully")}catch(e){this.wu("Error completing conversations initialization",e)}else om.error("Cannot complete initialization: remote config is null")}wu(e,t){om.error(e,t),this._conversationsManager=null,this.gu=!1,this.yu=!0}show(){this._conversationsManager?this._conversationsManager.show():om.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.pu&&!er(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":s_(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.bu?"remote_config_failed":et(this.pu)?this.bu?"disabled_in_project":"remote_config_pending":this.pu?en(this.mu)||!this.mu.token?"missing_token":null!=_&&_.__PosthogExtensions__?this.gu?"initializing":this.yu?"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 b(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(om.warn(oy),null)})()}getMessages(e,t){var i=this;return b(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(om.warn(oy),null)})()}markAsRead(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(om.warn(oy),null)})()}getTickets(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(om.warn(oy),null)})()}requestRestoreLink(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(om.warn(oy),null)})()}restoreFromToken(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(om.warn(oy),null)})()}restoreFromUrlToken(){var e=this;return b(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(om.warn(oy),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}ks(){var e;null==(e=this._conversationsManager)||e.setIdentity()}xs(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this.ku=!1,this.xu=!1,this.st=t6("[logs]"),this.Su=w({},this.st,{error(){for(var e=arguments.length,t=Array(e),s=0;e>s;s++)t[s]=arguments[s];t.some(ok)||i.st.error(...t)}}),this.gr=[],this.Cu=[],this.za=0,this.Mu=()=>{var e,t;this.za=0,null==(e=this.Tu)||e.onReconnect(),null==(t=this.Eu)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.ku=!0),n&&sf(n,"online",this.Mu)}Iu(e,t,i,s){var r,n,a,o,l,u,h,c,d,p,v,g,f,_,m=(r=null==(_=this._instance)||null==(_=_.config)?void 0:_.logs,d=null!=(n=null==r?void 0:r.flushIntervalMs)?n:3e3,p=null!=(a=null==r?void 0:r.maxBufferSize)?a:100,g=et(v=null!=i&&i.consoleCapture?void 0:null!=(o=null==r?void 0:r.maxLogsPerInterval)?o:1e3)?Math.max(p,2048):Math.max(p,v),{serviceName:null!=(l=null!=(u=null==(f=null==r?void 0:r.resourceAttributes)?void 0:f["service.name"])?u:null==r?void 0:r.serviceName)?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!=(h=null==f?void 0:f["service.version"])?h:null==r?void 0:r.serviceVersion,environment:null!=(c=null==f?void 0:f["deployment.environment"])?c:null==r?void 0:r.environment,resourceAttributes:f,beforeSend:null==r?void 0:r.beforeSend,flushIntervalMs:d,maxBufferSize:p,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new tE(this.Pu(e,t),m,this.Su,()=>this.Ru(),e=>e(),void 0,s),m]}Au(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Tu||this.Fu!==t){null==(i=this.Tu)||i.reset(),this.Fu=t;var i,s=this.Iu(()=>this.gr,e=>{this.gr=e});this.Tu=s[0],this.Ou=s[1]}return this.Tu}Lu(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Eu||this.Du!==t){null==(i=this.Eu)||i.reset(),this.Du=t;var i,s=this.Iu(()=>this.Cu,e=>{this.Cu=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ob);this.Eu=s[0],this.$u=s[1]}return this.Eu}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var i=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!en(i)&&i&&(this.ku=!0,this.loadIfEnabled())}}reset(){var e,t;this.gr=[],null==(e=this.Tu)||e.reset(),this.Cu=[],null==(t=this.Eu)||t.reset(),this.za=0}captureLog(e){this.Au().captureLog(e)}he(e){this.Lu().captureLog(e)}get logger(){return this.Nu||(this.Nu={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)=>
2this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Nu}flushLogs(e){e?this.qu(e):(this.Tu&&this.Tu.flush().catch(e=>this.ju(e)),this.Eu&&this.Eu.flush().catch(e=>this.ju(e)))}ju(e){ok(e)||this.st.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.ku&&!this.xu){var e=null==_?void 0:_.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.st.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.xu=!0)}):this.st.error(i8)}else this.st.error("PostHog Extensions not found.")}}Pu(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===T.LogsQueue?e():void 0,setPersistedProperty(e,i){e===T.LogsQueue&&t(null!=i?i:[])},$t:e=>this.$t(e),getLibraryId:()=>m.LIB_NAME,getLibraryVersion:()=>m.LIB_VERSION}}$t(e){return new Promise(t=>{if(rD(this.za,3))t({kind:"fatal",error:ox(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.st.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:ox(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Bu(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.Hu(i),i>=200&&300>i)?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):0===i?(e.error||this.st.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:ox(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)})}})}})}Hu(e){(0!==e||this._instance.__loaded)&&(this.za=rj(e,this.za,3,()=>this.st.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.")))}qu(e){this.gr.length>0&&this.Uu(e,this.gr,this.Ou,m.LIB_NAME,e=>{this.gr=e}),this.Cu.length>0&&this.Uu(e,this.Cu,this.$u,ob,e=>{this.Cu=e})}Uu(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var a=tk(n,tx(i,m.LIB_NAME,m.LIB_VERSION),s,m.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Bu(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}Bu(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Ru(){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,en(r)||(t.sessionStartTimestamp=r),en(n)||(t.lastActivityTimestamp=n)}if(null!=_&&null!=(e=_.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tg(_.location.href):_.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}},{metrics:class{constructor(e){this.st=t6("[metrics]"),this._instance=e}initialize(){}Au(){var e,t,i,s,r,n,a,o,l=null==(a=this._instance)||null==(a=a.config)?void 0:a.metrics;return this.Tu&&this.Fu===l||(null==(o=this.Tu)||o.reset(),this.Fu=l,this.Tu=new tC(this.Pu(),{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.st)),this.Tu}count(e,t,i){void 0===t&&(t=1),this.Au().count(e,t,i)}
2gauge(e,t,i){this.Au().gauge(e,t,i)}histogram(e,t,i){this.Au().histogram(e,t,i)}flush(e){if(!this.Tu)return Promise.resolve();if(e){var t=this.Tu.drainWindow();return t&&this.Xt(t,e),Promise.resolve()}return this.Tu.flush().catch(e=>this.st.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.Tu)||e.reset()}Pu(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Xt:e=>t.Xt(e),getLibraryId:()=>m.LIB_NAME,getLibraryVersion:()=>m.LIB_VERSION}}Xt(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(w({method:"POST",url:this.zu(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("metrics request failed with status "+i)}):r({kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+i)})}}))})}zu(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});aD.__defaultExtensionClasses=w({},oC);var o$=(m.SDK_DIST_CHANNEL="npm",s=aE[aR]=new aD,function(){function e(){e.done||(e.done=!0,aM=!1,su(aE,function(e){e._dom_loaded()}))}null!=l&&l.addEventListener?"complete"===l.readyState?e():sf(l,"DOMContentLoaded",e,{capture:!1}):n&&t5.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s);e.s(["default",0,o$,"posthog",0,o$],604570);var oI=e.i(271645),oT=(0,oI.createContext)({get client(){return r},bootstrap:void 0}),oR=function(e){return"function"==typeof e},oM=function(e,t){return(oM=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};"function"==typeof SuppressedError&&SuppressedError;var oO={componentStack:null,exceptionEvent:null,error:null};!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=i}function i(t){var i=e.call(this,t)||this;return i.state=oO,i}oM(i,e),i.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),i.prototype.componentDidCatch=function(e,t){var i,s=this.props.additionalProperties;oR(s)?i=s(e):"object"==typeof s&&(i=s);var r=this.context.client.captureException(e,i),n=t.componentStack;this.setState({error:e,componentStack:null!=n?n:null,exceptionEvent:r})},i.prototype.render=function(){var e=this.props,t=e.children,i=e.fallback,s=this.state;if(null==s.componentStack)return oR(t)?t():t;var r=oR(i)?oI.default.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return oI.default.isValidElement(r)?r:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),oI.default.createElement(oI.default.Fragment,null))},i.contextType=oT}(oI.default.Component),r=o$,e.s(["PostHogContext",0,oT,"usePostHog",0,function(){return(0,oI.useContext)(oT).client}],605164)},688921,e=>{"use strict";e.s(["ANALYTICS_EVENTS",0,{signupStarted:"signup_started",signupRoleSelected:"signup_role_selected",signupCompleted:"signup_completed",signupFailed:"signup_failed",activationCompleted:"activation_completed",loginStarted:"login_started",loginCompleted:"login_completed",loginFailed:"login_failed",intakeStepSaved:"onboarding_step_saved",intakeCompleted:"onboarding_completed",jobSearchStarted:"job_search_started",jobSearchCompleted:"job_search_completed",jobSearchFailed:"job_search_failed",jobSaved:"job_saved",jobApplicationSubmitted:"job_application_submitted",interviewPrepCreated:"interview_prep_created",interviewPrepFailed:"interview_prep_failed",pricingViewed:"pricing_viewed",checkoutStarted:"checkout_started",checkoutSessionCreated:"checkout_session_created",checkoutFailed:"checkout_failed",checkoutCompleted:"checkout_completed",freeTrialStarted:"free_trial_started",trialToPaidConversion:"trial_to_paid_conversion",freeToPaidConversion:"free_to_paid_conversion",paidSubscriptionStarted:"paid_subscription_started",retentionMilestoneReached:"retention_milestone_reached",planChangeStarted:"plan_change_started",subscriptionCancellationRequested:"subscription_cancellation_requested",subscriptionPaymentSucceeded:"subscription_payment_succeeded",subscriptionPaymentFailed:"subscription_payment_failed",subscriptionCanceled:"subscription_canceled",stripeSubscriptionUpdated:"stripe_subscription_updated",emailSearchStarted:"email_search_started",emailSearchCompleted:"email_search_completed",emailSearchFailed:"email_search_failed",emailRevealStarted:"email_reveal_started",emailRevealCompleted:"email_reveal_completed",emailRevealFailed:"email_reveal_failed",recentSearchSelected:"recent_search_selected",locationSelected:"email_search_location_selected",filterAdded:"email_results_filter_added",filterRemoved:"email_results_filter_removed",filtersCleared:"email_results_filters_cleared",contactSelected:"email_finder_contact_selected",emailScheduled:"outreach_email_scheduled"}])}]);
3
4//# debugId=8a516e6e-0f70-eabe-58d1-f382f7408937

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.