1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1743],{552:(e,t,i)=>{i.d(t,{Ay:()=>oB});var s="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:s;"undefined"==typeof self&&(r.self=r),"undefined"==typeof File&&(r.File=function(){});var n=null==r?void 0:r.navigator,o=null==r?void 0:r.document,a=null==r?void 0:r.location,l=null==r?void 0:r.fetch,u=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,c=null==r?void 0:r.AbortController,h=null==r?void 0:r.CompressionStream,d=null==n?void 0:n.userAgent,p=null!=s?s:{};function v(){return!(!s||!1===s.navigator.onLine)}var g="1.398.0",_={DEBUG:!1,LIB_VERSION:g,LIB_NAME:"web",JS_SDK_VERSION:g};function f(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function o(e){f(n,s,r,o,a,"next",e)}function a(e){f(n,s,r,o,a,"throw",e)}o(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e}).apply(null,arguments)}function b(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 w=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function x(e){return"string"==typeof e||e}function S(e){return"string"==typeof e?e:void 0}var E,k=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),P=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),F=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],I=["token"],$="NativeGzipValidationError",C=e=>e.length>=2&&31===e[0]&&139===e[1],R=(e,t)=>e===P.GZipJS||t===P.GZipJS||"gzip"===t,T=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),A=e=>{var t=Error("Native gzip produced invalid output: "+e);throw t.name=$,t},O=function(){var e=m(function*(e,t){18>e.size&&A("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));C(i)&&8===i[2]||A("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(E)return E;E=[];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[e]=t>>>0}return E})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&A("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&A("invalid-size")});return function(t,i){return e.apply(this,arguments)}}();function M(){return(M=m(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then(()=>o.close()).catch((s=m(function*(e){try{yield o.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),[u]=yield Promise.all([l,a]);return yield O(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 L=["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","hub
1spot","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"],D=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return L.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function N(e,t){return -1!==e.indexOf(t)}var z=function(e){return e.trim()},j=function(e){return e.replace(/^\$/,"")},q=Object.prototype,H=q.hasOwnProperty,U=q.toString,B=Array.isArray||function(e){return"[object Array]"===U.call(e)},V=e=>"function"==typeof e,W=e=>e===Object(e)&&!B(e),G=e=>{if(W(e)){for(var t in e)if(H.call(e,t))return!1;return!0}return!1},Y=e=>void 0===e,J=e=>"[object String]"==U.call(e),K=e=>J(e)&&0===e.trim().length,X=e=>null===e,Q=e=>Y(e)||X(e),Z=e=>"[object Number]"==U.call(e)&&e==e,ee=e=>Z(e)&&e>0,et=e=>"[object Boolean]"===U.call(e),ei=e=>e instanceof FormData,es=e=>N(F,e),er=e=>N(I,e);function en(e){return null===e||"object"!=typeof e}function eo(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ea(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var el=[!0,"true",1,"1","yes"],eu=e=>N(el,e),ec=[!1,"false",0,"0","no"];function eh(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),Z(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),eh(r||i,t,i,s))}class ed{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=eh(e.bucketSize,0,100,e.Ae),this.$e=eh(e.refillRate,0,this.Fe,e.Ae),this.De=eh(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var i=Math.floor((t-e.lastAccess)/this.De);i>0&&(e.tokens=Math.min(e.tokens+i*this.$e,this.Fe),e.lastAccess=e.lastAccess+i*this.De)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.Ee[s];return r?this.Ne(r,i):this.Ee[s]=r={tokens:this.Fe,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.Pe)||t.call(this,e)),0===r.tokens)}stop(){this.Ee={}}}var ep="Mobile",ev="Android",eg="Tablet",e_=ev+" "+eg,ef="iPad",em="Apple",ey=em+" Watch",eb="Safari",ew="BlackBerry",ex="Samsung",eS=ex+"Browser",eE=ex+" Internet",ek="Chrome",eP=ek+" OS",eF=ek+" iOS",eI="Internet Explorer",e$=eI+" "+ep,eC="Opera",eR=eC+" Mini",eT="Edge",eA="Microsoft "+eT,eO="Firefox",eM=eO+" iOS",eL="Nintendo",eD="PlayStation",eN="Xbox",ez=ev+" "+ep,ej=ep+" "+eb,eq="Windows",eH=eq+" Phone",eU="Nokia",eB="Ouya",eV="Generic",eW=eV+" "+ep.toLowerCase(),eG=eV+" "+eg.toLowerCase(),eY="Konqueror",eJ="Oculus Browser",eK="Vivaldi",eX="Yandex",eQ="Whale",eZ="DuckDuckGo",e0="Pale Moon",e1="Waterfox",e2="Brave",e3="Google Search App",e5="(\\d+(\\.\\d+)?)",e6=RegExp("Version/"+e5),e8=RegExp(eN,"i"),e4=RegExp(eD+" \\w+","i"),e7=RegExp(eL+" \\w+","i"),e9=RegExp(ew+"|PlayBook|BB10","i"),te={"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"},tt=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?e2:null)||(null!=s&&s.detectGoogleSearchApp&&N(e,"GSA/")?e3:N(e," OPR/")&&N(e,"Mini")?eR:N(e," OPR/")?eC:e9.test(e)?ew:N(e,"IE"+ep)||N(e,"WPDesktop")?e$:N(e,"OculusBrowser")?eJ:N(e,eS)?eE:N(e,eT)||N(e,"Edg/")?eA:N(e,eK+"/")?eK:N(e,"YaBrowser/")?eX:N(e,eQ+"/")?eQ:N(e,eZ+"/")||N(e,"Ddg/")?eZ:N(e,"FBIOS")?"Facebook "+ep:N(e,"UCWEB")||N(e,"UCBrowser")?"UC Browser":N(e,"CriOS")?eF:N(e,"CrMo")||N(e,ek)?ek:N(e,ev)&&N(e,eb)?ez:N(e,"FxiOS")?eM:N(e.toLowerCase(),eY.toLowerCase())?eY:N(e,e2+"/")?e2:(r=t)&&N(r,em)||N(e,eb)&&!N(e,ek)&&!N(e,ev)?N(e,ep)?ej:eb:N(e,"PaleMoon/")?e0:N(e,e1+"/")?e1:N(e,eO)?eO:N(e,"MSIE")||N(e,"Trident/")?eI:N(e,"Gecko")?eO:"")},ti={[e$]:[RegExp("rv:"+e5)],[eA]:[RegExp(eT+"?\\/"+e5)],[ek]:[RegExp("("+ek+"|CrMo)\\/"+e5)],[eF]:[RegExp("CriOS\\/"+e5)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e5)],[eb]:[e6],[ej]:[e6],[eC]:[RegExp("(Opera|OPR)\\/"+e5)],[eO]:[RegExp(eO+"\\/"+e5)],[eM]:[RegExp("FxiOS\\/"+e5)],[eY]:[RegExp("Konqueror[:/]?"+e5,"i")],[ew]:[RegExp(ew+" "+e5),e6],[ez]:[RegExp("android\\s"+e5,"i")],[eE]:[RegExp(eS+"\\/"+e5)],[eJ]:[RegExp("OculusBrowser\\/"+e5)],[eK]:[RegExp(eK+"\\/"+e5)],[eX]:[RegExp("YaBrowser\\/"+e5)],[eQ]:[RegExp(eQ+"\\/"+e5)],[e2]:[RegExp(e2+"\\/"+e5)],[eZ]:[RegExp("(DuckDuckGo|Ddg)\\/"+e5)],[e0]:[RegExp("PaleMoon\\/"+e5)],[e1]:[RegExp(e1+"\\/"+e5)],[e3]:[RegExp("GSA\\/"+e5)],[eI]:[RegExp("(rv:|MSIE )"+e5)],Mozilla:[RegExp("rv:"+e5)]},ts=function(e,t,i,s){var r=ti[tt(e,t,i,s)];if(Y(r))return null;for(var n=0;r.length>n;n++){var o=e.match(r[n]);if(o)return parseFloat(o[o.length-2])}return null},tr=[[RegExp(eN+"; "+eN+" (.*?)[);]","i"),e=>[eN,e&&e[1]||""]],[RegExp(eL,"i"),[eL,""]],[RegExp(eD,"i"),[eD,""]],[e9,[ew,""]],[RegExp(eq,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eH,""];if(new RegExp(ep).test(t)&&!/IEMobile\b/.test(t))return[eq+" "+ep,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=te[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eq,s]}return[eq,""]}],[/((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=Y(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ev+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ev+")","i"),e=>e&&e[2]?[ev,[e[2],e[3],e[4]||"0"].join(".")]:[ev,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eP,""]],[/Linux|debian/i,["Linux",""]]],tn=function(e){return e7.test(e)?eL:e4.test(e)?eD:e8.test(e)?eN:RegExp(eB,"i").test(e)?eB:RegExp("("+eH+"|WPDesktop)","i").test(e)?eH:/iPad/.test(e)?ef:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ey:e9.test(e)?ew:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eU,"i").test(e)?eU:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ep).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ev:e_:RegExp("(pda|"+ep+")","i").test(e)?eW:RegExp(eg,"i").test(e)&&!RegExp(eg+" pc","i").test(e)?eG:""},to=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ta(e,t){return"string"==typeof e&&to.test(e)?e:t()}function tl(e){return e?e.split("#")[0]:e}function tu(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}var tc=e=>e instanceof Error,th={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}},td=th.info;function tp(e){var t=[];for(var i in e){var s=e[i];X(s)||Y(s)||t.push({key:i,value:function e(t){if(et(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(B(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 tv(e,t,i){return y({},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 tg(e,t,i,s){return{resourceLogs:[{resource:{attributes:tp(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let t_=class{constructor(e,t,i,s,r,n,o){var a;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=i,this.qe=s,this.Be=r,this.je=n,this.He=o,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this.Ye=t.flushIntervalMs,this.Ke=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.it(e);
1if(null!==t){if(t.body){if(this.nt()){var i={record:function(e,t){var{text:i,number:s}=th[e.level||"info"]||td,r=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),t.windowId&&(n["window.id"]=t.windowId),Q(t.sessionStartTimestamp)||(n.sessionStartTimestamp=String(t.sessionStartTimestamp)),Q(t.lastActivityTimestamp)||(n.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(n["url.full"]=t.currentUrl),t.screenName&&(n["screen.name"]=t.screenName),t.appState&&(n["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(n.feature_flags=t.activeFeatureFlags);var o=y({},n,e.attributes||{}),a={timeUnixNano:r,observedTimeUnixNano:r,severityNumber:s,severityText:i,body:{stringValue:e.body},attributes:tp(o)};return e.trace_id&&(a.traceId=e.trace_id),e.span_id&&(a.spanId=e.span_id),Y(e.trace_flags)||(a.flags=e.trace_flags),a}(t,this.qe())};this.Be(()=>this.st(i))}}else this.Ae.info("Log was rejected in beforeSend function")}}}it(e){var t=this.Se.beforeSend;if(!t)return e;var i=B(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.Ae.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.Ae.error("Error in beforeSend function for log:",e),null}return s}nt(){if(void 0===this.et)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var e=this;return m(function*(){if(!e._instance.isDisabled)return e.Ue||(e.Ue=e.ot().finally(()=>{e.Ue=null})),e.Ue})()}ot(){var e=this;return m(function*(){e.tt();var t=null!==(r=e._instance.getPersistedProperty(k.LogsQueue))&&void 0!==r?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){e.ze=0;var r,n,o,a=Math.min(t.length,e.Ke),l=t.slice(0,a),u=tg(l.map(e=>e.record),e.ut(),null!==(n=e.He)&&void 0!==n?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.ht(u);if("too-large"===c.kind&&l.length>1)e.Ke=Math.max(1,Math.floor(l.length/2)),e.Ae.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ke);else if("retry-later"===c.kind||("too-large"===c.kind?e.Ae.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"===c.kind&&e.Se.maxBatchRecordsPerPost>e.Ke&&(e.Ke=Math.min(e.Se.maxBatchRecordsPerPost,e.Ke+1)),yield e.dt(l.length),t=null!==(o=e._instance.getPersistedProperty(k.LogsQueue))&&void 0!==o?o:[],s+=l.length,"fatal"===c.kind))throw c.error}})()}dt(e){var t=this;return m(function*(){var i,s=Math.max(0,e-t.ze),r=null!==(i=t._instance.getPersistedProperty(k.LogsQueue))&&void 0!==i?i:[];t._instance.setPersistedProperty(k.LogsQueue,r.slice(s)),yield t.je()})()}ut(){return tv(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){var t;if(!this._instance.optedOut){var i=null!==(t=this._instance.getPersistedProperty(k.LogsQueue))&&void 0!==t?t:[];this.Je>i.length||(i.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(k.LogsQueue,i),this.Qe>i.length?this.ct():this.rt()}}ct(e){void 0===e&&(e=this.Ye),this.vt||(this.vt=tu(()=>{this.vt=void 0,this.rt()},e))}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*Math.pow(2,e)}yt(){var e=this._instance.getPersistedProperty(k.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m(function*(){t.tt();var i=t.flush().catch(()=>{});void 0!==e?yield Promise.race([i,new Promise(t=>tu(t,e))]):yield i})()}flushWithTimeout(e){var t=this;return m(function*(){var i=!1,s=t.flush(),r=new Promise(t=>tu(()=>{i=!0,t()},e));try{yield Promise.race([s,r])}finally{i&&s.catch(()=>{})}})()}rt(){this.flush().then(()=>{this.Ve=0},e=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())})}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};class tf{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 m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&B(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
1pFirstLines:0),t.chunkIdMap)),y({},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 m(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)&&void 0!==i?i:"generic",handled:null===(s=t.handled)||void 0===s||s,synthetic:null!==(r=e.synthetic)&&void 0!==r&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return si&&i.length===st||(st=i.length,si=i.reduce((i,s)=>{se||(se={});var r=se[s];if(r)i[r[0]]=r[1];else for(var n=e(s),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,u=t[s];if(l&&u){i[l]=u,se[s]=[l,u];break}}return i},{})),si}}(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?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 y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function tm(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return Y(s)||(n.lineno=s),Y(r)||(n.colno=r),n}var ty=(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]},tb=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tw=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tx=/\((\S*)(?::(\d+))(?::(\d+))\)/,tS=(e,t)=>{var i=tb.exec(e);if(i){var[,s,r,n]=i;return tm(t,s,"?",+r,+n)}var o=tw.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=tx.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=ty(o[1]||"?",o[2]);return tm(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},tE=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tk=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tP=(e,t)=>{var i=tE.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tk.exec(i[3]);s&&(i[1]=i[1]||"eval",i[3]=s[1],i[4]=s[2],i[5]="")}var r=i[3],n=i[1]||"?";return[n,r]=ty(n,r),tm(t,r,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tF=/\(error: (.*)\)/;class tI{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=J(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 eo(e,"DOMException")}isDOMError(e){return eo(e,"DOMError")}}class t${match(e){return e instanceof Error}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 tC{constructor(){}match(e){return eo(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var tR=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tT{match(e){return"string"==typeof e}coerce(e,t){var i,[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(tR);return s&&(t=s[1],i=s[2]),[t,i]}}var tA=["fatal","error","warning","log","info","debug"];function tO(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");
1if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class tM{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return ea(e)?e.constructor.name:"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: "+tO(e)}isSeverityLevel(e){return J(e)&&!K(e)&&tA.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(tc(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tL{match(e){return ea(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tO(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tD{match(e){return en(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 tN{match(e){return eo(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ea(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 en(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 tz="$message",tj="$timestamp",tq=new Set([tz,tj]),tH={enabled:!0,max_bytes:32768};function tU(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:tH.enabled,max_bytes:function(e,t){if(!Z(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tH.max_bytes)}:y({},tH)}class tB{constructor(e){this.bt=[],this._t=0,this.Se=tU(e)}setConfig(e){this.Se=tU(e),this.wt()}add(e){var t=function(e){var t,i,s;try{s=[],t=null!==(i=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(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(t))return"[Circular]";s.push(t)}return t}}))&&void 0!==i?i:"null"}catch(e){return}try{var r=JSON.parse(t);if(!W(r))return;var n=r[tz],o=r[tj];if(!J(n)||0===n.trim().length||!J(o)&&!Z(o))return;return{step:r,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("undefined"!=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.Se.max_bytes||(this.bt.push({step:t.step,bytes:i}),this._t+=i,this.wt())}}getAttachable(){return this.bt.map(e=>e.step)}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}}var tV=function(e,t){var{debugEnabled:i}=void 0===t?{}:t,r={k(t){if(s&&(_.DEBUG||p.POSTHOG_DEBUG||i)&&!Y(s.console)&&s.console){for(var r=("__rrweb_original__"in s.console[t])?s.console[t].__rrweb_original__:s.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.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){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tV(e+" "+t,i)};return r}
1,tW=tV("[PostHog.js]"),tG=tW.createLogger,tY=tG("[ExternalScriptsLoader]"),tJ=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tY.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==o?void 0:o.querySelectorAll("script");if(s){for(var r,n=0;s.length>n;n++)if(r=function(){if(s[n].src===t){var e=s[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return r.v}var a=()=>{if(!o)return i("document not found");var s=o.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=>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)o.head.appendChild(s);else{var r,n=o.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):o.body.appendChild(s)}};null!=o&&o.body?a():null==o||o.addEventListener("DOMContentLoaded",a)};p.__PosthogExtensions__=p.__PosthogExtensions__||{},p.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s;if(e.config.strict_script_versioning)s=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var r="/static/"+t+".js?v="+e.version;"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5)),s=e.requestRouter.endpointFor("assets",r)}tJ(e,s,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tJ(e,n,i)}},p.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);tJ(e,s,i)};var tK="$people_distinct_id",tX="$device_id",tQ="$device_model",tZ="__alias",t0="__timers",t1="$autocapture_disabled_server_side",t2="$heatmaps_enabled_server_side",t3="$exception_capture_enabled_server_side",t5="$error_tracking_suppression_rules",t6="$error_tracking_capture_extension_exceptions",t8="$web_vitals_enabled_server_side",t4="$dead_clicks_enabled_server_side",t7="$product_tours_enabled_server_side",t9="$web_vitals_allowed_metrics",ie="$session_recording_remote_config",it="$replay_sample_rate",ii="$replay_override_sampling",is="$replay_override_linked_flag",ir="$replay_override_url_trigger",io="$replay_override_event_trigger",ia="$sesid",il="$session_is_sampled",iu="$enabled_feature_flags",ic="$active_feature_flags",ih="$early_access_features",id="$feature_flag_details",ip="$feature_flag_payloads",iv="$feature_flag_request_id",ig="$override_feature_flags",i_="$override_feature_flag_payloads",im="$stored_person_properties",iy="$stored_group_properties",ib="$surveys",iw="$surveys_loaded_at",ix="$surveys_activated",iS="ph_product_tours",iE="$flag_call_reported",ik="$flag_call_reported_session_id",iP="$feature_flag_errors",iF="$feature_flag_evaluated_at",iI="$user_state",i$="$client_session_props",iC="$capture_rate_limit",iR="$initial_campaign_params",iT="$initial_referrer_info",iA="$initial_person_info",iO="$epp",iM="__POSTHOG_TOOLBAR__",iL="$posthog_cookieless",iD="$sdk_debug_extensions_init_method",iN="$sdk_debug_extensions_init_time_ms",iz="$sdk_debug_recording_script_not_loaded",ij="PostHog loadExternalDependency extension not found.",iq="on_reject",iH="always",iU="anonymous",iB="identified",iV="identified_only",iW="visibilitychange",iG="beforeunload",iY="$pageview",iJ="$pageleave",iK="$identify",iX="$groupidentify";function iQ(e,t){B(e)&&e.forEach(t)}function iZ(e,t){if(!Q(e)){if(B(e))e.forEach(t);else if(ei(e))e.forEach((e,i)=>t(e,i));else for(var i in e)H.call(e,i)&&t(e[i],i)}}var i0=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 i1(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var i2=function(e){try{return e()}catch(e){return}},i3=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){tW.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tW.critical(e)}}},i5=function(e){var t={};return iZ(e,function(e,i){(J(e)&&e.length>0||Z(e))&&(t[i]=e)}),t},i6=["herokuapp.com","vercel.app","netlify.app"];function i8(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}function i4(e){return"ph_toolbar_internal"===e.name}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Z(e)&&isFinite(e)&&Math.floor(e)===e});class i7{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");
1var 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 i7(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 i7(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 i9{constructor(){this.S=0,this.C=0,this.I=new sn}generate(){var e=this.generateOrAbort();if(Y(e)){this.S=0;var t=this.generateOrAbort();if(Y(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>0x3ffffffffff&&(this.S++,this.M())}return i7.fromFieldsV7(this.S,Math.trunc(this.C/0x40000000),0x3fffffff&this.C,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var se,st,si,ss,sr=e=>{if("undefined"!=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};s&&!Y(s.crypto)&&crypto.getRandomValues&&(sr=e=>crypto.getRandomValues(e));class sn{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(sr(this.R),this.O=0),this.R[this.O++]}}var so=()=>sa().toString(),sa=()=>(ss||(ss=new i9)).generate(),sl="",su=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sc={N:()=>!!o,D(e){tW.error("cookieStore error: "+e)},A(e){if(o){try{for(var t=e+"=",i=o.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}},F(e){var t;try{t=JSON.parse(sc.A(e))||{}}catch(e){}return t},q(e,t,i,s,r){if(!o)return!1;try{var n="",a="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=o),sl)return sl;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+so();!sl&&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",sl=n)}return sl}(e);if(!i){var s,r=(s=e.match(su))?s[0]:"";r!==i&&tW.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(o.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}r&&(a="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+a;return c.length>3686.4&&tW.warn("cookieStore warning: large cookie, len="+c.length),o.cookie=c,!0}catch(e){return!1}},P(e,t){if(null!=o&&o.cookie)try{sc.q(e,"",-1,t)}catch(e){return}}},sh=null,sd={N(){if(!X(sh))return sh;var e=!0;if(Y(s))e=!1;else try{var t="__mplssupport__";sd.q(t,"xyz"),'"xyz"'!==sd.A(t)&&(e=!1),sd.P(t)}catch(t){e=!1}return e||tW.error("localStorage unsupported; falling back to cookie store"),sh=e,e},D(e){tW.error("localStorage error: "+e)},A(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){sd.D(e)}return null},F(e){try{return JSON.parse(sd.A(e))||{}}catch(e){}return null},q(e,t){try{return null==s||s.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sd.D(e)}return!1},P(e){try{null==s||s.localStorage.removeItem(e)}catch(e){sd.D(e)}}},sp=[tX,"distinct_id",ia,il,iO,iA,iI],sv={},sg={N:()=>!0,D(e){tW.error("memoryStorage error: "+e)},A:e=>sv[e]||null,F:e=>sv[e]||null,q:(e,t)=>(sv[e]=t,!0),P(e){delete sv[e]}},s_=null,sf={N(){if(!X(s_))return s_;if(s_=!0,Y(s))s_=!1;else try{var e="__support__";sf.q(e,"xyz"),'"xyz"'!==sf.A(e)&&(s_=!1),sf.P(e)}catch(e){s_=!1}return s_},D(e){tW.error("sessionStorage error: ",e)},A(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){sf.D(e)}return null},F(e){try{return JSON.parse(sf.A(e))||null}catch(e){}return null},q(e,t){try{return null==s||s.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sf.D(e)}return!1},P(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){sf.D(e)}}};class sm{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}
1isOptedOut(){return this.Se.cookieless_mode===iH||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===iq}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get St(){var e=this.Ct.A(this.It);return eu(e)?1:N(ec,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,t="localStorage"===e?sd:sc;if(!this.Tt||this.Tt!==t){this.Tt=t;var i="localStorage"===e?sc:sd;i.A(this.It)&&(this.Tt.A(this.It)||this.optInOut(eu(i.A(this.It))),i.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,p.doNotTrack].some(e=>eu(e))}}function sy(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!V(s))return t;try{var r=s(t);return J(r)&&r?r:t}catch(e){return tW.error("Error in get_current_url, falling back to window.location.href",e),t}}function sb(e){return e instanceof Element&&(e.id===iM||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sw(e){return!!e&&1===e.nodeType}function sx(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function sS(e){return!!e&&3===e.nodeType}function sE(e){return!!e&&11===e.nodeType&&sw(e.host)}function sk(e){return e?z(e).split(/\s+/):[]}function sP(e,t){var i,r,n=Y(r=null==s||null==(i=s.location)?void 0:i.href)?void 0:sy(t,r);return!!(n&&e&&e.some(e=>n.match(e)))}function sF(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 sk(t)}function sI(e){return Q(e)?null:z(e).split(/(\s+)/).filter(e=>sX(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function s$(e){var t="";return sU(e)&&!sB(e)&&e.childNodes&&e.childNodes.length&&iZ(e.childNodes,function(e){var i;sS(e)&&e.textContent&&(t+=null!==(i=sI(e.textContent))&&void 0!==i?i:"")}),z(t)}function sC(e){var t;return Y(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var sR=["a","button","form","input","select","textarea","label"];function sT(e,t){if(Y(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 sA(e){var t=e.parentNode;return!(!t||!sw(t))&&t}var sO=[".ph-no-autocapture","[data-ph-no-autocapture]"],sM=["next","previous","prev",">","<"],sL=[...sM,"+","-","â","â"],sD=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,sN=[".ph-no-rageclick",".ph-no-capture"],sz=["","text","search","email","password","url","tel","number"];function sj(e,t){if(!s||sq(e)||(et(t)?(r=!!t&&sN,n=void 0,o=!1):(r=null!==(a=null==t?void 0:t.css_selector_ignorelist)&&void 0!==a?a:sN,n=null==t?void 0:t.content_ignorelist,o=null!==(l=null==t?void 0:t.ignore_text_selection)&&void 0!==l&&l),!1===r)||o&&!(!(i=e)||!sw(i))&&(sx(i,"textarea")||(sx(i,"input")?N(sz,(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,r,n,o,a,l,{targetElementList:u}=sH(e,!1);return!function(e,t){var i;if(!1===e||Y(e))return!1;if(!0===e)i=sM;else{if(!B(e))return!1;if(e.length>10)return tW.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{safeText:t,ariaLabel:s}=e;return i.some(e=>sD(t,e)||sD(s,e))})}(n,u.map(e=>{var t;return{safeText:s$(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!sT(u,r)}var sq=e=>!e||sx(e,"html")||!sw(e),sH=(e,t)=>{if(!s||sq(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!sx(n,"body");)if(sE(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=sA(n);if(!o)break;if(t||sR.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var a=s.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(e){}r.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:r}};function sU(e){for(var t=e;t.parentNode&&!sx(t,"body");t=t.parentNode){var i=sF(t);if(N(i,"ph-sensitive")||N(i,"ph-no-capture"))return!1}if(N(sF(e),"ph-include"))return!0;var s=e.type||"";if(J(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}
1var r=e.name||e.id||"";return!J(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function sB(e){return!!(sx(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||sx(e,"select")||sx(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var sV="(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})",sW=RegExp("^(?:"+sV+")$"),sG=new RegExp(sV),sY="\\d{3}-?\\d{2}-?\\d{4}",sJ=RegExp("^("+sY+")$"),sK=RegExp("("+sY+")");function sX(e,t){return void 0===t&&(t=!0),!(Q(e)||J(e)&&(e=z(e),(t?sW:sG).test((e||"").replace(/[- ]/g,""))||(t?sJ:sK).test(e)))}function sQ(e){var t=s$(e);return sX(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&iZ(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=s$(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tW.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function sZ(e){return e.replace(/"|\\"/g,'\\"')}var s0=tG("[Dead Clicks]"),s1=()=>!0,s2=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(t4)),s=e.instance.config.capture_dead_clicks;return et(s)?s:!!W(s)||i};class s3{get lazyLoadedDeadClicksAutocapture(){return this.Et}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[t4]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt(()=>{this.Pt()}):this.stop()}Mt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?s0.error("failed to load script",t):e()})}Pt(){var e;if(o){if(!this.Et&&null!=(e=p.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=W(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Et=p.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Et.start(o),s0.info("starting...")}}else s0.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,s0.info("stopping..."))}}var s5=tG("[SegmentIntegration]"),s6="posthog-js";function s8(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var a=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=a,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,c,h,d,p,v=(null==(l=t.exception)?void 0:l.values)||[],g=v.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=v[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return i&&s&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),o&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}class s4{constructor(e,t,i,s,r,n){this.name=s6,this.setupOnce=function(o){o(s8(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class s7{constructor(e){this.Rt=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(tW.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){var e;this.Ft=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Rt)}destroy(){var e;null==(e=this.Ft)||e.call(this),this.Ft=void 0}doPageView(e,t){var i,r=this.At(e,t);return this.Ot={pathname:null!==(i=null==s?void 0:s.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.At(e,null==(t=this.Ot)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Ot)?void 0:e.pageViewId}}At(e,t){var i=this.Ot;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{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=r;
1if(!(Y(n)||Y(o)||Y(a)||Y(l)||Y(u)||Y(c))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var h=n>1?eh(o/n,0,1,tW):1,d=n>1?eh(a/n,0,1,tW):1,p=l>1?eh(u/l,0,1,tW):1,v=l>1?eh(c/l,0,1,tW):1;s=i0(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$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 s9=["flags","surveys"],re={[tK]:{exposure:"hidden"},[tZ]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[t0]:{exposure:"hidden"},[t1]:{exposure:"event"},[t2]:{exposure:"hidden"},[t3]:{exposure:"event"},[t5]:{exposure:"hidden"},[t6]:{exposure:"event"},[t8]:{exposure:"event"},[t4]:{exposure:"event"},[t7]:{exposure:"hidden"},[t9]:{exposure:"event"},[ie]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ia]:{exposure:"hidden"},[il]:{exposure:"event"},[it]:{exposure:"event",shouldSkipFromEventProperties:e=>X(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"},[iu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!W(e))return{};for(var t={},i=Object.keys(e),s=0;i.length>s;s++)t["$feature/"+i[s]]=e[i[s]];return t}},[ic]:{exposure:"event",storageGroup:"flags"},[ih]:{exposure:"hidden"},[id]:{exposure:"hidden",storageGroup:"flags"},[ip]:{exposure:"event",storageGroup:"flags"},[iv]:{exposure:"event",storageGroup:"flags",volatile:!0},[ig]:{exposure:"event"},[i_]:{exposure:"hidden"},[im]:{exposure:"hidden"},[iy]:{exposure:"hidden"},[ib]:{exposure:"hidden",storageGroup:"surveys"},[iw]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ix]:{exposure:"event"},[iS]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[iE]:{exposure:"hidden"},[ik]:{exposure:"hidden"},[iP]:{exposure:"hidden"}
1,[iF]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iI]:{exposure:"hidden"},[i$]:{exposure:"hidden"},[iC]:{exposure:"hidden"},[iR]:{exposure:"hidden"},[iT]:{exposure:"hidden"},[iA]:{exposure:"hidden"},[iO]:{exposure:"hidden"},[ii]:{exposure:"event"},[is]:{exposure:"event"},[ir]:{exposure:"event"},[io]:{exposure:"event"},[iD]:{exposure:"event"},[iN]:{exposure:"event"},[iz]:{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"}]],ri=e=>{var t=re[e];if(t)return t;for(var[i,s]of rt)if(0===e.indexOf(i))return s},rs=e=>{var t=null==o?void 0:o.createElement("a");return Y(t)?null:(t.href=e,t)},rr=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(!B(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){tW.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},rn=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var h=l[c].split("=");B(h)&&(t.includes(h[0])?u.push(h[0]+"="+i):u.push(l[c]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},ro=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},ra=(e,t)=>e>=t&&v(),rl=(e,t,i,s)=>{if(0===e){if(v()){var r=t+1;return r===i&&s(),r}return t}return 0},ru="https?://(.*)",rc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rh=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rc],rd="<masked>",rp=["li_fat_id"];function rv(e,t,i){if(!o)return{};var s,r=t?[...rc,...i||[]]:[],n=rg(rn(o.URL,r,rd),e);return i0((s={},iZ(rp,function(e){var t=sc.A(e);s[e]=t||null}),s),n)}function rg(e,t){var i=rh.concat(t||[]),s={};return iZ(i,function(t){var i=rr(e,t);s[t]=i||null}),s}function r_(e){var t=e?0===e.search(ru+"google.([^/?]*)")?"google":0===e.search(ru+"bing.com")?"bing":0===e.search(ru+"yahoo.com")?"yahoo":0===e.search(ru+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!X(t)){i.$search_engine=t;var s=o?rr(o.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rf(){return navigator.language||navigator.userLanguage}var rm="$direct";function ry(){return(null==o?void 0:o.referrer)||rm}function rb(e,t,i){void 0===i&&(i=!1);var s=e?[...rc,...t||[]]:[],r=i?tl(null==a?void 0:a.href):null==a?void 0:a.href,n=null==r?void 0:r.substring(0,1e3);return{r:ry().substring(0,1e3),u:n?rn(n,s,rd):void 0}}function rw(e,t){void 0===t&&(t=!1);var i,{r:s,u:r}=e,n=t?tl(r):r,o={$referrer:s,$referring_domain:null==s?void 0:s==rm?rm:null==(i=rs(s))?void 0:i.host};
1if(n){o.$current_url=n;var a=rs(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,i0(o,rg(n))}return s&&i0(o,r_(s)),o}function rx(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rS={flags:iF,surveys:iw},rE=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],rk="main";class rP{constructor(e,t,i){if(void 0===i&&(i=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=i,this.props={},this.Bt=!1,this.jt=(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.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&tW.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),s){var r=()=>this.flush();i8(s,"beforeunload",r,{capture:!1}),i8(s,"pagehide",r,{capture:!1})}}zt(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return Z(t)&&t>0?t:0}isDisabled(){return!!this.Vt}Ht(e){-1===rE.indexOf(e.persistence.toLowerCase())&&(tW.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,r,n,o=(t=e.cookie_persisted_properties||[],i=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===i&&(i=!1),r=[...sp,...t],y({},sd,{F(e){try{var t={};try{t=sc.F(e)||{}}catch(e){}var s,r=JSON.parse(sd.A(e)||"{}");if(i){var n={};for(var o in t){var a=t[o];X(a)||""===a||(n[o]=a)}s=i0(r,n)}else s=i0(t,r);return sd.q(e,s),s}catch(e){}return null},q(e,t,i,s,n,o){var a=sd.q(e,t,void 0,void 0,o);try{var l={};r.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&sc.q(e,l,i,s,n,o)}catch(e){sd.D(e)}return a},P(e,t){try{null==s||s.localStorage.removeItem(e),sc.P(e,t)}catch(e){sd.D(e)}}})),a=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sd.N()?(n=sd,a=!0):"localstorage+cookie"===l&&o.N()?(n=o,a=!0):"sessionstorage"===l&&sf.N()?n=sf:"memory"===l?n=sg:"cookie"===l?n=sc:o.N()?(n=o,a=!0):n=sc,this.Dt=a,n}Wt(e){return this.jt+"__"+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var t=null!=e?e:this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[iF];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return iZ(this.props,(t,i)=>{var s=ri(i);if("derived"===(null==s?void 0:s.exposure)){if(null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,i===iu?()=>this.Gt():()=>!1))return;s.transformToEventProperties&&i0(e,s.transformToEventProperties(t))}else if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,()=>!1))return;e[i]=t}}),e}load(){if(!this.Vt){var e=this.Ct.F(this.jt);e&&(this.props=i0({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of s9){var t=sd.F(this.Wt(e));if(t&&!G(t)){var i=this.Qt(e);i.persisted=!0,this.Jt(e)||(i.fingerprint=this.Yt(t,e)),this.Kt(e,t)||i0(this.props,t)}}}Jt(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=ri(t))?void 0:i.storageGroup)===e})}Kt(e,t){var i=rS[e];if(!i)return!1;var s=t[i],r=this.props[i];return Z(s)&&Z(r)&&r>s}refreshKey(e){var t;if(!this.Vt){var i=this.Nt?null==(t=ri(e))?void 0:t.storageGroup:void 0,s=i?sd.F(this.Wt(i)):this.Ct.F(this.jt);if(s&&e in s)this.Xt(e,s[e]);else{if(i){var r=this.Ct.F(this.jt);if(r&&e in r)return void this.Xt(e,r[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?Y(this.tr)&&(this.tr=setTimeout(()=>{this.tr=void 0,this.rr()},e)):this.rr()}}flush(){Y(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,rk))}ir(){var{main:e,groups:t}=this.sr();for(var i of(this.nr(this.Ct,this.jt,e,rk),s9)){var s,r=t[i];(!G(r)||null!=(s=this.$t[i])&&s.persisted)&&this.nr(sd,this.Wt(i),r,i)}}sr(){var e={},t={};for(var i of s9)t[i]={};return iZ(this.props,(i,s)=>{var r,n=null==(r=ri(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Yt(e,t){if(t===rk)return JSON.stringify(e)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var i={};return iZ(e,(e,t)=>{var s;i[t]=null!=(s=ri(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}nr(e,t,i,s){var r,n=this.Qt(s);if(s===rk||n.dirty||Y(n.fingerprint)){try{if((r=this.Yt(i,s))===n.fingerprint)return void(n.dirty=!1)}catch(e){r=void 0}e.q(t,i,this.ar,this.lr,this.ur,this.Se.debug)?(n.dirty=!1,s!==rk&&(n.persisted=!0),Y(r)||(n.fingerprint=r)):this.Se.debug&&tW.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(Y(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.jt,!1),this.Ct.P(this.jt,!0),!t&&this.qt)for(var i of s9)sd.P(this.Wt(i));t?delete this.$t[rk]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(W(e)){Y(t)&&(t="None"),this.ar=Y(i)?this.hr:i;var s=!1;if(iZ(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Xt(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(W(e)){this.ar=Y(t)?this.hr:t;var i=!1;if(iZ(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.Xt(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.Bt){var e=rv(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);G(i5(e))||this.register(e),this.Bt=!0}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?r_(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ry(),$referring_domain:null!=o&&o.referrer&&(null==(e=rs(o.referrer))?void 0:e.host)||rm},void 0)}set_initial_person_info(){this.props[iR]||this.props[iT]||this.register_once({[iA]:rb(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e,t,i,s={};iZ([iT,iR],e=>{var t=this.props[e];t&&iZ(t,function(e,t){s["$initial_"+j(t)]=e})});var r=this.props[iA];return r&&i0(s,(void 0===(e=this.Se.disable_capture_url_hashes)&&(e=!1),t=rw(r,e),i={},iZ(t,function(e,t){i["$initial_"+j(t)]=e}),i)),s}safe_merge(e){return iZ(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==t.persistence||!((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||[]),r=s?this.Ht(e):this.Ct,n=this.Ut(e);if(s||n!==this.Nt){var o=this.props;this.clear(),this.Ct=r,this.Nt=n,this.props=o,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[t0]||{};i[e]=t,this.Xt(t0,i),this.save()}remove_event_timer(e){var t=this.props[t0]||{},i=t[e];return Y(i)||(delete t[e],this.Xt(t0,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Xt(e,t),this.save()}Xt(e,t){var i;this.props[e]=t,null!=(i=ri(e))&&i.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var t,i=null==(t=ri(e))?void 0:t.storageGroup;i&&(this.Qt(i).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}}var rF={Activation:"events",Cancellation:"cancelEvents"},rI={Popover:"popover",API:"api",Widget:"widget"},r$={Always:"always"},rC={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},rR={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},rT={Popover:"popover",Inline:"inline"},rA={SHOWN:"product tour shown"},rO={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},rM=tG("[RateLimiter]");class rL{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{rM.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rM.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,{captureEventsBurstLimit:r,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(iC))&&void 0!==t?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>r&&(a.tokens=r);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(iC,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rD=tG("[RemoteConfig]");class rN{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}cr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}vr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return rD.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void rD.warn("Remote config is disabled. Falling back to local config.");this.cr(e=>{if(!e)return rD.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr(e=>{this.pr(e),this.gr()});this.pr(e),this.gr()})}catch(e){rD.error("Error loading remote config",e)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}
1refresh(){!this._instance.mr()&&o&&"hidden"!==o.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var e;if(!this.yr){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.yr=setInterval(()=>{this.refresh()},t))}}pr(e){var t;e||rD.error("Failed to fetch remote config from PostHog."),this._instance.pr(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var rz={GZipJS:"gzip-js",Base64:"base64"},rj=Uint8Array,rq=Uint16Array,rH=Uint32Array,rU=new rj([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]),rB=new rj([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]),rV=new rj([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rW=function(e,t){for(var i=new rq(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new rH(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]},rG=rW(rU,2),rY=rG[1];rG[0][28]=258,rY[258]=28;for(var rJ=rW(rB,0)[1],rK=new rq(32768),rX=0;32768>rX;++rX){var rQ=(43690&rX)>>>1|(21845&rX)<<1;rK[rX]=((65280&(rQ=(61680&(rQ=(52428&rQ)>>>2|(13107&rQ)<<2))>>>4|(3855&rQ)<<4))>>>8|(255&rQ)<<8)>>>1}var rZ=function(e,t,i){for(var s=e.length,r=0,n=new rq(t);s>r;++r)++n[e[r]-1];var o,a=new rq(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new rq(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],c=t-e[r],h=a[e[r]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)o[rK[h]>>>l]=u}else for(o=new rq(s),r=0;s>r;++r)o[r]=rK[a[e[r]-1]++]>>>15-e[r];return o},r0=new rj(288);for(rX=0;144>rX;++rX)r0[rX]=8;for(rX=144;256>rX;++rX)r0[rX]=9;for(rX=256;280>rX;++rX)r0[rX]=7;for(rX=280;288>rX;++rX)r0[rX]=8;var r1=new rj(32);for(rX=0;32>rX;++rX)r1[rX]=5;var r2=rZ(r0,9,0),r3=rZ(r1,5,0),r5=function(e){return(e/8>>0)+(7&e&&1)},r6=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof rq?rq:e instanceof rH?rH:rj)(i-t);return s.set(e.subarray(t,i)),s},r8=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},r4=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},r7=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 rj(0),0];if(1==r){var o=new rj(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,c=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=i[i[h].f>i[u].f?u++:h++],l=i[u!=c&&i[h].f>i[u].f?u++:h++],i[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new rq(d+1),v=r9(i[c-1],p,0);if(v>t){s=0;var g=0,_=v-t,f=1<<_;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+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;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 rj(p),v]},r9=function(e,t,i){return -1==e.s?Math.max(r9(e.l,t,i+1),r9(e.r,t,i+1)):t[e.s]=i},ne=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new rq(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},nt=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},ni=function(e,t,i){var s=i.length,r=r5(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)},ns=function(e,t,i,s,r,n,o,a,l,u,c){r8(t,c++,i),++r[256];for(var h=r7(r,15),d=h[0],p=h[1],v=r7(n,15),g=v[0],_=v[1],f=ne(d),m=f[0],y=f[1],b=ne(g),w=b[0],x=b[1],S=new rq(19),E=0;m.length>E;++E)S[31&m[E]]++;for(E=0;w.length>E;++E)S[31&w[E]]++;for(var k=r7(S,7),P=k[0],F=k[1],I=19;I>4&&!P[rV[I-1]];--I);var $,C,R,T,A=u+5<<3,O=nt(r,r0)+nt(n,r1)+o,M=nt(r,d)+nt(n,g)+o+14+3*I+nt(S,P)+(2*S[16]+3*S[17]+7*S[18]);if(O>=A&&M>=A)return ni(t,c,e.subarray(l,l+u));if(r8(t,c,1+(O>M)),c+=2,O>M){$=rZ(d,p,0),C=d,R=rZ(g,_,0),T=g;var L=rZ(P,F,0);for(r8(t,c,y-257),r8(t,c+5,x-1),r8(t,c+10,I-4),c+=14,E=0;I>E;++E)r8(t,c+3*E,P[rV[E]]);c+=3*I;for(var D=[m,w],N=0;2>N;++N){var z=D[N];for(E=0;z.length>E;++E)r8(t,c,L[j=31&z[E]]),c+=P[j],j>15&&(r8(t,c,z[E]>>>5&127),c+=z[E]>>>12)}}else $=r2,C=r0,R=r3,T=r1;for(E=0;a>E;++E)if(s[E]>255){r4(t,c,$[257+(j=s[E]>>>18&31)]),c+=C[j+257],j>7&&(r8(t,c,s[E]>>>23&31),c+=rU[j]);var j,q=31&s[E];r4(t,c,R[q]),c+=T[q],q>3&&(r4(t,c,s[E]>>>5&8191),c+=rB[q])}else r4(t,c,$[s[E]]),c+=C[s[E]];return r4(t,c,$[256]),c+C[256]},nr=new rH([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nn=function(){for(var e=new rH(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),no=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},na=!!u||!!l,nl="text/plain",nu=!1,nc=(e,t)=>{var[i,s]=e.split("#"),[r,n]=i.split("?");if(!n)return e;var o=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return r+(o?"?"+o:"")+(s?"#"+s:"")},nh=function(e,t,i){void 0===i&&(i=!0);var s,r,n,o,a,[l,u]=e.split("?"),c=y({},t),h=null!==(a=null==u?void 0:u.split("&").map(e=>{var t,[s,r]=e.split("="),n=i&&null!==(t=c[s])&&void 0!==t?t:r;return delete c[s],s+"="+n}))&&void 0!==a?a:[],d=(void 0===s&&(s="&"),o=[],iZ(c,function(e,t){Y(e)||Y(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+r)}),o.join(s));return d&&h.push(d),l+"?"+h.join("&")},nd=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),np=e=>{if(e.xt)return e.xt;var{data:t,compression:i}=e;if(t){if(i===rz.GZipJS){var s=function(e,t){void 0===t&&(t={});var i=(r=0xffffffff,{p(e){for(var t=r,i=0;e.length>i;++i)t=nn[255&t^e[i]]^t>>>8;r=t},d:()=>0xffffffff^r}),s=e.length;i.p(e);var r,n,o,a,l=(a=10+((n=t).filename&&n.filename.length+1||0),function(e,t,i,s,r,n){var o=e.length,a=new rj(s+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(s,a.length-8),u=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var h=c+65535;o>
1h?u=ni(l,u,e.subarray(c,h)):(l[c]=!0,u=ni(l,u,e.subarray(c,o)))}else{for(var d=nr[t-1],p=d>>>13,v=8191&d,g=(1<<i)-1,_=new rq(32768),f=new rq(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new rH(25e3),x=new rq(288),S=new rq(32),E=0,k=0,P=(c=0,0),F=0,I=0;o>c;++c){var $=b(c),C=32767&c,R=f[$];if(_[C]=R,f[$]=C,c>=F){var T=o-c;if((E>7e3||P>24576)&&T>423){u=ns(e,l,0,w,x,S,k,P,I,c-I,u),P=E=k=0,I=c;for(var A=0;286>A;++A)x[A]=0;for(A=0;30>A;++A)S[A]=0}var O=2,M=0,L=v,D=C-R&32767;if(T>2&&$==b(c-D))for(var N=Math.min(p,T)-1,z=Math.min(32767,c),j=Math.min(258,T);z>=D&&--L&&C!=R;){if(e[c+O]==e[c+O-D]){for(var q=0;j>q&&e[c+q]==e[c+q-D];++q);if(q>O){if(O=q,M=D,q>N)break;var H=Math.min(D,q-2),U=0;for(A=0;H>A;++A){var B=c-D+A+32768&32767,V=B-_[B]+32768&32767;V>U&&(U=V,R=B)}}}D+=(C=R)-(R=_[C])+32768&32767}if(M){w[P++]=0x10000000|rY[O]<<18|rJ[M];var W=31&rY[O],G=31&rJ[M];k+=rU[W]+rB[G],++x[257+W],++S[G],F=c+O,++E}else w[P++]=e[c],++x[e[c]]}}u=ns(e,l,!0,w,x,S,k,P,I,c-I,u)}return r6(a,0,s+r5(u)+8)}(e,null==(o=t).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,a,8)),u=l.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&no(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)}}(l,t),no(l,u-8,i.d()),no(l,u-4,s),l}(function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new rj(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},o=0;i>o;++o){if(r+5>s.length){var a=new rj(r+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);128>l?n(l):(2048>l?n(192|l>>>6):(l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return r6(s,0,r)}(nd(t)),{mtime:0});return{contentType:nl,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(i===rz.Base64){var r=(e=>"data="+encodeURIComponent("string"==typeof e?e:nd(e)))(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(nd(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var n=nd(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},nv=e=>{var t,i,s=()=>({url:nc(e.url,"compression"),encodedBody:np(y({},e,{compression:void 0,xt:void 0}))});try{t=np(e)}catch(t){if(R(e.compression,rr(e.url,"compression")))return tW.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&R(e.compression,rr(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?C(new Uint8Array(i)):ArrayBuffer.isView(i)&&C(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nu=!0,s())},ng=e=>{try{return nv(e)}catch(t){return tW.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},n_=function(){var e=m(function*(e){var t=nd(e.data),i=yield function(e,t,i){return M.apply(this,arguments)}(t,_.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return y({},e,{xt:{contentType:nl,body:s,estimatedSize:s.byteLength}})});return function(t){return e.apply(this,arguments)}}(),nf=(e,t)=>nh(e,{_:(new Date).getTime().toString(),ver:_.JS_SDK_VERSION,compression:t}),nm=[];l&&nm.push({transport:"fetch",method(e){var t,i=ng(e);if(i){var{url:s,encodedBody:r}=i,{contentType:n,body:o,estimatedSize:a}=null!=r?r:{},u=new Headers;iZ(e.headers,function(e,t){u.append(t,e)}),n&&u.append("Content-Type",n);var h=null,d=!1;if(c){var p=new c;h={signal:p.signal,timeout:setTimeout(()=>{var t,i;d=!0,p.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}l(s,y({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&52428.8>(a||0),body:o,signal:null==(t=h)?void 0:t.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){tW.error(e)}null==e.callback||e.callback(s)})).catch(t=>{d&&"AbortError"===(null==t?void 0:t.name)?tW.warn(t):tW.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>h?clearTimeout(h.timeout):null)}}}),u&&nm.push({transport:"XHR",method(e){var t=ng(e);if(t){var i=new u,{url:s,encodedBody:r}=t;i.open(e.method||"GET",s,!0);var{contentType:n,body:o}=null!=r?r:{};iZ(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};
1if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(o)}}}),null!=n&&n.sendBeacon&&nm.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:i}=nv(e),{contentType:s,body:r}=null!=i?i:{};if(!r)return;var o=r instanceof Blob?r:new Blob([r],{type:s});n.sendBeacon(t,o)}catch(e){}}});class ny{constructor(e,t){this.br=!0,this._r=[],this.wr=eh((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tW.createLogger("flush interval"),3e3),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=Object.values(this._r.length>0?this.Tr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Er(y({},e,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout(()=>{if(this.Ir(),this._r.length>0){var t=this.Tr();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&B(s.data)&&iZ(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Er(s)}()}},this.wr))}Er(e){try{this.kr(e)}catch(e){tW.error(e)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return iZ(this._r,t=>{var i,s=(t?t.batchKey:null)||t.url;Y(e[s])&&(e[s]=y({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this._r=[],e}}var nb=["retriesPerformedSoFar"];class nw{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!Y(s)&&"onLine"in s.navigator&&(this.Rr=s.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},i8(s,"online",this.Or),i8(s,"offline",this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=b(e,nb);ee(t)&&(i.url=nh(i.url,{retry_count:t})),this._instance._send_request(y({},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.st(y({retriesPerformedSoFar:t},i));0===e.statusCode&&tW.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)}}))}st(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._r.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),tW.warn(o),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),0===this._r.length)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout(()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()},this.Pr)}Lr(){var e=Date.now(),t=[],i=this._r.filter(i=>e>i.retryAt||(t.push(i),!1));if(this._r=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.$r&&(clearTimeout(this.$r),this.$r=void 0),this.Mr=!1,Y(s)||(this.Or&&(s.removeEventListener("online",this.Or),this.Or=void 0),this.Fr&&(s.removeEventListener("offline",this.Fr),this.Fr=void 0)),this._r))try{this._instance._send_request(y({},e,{transport:"sendBeacon"}))}catch(e){tW.error(e)}this._r=[]}}class nx{constructor(e){this.Dr=()=>{this.Nr||(this.Nr={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Nr.lastScrollY=Math.ceil(n),this.Nr.maxScrollY=Math.max(n,null!==(e=this.Nr.maxScrollY)&&void 0!==e?e:0),this.Nr.maxScrollHeight=Math.max(o,null!==(t=this.Nr.maxScrollHeight)&&void 0!==t?t:0),this.Nr.lastContentY=a,this.Nr.maxContentY=Math.max(a,null!==(i=this.Nr.maxContentY)&&void 0!==i?i:0),this.Nr.maxContentHeight=Math.max(l,null!==(s=this.Nr.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){i8(s,"scroll",this.Dr,{capture:!0}),i8(s,"scrollend",this.Dr,{capture:!0}),i8(s,"resize",this.Dr)}scrollElement(){if(!this.qr)return null==s?void 0:s.document.documentElement;for(var e of B(this.qr)?this.qr:[this.qr]){var t=null==s?void 0:s.document.querySelector(e);
1if(t)return t}}Br(e){if(this.qr){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return s?"y"===e?s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop||0:s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft||0:0}scrollY(){return this.Br("y")}scrollX(){return this.Br("x")}}var nS=e=>rb(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 nE{constructor(e,t,i,s){this.jr=e=>{var t=this.Hr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ur(this._instance)};this.zr.register({[i$]:i})}},this._instance=e,this.Vr=t,this.zr=i,this.Ur=s||nS,this.Vr.onSessionId(this.jr)}Hr(){return this.zr.props[i$]}getSetOnceProps(){var e,t=null==(e=this.Hr())?void 0:e.props;return t?"r"in t?rw(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 iZ(i5(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+j(i)]=t}),e}}class nk{constructor(){this.Wr={}}on(e,t){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(t),()=>{this.Wr[e]=this.Wr[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Wr[e]||[])i(t);for(var s of this.Wr["*"]||[])s(e,t)}}var nP=tG("[SessionId]");class nF{on(e,t){return this.Gr.on(e,t)}constructor(e,t,i){if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new nk,this.Kr=(e,t)=>
1!(!ee(e)||!ee(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===iH)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=t||so,this.ri=i||so;var s,r=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*eh(this.Se.session_idle_timeout_seconds||1800,60,36e3,nP.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni="ph_"+r+"_window_id",this.si="ph_"+r+"_primary_window_exists",this.oi()){var n=sf.F(this.ni),o=sf.F(this.si);n&&!o?this.Xr=n:sf.P(this.ni),sf.q(this.si,!0)}if(null!=(s=this.Se.bootstrap)&&s.sessionID)try{var a=(e=>{var t=this.Se.bootstrap.sessionID.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)})();this.ai(this.Se.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){nP.error("Invalid sessionID in bootstrap",e)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Y(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter(t=>t!==e)}}oi(){return"memory"!==this.Se.persistence&&!this.zr.Vt&&sf.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&sf.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?sf.F(this.ni):null}di(e){var t=this.Zr;return!X(t)&&!X(e)&&5e3>Math.abs(e-t)}ai(e,t,i){var s=t!==this._sessionActivityTimestamp,r=!(e!==this.ei||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.ei=e,r&&!s||r&&this.di(t)||(this.Zr=t,this.zr.register({[ia]:[t,e,i]}))}ci(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return ee(t)&&t>0}vi(){this.ci()?this.zr.refreshKey(ia):(this.zr.flush(),this.zr.load())}fi(){var e;if(!X(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,t,i]=this.pi();t===this.ei&&i===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[ia]:[this._sessionActivityTimestamp,null!==(e=this.ei)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi();return Math.max(ee(e)?e:0,ee(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[ia];return B(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&s&&(s.removeEventListener(iG,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&sf.P(this.si)},i8(s,iG,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Se.cookieless_mode===iH)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[,s,r]=this.pi(),n=this.gi(),o=this.hi(),a=ee(r)&&Math.abs(i-r)>864e5,l=!1,u=!1,c=!s,h=s,d=!c&&!e&&this.Kr(i,n);d&&((d=this.mi(i))||nP.info("cross-tab refresh kept the session alive",{sessionId:s}),[,s,r]=this.pi()),c||d||a?(s=this.ti(),o=this.ri(),nP.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:a}}),r=i,l=!0):(o||(o=this.ri(),l=!0),(u=s!==h)&&(nP.info("adopted cross-tab session id",{sessionId:s,windowId:o}),l=!0));var p=ee(n)&&e&&!a?n:i,v=ee(r)?r:(new Date).getTime();this.ui(o),this.ai(s,p,v),e||this.ii();var g={noSessionId:c,activityTimeout:d,sessionPastMaximumLength:a,crossTabAdoption:u};return l&&this.Qr.forEach(e=>e(s,o,g)),{sessionId:s,windowId:o,sessionStartTimestamp:v,changeReason:l?g:void 0,lastActivityTimestamp:n}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout(()=>{if(!this.Yr){if(this.mi((new Date).getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit("forcedIdleReset",{idleSessionId:e})}else this.ii()}},1.1*this.sessionTimeoutMs))}}var nI=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&D(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>D(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function n$(){return(n$=m(function*(){var e=null==n?void 0:n.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return J(i)&&i.length>0?i:void 0}catch(e){return void tW.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var nC=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 nR(e,t,i){return nd({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var nT={exact:(e,t)=>
1t.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=>nC(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!nC(t,e))),icontains:(e,t)=>t.map(nA).some(t=>e.map(nA).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(nA).every(t=>e.map(nA).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))})},nA=e=>e.toLowerCase();function nO(e,t){return!e||Object.entries(e).every(e=>{var[i,s]=e,r=null==t?void 0:t[i];if(Y(r)||X(r))return!1;var n=[String(r)],o=nT[s.operator];return!!o&&o(s.values,n)})}var nM="custom",nL="i.posthog.com",nD=/^\/static\//;class nN{constructor(e){this.bi={},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("."+nL,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.bi[this.apiHost]||(this.bi[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":nM),this.bi[this.apiHost]}wi(e){if(nD.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var i=this.wi(t);if(i)return""+i+t}if(this.region===nM)return this.apiHost+t;var s=nL+t;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var nz=tG("[Surveys]"),nj="seenSurvey_",nq=e=>{try{var t=((e,t)=>{var i=""+nj+t.id;return t.current_iteration&&t.current_iteration>0&&(i=""+nj+t.id+"_"+t.current_iteration),i})(0,e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){nz.error("Failed to persist survey seen state",e)}},nH=[rI.Popover,rI.Widget,rI.API],nU={ignoreConditions:!1,ignoreDelay:!1,displayType:rT.Popover},nB=tG("[PostHog ExternalIntegrations]"),nV={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nW{constructor(e){this._instance=e}Mt(e,t){var i;null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nB.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=p.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Mt(nV[e],()=>{var i;null==(i=p.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=p.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=p.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!==(e=this._instance.config.integrations)&&void 0!==e?e:{}))i(s)}}var nG,nY={},nJ=0,nK=()=>{},nX='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',nQ="Surveys module not available",nZ="sanitize_properties is deprecated. Use before_send instead",n0="Invalid value for property_denylist config: ",n1="posthog",n2=!na&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),n3=e=>{var t;return y({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(!J(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of i6)if(i===s)return!1;return!0}(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nK,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:a&&J(null==a?void 0:a.search)&&-1!==a.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:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.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){tW.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:iV,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nK},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:sL,ignore_text_selection:!0}
1:!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)}))(e))},n5=[["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"]],n6=e=>{var t={};for(var[i,s]of n5)Y(e[i])||(t[s]=e[i]);var r=i0({},t,e),n=e.__preview_external_dependency_versioned_paths;return Y(n)||(Y(e.strict_script_versioning)&&(r.strict_script_versioning=!!n),J(n)&&Y(e.asset_host)&&(r.asset_host=n)),B(e.property_blacklist)&&(Y(e.property_denylist)?r.property_denylist=e.property_blacklist:B(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:tW.error(n0+e.property_denylist)),r};class n8{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){tW.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class n4{ki(e,t){if(e){var i=this.Si.indexOf(e);-1!==i&&this.Si.splice(i,1)}return this.Si.push(t),null==t.initialize||t.initialize(),t}Ci(){return this.config.cookieless_mode===iH||this.config.cookieless_mode===iq&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new n8,this.Ii=!1,this.version=_.LIB_VERSION,this.Ti=new nk,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=n3(),this.SentryIntegration=s4,this.sentryIntegration=e=>(function(e,t){var i=s8(e,t);return{name:s6,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new nx(this),this.pageViewManager=new s7(this),this.rateLimiter=new rL(this),this.requestRouter=new nN(this),this.consent=new sm(this),this.externalIntegrations=new nW(this);var e,t=null!==(e=n4.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=J(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=J(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>tW.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==n1){var s,r=null!==(s=nY[i])&&void 0!==s?s:new n4;return r._init(e,t,i),nY[i]=r,nY[n1][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var r,n,o=J(e)?e.trim():"";if(!o)return tW.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Oi(t.debug),this.Li=t,this.Fi=[],t.person_profiles?this.Pi=t.person_profiles:t.process_person&&(this.Pi=t.process_person);var a=n3(t.defaults),l=n6(t),u=i0({},a,l,{name:i,token:o});W(a.rageclick)&&W(l.rageclick)&&(u.rageclick=i0({},a.rageclick,l.rageclick)),W(a.session_recording)&&W(l.session_recording)&&(u.session_recording=i0({},a.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&tW.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rz.GZipJS;var c=this.Ai();this.persistence=new rP(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rP(y({},this.config,{persistence:"sessionStorage"}),c,!1);var h=y({},this.persistence.props),d=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.$i=new ny(e=>this.Di(e),this.config.request_queue_config),this.Ni=new nw(this),this.__request_queue=[];var p=this.Ci();if(p||(this.sessionManager=new nF(this),this.sessionPropsManager=new nE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tW.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.qi(p)},0)):(tW.info("Initializing extensions synchronously"),this.qi(p)),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&tW.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:h,s:d}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var v=t.bootstrap.distinctID,g=this.get_distinct_id(),f=this.persistence.get_property(iI);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&f===iU)this.identify(v);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&f===iB)tW.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 m=this.config.get_device_id(so()),b=t.bootstrap.isIdentifiedID?m:v;this.persistence.set_property(iI,t.bootstrap.isIdentifiedID?iB:iU),this.register({distinct_id:v,$device_id:b})}}if(p)this.register_once({distinct_id:iL,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(so());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(iI,iU)}return i8(s,"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()||so();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(iI,iB)),t()},r=i.user();"then"in r&&V(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register(("undefined"!=typeof Promise&&Promise.resolve||s5.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()||(s5.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(s5.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,iY),identify:e=>s(e,iK),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Bi()):this.Bi(),V(this.config._onCapture)&&this.config._onCapture!==nK&&(tW.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tW.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 n$.apply(this,arguments)})().then(e=>{e&&this.register({[tQ]:e})}).catch(nK),this}qi(e){var t,i,s,r,n,o,a,l=performance.now(),u=y({},n4.__defaultExtensionClasses,this.config.__extensionClasses),c=[];u.featureFlags&&this.Si.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new u.featureFlags(this)),u.exceptions&&this.Si.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new u.exceptions(this)),u.historyAutocapture&&this.Si.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Si.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Si.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.Si.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Si.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Si.push(this.surveys=null!==(s=this.surveys)&&void 0!==s?s:new u.surveys(this)),u.logs&&this.Si.push(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this)),u.conversations&&this.Si.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new u.conversations(this)),u.productTours&&this.Si.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Si.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Si.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,s2)),u.toolbar&&this.Si.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new u.toolbar(this)),u.experiments&&this.Si.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new u.experiments(this)),this.Si.forEach(e
1=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.ji){var e=this.ji;this.ji=void 0,this.pr(e)}}),this.Hi(c,l)}Hi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Hi(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tW.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[iD]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iN]:s}),this.config.__preview_deferred_init_extensions&&tW.info("PostHog extensions initialized ("+s+"ms)")}pr(e){var t;if(!o||!o.body)return tW.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.pr(e)},500);this.config.__preview_deferred_init_extensions&&(this.ji=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=N(e.supportedCompression,rz.GZipJS)?rz.GZipJS:N(e.supportedCompression,rz.Base64)?rz.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:iV}),this.Si.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Bi(){try{this.config.loaded(this)}catch(e){tW.critical("`loaded` function failed",e)}if(this.zi(),this.config.internal_or_test_user_hostname&&null!=a&&a.hostname){var e=a.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.Ci())&&this.Vi()},1),this.Wi=new rN(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.$i)||e.enable())}_dom_loaded(){this.is_capturing()&&iQ(this.__request_queue,e=>this.Di(e)),this.__request_queue=[],this.zi()}_handle_unload(){var e,t,i,s;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(iJ),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(i=this.$i)||i.unload(),null==(s=this.Ni)||s.unload()):this.Gi()&&this.capture(iJ,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?n2?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=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(Y(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r=y({},e);r.timeout=r.timeout||6e4,r.url=nf(r.url,r.compression);var n=null!==(t=r.transport)&&void 0!==t?t:"fetch",o=nm.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),a=null!==(i=null==(s=function(e,t){for(var i=0;e.length>i;i++)if(e[i].transport===n)return e[i]}(o))?void 0:s.method)&&void 0!==i?i:o[0].method;if(!a)throw Error("No available transport method");"sendBeacon"!==n&&r.data&&r.compression===rz.GZipJS&&h&&"undefined"!=typeof Promise&&!nu?n_(r).then(e=>{a(e)}).catch(t=>{if(T(t))return nu=!0,void a(y({},r,{compression:void 0,url:nf(e.url,void 0)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return T(e)||t===$})(t)&&(nu=!0),a(r)}):a(r)})(y({},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}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){nJ++;try{var t,i=[],s=[],r=[];iQ(e,e=>{if(e){if(B(t=e[0]))r.push(e);else if(V(e))try{e.call(this)}catch(t){tW.error("Error executing queued PostHog call",e,t)}else B(e)&&"alias"===t?i.push(e):B(e)&&-1!==t.indexOf("capture")&&V(this[t])?r.push(e):s.push(e)}});var n=function(e,t){iQ(e,function(e){try{if(B(e[0])){var i=t;iZ(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tW.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{nJ--}}push(e){if(nJ>0&&B(e)&&J(e[0])){var t=n4.prototype[e[0]];V(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing()){if(!Y(e)&&J(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&&!J(null==t?void 0:t.$current_url)&&(tW.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.Zi||tW.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 c=new Date,h=(null==i?void 0:i.timestamp)||c,d=ta(null==i?void 0:i.uuid,so),p={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},h,d)};e===iY&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==i?void 0:i.$set)&&(p.$set=null==i?void 0:i.$set);var v=null==i?void 0:i.$unset;v&&(p.$unset=v);var g,_,f,m=this.Qi(null==i?void 0:i.$set_once,e!==iX,e===iK);if(m&&(p.$set_once=m),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=p,o=e=>J(e)?e.slice(0,r):e,a=new Set,p=function e(t,i){var s;return t!==Object(t)?o?o(t):t:a.has(t)?void 0:(a.add(t),B(t)?(s=[],iQ(t,t=>{s.push(e(t))})):(s={},iZ(t,(t,i)=>{a.has(t)||(s[i]=e(t,i))}
1)),s)}(n)),p.timestamp=h,Y(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=c),e===rC.DISMISSED||e===rC.SENT){var b=null==t?void 0:t[rR.SURVEY_ID],w=null==t?void 0:t[rR.SURVEY_ITERATION];nq({id:b,current_iteration:w}),p.$set=y({},p.$set,{[(g={id:b,current_iteration:w},f="$survey_"+(_=e===rC.SENT?"responded":"dismissed")+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(f="$survey_"+_+"/"+g.id+"/"+g.current_iteration),f)]:!0})}else e===rC.SHOWN&&(p.$set=y({},p.$set,{[rR.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===rA.SHOWN){var x=null==t?void 0:t[rO.TOUR_TYPE];x&&(p.$set=y({},p.$set,{[rO.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var S=y({},p.properties.$set,p.$set);if(G(S)||this.setPersonPropertiesForFlags(S),!Q(this.config.before_send)){var E=this.it(p);if(!E)return;(p=E).uuid=ta(p.uuid,so)}this.Ti.emit("eventCaptured",p);var k={method:"POST",url:null!==(s=null==i?void 0:i._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",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.Di(k):this.$i.enqueue(k),p}tW.critical("This capture call is ignored due to client rate limiting.")}}else tW.error("No event name provided to posthog.capture")}}else tW.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var l,u=n?void 0:this.persistence.remove_event_timer(e),c=y({},t);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ci()&&(c.$cookieless_mode=!0),"$snapshot"===e){var h=y({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=h.distinct_id,(!J(c.distinct_id)&&!Z(c.distinct_id)||K(c.distinct_id))&&tW.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var p,v=function(e,t,i,r){if(void 0===r&&(r=!1),!d)return{};var n,o,l,u,c,h,p,v,g,f,m,y,b=e?[...rc,...t||[]]:[],[w,x]=function(e){for(var t=0;tr.length>t;t++){var[i,s]=tr[t],r=i.exec(e),n=r&&(V(s)?s(r,e):s);if(n)return n}return["",""]}(d),S=null!=(c="undefined"!=typeof navigator?navigator:void 0)&&c.brave?{brave:!0}:{},E={detectGoogleSearchApp:i},k=i0(i5({$os:w,$os_version:x,$browser:tt(d,navigator.vendor,S,E),$device:tn(d),$device_type:(p={userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(o=navigator)?void 0:o.maxTouchPoints,screenWidth:null==s||null==(l=s.screen)?void 0:l.width,screenHeight:null==s||null==(u=s.screen)?void 0:u.height,devicePixelRatio:null==s?void 0:s.devicePixelRatio},(y=tn(d))===ef||y===e_||"Kobo"===y||"Kindle Fire"===y||y===eG?eg:y===eL||y===eN||y===eD||y===eB?"Console":y===ey?"Wearable":y?ep:"Android"===(null==p?void 0:p.userAgentDataPlatform)&&(null!==(v=null==p?void 0:p.maxTouchPoints)&&void 0!==v?v:0)>0?600>Math.min(null!==(g=null==p?void 0:p.screenWidth)&&void 0!==g?g:0,null!==(f=null==p?void 0:p.screenHeight)&&void 0!==f?f:0)/(null!==(m=null==p?void 0:p.devicePixelRatio)&&void 0!==m?m:1)?ep:eg:"Desktop"),$timezone:rx(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rn(r?tl(null==a?void 0:a.href):null==a?void 0:a.href,b,rd),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:ts(d,navigator.vendor,S,E),$browser_language:rf(),$browser_language_prefix:"string"==typeof(h=rf())?h.split("-")[0]:void 0,$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:_.LIB_NAME,$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return _.SDK_DIST_CHANNEL&&(k.$sdk_dist_channel=_.SDK_DIST_CHANNEL),k}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
1);if(this.sessionManager){var{sessionId:g,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());c.$session_id=g,c.$window_id=f}this.sessionPropsManager&&i0(c,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&i0(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=null==(l=this.Ni)?void 0:l.length}catch(e){c.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nM&&(c.$lib_custom_api_host=this.config.api_host),p=e!==iY||n?e!==iJ||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),c=i0(c,p),e===iY&&o&&(c.title=o.title),!Y(u)){var m=i.getTime()-u;c.$duration=parseFloat((m/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=i0({},v,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),B(this.config.property_denylist)?iZ(this.config.property_denylist,function(e){delete c[e]}):tW.error(n0+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tW.error(nZ),c=b(c,e));var w=this.Ji();return c.$process_person_profile=w,w&&!n&&this.Yi("_calculate_event_properties"),c}Qi(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Ji()||this.Ii&&!i)return e;var s,r=i0({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tW.error(nZ),r=n(r,"$set_once")),t&&(this.Ii=!0),G(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Ki(e,t){this.register({[e]:t})}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())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t)}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.Ti.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:nQ}),()=>{})}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:nQ})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:nQ})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=nU),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))&&void 0!==t?t:{visible:!1,disabledReason:nQ}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!==(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:nQ})}Xi(e){return!e||K(e)?(tW.critical("Unique user id has not been set in posthog.identify"),!1):e===iL?(tW.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())||(tW.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return tW.uninitializedWarning("posthog.identify");if(Z(e)&&(e=e.toString(),tW.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Xi(e)&&this.Yi("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tX)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(tZ)&&(this.unregister(tZ),this.register({distinct_id:e}));var r,n=(this.persistence.get_property(iI)||iU)===iU;e!==s&&n?(this.persistence.set_property(iI,iB),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(iK,{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Ri=nR(e,t,i),null==(r=this.featureFlags)||r.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(iE))}}setPersonProperties(e,t){if((e||t)&&this.Yi("posthog.setPersonProperties")){var i=nR(this.get_distinct_id(),e,t);this.Ri!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ri=i):tW.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(B(e)?e:[e]).filter(e=>J(e)&&e.length>0);0!==i.length&&this.Yi("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ri=null)}group(e,t,i){if(e&&t){var s=this.getGroups(),r=s[e]!==t;if(r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},s,{[e]:t})}),r||i){var n={$group_type:e,$group_key:t};i&&(n.$group_set=i),this.capture(iX,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),r&&!i&&this.reloadFeatureFlags()}else tW.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.Yi("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(tW.info("reset"),!this.__loaded)return tW.uninitializedWarning("posthog.reset");var t,i,s,r,n,o,a,l,u,c,h=this.get_property(tX),d=this.get_property(tQ),p=this.get_property(ie);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),Y(p)||null==(c=this.persistence)||c.register({[ie]:p}),null==(s=this.surveys)||s.reset(),null==(r=this.Wi)||r.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.persistence)||l.set_property(iI,iU),null==(u=this.sessionManager)||u.resetSessionId(),this.Ri=null,this.config.cookieless_mode===iH)this.register_once({distinct_id:iL,$device_id:null},"");else{var v=this.config.get_device_id(so());this.register_once({distinct_id:v,$device_id:e?v:h},""),e||Y(d)||this.register({[tQ]:d})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return m(function*(){var e,i,s,r;t.__loaded?(null==(e=t.logs)||e.flushLogs("sendBeacon"),null==(i=t.$i)||i.unload(),null==(s=t.Ni)||s.unload(),null==(r=t.featureFlags)||r.destroy()):tW.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.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.tn()}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)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!==(r=e.timestampLookBack)&&void 0!==r?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(tK)?(tW.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yi("posthog.alias")?(Y(t)&&(t=this.get_distinct_id()),e!==t?(this.Ki(tZ,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tW.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(W(e)){i0(this.config,n6(e));var i,s,r,n,o,a,l,u,c,h,d,p=this.Ai();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rP(y({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.Oi(this.config.debug);et(v)&&(this.config.debug=v),et(this.config.debug)&&(this.config.debug?(_.DEBUG=!0,sd.N()&&sd.q("ph_debug",!0),tW.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(_.DEBUG=!1,sd.N()&&sd.P("ph_debug"))),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(r=this.exceptions)||r.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||
1c.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this.rn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){_.LIB_NAME=e,_.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.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(y({},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)&&void 0!==e?e:n4.nn}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))&&void 0!==t&&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)&&void 0!==e?e:n1;return t!==n1&&(t=n1+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iI))===iB||(null==(t=this.sessionPersistence)?void 0:t.get_property(iI))===iB}Ji(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iV&&!this._isIdentified()&&G(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tZ])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iO]))}Gi(){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.Ji()||this.Yi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(e){return"never"===this.config.person_profiles?(tW.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ki(iO,!0),!0)}Ai(){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!==iq)}rn(){var e,t,i,s,r=this.Ai();return(null==(e=this.persistence)?void 0:e.Vt)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Vt)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iH){if(this.Ci()){this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new nF(this),this.pageViewManager=new s7(this),this.persistence&&(this.sessionPropsManager=new nE(this,this.sessionManager,this.persistence));var i,s,r,n,o,a,l,u,c=null!==(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)&&void 0!==o?o:null==(l=n4.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this.ki(this.sessionRecording,new c(this)),this.Ui&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.Ui)))}this.consent.optInOut(!0),this.rn(),this.zi(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iq&&(null==(i=this.surveys)||i.loadIfEnabled()),(Y(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(s=null==e?void 0:e.captureEventName)&&void 0!==s?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else tW.warn(nX)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iH?(this.config.cookieless_mode===iq&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===iq&&(this.register({distinct_id:iL,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewM
1anager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi())):tW.warn(nX)}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===iH||(this.config.cookieless_mode===iq?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return n?nI(n,this.config.custom_blocked_useragents):void 0}Vi(){o&&("visible"===o.visibilityState?this.Ei||(this.Ei=!0,this.capture(iY,{title:o.title},{send_instantly:!0}),this.Mi&&(o.removeEventListener(iW,this.Mi),this.Mi=null)):this.Mi||(this.Mi=this.Vi.bind(this),i8(o,iW,this.Mi)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==s||s.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}))}mr(){var e,t,i,s,r=this.Li||{};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?(tW.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&&!Q(r[e]),s=t in r&&!Q(r[t]),i?r[e]:!!s&&(tW&&tW.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}it(e){if(Q(this.config.before_send))return e;var t,i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(er),s=B(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s){if(Q(r=n(r))){var o="Event '"+e.event+"' was rejected in beforeSend function";return es(e.event)?tW.warn(o+". This can cause unexpected behavior."):tW.info(o),null}r.properties&&!G(r.properties)||tW.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(r.properties&&Q(r.properties[a]))return tW.warn("Event '"+e.event+"' had its '"+a+"' 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.Ot)?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)})}Oi(e){var t=et(e)&&!e,i=sd.N()&&"true"===sd.A("ph_debug");return!t&&(!!i||e)}}n4.__defaultExtensionClasses={},n4.nn={trace:nG=()=>{},debug:nG,info:nG,warn:nG,error:nG,fatal:nG},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=i3(e.prototype[t[i]])}(n4,["identify"]);class n7{constructor(e){this.disabled=!1===e;var t=W(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 n9="$copy_autocapture",oe=tG("[AutoCapture]");function ot(e,t){return t.length>e?t.slice(0,e)+"...":t}var oi=tG("[ExceptionAutocapture]"),os=tG("[TracingHeaders]"),or=tG("[Web Vitals]"),on="disabled",oo="lazy_loading",oa="awaiting_config",ol="missing_config";tG("[SessionRecording]"),tG("[SessionRecording]");var ou="[SessionRecording]",oc=tG(ou),oh=tG("[Heatmaps]");function od(e){return W(e)&&"clientX"in e&&"clientY"in e&&Z(e.clientX)&&Z(e.clientY)}var op=tG("[Product Tours]"),ov=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(t7))},og=["$set_once","$set"],o_=tG("[SiteApps]"),of="Error while initializing PostHog app with config id ";function om(e,t,i){if(Q(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 oy{constructor(e){this.sn=new nk,this.an=(e,t)=>this.ln(e,t)&&this.un(e,t)&&this.hn(e,t)&&this.dn(e,t),this.ln=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e,t;Y(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(!Y(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
vendor: 4,674 bytes, line 1
1=>{var t,i;null==(t=this.vn)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.cn)||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.cn.has(e)||this.cn.has(null==t?void 0:t.event))&&this.vn&&(null==(i=this.vn)?void 0:i.size)>0&&this.vn.forEach(e=>{this.fn(t,e)&&this.sn.emit("actionCaptured",e.name)})}pn(e){this.onAction("actionCaptured",t=>e(t))}fn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.an(e,i))return!0;return!1}onAction(e,t){return this.sn.on(e,t)}un(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||!om(s,t.url,t.url_matching||"contains"))return!1}return!0}hn(e,t){return!!this.gn(e,t)&&!!this.mn(e,t)&&!!this.yn(e,t)}gn(e,t){if(null==t||!t.href)return!0;var i=this.bn(e);if(i.length>0)return i.some(e=>om(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&&om((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}mn(e,t){if(null==t||!t.text)return!0;var i=this.bn(e);if(i.length>0)return i.some(e=>om(e.text,t.text,t.text_matching||"exact")||om(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,o,a=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!a&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!Q(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),n=t.text,o=t.text_matching||"exact",r.some(e=>om(e,n,o)))}yn(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}bn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}dn(e,t){return null==t||!t.properties||0===t.properties.length||nO(t.properties.reduce((e,t)=>{var i=B(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 ob{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,t){return!!e&&nO(e.propertyFilters,null==t?void 0:t.properties)}Cn(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}In(e,t,i){var s=(i===rF.Activation?this.wn:this.xn).get(e),r=[];return this.Tn(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.Sn(n,t)})}register(e){var t;Y(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(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.Pn&&(this.Pn=new oy(this._instance),this.Pn.init(),this.Pn.pn(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.Pn)||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.kn.get(t.name);i&&i.push(e.id),this.kn.set(t.name,i||[e.id])}}))}))}En(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.wn=this.Cn(e,rF.Activation),this.xn=this.Cn(e,rF.Cancellation))}onEvent(e,t){var i,s,r=this.Rn(),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 o=this.On(e,n);if("consume"===o)return r.info("event consumed activated item, remov
1ing it",{event:e,itemId:n}),void this.Ln([n]);if("persist"===o)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this.Fn(n)}if(this.xn.has(e)){var a=this.In(e,t,rF.Cancellation);a.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(e=>e.id)}),this.Ln(a.map(e=>e.id)),a.forEach(e=>this.An(e.id)))}if(this.wn.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.wn.get(e)});var l=this.In(e,t,rF.Activation);this.$n(l.map(e=>e.id))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){0!==e.length&&(this._n=[...new Set([...this._n,...e])],this.Rn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter(t=>t!==e);var t=this.Dn();t.includes(e)||this.Nn([...t,e])}Ln(e){var t=new Set(e);this._n=this._n.filter(e=>!t.has(e));var i=this.Dn(),s=i.filter(e=>!t.has(e));s.length!==i.length&&this.Nn(s)}Dn(){var e,t=this.qn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter(e=>!this.Bn(e))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}jn(){return this.Pn}}class ow extends ob{constructor(e){super(e)}qn(){return ix}Hn(){return rC.SHOWN}Tn(e){var t;null==(t=this._instance)||t.getSurveys(e)}An(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Rn(){return nz}Nn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ix]:e})}Bn(){return!1}On(e,t){var i,s,r,n,o,a;return this.Tn(e=>{a=e.find(e=>e.id===t)}),!a||(o=(null!==(s=null==(r=(i=a).conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)&&void 0!==s?s:0)>0,i.schedule===r$.Always||null!=(n=i.conditions)&&null!=(n=n.events)&&n.repeatedActivation&&o)?e===rC.SHOWN?"consume":"ignore":e===rC.SHOWN?"persist":e===rC.DISMISSED||e===rC.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var ox="SDK is not enabled or survey functionality is not yet loaded",oS="Disabled. Not loading surveys.",oE=null!=s&&s.location?ro(s.location.hash,"__posthog")||ro(location.hash,"state"):null,ok="_postHogToolbarParams",oP=tG("[Toolbar]"),oF=tG("[FeatureFlags]"),oI=tG("[FeatureFlags]",{debugEnabled:!0}),o$="\" failed. Feature flags didn't load in time.",oC=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},oR=e=>{var t={};for(var[i,s]of i1(e||{}))s&&(t[i]=s);return t},oT=tG("[Error tracking]"),oA="Refusing to render web experiment since the viewer is a likely bot",oO={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>nC(t,e),not_regex:(e,t)=>!nC(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class oM{get Se(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{oM.Un("retrieved web experiments from the server"),t.zn=new Map,e.forEach(e=>{if(e.feature_flag_key){t.zn&&(oM.Un("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.zn)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);J(s)&&e.variants[s]&&t.Vn(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];oM.Wn(n,t._instance)&&t.Vn(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())oM.Un(oA);else if(!this.Se.disable_web_experiments){if(Q(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();oM.Un("applying feature flags",e),e.forEach(e=>{var t;if(this.zn&&null!=(t=this.zn)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.zn)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Vn(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=oM.getWindowLocation();if(null!=e&&e.search){var t=rr(null==e?void 0:e.search,"__experiment_id"),i=rr(null==e?void 0:e.search,"__experiment_variant");t&&i&&(oM.Un("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Gn(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Se.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.Se.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Gn(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(oM.Un("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Vn(s[0].name,t,s[0].variants[t].transforms))}static Wn(e,t){return!Q(e.conditions)&&oM.Zn(e,t)&&oM.Qn(e)}static Zn(e,t){if(Q(e.conditions)||Q(null==(s=e.conditions)?void 0:s.url))return!0;var i=oM.getWindowLocation();if(i){var s,r,n,o,a=sy(t,i.href);return null==(r=e.conditions)||!r.url||oO[null!==(n=null==(o=e.conditions)?void 0:o.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url,a)}return!1}
1static getWindowLocation(){return null==s?void 0:s.location}static Qn(e){if(Q(e.conditions)||Q(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rv();if(t.utm_source){var i,s,r,n,o,a,l,u,c,h=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==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.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==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return h&&p&&v&&d}return!1}static Un(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];tW.info("[WebExperiments] "+e,i)}Vn(e,t,i){this._is_bot()?oM.Un(oA):"control"!==t?i.forEach(i=>{if(i.selector){oM.Un("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)})}}):oM.Un("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?nI(n,this.Se.custom_blocked_useragents):void 0}}var oL=tG("[Conversations]"),oD="Conversations not available yet.",oN="console",oz={featureFlags:class{constructor(e){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=0,this.os=()=>{var e=this.ls();this.ss=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],s&&i8(s,"online",this.os)}destroy(){null==s||s.removeEventListener("online",this.os)}get Se(){return this._instance.config}get zr(){return this._instance.persistence}us(e){return this._instance.get_property(e)}hs(){var e,t;return null!==(e=null==(t=this.zr)?void 0:t.Gt(this.Se.feature_flag_cache_ttl_ms))&&void 0!==e&&e}ds(){return!!this.hs()&&(this.ns||this.Kn||(this.ns=!0,oF.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}cs(){var e,t=null!==(e=this.Se.evaluation_contexts)&&void 0!==e?e:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||(oF.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.rs=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||oF.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}vs(){return this.cs().length>0}fs(){var e=this.Se.flag_keys;if(!Y(e)){if(B(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||oF.error("Invalid flag key found:",e,"Expected non-empty string"),t});oF.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:i}=this._instance,s=null!==(e=null==(t=i.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(s).length){var r,n,o=null!==(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)&&void 0!==r?r:{},a=Object.keys(s).filter(e=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(o).filter(e=>a[e]).reduce((e,t)=>(o[t]&&(e[t]=o[t]),e),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!==(s=this.us(iu))&&void 0!==s?s:{},o=null!=i&&i.merge&&null!==(r=this.us(ip))&&void 0!==r?r:{},a=y({},n,e),l=y({},o,t),u={};for(var[c,h]of Object.entries(a))u[c]={key:c,enabled:x(h),variant:S(h),reason:void 0,metadata:Y(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}};this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.us(id),t=this.us(ig),i=this.us(i_);if(!i&&!t)return e||{};var s=i0({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=s[r],l=null==t?void 0:t[r],u=Y(l)?null!==(n=null==a?void 0:a.enabled)&&void 0!==n&&n:!!l,c=Y(l)?a.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[r],d=y({},a,{enabled:u,variant:u?null!=c?c:null==a?void 0:a.variant:void 0});u!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),c!==(null==a?void 0:a.variant)&&(
1d.original_variant=null==a?void 0:a.variant),h&&(d.metadata=y({},null==a?void 0:a.metadata,{payload:h,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),s[r]=d}return this.Jn||(oF.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.Jn=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:x(s),variant:S(s),payload:w(t[i])}})}getFlagVariants(){var e=this.us(iu),t=this.us(ig);if(!t)return e||{};for(var i=i0({},e),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Jn||(oF.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Jn=!0),i}getFlagPayloads(){var e=this.us(ip),t=this.us(i_);if(!t)return e||{};for(var i=i0({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.Jn||(oF.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Jn=!0),i}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.ls()||this.ps||(this._instance.Ti.emit("featureFlagsReloading",!0),this.ps=setTimeout(()=>{this.gs()},5))}ys(){clearTimeout(this.ps),this.ps=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.ps||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Xn=e}gs(e){var t;if(this.ys(),!this._instance.mr()&&!this.ls()){if(this.Kn)this.es=!0;else{var i=this.Se.token,s=this.us(tX),r={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this.zr)?void 0:t.get_initial_props())||{},this.us(im)||{}),group_properties:this.us(iy),timezone:rx()};X(s)||Y(s)||(r.$device_id=s),(null!=e&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.vs()&&(r.evaluation_contexts=this.cs());var n=this.fs();Y(n)||(r.flag_keys=n);var o=!!this.Se.advanced_only_evaluate_survey_feature_flags,a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Kn=!0,this._instance._send_request({method:"POST",url:a,data:r,compression:this.Se.disable_compression?void 0:rz.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,i,s,n=!0;if(this.bs(e.statusCode),200===e.statusCode&&(this.es||(this.$anon_distinct_id=void 0),n=!1),this.Kn=!1,!r.disable_flags||this.es){this.ts=!n;var a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==e.statusCode&&a.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(u&&a.push("quota_limited"),null==(s=this.zr)||s.register({[iP]:a}),u)?oF.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(r.disable_flags||this.receivedFeatureFlags(null!==(l=e.json)&&void 0!==l?l:{},n,{partialResponse:o}),this.es&&(this.es=!1,this.gs()))}}})}}}ls(){return ra(this.ss,3)}bs(e){this.ss=rl(e,this.ss,3,()=>oF.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.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ds()){var s=this.getFeatureFlagResult(e,t);return null!==(i=null==s?void 0:s.variant)&&void 0!==i?i:null==s?void 0:s.enabled}}else oF.warn('getFeatureFlag for key "'+e+o$)}}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.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ds()){var i=this.getFlagVariants(),s=e in i,r=i[e],n=this.getFlagPayloads()[e],o=String(r),a=this.us(iv)||void 0,l=this.us(iF)||void 0,u=this.us(iE)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var c,h=this._instance.get_session_id(),d=this.us(ik);h&&h!==d&&(u={},null==(c=this.zr)||c.register({[iE]:u,[ik]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){B(u[e])?u[e].push(o):u[e]=[o],null==(_=this.zr)||_.register({[iE]:u});var p=this.getFeatureFlagDetails(e),v=[...null!==(f=this.us(iP))&&void 0!==f?f:[]];Y(r)&&v.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.Se.bootstrap)||null==(m
1=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.Se.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.ts};Y(null==p||null==(b=p.metadata)?void 0:b.version)||(g.$feature_flag_version=p.metadata.version);var _,f,m,y,b,x,S,E,k,P,F,I=null!==(x=null==p||null==(S=p.reason)?void 0:S.description)&&void 0!==x?x:null==p||null==(E=p.reason)?void 0:E.code;I&&(g.$feature_flag_reason=I),null!=p&&null!=(k=p.metadata)&&k.id&&(g.$feature_flag_id=p.metadata.id),Y(null==p?void 0:p.original_variant)&&Y(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=Y(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(P=p.metadata)&&P.original_payload&&(g.$feature_flag_original_payload=null==p||null==(F=p.metadata)?void 0:F.original_payload),v.length&&(g.$feature_flag_error=v.join(",")),this._instance.capture("$feature_flag_called",g)}if(s)return{key:e,enabled:!!r,variant:"string"==typeof r?r:void 0,payload:w(n)}}}else oF.warn('getFeatureFlagResult for key "'+e+o$)}}getRemoteConfigPayload(e,t){var i=this.Se.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.vs()&&(s.evaluation_contexts=this.cs());var r=this.fs();Y(r)||(s.flag_keys=r),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this.Se.disable_compression?void 0:rz.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(i){var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return Y(i)?void 0:!!i}oF.warn('isFeatureEnabled for key "'+e+o$)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.zr){this.Yn=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,s,r,n){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var o,a=((o=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!==(t=o[e].variant)&&void 0!==t?t:o[e].enabled]})),e.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&&oF.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=a.flags,u=a.featureFlags,c=a.featureFlagPayloads;if(u){var h=e.requestId,d=e.evaluatedAt;if(B(u)){oF.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var v=0;u.length>v;v++)p[u[v]]=!0;t&&t.register({[ic]:u,[iu]:p})}else{var g=u,_=c,f=l;if(null!=n&&n.partialResponse)g=y({},i,g),_=y({},s,_),f=y({},r,f);else if(e.errorsWhileComputingFlags){if(l){var m=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));g=y({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return m.has(t)}))),_=y({},s,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return m.has(t)}))),f=y({},r,Object.fromEntries(Object.entries(f||{}).filter(e=>{var[t]=e;return m.has(t)})))}else g=y({},i,g),_=y({},s,_),f=y({},r,f)}t&&t.register(y({[ic]:Object.keys(oR(g)),[iu]:g||{},[ip]:_||{},[id]:f||{}},h?{[iv]:h}:{},d?{[iF]:d}:{}))}}}(e,this.zr,s,r,n,i),t||(this.ns=!1),this._s(t)}}override(e,t){void 0===t&&(t=!1),oF.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.zr)return oF.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.zr.unregister(ig),this.zr.unregister(i_),this._s(),oI.info("All overrides cleared");if(B(e)){var t,i=oC(e);return this.zr.register({[ig]:i}),this._s(),oI.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.Jn=!!(null!==(t=e.suppressWarning)&&void 0!==t&&t),"flags"in e){if(!1===e.flags)this.zr.unregister(ig),oI.info("Flag overrides cleared");else if(e.flags){if(B(e.flags)){var s=oC(e.flags);this.zr.register({[ig]:s})}else this.zr.register({[ig]:e.flags});oI.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.zr.unregister(i_),oI.info("Payload overrides cleared")):e.payloads&&(this.zr.register({[i_]:e.payloads}),oI.info("Payload overrides set",{payloads:e.payloads}))),void this._s()}if(e&&"object"==typeof e)return this.zr.register({[ig]:e}),this._s(),oI.info("Flag overrides set",{flags:e});oF.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:i}=this.ws();try{e(t,i)}catch(e){oF.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.us(ih)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(o.$early_access_feature_name=r.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=y({},this.getFlagVariants(),{[e]:t});null==(s=this.zr)||s.register({[ic]:Object.keys(oR(a)),[iu]:a}),this._s()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.us(ih),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this.zr)||i.unregister(ih),null==(s=this.zr)||s.register({[ih]:r}),e(r)}}})}ws(){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),{})}}_s(e){var{flags:t,flagVariants:i}=this.ws();
1this.featureFlagEventHandlers.forEach(s=>{try{s(t,i,{errorsLoading:e})}catch(e){oF.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.us(im)||{},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 o in r)({}).hasOwnProperty.call(r,o)&&(o in i||(n[o]=r[o]));this._instance.register({[im]:y({},i,n,s)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.us(im)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[im]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(im),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.us(iy)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[iy]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.us(iy)||{};this._instance.register({[iy]:y({},t,{[e]:{}})})}else this._instance.unregister(iy)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.ys(),this.Jn=!1,this.ss=0}}},oj=y({productTours:class{get zr(){return this._instance.persistence}constructor(e){this.Fo=null,this.Ao=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,i;if(this.zr&&this.zr.register({[t7]:!!e.productTours}),!ov(this._instance))return!this.Fo&&Q(null==(t=this.zr)?void 0:t.props[iS])||op.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.Fo)||i.stop(),this.Fo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Fo&&ov(this._instance)&&this.Mt(()=>this.$o())}Mt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?op.error("Could not load product tours script",t):e()})}$o(){var e;!this.Fo&&null!=(e=p.__PosthogExtensions__)&&e.generateProductTours&&(this.Fo=p.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!B(this.Ao)||t){var i=this.zr;if(i){var s=i.props[iS];if(B(s)&&!t)return this.Ao=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",callback:t=>{if(ov(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return op.error(r),void e([],{isLoaded:!1,error:r})}var n=B(t.json.product_tours)?t.json.product_tours:[];this.Ao=n,i&&i.register({[iS]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ao,{isLoaded:!0})}getActiveProductTours(e){Q(this.Fo)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Fo.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Fo)||t.showTourById(e)}previewTour(e){this.Fo?this.Fo.previewTour(e):this.Mt(()=>{var t;this.$o(),null==(t=this.Fo)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Fo)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Fo)||e.nextStep()}previousStep(){var e;null==(e=this.Fo)||e.previousStep()}clearCache(){var e;this.Ao=null,null==(e=this.zr)||e.unregister(iS)}resetTour(e){var t;null==(t=this.Fo)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Fo)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Fo)||t.cancelPendingTour(e)}}},oz),oq=y({surveys:class{get Se(){return this._instance.config}constructor(e){this.Xo=void 0,this._surveyManager=null,this.ea=!1,this.ta=[],this.ra=null,this.ia=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(Q(t))return nz.warn("Flags not loaded yet. Not loading surveys.");var i=B(t);this.Xo=i?t.length>
10:t,nz.info("flags response received, isSurveysEnabled: "+this.Xo),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(nj)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager){if(this.ea)nz.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)nz.info(oS);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())nz.info("Not loading surveys in cookieless mode without consent.");else{var e=null==p?void 0:p.__PosthogExtensions__;if(e){if(!Y(this.Xo)||this.Se.advanced_enable_surveys){var t=this.Xo||this.Se.advanced_enable_surveys;this.ea=!0;try{var i=e.generateSurveys;if(i)return void this.na(i,t);var s=e.loadExternalDependency;if(!s)return void this.sa(ij);s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.sa("Could not load surveys script",i):this.na(e.generateSurveys,t)})}catch(e){throw this.sa("Error initializing surveys",e),e}finally{this.ea=!1}}}else nz.error("PostHog Extensions not found.")}}}na(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new ow(this._instance),nz.info("Surveys loaded successfully"),this.oa({isLoaded:!0})}sa(e,t){nz.error(e,t),this.oa({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ta.push(e),this._surveyManager&&this.oa({isLoaded:!0}),()=>{this.ta=this.ta.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Se.disable_surveys)return nz.info(oS),e([]);var i,s=this._instance.get_property(ib);if(s&&!t)return e(s,{isLoaded:!0}),void(this.aa()&&this.getSurveys(()=>{},!0));"undefined"!=typeof Promise&&this.ra?this.ra.then(t=>{var{surveys:i,context:s}=t;return e(i,s)}):("undefined"!=typeof Promise&&(this.ra=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:t=>{this.ra=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;nz.error(r),this.ia=Date.now();var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}this.ia=null;var o,a,l=t.json.surveys||[],u=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(o=this._instance.persistence)||o.register({[ib]:l,[iw]:Date.now()});var c={isLoaded:!0};e(l,c),null==i||i({surveys:l,context:c})}}))}aa(){return this.la()&&!this.ra&&!this.ua()}la(){var e=this._instance.get_property(iw);return Z(e)&&Date.now()-e>3e5}ua(){return Z(this.ia)&&3e5>Date.now()-this.ia}markSurveyAsSeen(e,t){var i;nq({id:e,current_iteration:null!==(i=null==t?void 0:t.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}oa(e){for(var t of this.ta)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){nz.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Q(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);nz.warn("init was not called")}ha(e){var t=null;return this.getSurveys(i=>{var s;t=null!==(s=i.find(t=>t.id===e))&&void 0!==s?s:null}),t}da(e){if(Q(this._surveyManager))return{eligible:!1,reason:ox};var t="string"==typeof e?this.ha(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Q(this._surveyManager))return nz.warn("init was not called"),{visible:!1,disabledReason:ox};var t=this.da(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Q(this._surveyManager)?(nz.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ox})):new Promise(i=>
1{this.getSurveys(t=>{var s,r=null!==(s=t.find(t=>t.id===e))&&void 0!==s?s:null;if(r){var n=this.da(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(Q(this._surveyManager))nz.warn("init was not called");else{var r="string"==typeof e?this.ha(e):e;if(null!=r&&r.id){if(nH.includes(r.type)){var n=null==o?void 0:o.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(nz.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;nz.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),nz.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);nz.warn("Survey element not found")}else nz.warn("Surveys of type "+r.type+" cannot be rendered in the app")}else nz.warn("Survey not found")}}displaySurvey(e,t){var i;if(Q(this._surveyManager))nz.warn("init was not called");else{var s=this.ha(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=y({},s,{appearance:y({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==rT.Popover&&t.initialResponses&&nz.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void nz.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==rT.Inline?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else nz.warn("Survey not found")}}cancelPendingSurvey(e){Q(this._surveyManager)?nz.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},oz),oH=y({experiments:oM},oz),oU=y({},oz,{sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var e;return!(null==(e=this.xs)||!e.isStarted)}get status(){var e,t;return this.ks===oa||this.ks===ol?this.ks:null!==(e=null==(t=this.xs)?void 0:t.status)&&void 0!==e?e:this.ks}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ks=on,this.Ss=void 0,this._instance=e,!this._instance.sessionManager)throw oc.error("started without valid sessionManager"),Error(ou+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===iH)throw Error(ou+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Cs(){var e,t=!(null==(e=this._instance.get_property(ie))||!e.enabled),i=!this.Se.disable_session_recording,r=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!this.Cs||null==(t=this.xs)||!t.isStarted){var i=!Y(Object.assign)&&!Y(Array.from);this.Cs&&i?(this.Is(e),oc.info("starting")):(this.ks=on,this.stopRecording())}}Is(e){var t,i,s;this.Cs&&(this.ks!==oa&&this.ks!==ol&&(this.ks=oo),null!=p&&null!=(t=p.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=p.__PosthogExtensions__)&&i.initSessionRecording?this.Ts(e):null==(s=p.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Es,t=>{if(t)return oc.error("could not load recorder",t);this.Ts(e)}))}stopRecording(){var e,t;null==(e=this.Ss)||e.call(this),this.Ss=void 0,null==(t=this.xs)||t.stop()}Ms(){var e,t;null==(e=this.Ss)||e.call(this),this.Ss=void 0,null==(t=this.xs)||t.discard()}Ps(){var e,t;null==(e=this.zr)||e.unregister(il),null==(t=this.zr)||t.unregister(it)}Rs(e,t){if(Q(e))return null;var i=Z(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(oc.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Os(e){if(this.zr){var t,i,s=this.zr,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Rs(null==(t=this.Se.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Rs(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=r?r:n;Q(o)&&this.Ps();var a=null==i?void 0:i.minimumDurationMilliseconds;s.register({[ie]:y({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:y({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:o,minimumDurationMilliseconds:Y(a)?null:a,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.Ss)||t.call(this),this.Ss=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Os(e),void this.Ms()):(this.Os(e),void this.startIfEnabledOrStop()):(this.ks===oa&&(this.ks=ol,oc.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.xs)&&i.log?this.xs.log(e,t):oc.warn("log called before recorder was ready")}get Es(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(ie);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Ls(){var e,t,i=this._instance.get_property(ie);if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}catch(e){return oc.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}var s=null!==(e=t.cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-s}Ts(e){var t,i;if(null==(t=p.__PosthogExtensions__)||!t.initSessionRecording)return oc.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iz]:!0});if(this.xs||(this.xs=null==(i=p.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.xs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ls()){if(this.ks===ol||this.ks===oa)return;return this.ks=oa,oc.info("persisted remote config is stale, requesting fresh config before starting"),void new rN(this._instance).load()}this.ks=oo,this.xs.start(e)}onRRwebEmit(e){var t;null==(t=this.xs)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.xs||null==(t=this.zr)||t.register({[is]:!0}),null==(e=this.xs)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.xs||null==(t=this.zr)||t.register({[ii]:!0}),null==(e=this.xs)||e.overrideSampling()}overrideTrigger(e){var t,i;this.xs||null==(i=this.zr)||i.register({["url"===e?ir:io]:!0}),null==(t=this.xs)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.xs)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.xs)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Fs=!1,this.As=null,this.$s=!1,this.instance=e,this.rageclicks=new n7(e.config.rageclick),this.Ds=null}initialize(){this.startIfEnabled()}get Se(){var e,t,i=W(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}Ns(){if(this.isBrowserSupported()){if(s&&o){var e=e=>{e=e||(null==s?void 0:s.event);try{this.qs(e)}catch(e){oe.error("Failed to capture event",e)}};if(i8(o,"submit",e,{capture:!0}),i8(o,"change",e,{capture:!0}),i8(o,"click",e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event);try{this.qs(e,n9)}catch(e){oe.error("Failed to capture copy/cut event",e)}};i8(o,"copy",t,{capture:!0}),i8(o,"cut",t,{capture:!0})}}}else oe.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Fs&&(this.Ns(),this.Fs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.$s=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[t1]:!!e.autocapture_opt_out}),this.As=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ds=e}getElementSelectors(e){var t,i=[];return null==(t=this.Ds)||t.forEach(t=>{var s=null==o?void 0:o.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[t1];if(X(this.As)&&!et(i)&&!this.instance.mr())return!1;var s=null!==(t=this.As)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!s}qs(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=sC(e);sS(r)&&(r=r.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())&&sj(r,this.instance.config.rageclick)&&this.qs(e,"$rageclick");var n=t===n9;if(r&&function(e,t,i,r,n,o){if(void 0===i&&(i=void 0),!s||sq(e)||null!=(a=i)&&a.url_allowlist&&!sP(i.url_allowlist,o)||null!=(l=i)&&l.url_ignorelist&&sP(i.url_ignorelist,o))return!1;if(null!=(u=i)&&u.dom_event_allowlist){var a,l,u,c,h,d,p=i.dom_event_allowlist;if(p&&!p.some(e=>t.type===e))return!1}var{parentIsUsefulElement:v,targetElementList:g}=sH(e,r);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(Y(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}(g,i)||!sT(g,null==(c=i)?void 0:c.css_selector_allowlist)||sT(g,null!==(h=null==(d=i)?void 0:d.css_selector_ignorelist)&&void 0!==h?h:sO))return!1;try{var _=s.getComputedStyle(e);
1if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return v?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(sR.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.Se,n,n?["copy","cut"]:void 0,this.instance)){var{props:o,explicitNoCapture:a}=function(e,t){var i,r,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u,disableCaptureUrlHashes:c}=t;if(!sw(e))return{props:{}};for(var h=[e],d=e;d.parentNode&&!sx(d,"body");)if(sE(d.parentNode))h.push(d.parentNode.host),d=d.parentNode.host;else{if(!sw(d.parentNode))break;h.push(d.parentNode),d=d.parentNode}var p,v=[],g={},_=!1,f=!1;if(iZ(h,e=>{var t=sU(e);if(sx(e,"a")){var i=e.getAttribute("href");_=!!(t&&i&&sX(i))&&(c?tl(i):i)}N(sF(e),"ph-no-capture")&&(f=!0),v.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),o={tag_name:n};sR.indexOf(n)>-1&&!i&&(o.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?ot(1024,sQ(e)):ot(1024,s$(e)));var a=sF(e);a.length>0&&(o.classes=a.filter(function(e){return""!==e})),iZ(e.attributes,function(i){var n;if((!sB(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&sX(i.value)&&(!J(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var a=i.value;"class"===i.name&&(a=sk(a).join(" ")),o["attr__"+i.name]=ot(1024,"href"===i.name&&r?tl(a):a)}});for(var l=1,u=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!sw(t));return t}(c);)l++,c.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,o,a,l,c)),i0(g,function(e){if(!sU(e))return{};var t={};return iZ(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&&sX(s)&&(t[i]=s)}}),t}(e))}),f)return{props:{},explicitNoCapture:f};if(a||(v[0].$el_text=sx(e,"a")||sx(e,"button")?sQ(e):s$(e)),_){v[0].attr__href=_;var m,b,w=null==(m=rs(_))?void 0:m.host,x=null==s||null==(b=s.location)?void 0:b.host;w&&x&&w!==x&&(p=_)}return{props:i0({$event_type:n.type,$ce_version:1},u?{}:{$elements:v},{$elements_chain:v.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?B(t)?t:sk(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return i1(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).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=y({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return i1(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return o[sZ(t.toString())]=sZ(i.toString())}),(s+=":")+i1(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=v[0])&&i.$el_text?{$el_text:null==(r=v[0])?void 0:r.$el_text}:{},p&&"click"===n.type?{$external_click_url:p}:{},g)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.$s,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(a)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),t===n9){var u,c=sI(null==s||null==(u=s.getSelection())?void 0:u.toString()),h=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return V(null==o?void 0:o.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Bs=(null==s||null==(t=s.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tW.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.js&&this.js(),this.js=void 0,tW.info("History API monitoring stopped")}monitorHistoryChanges(){s&&s.history&&(this.Hs("pushState"),this.Hs("replaceState"),this.Us())}Hs(e){var t;if(s&&(null==(t=s.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);V(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]===r&&(e[t]=s)}}catch(e){return()=>{}}}(s.history,e,t=>
1function(s,r,n){t.call(this,s,r,n),i.zs(e)})}}zs(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this.Bs&&this.isEnabled&&this._instance.capture(iY,{navigation_type:e}),this.Bs=i}catch(t){tW.error("Error capturing "+e+" pageview",t)}}Us(){if(!this.js){var e=()=>{this.zs("popstate")};i8(s,"popstate",e),this.js=()=>{s&&s.removeEventListener("popstate",e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.Vs=!1,this.Fs=!1,this.Ws=null,this.instance=e,this.Vs=!(null==(t=this.instance.persistence)||!t.props[t2]),this.rageclicks=new n7(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return W(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Q(this.Se.capture_heatmaps)?Q(this.Se.enable_heatmaps)?this.Vs:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Fs||(oh.info("starting..."),this.Gs(),this.ke());else{var e;clearInterval(null!==(e=this.Ws)&&void 0!==e?e:void 0),this.Zs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[t2]:t}),this.Vs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Qs(e){this.fe(e.originalEvent,"deadclick")}ke(){this.Ws&&clearInterval(this.Ws),this.Ws="visible"===(null==o?void 0:o.visibilityState)?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Gs(){s&&o&&(this.Js=this.Lr.bind(this),i8(s,iG,this.Js),this.Ys=e=>this.fe(e||(null==s?void 0:s.event)),i8(o,"click",this.Ys,{capture:!0}),this.Ks=e=>this.Xs(e||(null==s?void 0:s.event)),i8(o,"mousemove",this.Ks,{capture:!0}),this.eo=new s3(this.instance,s1,this.Qs.bind(this)),this.eo.startIfEnabledOrStop(),this.ro=this.ke.bind(this),i8(o,iW,this.ro),this.Fs=!0)}Zs(){var e;s&&o&&(this.Js&&s.removeEventListener(iG,this.Js),this.Ys&&o.removeEventListener("click",this.Ys,{capture:!0}),this.Ks&&o.removeEventListener("mousemove",this.Ks,{capture:!0}),this.ro&&o.removeEventListener(iW,this.ro),clearTimeout(this.io),null==(e=this.eo)||e.stop(),this.Fs=!1)}no(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var r=e;r&&sw(r)&&!sx(r,"body")&&r!==i;){var n,o,a,l=void 0;try{l=null==(n=null!==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:s)?void 0:n.getComputedStyle(r).position}catch(e){break}if(N(t,l))return!0;r=sA(r)}return!1}(sC(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}fe(e,t){var i;if(void 0===t&&(t="click"),!sb(e.target)&&od(e)){var s=this.no(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&sj(sC(e),this.instance.config.rageclick)&&this.so(y({},s,{type:"rageclick"})),this.so(s)}}Xs(e){!sb(e.target)&&od(e)&&(clearTimeout(this.io),this.io=setTimeout(()=>{this.so(this.no(e,"mousemove"))},500))}so(e){if(s){var t=this.Se.disable_capture_url_hashes?tl(s.location.href):s.location.href,i=this.Se.custom_personal_data_properties,r=rn(t,this.Se.mask_personal_data_properties?[...rc,...i||[]]:[],rd);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(e)}}Lr(){this.R&&!G(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:s3,webVitalsAutocapture:class{constructor(e){var t;this.Vs=!1,this.Fs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.oo=()=>{clearTimeout(this.ao),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.lo=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,i=this.uo();if(!Y(i)){if(Q(null==e?void 0:e.name)||Q(null==e?void 0:e.value))or.error("Invalid metric received",e);else if(!this.ho||this.ho>e.value){this.R.url!==i&&(this.oo(),this.ao=setTimeout(this.oo,this.flushToCaptureTimeoutMs)),Y(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Y(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var s=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),r=y({},e,{$current_url:i,timestamp:Date.now()});Y(s)||(r.$session_id=s.sessionId,r.$window_id=s.windowId),this.R.metrics.push(r),this.R.metrics.length===this.allowedMetrics.length&&this.oo()}else or.error("Ignoring metric with value >= "+this.ho,e)}},this.do=()=>
1{if(!this.Fs){var e,t,i,s,r=p.__PosthogExtensions__;Y(r)||Y(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.lo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.lo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.lo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.lo.bind(this)),this.Fs=!0):or.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Vs=!(null==(t=this._instance.persistence)||!t.props[t8]),this.startIfEnabled()}get co(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=W(this.co)?null==(e=this.co)?void 0:e.web_vitals_allowed_metrics:void 0;return Q(i)?(null==(t=this._instance.persistence)?void 0:t.props[t9])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(W(this.co)?this.co.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=W(this.co)?this.co.web_vitals_attribution:void 0;return null!=e&&e}get ho(){var e=W(this.co)&&Z(this.co.__web_vitals_max_value)?this.co.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==a?void 0:a.protocol;if("http:"!==e&&"https:"!==e)return or.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=W(this.co)?this.co.web_vitals:et(this.co)?this.co:void 0;return et(t)?t:this.Vs}startIfEnabled(){this.isEnabled&&!this.Fs&&(or.info("enabled, starting..."),this.Mt(this.do))}onRemoteConfig(e){if("capturePerformance"in e){var t=W(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=W(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[t8]:t}),this._instance.persistence.register({[t9]:i})),this.Vs=t,this.startIfEnabled()}}Mt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?or.error("failed to load script",t):e()})}uo(){var e=s?this._instance.config.disable_capture_url_hashes?tl(s.location.href):s.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return rn(e,this._instance.config.mask_personal_data_properties?[...rc,...t||[]]:[],rd)}or.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,i,r;this.do=()=>{var e;if(s&&this.isEnabled&&null!=(e=p.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=p.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=p.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=p.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.vo&&this.Se.capture_unhandled_errors&&(this.vo=t(this.captureException.bind(this))),!this.fo&&this.Se.capture_unhandled_rejections&&(this.fo=i(this.captureException.bind(this))),!this.po&&this.Se.capture_console_errors&&(this.po=r(this.captureException.bind(this)))}catch(e){oi.error("failed to start",e),this.mo()}}},this._instance=e,this.yo=!(null==(t=this._instance.persistence)||!t.props[t3]),this.bo=new ed({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4,Ae:oi}),this.Se=this._o(),this.startIfEnabledOrStop()}_o(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return W(e)?t=y({},t,e):(Y(e)?this.yo:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(oi.info("enabled"),this.mo(),this.Mt(this.do)):this.mo()}Mt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return oi.error("failed to load script",t);e()})}mo(){var e,t,i;null==(e=this.vo)||e.call(this),this.vo=void 0,null==(t=this.fo)||t.call(this),this.fo=void 0,null==(i=this.po)||i.call(this),this.po=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.yo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[t3]:this.yo}),this.Se=this._o(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this._o()}captureException(e){var t,i,s,r=null!==(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==t?t:"Exception";this.bo.consumeRateLimit(r)?oi.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.wo=[],this.xo=new tf([new tI,new tN,new tC,new t$,new tL,new tM,new tT,new tD
1],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"),o=s;n.length>o;o++){var a=n[o];if(1024>=a.length){var l=tF.test(a)?a.replace(tF,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of i){var c=u(l,e);if(c){r.push(c);break}}if(r.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>y({},e,{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(r)}}("web:javascript",tS,tP)),this._instance=e,this.wo=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(t5))&&void 0!==t?t:[],this.ko=tU(this.So()),this.Co=new tB(this.ko)}onConfigChange(){this.ko=tU(this.So()),this.Co.setConfig(this.ko)}onRemoteConfig(e){var t,i,s;if("errorTracking"in e){var r=null!==(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.wo=r,this._instance.persistence&&this._instance.persistence.register({[t5]:this.wo,[t6]:n})}}get Io(){var e,t=!!this._instance.get_property(t6),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.xo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.ko.enabled)try{if(!J(e)||0===e.trim().length)return void oT.warn("Ignoring exception step because message must be a non-empty string");var i=this.To(t),{sanitizedProperties:s,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tq.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(i);r.length>0&&oT.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Co.add(y({[tz]:e,[tj]:(new Date).toISOString()},s))}catch(e){oT.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Eo(t)){if(this.Mo(t))return this.Po("Exception dropped: matched a suppression rule"),void oT.info("Skipping exception capture because a suppression rule matched");if(!this.Io&&this.Ro(t))return this.Po("Exception dropped: thrown by a browser extension"),void oT.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Oo(t))return this.Po("Exception dropped: thrown by the PostHog SDK"),void oT.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.ko.enabled&&Q(e.$exception_steps)?this.Lo(e):e;try{var s=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",Zi:!0});return s&&this.Co.clear(),s}catch(e){return oT.error("Failed to capture exception event. Dropping this exception.",e),void this.Co.clear()}}catch(e){return void oT.error("Failed to process exception event. Ignoring this exception.",e)}}Lo(e){try{var t=this.Co.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return oT.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Po(e){this.ko.enabled&&this.Co.add({[tz]:e,[tj]:(new Date).toISOString()})}To(e){return W(e)?y({},e):{}}So(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}Mo(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:i,value:s}=t;return J(i)&&i.length>0&&e.$exception_types.push(i),J(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.wo.some(e=>{var i=e.values.map(e=>{var i,s=nT[e.operator],r=B(e.value)?e.value:[e.value],n=null!==(i=t[e.key])&&void 0!==i?i:[];return r.length>0&&s(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}Ro(e){return e.flatMap(e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}Oo(e){if(e.length>0){var t,i,s,r,n=null!==(t=null==(i=e[0].stacktrace)?void 0:i.frames)&&void 0!==t?t:[],o=n[n.length-1];return null!==(s=null==o||null==(r=o.filename)?void 0:r.includes("posthog.com/static"))&&void 0!==s&&s}return!1}Eo(e){return!Q(e)&&B(e)}}},oj,{siteApps:class{constructor(e){this.Do=0,this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qo(e,t){if(t){var i=this.globalsForEvent(t);this.No.push(i),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.qo.bind(this));this.Bo=()=>{e(),this.No=[],this.Bo=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,o,a,l={},u=this._instance.get_property("$groups")||[];for(var[c,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[c]={id:u[c],type:c,properties:h};var{$set_once:d,$set:p}=e;return{event:y({},b(e,og),{properties:y({},e.properties,p?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},p)}:{},d?{$set_once:y({},null!==(s=null==(r=e.properties)?void 0:r.$set_once)&&void 0!==s?s:{},d)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}jo(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)||(o_.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)||(o_.error("prepare_external_dependency_script returned null"),null):e}Ho(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,s,r,n,a,l,u=null==o?void 0:o.defaultView,c=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!c)return()=>{};if(this.Do++,this.Uo)return this.zo();var h=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),h.push(()=>{e[t]=s})}},g=e=>{if(p.has(e))return e;var t=d.jo(e);return t&&p.add(t),t},_=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!X(e));return v(c,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(c,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),v(c,"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
1=>{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,_(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,_(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,_(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,_(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=_(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),v(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this.Uo=()=>{h.forEach(e=>e()),this.Uo=void 0},this.zo()}zo(){var e=!1;return()=>{var t;e||(e=!0,this.Do--,0===this.Do&&(null==(t=this.Uo)||t.call(this)))}}Vo(e,t){void 0===t&&(t=!0);var i=this.Ho();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.No.length&&(o_.info("Processing "+this.No.length+" events for site app with id "+e.id),this.No.forEach(e=>this.Vo(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Bo)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,o_.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=this.Vo(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1);n&&(t.processEvent=n),s=!0}catch(t){o_.error(of+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){o_.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Wo(){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)}Go(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.Vo(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){o_.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.Wo(),void this._instance.on("eventCaptured",e=>this.Go(e))):void o_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Bo)||i.call(this),null!=(s=e.siteApps)&&s.length){if(this.isEnabled){var n=function(e){var t;p["__$$ph_site_app_"+e]=r._instance,null==(t=p.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,a,t=>{if(t)return o_.error(of+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else o_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},oq,{tracingHeaders:class{constructor(e){this.Zo=void 0,this.Qo=void 0,this.Jo=void 0,this.do=()=>{var e,t,i=this.Yo();i?(Y(this.Zo)&&(this.Zo=null==(e=p.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Y(this.Qo)&&(this.Qo=null==(t=p.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.mo()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Mt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return os.error("failed to load script",t);e()})}Ko(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Yo(){var e=this.Ko();return B(e)?(B(this.Jo)?this.Jo.splice(0,this.Jo.length,...e):this.Jo=[...e],e.length>0?this.Jo:void 0):(B(this.Jo)&&this.Jo.splice(0),this.Jo=e||void 0,this.Jo)}mo(){var e,t;null==(e=this.Zo)||e.call(this),null==(t=this.Qo)||t.call(this),this.Zo=void 0,this.Qo=void 0}startIfEnabledOrStop(){this.Yo()?this.Mt(this.do):this.mo()}}},{toolbar:class{constructor(e){this.instance=e}ca(e){p.ph_toolbar_state=e}va(){var e;return null!==(e=p.ph_toolbar_state)&&void 0!==e?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),i4(this.instance.config)||!s||!o)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=oE||ro(e.hash,"__posthog")||ro(e.hash,"state"),a=n?i2(()=>JSON.parse(atob(decodeURIComponent(n))))||i2(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(ok)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}fa(e){var t=p.ph_load_toolbar||p.ph_load_editor;!Q(t)&&V(t)?t(e,this.instance):oP.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==o||!o.getElementById(iM));if(!s||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(s.localStorage.setItem(ok,JSON.stringify(y({},n,{source:void 0}))),2===this.va())?this.fa(n):0===this.va()&&(this.ca(1),null==(t=p.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return oP.error("[Toolbar] Failed to load",e),void this.ca(0);this.ca(2),this.fa(n)}),i8(s,"turbolinks:load",()=>{this.ca(0),this.loadToolbar(n)})),!0}pa(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)}}},oH,{conversations:class{constructor(e){this.ga=void 0,this._conversationsManager=null,this.ma=!1,this.ya=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Q(t)||(et(t)?this.ga=t:(this.ga=t.enabled,this.ya=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.ga=void 0,this.ya=null}loadIfEnabled(){if(!(this._conversationsManager||this.ma||this._instance.config.disable_conversations||i4(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==p?void 0:p.__PosthogExtensions__;if(e&&!Y(this.ga)&&this.ga){if(this.ya&&this.ya.token){this.ma=!0;try{var t=e.initConversations;if(t)return this.ba(t),void(this.ma=!1);var i=e.loadExternalDependency;if(!i)return void this._a(ij);i(this._instance,"conversations",t=>{t||!e.initConversations?this._a("Could not load conversations script",t):this.ba(e.initConversations),this.ma=!1})}catch(e){this._a("Error initializing conversations",e),this.ma=!1}}else oL.error("Conversations enabled but missing token in remote config.")}}}ba(e){if(this.ya)try{this._conversationsManager=e(this.ya,this._instance),oL.info("Conversations loaded successfully")}catch(e){this._a("Error completing conversations initialization",e)}else oL.error("Cannot complete initialization: remote config is null")}_a(e,t){oL.error(e,t),this._conversationsManager=null,this.ma=!1}show(){this._conversationsManager?this._conversationsManager.show():oL.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ga&&!X(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}
1sendMessage(e,t,i){var s=this;return m(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(oL.warn(oD),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oL.warn(oD),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oL.warn(oD),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oL.warn(oD),null)})()}requestRestoreLink(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oL.warn(oD),null)})()}restoreFromToken(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oL.warn(oD),null)})()}restoreFromUrlToken(){var e=this;return m(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oL.warn(oD),null)})()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}en(){var e;null==(e=this._conversationsManager)||e.setIdentity()}tn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.wa=!1,this.xa=!1,this.Ae=tG("[logs]"),this._r=[],this.ka=[],this.ss=0,this.Sa=()=>{var e,t;this.ss=0,null==(e=this.Ca)||e.onReconnect(),null==(t=this.Ia)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.wa=!0),s&&i8(s,"online",this.Sa)}Ta(e,t,i,s){var r,n,o,a,l,u,c,h,d,p,v,g,_,f,m=(d=null!==(n=null==(r=null==(f=this._instance)||null==(f=f.config)?void 0:f.logs)?void 0:r.flushIntervalMs)&&void 0!==n?n:3e3,p=null!==(o=null==r?void 0:r.maxBufferSize)&&void 0!==o?o:100,g=Y(v=null!=i&&i.consoleCapture?void 0:null!==(a=null==r?void 0:r.maxLogsPerInterval)&&void 0!==a?a:1e3)?Math.max(p,2048):Math.max(p,v),{serviceName:null!==(l=null!==(u=null==(_=null==r?void 0:r.resourceAttributes)?void 0:_["service.name"])&&void 0!==u?u:null==r?void 0:r.serviceName)&&void 0!==l?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!==(c=null==_?void 0:_["service.version"])&&void 0!==c?c:null==r?void 0:r.serviceVersion,environment:null!==(h=null==_?void 0:_["deployment.environment"])&&void 0!==h?h:null==r?void 0:r.environment,resourceAttributes:_,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 t_(this.Ea(e,t),m,this.Ae,()=>this.Ma(),e=>e(),void 0,s),m]}Pa(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.Ca&&this.Ra===i||(null==(t=this.Ca)||t.reset(),this.Ra=i,[this.Ca,this.Oa]=this.Ta(()=>this._r,e=>{this._r=e})),this.Ca}La(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.Ia&&this.Fa===i||(null==(t=this.Ia)||t.reset(),this.Fa=i,[this.Ia,this.Aa]=this.Ta(()=>this.ka,e=>{this.ka=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},oN)),this.Ia}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Q(i)&&i&&(this.wa=!0,this.loadIfEnabled())}reset(){var e,t;this._r=[],null==(e=this.Ca)||e.reset(),this.ka=[],null==(t=this.Ia)||t.reset(),this.ss=0}captureLog(e){this.Pa().captureLog(e)}le(e){this.La().captureLog(e)}get logger(){return this.$a||(this.$a={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.$a}flushLogs(e){e?this.Da(e):(this.Ca&&this.Ca.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)),this.Ia&&this.Ia.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.wa&&!this.xa){var e=null==p?void 0:p.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.Ae.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.xa=!0)}):this.Ae.error(ij)}else this.Ae.error("PostHog Extensions not found.")}}Ea(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===k.LogsQueue?e():void 0,setPersistedProperty(e,i){e===k.LogsQueue&&t(null!=i?i:[])},ht:e=>this.ht(e),getLibraryId:()=>_.LIB_NAME,getLibraryVersion:()=>_.LIB_VERSION}}ht(e){return new Promise(t=>{if(ra(this.ss,3))t({kind:"fatal",error:Error("logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>s({kind:"retry-later",error:Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.Na(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.qa(i),i>=200&&300>i)?s({kind:"ok"}
1):413===i?s({kind:"too-large"}):0!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):s({kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:Error("logs request failed with status "+i)})}})}})}qa(e){(0!==e||this._instance.__loaded)&&(this.ss=rl(e,this.ss,3,()=>this.Ae.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.")))}Da(e){this._r.length>0&&this.Ba(e,this._r,this.Oa,_.LIB_NAME,e=>{this._r=e}),this.ka.length>0&&this.Ba(e,this.ka,this.Aa,oN,e=>{this.ka=e})}Ba(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var o=tg(n,tv(i,_.LIB_NAME,_.LIB_VERSION),s,_.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Na(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}Na(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Ma(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:i,windowId:s,sessionStartTimestamp:r,lastActivityTimestamp:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i,t.windowId=s,Q(r)||(t.sessionStartTimestamp=r),Q(n)||(t.lastActivityTimestamp=n)}if(null!=p&&null!=(e=p.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tl(p.location.href):p.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}});n4.__defaultExtensionClasses=y({},oU);var oB=function(){_.SDK_DIST_CHANNEL="npm";var e=nY[n1]=new n4;return function(){function e(){e.done||(e.done=!0,n2=!1,iZ(nY,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?e():i8(o,"DOMContentLoaded",e,{capture:!1}):s&&tW.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}()}}]);
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.