1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2682],{59658:(e,t,i)=>{i.d(t,{default:()=>n3});var s,n="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:n,o=Array.prototype,a=o.forEach,l=o.indexOf,c=null==r?void 0:r.navigator,u=null==r?void 0:r.document,d=null==r?void 0:r.location,h=null==r?void 0:r.fetch,_=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,p=null==r?void 0:r.AbortController,g=null==c?void 0:c.userAgent,f=null!=n?n:{},v={DEBUG:!1,LIB_VERSION:"1.205.0"},m="$copy_autocapture",b=["$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"];function y(e,t){return -1!==e.indexOf(t)}!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(s||(s={}));var w=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},S=function(e){return e.replace(/^\$/,"")},E=Array.isArray,k=Object.prototype,x=k.hasOwnProperty,I=k.toString,C=E||function(e){return"[object Array]"===I.call(e)},P=e=>"function"==typeof e,F=e=>e===Object(e)&&!C(e),R=e=>{if(F(e)){for(var t in e)if(x.call(e,t))return!1;return!0}return!1},T=e=>"[object String]"==I.call(e),$=e=>T(e)&&0===e.trim().length,O=e=>null===e,L=e=>void 0===e||O(e),A=e=>"[object Number]"==I.call(e),M=e=>"[object Boolean]"===I.call(e),D=e=>y(b,e),N=e=>{var t={_log:function(t){if(n&&(v.DEBUG||f.POSTHOG_DEBUG)&&void 0!==n.console&&n.console){for(var i=("__rrweb_original__"in n.console[t])?n.console[t].__rrweb_original__:n.console[t],s=arguments.length,r=Array(s>1?s-1:0),o=1;o<s;o++)r[o-1]=arguments[o];i(e,...r)}},info:function(){for(var e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];t._log("log",...i)},warn:function(){for(var e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];t._log("warn",...i)},error:function(){for(var e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];t._log("error",...i)},critical:function(){for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling ".concat(e))},createLogger:t=>N("".concat(e," ").concat(t))};return t},q=N("[PostHog.js]"),B=q.createLogger,H=B("[ExternalScriptsLoader]"),U=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return H.warn("".concat(t," was requested but loading of external scripts is disabled.")),i("Loading of external scripts is disabled");var s=()=>{if(!u)return i("document not found");var s=u.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>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");var n,r=u.querySelectorAll("body > script");r.length>0?null==(n=r[0].parentNode)||n.insertBefore(s,r[0]):u.body.appendChild(s)};null!=u&&u.body?s():null==u||u.addEventListener("DOMContentLoaded",s)};function z(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function j(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?z(Object(i),!0).forEach(function(t){W(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function W(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function V(e,t){if(null==e)return{};var i,s,n=function(e,t){if(null==e)return{};var i,s,n={},r=Object.keys(e);for(s=0;s<r.length;s++)i=r[s],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)i=r[s],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}f.__PosthogExtensions__=f.__PosthogExtensions__||{},f.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var s="/static/".concat(t,".js")+"?v=".concat(e.version);if("remote-config"===t&&(s="/array/".concat(e.config.token,"/config.js")),"toolbar"===t){var n=3e5*Math.floor(Date.now()/3e5);s="".concat(s,"&t=").concat(n)}
1var r=e.requestRouter.endpointFor("assets",s);U(e,r,i)},f.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);U(e,s,i)};var G={};function J(e,t,i){if(C(e)){if(a&&e.forEach===a)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(var s=0,n=e.length;s<n;s++)if(s in e&&t.call(i,e[s],s)===G)return}}}function Y(e,t,i){if(!L(e)){if(C(e))return J(e,t,i);if(e instanceof FormData){for(var s of e.entries())if(t.call(i,s[1],s[0])===G)return}else for(var n in e)if(x.call(e,n)&&t.call(i,e[n],n)===G)return}}var K=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return J(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e};function X(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var Q=function(e){try{return e()}catch(e){return}},Z=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){q.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),q.critical(e)}}},ee=function(e){var t={};return Y(e,function(e,i){T(e)&&e.length>0&&(t[i]=e)}),t},et=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,i,s,r,o){if(t)if(t.addEventListener&&!r)t.addEventListener(i,s,!!o);else{var a="on"+i,l=t[a];t[a]=function(i){if(i=i||e(null==n?void 0:n.event)){var r,o=!0;P(l)&&(r=l(i));var a=s.call(t,i);return!1!==r&&!1!==a||(o=!1),o}}}else q.error("No valid element provided to register_event")}}();function ei(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}var es="$people_distinct_id",en="__alias",er="__timers",eo="$autocapture_disabled_server_side",ea="$heatmaps_enabled_server_side",el="$exception_capture_enabled_server_side",ec="$web_vitals_enabled_server_side",eu="$dead_clicks_enabled_server_side",ed="$web_vitals_allowed_metrics",eh="$session_recording_enabled_server_side",e_="$console_log_recording_enabled_server_side",ep="$session_recording_network_payload_capture",eg="$session_recording_canvas_recording",ef="$replay_sample_rate",ev="$replay_minimum_duration",em="$replay_script_config",eb="$sesid",ey="$session_is_sampled",ew="$session_recording_url_trigger_activated_session",eS="$session_recording_event_trigger_activated_session",eE="$enabled_feature_flags",ek="$early_access_features",ex="$stored_person_properties",eI="$stored_group_properties",eC="$surveys",eP="$surveys_activated",eF="$flag_call_reported",eR="$user_state",eT="$client_session_props",e$="$capture_rate_limit",eO="$initial_campaign_params",eL="$initial_referrer_info",eA="$initial_person_info",eM="$epp",eD="__POSTHOG_TOOLBAR__",eN="$posthog_cklsh",eq=[es,en,"__cmpns",er,eh,ea,eb,eE,eR,ek,eI,ex,eC,eF,eT,e$,eO,eL,eM],eB=B("[FeatureFlags]"),eH="$active_feature_flags",eU="$override_feature_flags",ez="$feature_flag_payloads",ej=e=>{var t={};for(var[i,s]of X(e||{}))s&&(t[i]=s);return t};class eW{constructor(e){W(this,"_override_warning",!1),W(this,"_hasLoadedFlags",!1),W(this,"_requestInFlight",!1),W(this,"_reloadingDisabled",!1),W(this,"_additionalReloadRequested",!1),W(this,"_decideCalled",!1),W(this,"_flagsLoadedFromRemote",!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(eE),t=this.instance.get_property(eU);if(!t)return e||{};for(var i=K({},e),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this._override_warning||(eB.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}getFlagPayloads(){return this.instance.get_property(ez)||{}}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout(()=>{this._callDecideEndpoint()},5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(ex),group_properties:this.instance.get_property(eI)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:s.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var i,s,n=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,n=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig(null!=(s=e.json)?s:{})),t.disable_flags||(this._flagsLoadedFromRemote=!n,this.receivedFeatureFlags(null!=(i=e.json)?i:{},n),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var i,s,n,r,o,a=this.getFlagVariants()[e],l="".concat(a),c=this.instance.get_property(eF)||{};return!t.send_event&&"send_event"in t||e in c&&c[e].includes(l)||(C(c[e])?c[e].push(l):c[e]=[l],null==(i=this.instance.persistence)||i.register({[eF]:c}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:(null==(s=this.instance.config.bootstrap)||null==(n=s.featureFlags)?void 0:n[e])||null,$feature_flag_bootstrapped_payload:(null==(r=this.instance.config.bootstrap)||null==(o=r.featureFlagPayloads)?void 0:o[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote})),a}eB.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);eB.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this.instance.persistence){this._hasLoadedFlags=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads();!function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=e.featureFlags,r=e.featureFlagPayloads;if(n)if(C(n)){var o={};if(n)for(var a=0;a<n.length;a++)o[n[a]]=!0;t&&t.register({[eH]:n,[eE]:o})}else{var l=n,c=r;e.errorsWhileComputingFlags&&(l=j(j({},i),l),c=j(j({},s),c)),t&&t.register({[eH]:Object.keys(ej(l)),[eE]:l||{},[ez]:c||{}})}}(e,this.instance.persistence,i,s),this._fireFeatureFlagsCallbacks(t)}}override(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return eB.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(eU);else if(C(e)){for(var i={},s=0;s<e.length;s++)i[e[s]]=!0;this.instance.persistence.register({[eU]:i})}else this.instance.persistence.register({[eU]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,s=(this.instance.get_property(ek)||[]).find(t=>
1t.flagKey===e),n={["$feature_enrollment/".concat(e)]:t},r={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(r.$early_access_feature_name=s.name),this.instance.capture("$feature_enrollment_update",r),this.setPersonPropertiesForFlags(n,!1);var o=j(j({},this.getFlagVariants()),{},{[e]:t});null==(i=this.instance.persistence)||i.register({[eH]:Object.keys(ej(o)),[eE]:o}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.instance.get_property(ek);if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var i;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this.instance.persistence)||i.register({[ek]:s}),e(s)}}})}_prepareFeatureFlagsForCallbacks(){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),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.instance.get_property(ex)||{};this.instance.register({[ex]:j(j({},i),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(ex)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.instance.get_property(eI)||{};
10!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=j(j({},i[t]),e[t]),delete e[t]}),this.instance.register({[eI]:j(j({},i),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(eI)||{};this.instance.register({[eI]:j(j({},t),{},{[e]:{}})})}else this.instance.unregister(eI)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return A(e)&&isFinite(e)&&Math.floor(e)===e});var eV="0123456789abcdef";class eG{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)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/0x10000000000,n[1]=e/0x100000000,n[2]=e/0x1000000,n[3]=e/65536,n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new eG(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+eV.charAt(this.bytes[t]>>>4)+eV.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new eG(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class eJ{constructor(){W(this,"timestamp",0),W(this,"counter",0),W(this,"random",new eX)}generate(){var e=this.generateOrAbort();if(void 0===e){this.timestamp=0;var t=this.generateOrAbort();if(void 0===t)throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>0x3ffffffffff&&(this.timestamp++,this.resetCounter())}return eG.fromFieldsV7(this.timestamp,Math.trunc(this.counter/0x40000000),0x3fffffff&this.counter,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var eY,eK=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};n&&void 0!==n.crypto&&crypto.getRandomValues&&(eK=e=>crypto.getRandomValues(e));class eX{constructor(){W(this,"buffer",new Uint32Array(8)),W(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(eK(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var eQ=()=>eZ().toString(),eZ=()=>(eY||(eY=new eJ)).generate(),e0="",e1=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,e2={is_supported:()=>!!u,error:function(e){q.error("cookieStore error: "+e)},get:function(e){if(u){try{for(var t=e+"=",i=u.cookie.split(";").filter(e=>e.length),s=0;s<i.length;s++){for(var n=i[s];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(e2.get(e))||{}}catch(e){}return t},set:function(e,t,i,s,n){if(u)try{var r="",o="",a=function(e,t){if(t){var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;if(e0)return e0;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),n="dmn_chk_"+eQ(),r=RegExp("(^|;)\\s*"+n+"=1");!e0&&s--;){var o=i.slice(s).join("."),a=n+"=1;domain=."+o;t.cookie=a,r.test(t.cookie)&&(t.cookie=a+";expires=Thu, 01 Jan 1970 00:00:00 GMT",e0=o)}return e0}(e);if(!i){var s,n=(s=e.match(e1))?s[0]:"";n!==i&&q.info("Warning: cookie subdomain discovery mismatch",n,i),i=n}return i?"; domain=."+i:""}return""}(u.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+24*i*36e5),r="; expires="+l.toUTCString()}n&&(o="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+r+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&q.warn("cookieStore warning: large cookie, len="+c.length),u.cookie=c,c}catch(e){return}},remove:function(e,t){try{e2.set(e,"",-1,t)}catch(e){return}}},e3=null,e5={is_supported:function(){if(!O(e3))return e3;var e=!0;if(void 0===n)e=!1;
1else try{var t="__mplssupport__";e5.set(t,"xyz"),'"xyz"'!==e5.get(t)&&(e=!1),e5.remove(t)}catch(t){e=!1}return e||q.error("localStorage unsupported; falling back to cookie store"),e3=e,e},error:function(e){q.error("localStorage error: "+e)},get:function(e){try{return null==n?void 0:n.localStorage.getItem(e)}catch(e){e5.error(e)}return null},parse:function(e){try{return JSON.parse(e5.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==n||n.localStorage.setItem(e,JSON.stringify(t))}catch(e){e5.error(e)}},remove:function(e){try{null==n||n.localStorage.removeItem(e)}catch(e){e5.error(e)}}},e6=["distinct_id",eb,ey,eM,eA],e8=j(j({},e5),{},{parse:function(e){try{var t={};try{t=e2.parse(e)||{}}catch(e){}var i=K(t,JSON.parse(e5.get(e)||"{}"));return e5.set(e,i),i}catch(e){}return null},set:function(e,t,i,s,n,r){try{e5.set(e,t,void 0,void 0,r);var o={};e6.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&e2.set(e,o,i,s,n,r)}catch(e){e5.error(e)}},remove:function(e,t){try{null==n||n.localStorage.removeItem(e),e2.remove(e,t)}catch(e){e5.error(e)}}}),e4={},e7={is_supported:function(){return!0},error:function(e){q.error("memoryStorage error: "+e)},get:function(e){return e4[e]||null},parse:function(e){return e4[e]||null},set:function(e,t){e4[e]=t},remove:function(e){delete e4[e]}},e9=null,te={is_supported:function(){if(!O(e9))return e9;if(e9=!0,void 0===n)e9=!1;else try{var e="__support__";te.set(e,"xyz"),'"xyz"'!==te.get(e)&&(e9=!1),te.remove(e)}catch(e){e9=!1}return e9},error:function(e){q.error("sessionStorage error: ",e)},get:function(e){try{return null==n?void 0:n.sessionStorage.getItem(e)}catch(e){te.error(e)}return null},parse:function(e){try{return JSON.parse(te.get(e))||null}catch(e){}return null},set:function(e,t){try{null==n||n.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){te.error(e)}},remove:function(e){try{null==n||n.sessionStorage.removeItem(e)}catch(e){te.error(e)}}},tt=["localhost","127.0.0.1"],ti=e=>{var t=null==u?void 0:u.createElement("a");return void 0===t?null:(t.href=e,t)},ts=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},tn=function(e){var t,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",n=[];return Y(e,function(e,s){void 0===e||void 0===s||"undefined"===s||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(s),n[n.length]=i+"="+t)}),n.join(s)},tr=function(e,t){for(var i,s=((e.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<s.length;n++){var r=s[n].split("=");if(r[0]===t){i=r;break}}if(!C(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){q.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},to=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},ta="Mobile",tl="Android",tc="Tablet",tu=tl+" "+tc,td="iPad",th="Apple",t_=th+" Watch",tp="Safari",tg="BlackBerry",tf="Samsung",tv=tf+"Browser",tm=tf+" Internet",tb="Chrome",ty=tb+" OS",tw=tb+" iOS",tS="Internet Explorer",tE=tS+" "+ta,tk="Opera",tx=tk+" Mini",tI="Edge",tC="Microsoft "+tI,tP="Firefox",tF=tP+" iOS",tR="Nintendo",tT="PlayStation",t$="Xbox",tO=tl+" "+ta,tL=ta+" "+tp,tA="Windows",tM=tA+" Phone",tD="Nokia",tN="Ouya",tq="Generic",tB=tq+" "+ta.toLowerCase(),tH=tq+" "+tc.toLowerCase(),tU="Konqueror",tz="(\\d+(\\.\\d+)?)",tj=RegExp("Version/"+tz),tW=RegExp(t$,"i"),tV=RegExp(tT+" \\w+","i"),tG=RegExp(tR+" \\w+","i"),tJ=RegExp(tg+"|PlayBook|BB10","i"),tY={"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"},tK=function(e,t){let i;return t=t||"",y(e," OPR/")&&y(e,"Mini")?tx:y(e," OPR/")?tk:tJ.test(e)?tg:y(e,"IE"+ta)||y(e,"WPDesktop")?tE:y(e,tv)?tm:y(e,tI)||y(e,"Edg/")?tC:y(e,"FBIOS")?"Facebook "+ta:y(e,"UCWEB")||y(e,"UCBrowser")?"UC Browser":y(e,"CriOS")?tw:y(e,"CrMo")||y(e,tb)?tb:y(e,tl)&&y(e,tp)?tO:y(e,"FxiOS")?tF:y(e.toLowerCase(),tU.toLowerCase())?tU:(i=t)&&y(i,th)||y(e,tp)&&!y(e,tb)&&!y(e,tl)?y(e,ta)?tL:tp:y(e,tP)?tP:y(e,"MSIE")||y(e,"Trident/")?tS:y(e,"Gecko")?tP:""},tX={[tE]:[RegExp("rv:"+tz)],[tC]:[RegExp(tI+"?\\/"+tz)],[tb]:[RegExp("("+tb+"|CrMo)\\/"+tz)],[tw]:[RegExp("CriOS\\/"+tz)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+tz)],[tp]:[tj],[tL]:[tj],[tk]:[RegExp("(Opera|OPR)\\/"+tz)],[tP]:[RegExp(tP+"\\/"+tz)],[tF]:[RegExp("FxiOS\\/"+tz)],[tU]:[RegExp("Konqueror[:/]?"+tz,"i")],[tg]:[RegExp(tg+" "+tz),tj],[tO]:[RegExp("android\\s"+tz,"i")],[tm]:[RegExp(tv+"\\/"+tz)],[tS]:[RegExp("(rv:|MSIE )"+tz)],Mozilla:[RegExp("rv:"+tz)]},tQ=[[RegExp(t$+"; "+t$+" (.*?)[);]","i"),e=>[t$,e&&e[1]||""]],[RegExp(tR,"i"),[tR,""]],[RegExp(tT,"i"),[tT,""]],[tJ,[tg,""]],[RegExp(tA,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[tM,""];if(new RegExp(ta).test(t)&&!/IEMobile\b/.test(t))return[tA+" "+ta,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=tY[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[tA,s]}return[tA,""]}],[/((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=void 0===e[2]?e[3]:e[2]),["watchOS",t]}],[RegExp("("+tl+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+tl+")","i"),e=>e&&e[2]?[tl,[e[2],e[3],e[4]||"0"].join(".")]:[tl,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ty,""]],[/Linux|debian/i,["Linux",""]]],tZ=function(e){return tG.test(e)?tR:tV.test(e)?tT:tW.test(e)?t$:RegExp(tN,"i").test(e)?tN:RegExp("("+tM+"|WPDesktop)","i").test(e)?tM:/iPad/.test(e)?td:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?t_:tJ.test(e)?tg:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(tD,"i").test(e)?tD:/(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(ta).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)?tl:tu:tl:RegExp("(pda|"+ta+")","i").test(e)?tB:RegExp(tc,"i").test(e)&&!RegExp(tc+" pc","i").test(e)?tH:""},t0="https?://(.*)",t1=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],t2={campaignParams:function(e){return u?this._campaignParamsFromUrl(u.URL,e):{}},_campaignParamsFromUrl:function(e,t){var i=t1.concat(t||[]),s={};return Y(i,function(t){var i=tr(e,t);
1s[t]=i||null}),s},_searchEngine:function(e){return e?0===e.search(t0+"google.([^/?]*)")?"google":0===e.search(t0+"bing.com")?"bing":0===e.search(t0+"yahoo.com")?"yahoo":0===e.search(t0+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=t2._searchEngine(e),i={};if(!O(t)){i.$search_engine=t;var s=u?tr(u.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i},searchInfo:function(){var e=null==u?void 0:u.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:tK,browserVersion:function(e,t){var i=tX[tK(e,t)];if(void 0===i)return null;for(var s=0;s<i.length;s++){var n=i[s],r=e.match(n);if(r)return parseFloat(r[r.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return"string"==typeof e?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<tQ.length;t++){var[i,s]=tQ[t],n=i.exec(e),r=n&&(P(s)?s(n,e):s);if(r)return r}return["",""]},device:tZ,deviceType:function(e){var t=tZ(e);return t===td||t===tu||"Kobo"===t||"Kindle Fire"===t||t===tH?tc:t===tR||t===t$||t===tT||t===tN?"Console":t===t_?"Wearable":t?ta:"Desktop"},referrer:function(){return(null==u?void 0:u.referrer)||"$direct"},referringDomain:function(){var e;return null!=u&&u.referrer&&(null==(e=ti(u.referrer))?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:null==d?void 0:d.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(e){var t,{r:i,u:s}=e,n={$initial_referrer:i,$initial_referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=ti(i))?void 0:t.host};if(s){n.$initial_current_url=s;var r=ti(s);n.$initial_host=null==r?void 0:r.host,n.$initial_pathname=null==r?void 0:r.pathname,Y(this._campaignParamsFromUrl(s),function(e,t){n["$initial_"+S(t)]=e})}return i&&Y(this._searchInfoFromReferrer(i),function(e,t){n["$initial_"+S(t)]=e}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},timezoneOffset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}},properties:function(){if(!g)return{};var[e,t]=t2.os(g);return K(ee({$os:e,$os_version:t,$browser:t2.browser(g,navigator.vendor),$device:t2.device(g),$device_type:t2.deviceType(g),$timezone:t2.timezone(),$timezone_offset:t2.timezoneOffset()}),{$current_url:null==d?void 0:d.href,$host:null==d?void 0:d.host,$pathname:null==d?void 0:d.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:t2.browserVersion(g,navigator.vendor),$browser_language:t2.browserLanguage(),$browser_language_prefix:t2.browserLanguagePrefix(),$screen_height:null==n?void 0:n.screen.height,$screen_width:null==n?void 0:n.screen.width,$viewport_height:null==n?void 0:n.innerHeight,$viewport_width:null==n?void 0:n.innerWidth,$lib:"web",$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!g)return{};var[e,t]=t2.os(g);return K(ee({$os:e,$os_version:t,$browser:t2.browser(g,navigator.vendor)}),{$browser_version:t2.browserVersion(g,navigator.vendor)})}},t3=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class t5{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(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.storage=this.buildStorage(e),this.load(),e.debug&&q.info("Persistence loaded",e.persistence,j({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){-1===t3.indexOf(e.persistence.toLowerCase())&&(q.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&e5.is_supported()?e5:"localstorage+cookie"===t&&e8.is_supported()?e8:"sessionstorage"===t&&te.is_supported()?te:"memory"===t?e7:"cookie"===t?e2:e8.is_supported()?e8:e2}properties(){var e={};return Y(this.props,function(t,i){if(i===eE&&F(t))for(var s,n=Object.keys(t),r=0;r<n.length;r++)e["$feature/".concat(n[r])]=t[n[r]];else s=!1,(O(eq)?s:l&&eq.indexOf===l?-1!=eq.indexOf(i):(Y(eq,function(e){if(s||(s=e===i))return G}),s))||(e[i]=t)}),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=K({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(F(e)){void 0===t&&(t="None"),this.expire_days=void 0===i?this.default_expiry:i;var s=!1;if(Y(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(F(e)){this.expire_days=void 0===t?this.default_expiry:t;var i=!1;if(Y(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.props[s]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=t2.campaignParams(this.config.custom_campaign_params);R(ee(e))||this.register(e),this.campaign_params_saved=!0}
1}update_search_keyword(){this.register(t2.searchInfo())}update_referrer_info(){this.register_once(t2.referrerInfo(),void 0)}set_initial_person_info(){this.props[eO]||this.props[eL]||this.register_once({[eA]:t2.initialPersonInfo()},void 0)}get_referrer_info(){return ee({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};Y([eL,eO],t=>{var i=this.props[t];i&&Y(i,function(t,i){e["$initial_"+S(i)]=t})});var t=this.props[eA];return t&&K(e,t2.initialPersonPropsFromInfo(t)),e}safe_merge(e){return Y(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.buildStorage(e),s=this.props;this.clear(),this.storage=i,this.props=s,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[er]||{};i[e]=t,this.props[er]=i,this.save()}remove_event_timer(e){var t=(this.props[er]||{})[e];return void 0===t||(delete this.props[er][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function t6(e){var t,i;return(null==(t=JSON.stringify(e,(i=[],function(e,t){if(F(t)){for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(t)?"[Circular]":(i.push(t),t)}return t})))?void 0:t.length)||0}var t8=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(t8||{}),t4=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(t4||{});function t7(e){var t;return e instanceof Element&&(e.id===eD||!(null==(t=e.closest)||!t.call(e,".toolbar-global-fade-container")))}function t9(e){return!!e&&1===e.nodeType}function ie(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function it(e){return!!e&&3===e.nodeType}function ii(e){return!!e&&11===e.nodeType}function is(e){return e?w(e).split(/\s+/):[]}function ir(e){var t=null==n?void 0:n.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function io(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 is(t)}function ia(e){return L(e)?null:w(e).split(/(\s+)/).filter(e=>iw(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function il(e){var t="";return ih(e)&&!i_(e)&&e.childNodes&&e.childNodes.length&&Y(e.childNodes,function(e){var i;it(e)&&e.textContent&&(t+=null!=(i=ia(e.textContent))?i:"")}),w(t)}function ic(e){var t;return void 0===e.target?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var iu=["a","button","form","input","select","textarea","label"];function id(e){var t=e.parentNode;return!(!t||!t9(t))&&t}function ih(e){for(var t=e;t.parentNode&&!ie(t,"body");t=t.parentNode){var i=io(t);if(y(i,"ph-sensitive")||y(i,"ph-no-capture"))return!1}if(y(io(e),"ph-include"))return!0;var s=e.type||"";if(T(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!(T(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function i_(e){return!!(ie(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ie(e,"select")||ie(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ip="(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}
1)|((?:2131|1800|35[0-9]{3})[0-9]{11})",ig=new RegExp("^(?:".concat(ip,")$")),iv=new RegExp(ip),im="\\d{3}-?\\d{2}-?\\d{4}",ib=new RegExp("^(".concat(im,")$")),iy=new RegExp("(".concat(im,")"));function iw(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(L(e)||T(e)&&(e=w(e),(t?ig:iv).test((e||"").replace(/[- ]/g,""))||(t?ib:iy).test(e)))&&!0}function iS(e){var t=il(e);return iw(t="".concat(t," ").concat(function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&Y(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var n=il(t);i="".concat(i," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(i="".concat(i," ").concat(e(t)).trim())}catch(e){q.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function iE(e){return e.replace(/"|\\"/g,'\\"')}var ik="[SessionRecording]",ix="redacted",iI={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},iC=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],iP=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],iF=["/s/","/e/","/i/"];function iR(e,t,i,s){if(L(e))return e;var n=(null==t?void 0:t["content-length"])||new Blob([e]).size;return T(n)&&(n=parseInt(n)),n>i?ik+" ".concat(s," body too large to record (").concat(n," bytes)"):e}function iT(e,t){if(L(e))return e;var i=e;return iw(i,!1)||(i=ik+" "+t+" body "+ix),Y(iP,e=>{var s,n;null!=(s=i)&&s.length&&-1!==(null==(n=i)?void 0:n.indexOf(e))&&(i=ik+" "+t+" body "+ix+" as might contain: "+e)}),i}function i$(e,t,i,s,n){return t>i&&(q.warn("min cannot be greater than max."),t=i),A(e)?e>i?(s&&q.warn(s+" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(s&&q.warn(s+" cannot be less than min: "+t+". Using min value instead."),t):e:(s&&q.warn(s+" must be a number. using max or fallback. max: "+i+", fallback: "+n),i$(n||i,t,i,s))}class iO{constructor(e){var t,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};W(this,"bucketSize",100),W(this,"refillRate",10),W(this,"mutationBuckets",{}),W(this,"loggedTracker",{}),W(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]})}),W(this,"getNodeOrRelevantParent",e=>{var t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var i=t.closest("svg");if(i)return[this.rrweb.mirror.getId(i),i]}return[e,t]}),W(this,"numberOfChanges",e=>{var t,i,s,n,r,o,a,l;return(null!=(t=null==(i=e.removes)?void 0:i.length)?t:0)+(null!=(s=null==(n=e.attributes)?void 0:n.length)?s:0)+(null!=(r=null==(o=e.texts)?void 0:o.length)?r:0)+(null!=(a=null==(l=e.adds)?void 0:l.length)?a:0)}),W(this,"throttleMutations",e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,i=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t,i,s,[n,r]=this.getNodeOrRelevantParent(e.id);return 0!==this.mutationBuckets[n]&&(this.mutationBuckets[n]=null!=(t=this.mutationBuckets[n])?t:this.bucketSize,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),0===this.mutationBuckets[n]&&(this.loggedTracker[n]||(this.loggedTracker[n]=!0,null==(i=(s=this.options).onBlockedNode)||i.call(s,n,r))),e)}));var s=this.numberOfChanges(t);return 0!==s||i===s?e:void 0}),this.rrweb=e,this.options=s,this.refillRate=i$(null!=(t=this.options.refillRate)?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=i$(null!=(i=this.options.bucketSize)?i:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}}var iL=Uint8Array,iA=Uint16Array,iM=Uint32Array,iD=new iL([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]),iN=new iL([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]),iq=new iL([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iB=function(e,t){for(var i=new iA(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var n=new iM(i[30]);for(s=1;s<30;++s)for(var r=i[s];r<i[s+1];++r)n[r]=r-i[s]<<5|s;return[i,n]},iH=iB(iD,2),iU=iH[0],iz=iH[1];iU[28]=258,iz[258]=28;for(var ij=iB(iN,0)[1],iW=new iA(32768),iV=0;iV<32768;++iV){var iG=(43690&iV)>>>1|(21845&iV)<<1;iG=(61680&(iG=(52428&iG)>>>2|(13107&iG)<<2))>>>4|(3855&iG)<<4,iW[iV]=((65280&iG)>>>8|(255&iG)<<8)>>>1}var iJ=function(e,t,i){for(var s=e.length,n=0,r=new iA(t);n<s;++n)++r[e[n]-1];var o,a=new iA(t);for(n=0;n<t;++n)a[n]=a[n-1]+r[n-1]<<1;if(i){o=new iA(1<<t);var l=15-t;for(n=0;n<s;++n)if(e[n])for(var c=n<<4|e[n],u=t-e[n],d=a[e[n]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)o[iW[d]>>>l]=c}else for(o=new iA(s),n=0;n<s;++n)o[n]=iW[a[e[n]-1]++]>>>15-e[n];return o},iY=new iL(288);for(iV=0;iV<144;++iV)iY[iV]=8;for(iV=144;iV<256;++iV)iY[iV]=9;for(iV=256;iV<280;++iV)iY[iV]=7;for(iV=280;iV<288;++iV)iY[iV]=8;var iK=new iL(32);for(iV=0;iV<32;++iV)iK[iV]=5;var iX=iJ(iY,9,0),iQ=iJ(iK,5,0),iZ=function(e){return(e/8|0)+(7&e&&1)},i0=function(e,t,i){(null==i||i>e.length)&&(i=e.length);
1var s=new(e instanceof iA?iA:e instanceof iM?iM:iL)(i-t);return s.set(e.subarray(t,i)),s},i1=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},i2=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},i3=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var n=i.length,r=i.slice();if(!n)return[new iL(0),0];if(1==n){var o=new iL(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],c=0,u=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=n-1;)a=i[i[c].f<i[d].f?c++:d++],l=i[c!=u&&i[c].f<i[d].f?c++:d++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=r[0].s;for(s=1;s<n;++s)r[s].s>h&&(h=r[s].s);var _=new iA(h+1),p=i5(i[u-1],_,0);if(p>t){s=0;var g=0,f=p-t,v=1<<f;for(r.sort(function(e,t){return _[t.s]-_[e.s]||e.f-t.f});s<n;++s){var m=r[s].s;if(!(_[m]>t))break;g+=v-(1<<p-_[m]),_[m]=t}for(g>>>=f;g>0;){var b=r[s].s;_[b]<t?g-=1<<t-_[b]++-1:++s}for(;s>=0&&g;--s){var y=r[s].s;_[y]==t&&(--_[y],++g)}p=t}return[new iL(_),p]},i5=function(e,t,i){return -1==e.s?Math.max(i5(e.l,t,i+1),i5(e.r,t,i+1)):t[e.s]=i},i6=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new iA(++t),s=0,n=e[0],r=1,o=function(e){i[s++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++r;else{if(!n&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(n),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(n);r=1,n=e[a]}return[i.subarray(0,s),t]},i8=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},i4=function(e,t,i){var s=i.length,n=iZ(t+2);e[n]=255&s,e[n+1]=s>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var r=0;r<s;++r)e[n+r+4]=i[r];return 8*(n+4+s)},i7=function(e,t,i,s,n,r,o,a,l,c,u){i1(t,u++,i),++n[256];for(var d=i3(n,15),h=d[0],_=d[1],p=i3(r,15),g=p[0],f=p[1],v=i6(h),m=v[0],b=v[1],y=i6(g),w=y[0],S=y[1],E=new iA(19),k=0;k<m.length;++k)E[31&m[k]]++;for(k=0;k<w.length;++k)E[31&w[k]]++;for(var x=i3(E,7),I=x[0],C=x[1],P=19;P>4&&!I[iq[P-1]];--P);var F,R,T,$,O=c+5<<3,L=i8(n,iY)+i8(r,iK)+o,A=i8(n,h)+i8(r,g)+o+14+3*P+i8(E,I)+(2*E[16]+3*E[17]+7*E[18]);if(O<=L&&O<=A)return i4(t,u,e.subarray(l,l+c));if(i1(t,u,1+(A<L)),u+=2,A<L){F=iJ(h,_,0),R=h,T=iJ(g,f,0),$=g;var M=iJ(I,C,0);for(i1(t,u,b-257),i1(t,u+5,S-1),i1(t,u+10,P-4),u+=14,k=0;k<P;++k)i1(t,u+3*k,I[iq[k]]);u+=3*P;for(var D=[m,w],N=0;N<2;++N){var q=D[N];for(k=0;k<q.length;++k){var B=31&q[k];i1(t,u,M[B]),u+=I[B],B>15&&(i1(t,u,q[k]>>>5&127),u+=q[k]>>>12)}}}else F=iX,R=iY,T=iQ,$=iK;for(k=0;k<a;++k)if(s[k]>255){i2(t,u,F[(B=s[k]>>>18&31)+257]),u+=R[B+257],B>7&&(i1(t,u,s[k]>>>23&31),u+=iD[B]);var H=31&s[k];i2(t,u,T[H]),u+=$[H],H>3&&(i2(t,u,s[k]>>>5&8191),u+=iN[H])}else i2(t,u,F[s[k]]),u+=R[s[k]];return i2(t,u,F[256]),u+R[256]},i9=new iM([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),se=function(){for(var e=new iM(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),st=function(){var e=0xffffffff;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=se[255&i^t[s]]^i>>>8;e=i},d:function(){return 0xffffffff^e}}},si=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},ss=function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&si(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;s<=i.length;++s)e[s+10]=i.charCodeAt(s)}};function sn(e,t){void 0===t&&(t={});var i,s,n,r=st(),o=e.length;r.p(e);var a=(s=t,n=10+((i=t).filename&&i.filename.length+1||0),function(e,t,i,s,n,r){var o=e.length,a=new iL(s+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(s,a.length-n),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d<o?c=i4(l,c,e.subarray(u,d)):(l[u]=r,c=i4(l,c,e.subarray(u,o)))}else{for(var h=i9[t-1],_=h>>>13,p=8191&h,g=(1<<i)-1,f=new iA(32768),v=new iA(g+1),m=Math.ceil(i/3),b=2*m,y=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<b)&g},w=new iM(25e3),S=new iA(288),E=new iA(32),k=0,x=0,I=(u=0,0),C=0,P=0;u<o;++u){var F=y(u),R=32767&u,T=v[F];if(f[R]=T,v[F]=R,C<=u){var $=o-u;if((k>7e3||I>24576)&&$>423){c=i7(e,l,0,w,S,E,x,I,P,u-P,c),I=k=x=0,P=u;for(var O=0;O<286;++O)S[O]=0;for(O=0;O<30;++O)E[O]=0}var L=2,A=0,M=p,D=R-T&32767;if($>2&&F==y(u-D))for(var N=Math.min(_,$)-1,q=Math.min(32767,u),B=Math.min(258,$);D<=q&&--M&&R!=T;){if(e[u+L]==e[u+L-D]){for(var H=0;H<B&&e[u+H]==e[u+H-D];++H);if(H>L){if(L=H,A=D,H>N)break;var U=Math.min(D,H-2),z=0;for(O=0;O<U;++O){var j=u-D+O+32768&32767,W=j-f[j]+32768&32767;W>z&&(z=W,T=j)}}}D+=(R=T)-(T=f[R])+32768&32767}if(A){w[I++]=0x10000000|iz[L]<<18|ij[A];var V=31&iz[L],G=31&ij[A];x+=iD[V]+iN[G],++S[257+V],++E[G],C=u+L,++k}else w[I++]=e[u],++S[e[u]]}}c=i7(e,l,r,w,S,E,x,I,P,u-P,c)}return i0(a,0,s+iZ(c)+n)}(e,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+s.mem,n,8,!0)),l=a.length;return ss(a,t),si(a,l-8,r.d()),si(a,l-4,o),a}function sr(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new iL(e.length+(e.length>>>1)),n=0,r=function(e){s[n++]=e},o=0;o<i;++o){if(n+5>s.length){var a=new iL(n+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);l<128||t?r(l):(l<2048?r(192|l>>>6):(l>55295&&l<57344?(r(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),r(128|l>>>12&63)):r(224|l>>>12),r(128|l>>>6&63)),r(128|63&l))}return i0(s,0,n)}var so="[SessionRecording]",sa=B(so),sl=[t4.MouseMove,t4.MouseInteraction,t4.Scroll,t4.ViewportResize,t4.Input,t4.TouchMove,t4.MediaInteraction,t4.Drag],sc=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function su(e){return function(e,t){for(var i="",s=0;s<e.length;){var n=e[s++];n<128||t?i+=String.fromCharCode(n):n<224?i+=String.fromCharCode((31&n)<<6|63&e[s++]):n<240?i+=String.fromCharCode((1
15&n)<<12|(63&e[s++])<<6|63&e[s++]):i+=String.fromCharCode(55296|(n=((15&n)<<18|(63&e[s++])<<12|(63&e[s++])<<6|63&e[s++])-65536)>>10,56320|1023&n)}return i}(sn(sr(JSON.stringify(e))),!0)}function sd(e){return e.type===t8.Custom&&"sessionIdle"===e.data.tag}function sh(e,t){return t.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))}class s_{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==f||null==(e=f.__PosthogExtensions__)||null==(t=e.rrweb)?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw Error(so+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!=(e=null==(t=this.instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)?e:3e5}get isSampled(){var e=this.instance.get_property(ey);return M(e)?e:null}get sessionDuration(){var e,t,i=null==(e=this.buffer)?void 0:e.data[(null==(t=this.buffer)?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get isRecordingEnabled(){var e=!!this.instance.get_property(eh),t=!this.instance.config.disable_session_recording;return n&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(e_),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){var e,t,i,s,n,r,o=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(eg),l=null!=(e=null!=(t=null==o?void 0:o.recordCanvas)?t:null==a?void 0:a.enabled)&&e,c=null!=(i=null!=(s=null==o?void 0:o.canvasFps)?s:null==a?void 0:a.fps)?i:0,u=null!=(n=null!=(r=null==o?void 0:o.canvasQuality)?r:null==a?void 0:a.quality)?n:0;return{enabled:l,fps:i$(c,0,12,"canvas recording fps"),quality:i$(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,i=this.instance.get_property(ep),s={recordHeaders:null==(e=this.instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(t=this.instance.config.session_recording)?void 0:t.recordBody},n=(null==s?void 0:s.recordHeaders)||(null==i?void 0:i.recordHeaders),r=(null==s?void 0:s.recordBody)||(null==i?void 0:i.recordBody),o=F(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(M(o)?o:null==i?void 0:i.capturePerformance);return n||r||a?{recordHeaders:n,recordBody:r,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(ef);return A(e)?e:null}get minimumDuration(){var e=this.instance.get_property(ev);return A(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":L(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":M(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return 0===this._urlTriggers.length?"trigger_disabled":(null==(e=this.instance)?void 0:e.get_property(ew))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return 0===this._eventTriggers.length?"trigger_disabled":(null==(e=this.instance)?void 0:e.get_property(eS))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(W(this,"queuedRRWebEvents",[]),W(this,"isIdle",!1),W(this,"_linkedFlagSeen",!1),W(this,"_lastActivityTimestamp",Date.now()),W(this,"_linkedFlag",null),W(this,"_removePageViewCaptureHook",void 0),W(this,"_onSessionIdListener",void 0),W(this,"_persistDecideOnSessionListener",void 0),W(this,"_samplingSessionListener",void 0),W(this,"_urlTriggers",[]),W(this,"_urlBlocklist",[]),W(this,"_urlBlocked",!1),W(this,"_eventTriggers",[]),W(this,"_removeEventTriggerCaptureHook",void 0),W(this,"_forceAllowLocalhostNetworkCapture",!1),W(this,"_onBeforeUnload",()=>{this._flushBuffer()}),W(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),W(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),W(this,"_onVisibilityChange",()=>{if(null!=u&&u.visibilityState){var e="window "+u.visibilityState;this._tryAddCustomEvent(e,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw sa.error("started without valid sessionManager"),Error(so+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw Error(so+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:t,windowId:i}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=i,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&sa.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as i
1dle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==n||n.addEventListener("beforeunload",this._onBeforeUnload),null==n||n.addEventListener("offline",this._onOffline),null==n||n.addEventListener("online",this._onOnline),null==n||n.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),L(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!t)return;this._tryAddCustomEvent("$pageview",{href:t})}}catch(e){sa.error("Could not add $pageview to rrweb session",e)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((e,t,i)=>{var s,n,r,o;i&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:i}),null==(s=this.instance)||null==(n=s.persistence)||n.unregister(eS),null==(r=this.instance)||null==(o=r.persistence)||o.unregister(ew))}))):this.stopRecording()}stopRecording(){var e,t,i,s;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==n||n.removeEventListener("beforeunload",this._onBeforeUnload),null==n||n.removeEventListener("offline",this._onOffline),null==n||n.removeEventListener("online",this._onOnline),null==n||n.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null==(e=this._removePageViewCaptureHook)||e.call(this),this._removePageViewCaptureHook=void 0,null==(t=this._removeEventTriggerCaptureHook)||t.call(this),this._removeEventTriggerCaptureHook=void 0,null==(i=this._onSessionIdListener)||i.call(this),this._onSessionIdListener=void 0,null==(s=this._samplingSessionListener)||s.call(this),this._samplingSessionListener=void 0,sa.info("stopped"))}makeSamplingDecision(e){var t,i,s=this.sessionId!==e,n=this.sampleRate;if(A(n)){var r,o=this.isSampled,a=s||!M(o);r=a?Math.random()<n:o,a&&(r?this._reportStarted("sampled"):sa.warn("Sample rate (".concat(n,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:n,isSampled:r})),null==(i=this.instance.persistence)||i.register({[ey]:r})}else null==(t=this.instance.persistence)||t.register({[ey]:null})}onRemoteConfig(e){var t,i,s,n,r,o;
1if(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=(null==(t=e.sessionRecording)?void 0:t.linkedFlag)||null,null!=(i=e.sessionRecording)&&i.endpoint&&(this._endpoint=null==(o=e.sessionRecording)?void 0:o.endpoint),this._setupSampling(),!L(this._linkedFlag)&&!this._linkedFlagSeen){var a=T(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=T(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((e,t)=>{var i=F(t)&&a in t,s=l?t[a]===l:i;s&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:l}),this._linkedFlagSeen=s})}null!=(s=e.sessionRecording)&&s.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!=(n=e.sessionRecording)&&n.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!=(r=e.sessionRecording)&&r.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){A(this.sampleRate)&&L(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistRemoteConfig(e){if(this.instance.persistence){var t,i=this.instance.persistence,s=()=>{var t,s,n,r,o,a,l,c,u=null==(t=e.sessionRecording)?void 0:t.sampleRate,d=L(u)?null:parseFloat(u),h=null==(s=e.sessionRecording)?void 0:s.minimumDurationMilliseconds;i.register({[eh]:!!e.sessionRecording,[e_]:null==(n=e.sessionRecording)?void 0:n.consoleLogRecordingEnabled,[ep]:j({capturePerformance:e.capturePerformance},null==(r=e.sessionRecording)?void 0:r.networkPayloadCapture),[eg]:{enabled:null==(o=e.sessionRecording)?void 0:o.recordCanvas,fps:null==(a=e.sessionRecording)?void 0:a.canvasFps,quality:null==(l=e.sessionRecording)?void 0:l.canvasQuality},[ef]:d,[ev]:void 0===h?null:h,[em]:null==(c=e.sessionRecording)?void 0:c.scriptConfig})};s(),null==(t=this._persistDecideOnSessionListener)||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(s)}}log(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null==(t=this.instance.sessionRecording)||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(void 0!==Object.assign&&void 0!==Array.from&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,i;(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)?this._onScriptLoaded():null==(t=f.__PosthogExtensions__)||null==(i=t.loadExternalDependency)||i.call(t,this.instance,this.scriptName,e=>{if(e)return sa.error("could not load recorder",e);this._onScriptLoaded()}),sa.info("starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,i;return(null==(e=this.instance)||null==(t=e.persistence)||null==(i=t.get_property(em))?void 0:i.script)||"recorder"}isInteractiveEvent(e){var t;return 3===e.type&&-1!==sl.indexOf(null==(t=e.data)?void 0:t.source)}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var{windowId:s,sessionId:n}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),r=this.sessionId!==n,o=this.windowId!==s;this.windowId=s,this.sessionId=n,r||o?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):sa.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(sc(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(sc(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var e,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{}
1,collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};for(var[i,s]of Object.entries(this.instance.config.session_recording||{}))i in t&&("maskInputOptions"===i?t.maskInputOptions=j({password:!0},s):t[i]=s);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!=(e=this.mutationRateLimiter)?e:new iO(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{var i="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");sa.info(i,{node:t}),this.log(so+" "+i,"warn")}});var n=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(j({emit:e=>{this.onRRwebEmit(e)},plugins:n},t)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:n.map(e=>null==e?void 0:e.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else sa.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},e))}}_gatherRRWebPlugins(){var e,t,i,s,n,r,o,a,l,c,u,d,h,_,p,g=[],v=null==(d=f.__PosthogExtensions__)||null==(h=d.rrwebPlugins)?void 0:h.getRecordConsolePlugin;v&&this.isConsoleLogCaptureEnabled&&g.push(v());var m=null==(_=f.__PosthogExtensions__)||null==(p=_.rrwebPlugins)?void 0:p.getRecordNetworkPlugin;return this.networkPayloadCapture&&P(m)&&(!tt.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?g.push(m((e=this.instance.config,t=this.networkPayloadCapture,n={payloadSizeLimitBytes:iI.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...iI.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...iI.payloadHostDenyList]},r=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,a=!1!==e.capture_performance&&t.recordPerformance,s=Math.min(1e6,null!=(i=n.payloadSizeLimitBytes)?i:1e6),l=e=>(null!=e&&e.requestBody&&(e.requestBody=iR(e.requestBody,e.requestHeaders,s,"Request")),null!=e&&e.responseBody&&(e.responseBody=iR(e.responseBody,e.responseHeaders,s,"Response")),e),c=t=>{var i;return l(((e,t)=>{var i,s=ti(e.name),n=0===t.indexOf("http")?null==(i=ti(t))?void 0:i.pathname:t;"/"===n&&(n="");var r=null==s?void 0:s.pathname.replace(n||"","");if(!(s&&r&&iF.some(e=>0===r.indexOf(e))))return e})((L(i=t.requestHeaders)||Y(Object.keys(null!=i?i:{}),e=>{iC.includes(e.toLowerCase())&&(i[e]=ix)}),t),e.api_host))},(u=P(e.session_recording.maskNetworkRequestFn))&&P(e.session_recording.maskCapturedNetworkRequestFn)&&q.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var i=e.session_recording.maskNetworkRequestFn({url:t.name});return j(j({},t),{},{name:null==i?void 0:i.url})}),n.maskRequestFn=P(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var i,s,n,r=c(t);return r&&null!=(i=null==(s=(n=e.session_recording).maskCapturedNetworkRequestFn)?void 0:s.call(n,r))?i:void 0}:e=>(function(e){if(void 0!==e)return e.requestBody=iT(e.requestBody,"Request"),e.responseBody=iT(e.responseBody,"Response"),e})(c(e)),j(j(j({},iI),n),{},{recordHeaders:r,recordBody:o,recordPerformance:a,recordInitialRequests:a})))):sa.info("NetworkCapture not started because we are on localhost.")),g}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&F(e)){if(e.type===t8.Meta){var i=this._maskUrl(e.data.href);if(this._lastHref=i,!i)return;e.data.href=i}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),"paused"!==this.status||e.type===t8.Custom&&"recording paused"===e.data.tag){e.type===t8.FullSnapshot&&this._scheduleFullSnapshot(),e.type===t8.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();var s=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(s){var n=function(e){if(e&&F(e)&&6===e.type&&F(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],i=0;i<e.data.payload.payload.length;i++)e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?t.push(e.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[i]);return e.data.payload.payload=t,e}return e}(s);if(this._updateWindowAndSessionIds(n),!this.isIdle||sd(n)){if(sd(n)){var r=n.data.payload;r&&(n.timestamp=r.lastActivityTimestamp+r.threshold)}var o=null==(t=this.instance.config.session_recording.compress_events)||t?function(e){if(1024>t6(e))return e;try{if(e.type===t8.FullSnapshot)return j(j({},e),{},{data:su(e.data),cv:"2024-10"});if(e.type===t8.IncrementalSnapshot&&e.data.source===t4.Mutation)return j(j({},e),{},{cv:"2024-10",data:j(j({},e.data),{},{texts:su(e.data.texts),attributes:su(e.data.attributes),removes:su(e.data.removes),adds:su(e.data.adds)})});if(e.type===t8.IncrementalSnapshot&&e.data.source===t4.StyleSheetRule)return j(j({},e),{},{cv:"2024-10",data:j(j({},e.data),{},{adds:su(e.data.adds),removes:su(e.data.removes)})})}catch(e){sa.error("could not compress event - will use uncompressed event",e)}return e}(n):n,a={$snapshot_bytes:t6(o),$snapshot_data:o,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(a):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&n){var e=this._maskUrl(n.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];
1this.queuedRRWebEvents=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)})}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,s={url:e};return null==(i=s=t.maskNetworkRequestFn(s))?void 0:i.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,i=A(t)&&t>=0,s=A(e)&&i&&t<e;return"buffering"===this.status||"paused"===this.status||s?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&(function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(t.size>=i&&t.data.length>1){var s=Math.floor(t.data.length/2),n=t.data.slice(0,s),r=t.data.slice(s);return[e({size:t6(n),data:n,sessionId:t.sessionId,windowId:t.windowId}),e({size:t6(r),data:r,sessionId:t.sessionId,windowId:t.windowId})].flatMap(e=>e)}return[t]})(this.buffer).forEach(e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:v.LIB_VERSION})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t,i=2+((null==(t=this.buffer)?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(void 0!==n&&n.location.href){var e=n.location.href,t="paused"===this.status,i=sh(e,this._urlBlocklist);i&&!t?this._pauseRecording():!i&&t&&this._resumeRecording(),sh(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,i;"trigger_pending"===this.triggerStatus&&(null==(t=this.instance)||null==(i=t.persistence)||i.register({["url"===e?ew:eS]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){"paused"!==this.status&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),sa.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){"paused"===this.status&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),sa.info("recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&L(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){sa.error("Could not activate event trigger",e)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null==(e=this.instance.persistence)||e.register({[ey]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),sa.info(e.replace("_"," "),t),y(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}var sp=B("[RemoteConfig]");class sg{constructor(e){this.instance=e}get remoteConfig(){var e,t;return null==(e=f._POSTHOG_REMOTE_CONFIG)||null==(t=e[this.instance.config.token])?void 0:t.config}_loadRemoteConfigJs(e){var t,i,s;null!=(t=f.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=f.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"remote-config",()=>e(this.remoteConfig)):(sp.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return sp.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void sp.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(e=>{if(!e)return sp.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(e=>{this.onRemoteConfig(e)});this.onRemoteConfig(e)})}catch(e){sp.error("Error loading remote config",e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):sp.info("__preview_remote_config is disabled. Logging config instead",e):sp.error("Failed to fetch remote config from PostHog.")}}var sf,sv=null!=n&&n.location?to(n.location.hash,"__posthog")||to(location.hash,"state"):null,sm="_postHogToolbarParam
1s",sb=B("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(sf||(sf={}));class sy{constructor(e){this.instance=e}setToolbarState(e){f.ph_toolbar_state=e}getToolbarState(){var e;return null!=(e=f.ph_toolbar_state)?e:sf.UNINITIALIZED}maybeLoadToolbar(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!n||!u)return!1;i=null!=(e=i)?e:n.location,r=null!=(t=r)?t:n.history;try{if(!s){try{n.localStorage.setItem("test","test"),n.localStorage.removeItem("test")}catch(e){return!1}s=null==n?void 0:n.localStorage}var o,a=sv||to(i.hash,"__posthog")||to(i.hash,"state"),l=a?Q(()=>JSON.parse(atob(decodeURIComponent(a))))||Q(()=>JSON.parse(decodeURIComponent(a))):null;return l&&"ph_authorize"===l.action?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?i.hash=l.desiredHash:r?r.replaceState(r.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(s.getItem(sm)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=f.ph_load_toolbar||f.ph_load_editor;!L(t)&&P(t)?t(e,this.instance):sb.warn("No toolbar load function found")}loadToolbar(e){var t,i,s=!(null==u||!u.getElementById(eD));if(!n||s)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,o=j(j({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(n.localStorage.setItem(sm,JSON.stringify(j(j({},o),{},{source:void 0}))),this.getToolbarState()===sf.LOADED)?this._callLoadToolbar(o):this.getToolbarState()===sf.UNINITIALIZED&&(this.setToolbarState(sf.LOADING),null==(t=f.__PosthogExtensions__)||null==(i=t.loadExternalDependency)||i.call(t,this.instance,"toolbar",e=>{if(e)return sb.error("[Toolbar] Failed to load",e),void this.setToolbarState(sf.UNINITIALIZED);this.setToolbarState(sf.LOADED),this._callLoadToolbar(o)}),et(n,"turbolinks:load",()=>{this.setToolbarState(sf.UNINITIALIZED),this.loadToolbar(o)})),!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}}class sw{constructor(e){W(this,"isPaused",!0),W(this,"queue",[]),W(this,"flushTimeoutMs",3e3),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=Object.values(this.queue.length>0?this.formatQueue():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.sendRequest(j(j({},e),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue();for(var i in t)!function(i){var s=t[i],n=(new Date).getTime();s.data&&C(s.data)&&Y(s.data,e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp}),e.sendRequest(s)}(i)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return Y(this.queue,t=>{var i,s=(t?t.batchKey:null)||t.url;void 0===e[s]&&(e[s]=j(j({},t),{},{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.queue=[],e}}var sS=function(e){var t,i,s,n,r="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<s;n++){var o=e.charCodeAt(n),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),O(a)||(i>t&&(r+=e.substring(t,i)),r+=a,t=i=n+1)}return i>t&&(r+=e.substring(t,e.length)),r},sE=!!_||!!h,sk="text/plain",sx=(e,t)=>{var[i,s]=e.split("?"),n=j({},t);null==s||s.split("&").forEach(e=>{var[t]=e.split("=");delete n[t]});var r=tn(n);return r=r?(s?s+"&":"")+r:s,"".concat(i,"?").concat(r)},sI=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),sC=e=>{var{data:t,compression:i}=e;if(t){if(i===s.GZipJS){var n=new Blob([sn(sr(sI(t)),{mtime:0}
1)],{type:sk});return{contentType:sk,body:n,estimatedSize:n.size}}if(i===s.Base64){var r=(e=>"data="+encodeURIComponent("string"==typeof e?e:sI(e)))(function(e){var t,i,s,n,r,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=sS(e);do t=(r=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=r>>12&63,s=r>>6&63,n=63&r,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(s)+o.charAt(n);while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(sI(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var o=sI(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},sP=[];h&&sP.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:n,estimatedSize:r}=null!=(t=sC(e))?t:{},o=new Headers;Y(e.headers,function(e,t){o.append(t,e)}),s&&o.append("Content-Type",s);var a=e.url,l=null;if(p){var c=new p;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}h(a,j({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&52428.8>(r||0),body:n,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s,n={statusCode:t.status,text:i};if(200===t.status)try{n.json=JSON.parse(i)}catch(e){q.error(e)}null==(s=e.callback)||s.call(e,n)})).catch(t=>{var i;q.error(t),null==(i=e.callback)||i.call(e,{statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),_&&sP.push({transport:"XHR",method:e=>{var t,i=new _;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:n}=null!=(t=sC(e))?t:{};Y(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),i.withCredentials=!0,i.onreadystatechange=()=>{if(4===i.readyState){var t,s={statusCode:i.status,text:i.responseText};if(200===i.status)try{s.json=JSON.parse(i.responseText)}catch(e){}null==(t=e.callback)||t.call(e,s)}},i.send(n)}}),null!=c&&c.sendBeacon&&sP.push({transport:"sendBeacon",method:e=>{var t=sx(e.url,{beacon:"1"});try{var i,{contentType:s,body:n}=null!=(i=sC(e))?i:{},r="string"==typeof n?new Blob([n],{type:s}):n;c.sendBeacon(t,r)}catch(e){}}});var sF=["retriesPerformedSoFar"];class sR{constructor(e){W(this,"isPolling",!1),W(this,"pollIntervalMs",3e3),W(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,void 0!==n&&"onLine"in n.navigator&&(this.areWeOnline=n.navigator.onLine,n.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),n.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=V(e,sF);A(t)&&t>0&&(i.url=sx(i.url,{retry_count:t})),this.instance._send_request(j(j({},i),{},{callback:e=>{var s;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.enqueue(j({retriesPerformedSoFar:t},i)):null==(s=i.callback)||s.call(i,e)}}))}enqueue(e){var t,i,s,n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(s=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,n)))-t/2),Math.ceil(i+s)),o=Date.now()+r;this.queue.push({retryAt:o,requestOptions:e});var a="Enqueued failed request for retry in ".concat(r);navigator.onLine||(a+=" (Browser is offline)"),q.warn(a),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var e=Date.now(),t=[],i=this.queue.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.queue=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(j(j({},e),{},{transport:"sendBeacon"}))}catch(e){q.error(e)}this.queue=[]}}var sT,s$=B("[SessionId]");class sO{constructor(e,t,i){if(W(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||eQ,this._windowIdGenerator=i||eQ;var s,n=this.config.persistence_name||this.config.token,r=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*i$(r,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+n+"_window_id",this._primary_window_exists_storage_key="ph_"+n+"_primary_window_exists",this._canUseSessionStorage()){var o=te.parse(this._window_id_storage_key),a=te.parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:te.remove(this._window_id_storage_key),te.set(this._primary_window_exists_storage_key,!0)}if(null!=(s=this.config.bootstrap)&&s.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){s$.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}
1onSessionId(e){return void 0===this._sessionIdChangedHandlers&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(t=>t!==e)}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&te.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&te.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?te.parse(this._window_id_storage_key):null}_setSessionId(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[eb]:[t,e,i]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[eb];return C(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==n||n.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&te.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var i=t||(new Date).getTime(),[s,n,r]=this._getSessionId(),o=this._getWindowId(),a=A(r)&&r>0&&Math.abs(i-r)>864e5,l=!1,c=!n,u=!e&&Math.abs(i-s)>this.sessionTimeoutMs;c||u||a?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),s$.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),r=i,l=!0):o||(o=this._windowIdGenerator(),l=!0);var d=0===s||!e||a?i:s,h=0===r?(new Date).getTime():r;return this._setWindowId(o),this._setSessionId(n,d,h),e||this.resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach(e=>e(n,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:h,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:s}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(sT||(sT={}));var sL="i.posthog.com";class sA{constructor(e){W(this,"_regionCache",{}),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 uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(sL),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=sT.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=sT.EU:this._regionCache[this.apiHost]=sT.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return this.uiHost+t;if(this.region===sT.CUSTOM)return this.apiHost+t;var i=sL+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}}var sM="posthog-js";function sD(e){var{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=>{if(!("*"===n||n.includes(r.level))||!e.__loaded)return r;r.tags||(r.tags={});var o,a,l,c,u,d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));r.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(r.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h=(null==(o=r.exception)?void 0:o.values)||[];h.map(e=>{e.stacktrace&&(e.stacktrace.type="raw")});var _={$exception_message:(null==(a=h[0])?void 0:a.value)||r.message,$exception_type:null==(l=h[0])?void 0:l.type,$exception_personURL:d,$exception_level:r.level,$exception_list:h,$sentry_event_id:r.event_id,$sentry_exception:r.exception,$sentry_exception_message:(null==(c=h[
10])?void 0:c.value)||r.message,$sentry_exception_type:null==(u=h[0])?void 0:u.type,$sentry_tags:r.tags};return t&&i&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+r.event_id),e.exceptions.sendExceptionEvent(_),r}}class sN{constructor(e,t,i,s,n){this.name=sM,this.setupOnce=function(r){r(sD(e,{organization:t,projectId:i,prefix:s,severityAllowList:n}))}}}var sq,sB,sH,sU=B("[SegmentIntegration]");class sz{constructor(e){this._instance=e}doPageView(e,t){var i,s=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!=(i=null==n?void 0:n.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var i=this._currentPageview;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:r,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=n;if(void 0!==r&&void 0!==o&&void 0!==a&&void 0!==l&&void 0!==c&&void 0!==u){r=Math.ceil(r),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var d=r<=1?1:i$(o/r,0,1),h=r<=1?1:i$(a/r,0,1),_=l<=1?1:i$(c/l,0,1),p=l<=1?1:i$(u/l,0,1);s=K(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:p})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}!function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(sq||(sq={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(sB||(sB={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(sH||(sH={}));class sj{constructor(){W(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.events[e]||[])i(t);for(var s of this.events["*"]||[])s(e,t)}}class sW{constructor(e){W(this,"_debugEventEmitter",new sj),W(this,"checkStep",(e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t)),W(this,"checkStepEvent",(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e,t;void 0!==(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(void 0!==(null==(t=this.instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.actionRegistry)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.actionEvents)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this.instance)&&i.autocapture)){var s,n=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)})}),null==(s=this.instance)||s.autocapture.setElementSelectors(n)}}on(e,t){var i;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null==(i=this.actionRegistry)?void 0:i.size)>0&&this.actionRegistry.forEach(e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)})}_addActionHook(e){this.onAction("actionCaptured",t=>e(t))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.checkStep(e,i))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(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||!sW.matchString(s,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,i){switch(i){case"regex":return!!n&&ts(e,t);case"exact":return t===e;case"contains":return ts(e,sW.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.getElementsList(e).some(e=>!(null!=t&&t.href&&!sW.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&(null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&
1!(null!=t&&t.text&&!sW.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!sW.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))return!1;if(null!=t&&t.selector){var i,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(!s||!s.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class sV{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;void 0===(null==(t=this.instance)?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter(e=>{var t,i,s,n;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(s=i.actions)||null==(n=s.values)?void 0:n.length)>0});0!==t.length&&(null==this.actionMatcher&&(this.actionMatcher=new sW(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,n,r,o,a,l,c,u;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(s=i.actions)&&s.values&&(null==(n=e.conditions)||null==(r=n.actions)||null==(o=r.values)?void 0:o.length)>0&&(null==(a=this.actionMatcher)||a.register(e.conditions.actions.values),null==(l=e.conditions)||null==(c=l.actions)||null==(u=c.values)||u.forEach(t=>{if(t&&t.name){var i=this.actionToSurveys.get(t.name);i&&i.push(e.id),this.actionToSurveys.set(t.name,i||[e.id])}}))}))}setupEventBasedSurveys(e){var t;0!==e.filter(e=>{var t,i,s,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(s=i.events)||null==(n=s.values)?void 0:n.length)>0}).length&&(null==(t=this.instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t,i,s;null==(t=e.conditions)||null==(i=t.events)||null==(s=i.values)||s.forEach(t=>{if(t&&t.name){var i=this.eventToSurveys.get(t.name);i&&i.push(e.id),this.eventToSurveys.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,s,n=(null==(i=this.instance)||null==(s=i.persistence)?void 0:s.props[eP])||[];if(sV.SURVEY_SHOWN_EVENT_NAME==e&&t&&n.length>0){var r,o=null==t||null==(r=t.properties)?void 0:r.$survey_id;if(o){var a=n.indexOf(o);a>=0&&(n.splice(a,1),this._updateActivatedSurveys(n))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,i,s=(null==(t=this.instance)||null==(i=t.persistence)?void 0:i.props[eP])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,i;null==(t=this.instance)||null==(i=t.persistence)||i.register({[eP]:[...new Set(e)]})}getSurveys(){var e,t;return(null==(e=this.instance)||null==(t=e.persistence)?void 0:t.props[eP])||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}W(sV,"SURVEY_SHOWN_EVENT_NAME","survey shown");var sG,sJ,sY,sK,sX,sQ,sZ,s0,s1={},s2=[],s3=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,s5=Array.isArray;function s6(e,t){for(var i in t)e[i]=t[i];return e}function s8(e){var t=e.parentNode;t&&t.removeChild(e)}function s4(e,t,i,s,n){var r={type:e,props:t,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++sY:n,__i:-1,__u:0};return null==n&&null!=sJ.vnode&&sJ.vnode(r),r}function s7(e){return e.children}function s9(e,t){this.props=e,this.context=t}function ne(e,t){if(null==t)return e.__?ne(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?ne(e):null}function nt(e){(!e.__d&&(e.__d=!0)&&sK.push(e)&&!ni.__r++||sX!==sJ.debounceRendering)&&((sX=sJ.debounceRendering)||sQ)(ni)}function ni(){var e,t,i,s,n,r,o,a,l;for(sK.sort(sZ);e=sK.shift();)e.__d&&(t=sK.length,s=void 0,r=(n=(i=e).__v).__e,a=[],l=[],(o=i.__P)&&((s=s6({},n)).__v=n.__v+1,sJ.vnode&&sJ.vnode(s),nl(o,s,n,i.__n,void 0!==o.ownerSVGElement,32&n.__u?[r]:null,a,null==r?ne(n):r,!!(32&n.__u),l),s.__.__k[s.__i]=s,function(e,t,i){t.__d=void 0;for(var s=0;s<i.length;s++)nc(i[s],i[++s],i[++s]);sJ.__c&&sJ.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){sJ.__e(e,t.__v)}})}(a,s,l),s.__e!=r&&function e(t){var i,s;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,i=0;i<t.__k.length;i++)if(null!=(s=t.__k[i])&&null!=s.__e){t.__e=t.__c.base=s.__e;break}return e(t)}}(s)),sK.length>t&&sK.sort(sZ));ni.__r=0}function ns(e,t,i,s,n,r,o,a,l,c,u){var d,h,_,p,g,f=s&&s.__k||s2,v=t.length;for(i.__d=l,function(e,t,i){var s,n,r,o,a,l=t.length,c=i.length,u=c,d=0;for(e.__k=[],s=0;s<l;s++)null!=(n=e.__k[s]=null==(n=t[s])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?s4(null,n,null,null,n):s5(n)?s4(s7,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?s4(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=e,n.__b=e.__b+1,a=function(e,t,i,s){var n=e.key,r=e.type,o=i-1,a=i+1,l=t[i];if(null===l||l&&n==l.key&&r===l.type)return i;if(s>+(null!=l&&0==(131072&l.__u)))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&0==(131072&l.__u)&&n==l.key&&r===l.type)return o;o--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&n==l.key&&r===l.type)return a;a++}}return -1}(n,i,o=s+d,u),n.__i=a,r=null,-1!==a&&(u--,(r=i[a])&&(r.__u|=131072)),null==r||null===r.__v?(-1==a&&d--,"function"!=typeof n.type&&(n.__u|=65536)):a!==o&&(a===o+1?d++:a>o?u>l-o?d+=a-o:d--:d=a<o&&a==o-1?a-o:0,a!==s+d&&(n.__u|=65536))):(r=i[s])&&null==r.key&&r.__e&&(r.__e==e.__d&&(e.__d=ne(r)),nu(r,r,!1),i[s]=null,u--);if(u)for(s=0;s<c;s++)null!=(r=i[s])&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=ne(r)),nu(r,r))}(i,t,f),l=i.__d,d=0;d<v;d++)null!=(_=i.__k[d])&&"boolean"!=typeof _&&"function"!=typeof _&&(h=-1===_.__i?s1:f[_.__i]||s1,_.__i=d,nl(e,_,h,n,r,o,a,l,c,u),p=_.__e,_.ref&&h.ref!=_.ref&&(h.ref&&nc(h.ref,null,_),u.push(_.ref,_.__c||p,_)),null==g&&null!=p&&(g=p),65536&_.__u||h.__k===_.__k?l=function e(t,i,s){var n,r;if("function"==typeof t.type){for(n=t.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=t,i=e(n[r],i,s));return i}return t.__e!=i&&(s.insertBefore(t.__e,i||null),i=t.__e),i&&i.nextSibling}
vendor: 4,745 bytes, line 1
1(_,l,e):"function"==typeof _.type&&void 0!==_.__d?l=_.__d:p&&(l=p.nextSibling),_.__d=void 0,_.__u&=-196609);i.__d=l,i.__e=g}function nn(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||s3.test(t)?i:i+"px"}function nr(e,t,i,s,n){var r;e:if("style"===t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof s&&(e.style.cssText=s=""),s)for(t in s)i&&t in i||nn(e.style,t,"");if(i)for(t in i)s&&i[t]===s[t]||nn(e.style,t,i[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?s?i.u=s.u:(i.u=Date.now(),e.addEventListener(t,r?na:no,r)):e.removeEventListener(t,r?na:no,r);else{if(n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,i))}}function no(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(sJ.event?sJ.event(e):e)}function na(e){return this.l[e.type+!0](sJ.event?sJ.event(e):e)}function nl(e,t,i,s,n,r,o,a,l,c){var u,d,h,_,p,g,f,v,m,b,y,w,S,E,k,x=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(l=!!(32&i.__u),r=[a=t.__e=i.__e]),(u=sJ.__b)&&u(t);e:if("function"==typeof x)try{if(v=t.props,m=(u=x.contextType)&&s[u.__c],b=u?m?m.props.value:u.__:s,i.__c?f=(d=t.__c=i.__c).__=d.__E:("prototype"in x&&x.prototype.render?t.__c=d=new x(v,b):(t.__c=d=new s9(v,b),d.constructor=x,d.render=nd),m&&m.sub(d),d.props=v,d.state||(d.state={}),d.context=b,d.__n=s,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=x.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=s6({},d.__s)),s6(d.__s,x.getDerivedStateFromProps(v,d.__s))),_=d.props,p=d.state,d.__v=t,h)null==x.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==x.getDerivedStateFromProps&&v!==_&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(v,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(v,d.__s,b)||t.__v===i.__v)){for(t.__v!==i.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.forEach(function(e){e&&(e.__=t)}),y=0;y<d._sb.length;y++)d.__h.push(d._sb[y]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(v,d.__s,b),null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(_,p,g)})}if(d.context=b,d.props=v,d.__P=e,d.__e=!1,w=sJ.__r,S=0,"prototype"in x&&x.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(s=s6(s6({},s),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(_,p)),ns(e,s5(k=null!=u&&u.type===s7&&null==u.key?u.props.children:u)?k:[k],t,i,s,n,r,o,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),f&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=r?(t.__e=a,t.__u|=l?160:32,r[r.indexOf(a)]=null):(t.__e=i.__e,t.__k=i.__k),sJ.__e(e,t,i)}else null==r&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=function(e,t,i,s,n,r,o,a,l){var c,u,d,h,_,p,g,f=i.props,v=t.props,m=t.type;if("svg"===m&&(n=!0),null!=r){for(c=0;c<r.length;c++)if((_=r[c])&&"setAttribute"in _==!!m&&(m?_.localName===m:3===_.nodeType)){e=_,r[c]=null;break}}if(null==e){if(null===m)return document.createTextNode(v);e=n?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,v.is&&v),r=null,a=!1}if(null===m)f===v||a&&e.data===v||(e.data=v);else{if(r=r&&sG.call(e.childNodes),f=i.props||s1,!a&&null!=r)for(f={},c=0;c<e.attributes.length;c++)f[(_=e.attributes[c]).name]=_.value;for(c in f)_=f[c],"children"==c||("dangerouslySetInnerHTML"==c?d=_:"key"===c||c in v||nr(e,c,null,_,n));for(c in v)_=v[c],"children"==c?h=_:"dangerouslySetInnerHTML"==c?u=_:"value"==c?p=_:"checked"==c?g=_:"key"===c||a&&"function"!=typeof _||f[c]===_||nr(e,c,_,f[c],n);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),ns(e,s5(h)?h:[h],t,i,s,n&&"foreignObject"!==m,r,o,r?r[0]:i.__k&&ne(i,0),a,l),null!=r)for(c=r.length;c--;)null!=r[c]&&s8(r[c]);a||(c="value",void 0===p||p===e[c]&&("progress"!==m||p)&&("option"!==m||p===f[c])||nr(e,c,p,f[c],!1),c="checked",void 0!==g&&g!==e[c]&&nr(e,c,g,f[c],!1))}return e}(i.__e,t,i,s,n,r,o,l,c);(u=sJ.diffed)&&u(t)}
vendor: 1,211 bytes, line 1
1function nc(e,t,i){try{"function"==typeof e?e(t):e.current=t}catch(e){sJ.__e(e,i)}}function nu(e,t,i){var s,n;if(sJ.unmount&&sJ.unmount(e),(s=e.ref)&&(s.current&&s.current!==e.__e||nc(s,null,t)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){sJ.__e(e,t)}s.base=s.__P=null,e.__c=void 0}if(s=e.__k)for(n=0;n<s.length;n++)s[n]&&nu(s[n],t,i||"function"!=typeof e.type);i||null==e.__e||s8(e.__e),e.__=e.__e=e.__d=void 0}function nd(e,t,i){return this.constructor(e,i)}sG=s2.slice,sJ={__e:function(e,t,i,s){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,s||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},sY=0,s9.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s6({},this.state),"function"==typeof e&&(e=e(s6({},i),this.props)),e&&s6(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),nt(this))},s9.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),nt(this))},s9.prototype.render=s7,sK=[],sQ="function"==typeof Promise?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,sZ=function(e,t){return e.__v.__b-t.__v.__b},ni.__r=0,s0=0,function(e,t){var i={__c:t="__cC"+s0++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var i,s;return this.getChildContext||(i=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&i.some(function(e){e.__e=!0,nt(e)})},this.sub=function(e){i.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){i.splice(i.indexOf(e),1),t&&t.call(e)}}),e.children}};i.Provider.__=i.Consumer.contextType=i}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0,onPreviewSubmit:()=>{}});var nh=B("[Surveys]"),n_={icontains:e=>!!n&&n.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!n&&-1===n.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!n&&ts(n.location.href,e),not_regex:e=>!!n&&!ts(n.location.href,e),exact:e=>(null==n?void 0:n.location.href)===e,is_not:e=>(null==n?void 0:n.location.href)!==e};class np{constructor(e){this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate"),(()=>{for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);null!=i&&i.startsWith("seenSurvey_")&&e.push(i)}return e}
1)().forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){var e,t,i,s=null==f||null==(e=f.__PosthogExtensions__)?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||s||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new sV(this.instance)),null==(t=f.__PosthogExtensions__)||null==(i=t.loadExternalDependency)||i.call(t,this.instance,"surveys",e=>{var t,i;if(e)return nh.error("Could not load surveys script",e);this._surveyManager=null==(t=f.__PosthogExtensions__)||null==(i=t.generateSurveys)?void 0:i.call(t,this.instance)}))}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new sV(this.instance));var i=this.instance.get_property(eC);if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var i,s,n=t.json.surveys||[],r=n.filter(e=>{var t,i,s,n,r,o,a,l,c,u,d,h;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(s=i.events)?void 0:s.values)&&(null==(n=e.conditions)||null==(r=n.events)||null==(o=r.values)?void 0:o.length)>0||(null==(a=e.conditions)?void 0:a.actions)&&(null==(l=e.conditions)||null==(c=l.actions)?void 0:c.values)&&(null==(u=e.conditions)||null==(d=u.actions)||null==(h=d.values)?void 0:h.length)>0});return r.length>0&&(null==(s=this._surveyEventReceiver)||s.register(r)),null==(i=this.instance.persistence)||i.register({[eC]:n}),e(n)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys(t=>{var i,s=t.filter(e=>!(!e.start_date||e.end_date)).filter(e=>{if(!e.conditions)return!0;var t,i,s,n,r=null==(t=e.conditions)||!t.url||n_[null!=(i=null==(s=e.conditions)?void 0:s.urlMatchType)?i:"icontains"](e.conditions.url),o=null==(n=e.conditions)||!n.selector||(null==u?void 0:u.querySelector(e.conditions.selector));return r&&o}),n=null==(i=this._surveyEventReceiver)?void 0:i.getSurveys();return e(s.filter(e=>{if(!(e.linked_flag_key||e.targeting_flag_key||e.internal_targeting_flag_key||null!=(t=e.feature_flag_keys)&&t.length))return!0;var t,i,s,r,o,a,l,c,u,d,h,_=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),p=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),g=(null==(i=e.conditions)?void 0:i.events)&&(null==(s=e.conditions)||null==(r=s.events)?void 0:r.values)&&(null==(o=e.conditions)||null==(a=o.events)?void 0:a.values.length)>0,f=(null==(l=e.conditions)?void 0:l.actions)&&(null==(c=e.conditions)||null==(u=c.actions)?void 0:u.values)&&(null==(d=e.conditions)||null==(h=d.actions)?void 0:h.values.length)>0,v=!g&&!f||(null==n?void 0:n.includes(e.id)),m=this._canActivateRepeatedly(e),b=!(e.internal_targeting_flag_key&&!m)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key),y=this.checkFlags(e);return _&&p&&b&&v&&y}))},t)}checkFlags(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every(e=>{var{key:t,value:i}=e;return!t||!i||this.instance.featureFlags.isFeatureEnabled(i)})}getNextSurveyStep(e,t,i){var s,n=e.questions[t],r=t+1;if(null==(s=n.branching)||!s.type)return t===e.questions.length-1?sH.End:r;if(n.branching.type===sH.End)return sH.End;if(n.branching.type===sH.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===sH.ResponseBased){if(n.type===sB.SingleChoice){var o,a,l=n.choices.indexOf("".concat(i));if(null!=(o=n.branching)&&null!=(a=o.responseValues)&&a.hasOwnProperty(l)){var c=n.branching.responseValues[l];return Number.isInteger(c)?c:c===sH.End?sH.End:r}}else if(n.type===sB.Rating){if("number"!=typeof i||!Number.isInteger(i))throw Error("The response type must be an integer");var u,d,h=function(e,t){if(3===t){if(e<1||e>3)throw Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw Error("The scale must be one of: 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(d=u.responseValues)&&d.hasOwnProperty(h)){var _=n.branching.responseValues[h];return Number.isInteger(_)?_:_===sH.End?sH.End:r}}return r}return nh.warn("Falling back to next question index due to unexpected branching type"),r}_canActivateRepeatedly(e){var t;return L(null==(t=f.__PosthogExtensions__)?void 0:t.canActivateRepeatedly)?(nh.warn("init was not called"),!1):f.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){L(this._surveyManager)?nh.warn("init was not called"):this.getSurveys(t=>{var i=t.filter(t=>t.id===e)[0];this._surveyManager.canRenderSurvey(i)})}renderSurvey(e,t){L(this._surveyManager)?nh.warn("init was not called"):this.getSurveys(i=>{var s=i.filter(t=>t.id===e)[0];this._surveyManager.renderSurvey(s,null==u?void 0:u.querySelector(t))})}}var ng=B("[RateLimiter]");class nf{constructor(e){var t,i;W(this,"serverLimits",{}),W(this,"lastEventRateLimited",!1),W(this,"checkForLimiting",e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{ng.info("".concat(e||"events"," is quota limited.")),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void ng.warn('could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}}),this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=e.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,i,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=(new Date).getTime(),r=null!=(e=null==(t=this.instance.persistence)?void 0:t.get_property(e$))?e:{tokens:this.captureEventsBurstLimit,last:n};r.tokens+=(n-r.last)/1e3*this.captureEventsPerSecond,r.last=n,r.tokens>this.captureEventsBurstLimit&&(r.tokens=this.captureEventsBurstLimit);var o=r.tokens<1;return o||s||(r.tokens=Math.max(0,r.tokens-1)),!o||this.lastEventRateLimited||s||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(i=this.instance.persistence)||i.set_property(e$,r),{isRateLimited:o,remainingTokens:r.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var nv=()=>j({initialPathName:(null==d?void 0:d.pathname)||"",referringDomain:t2.referringDomain()},t2.campaignParams());class nm{constructor(e,t,i){W(this,"_onSessionIdCallback",e=>{var t=this._getStoredProps();if(!t||t.sessionId!==e){var i={sessionId:e,props:this._sessionSourceParamGenerator()};this._persistence.register({[eT]:i})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||nv,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[eT]}getSessionProps(){var e,t=null==(e=this._getStoredProps())?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}var nb=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],ny=function(e,t){if(!e)return!1;var i=e.toLowerCase();return nb.concat(t||[]).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},nw=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&ny(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>ny(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};class nS{constructor(){this.clicks=[]}isRageClick(e,t,i){var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<30&&i-s.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var nE=B("[Dead Clicks]"),nk=()=>!0,nx=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(eu)),s=e.instance.config.capture_dead_clicks;return M(s)?s:i};
1class nI{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[eu]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,i,s;null!=(t=f.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=f.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"dead-clicks-autocapture",t=>{t?nE.error("failed to load script",t):e()})}start(){var e;if(u){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=f.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=F(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=f.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(u),nE.info("starting...")}}else nE.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,nE.info("stopping..."))}}var nC=B("[Heatmaps]");function nP(e){return F(e)&&"clientX"in e&&"clientY"in e&&A(e.clientX)&&A(e.clientY)}class nF{constructor(e){var t;W(this,"rageclicks",new nS),W(this,"_enabledServerSide",!1),W(this,"_initialized",!1),W(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[ea]),null==n||n.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var e=5e3;return F(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return void 0===this.instance.config.capture_heatmaps?void 0===this.instance.config.enable_heatmaps?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this._initialized||(nC.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds));else{var e,t;clearInterval(null!=(e=this._flushInterval)?e:void 0),null==(t=this.deadClicksCapture)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ea]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){n&&u&&(et(u,"click",e=>this._onClick(e||(null==n?void 0:n.event)),!1,!0),et(u,"mousemove",e=>this._onMouseMove(e||(null==n?void 0:n.event)),!1,!0),this.deadClicksCapture=new nI(this.instance,nk,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var s=e;s&&t9(s)&&!ie(s,"body")&&s!==i;){if(y(t,null==n?void 0:n.getComputedStyle(s).position))return!0;s=id(s)}return!1}(ic(e),["fixed","sticky"],r);return{x:e.clientX+(o?0:s),y:e.clientY+(o?0:i),target_fixed:o,type:t}}_onClick(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(!t7(e.target)&&nP(e)){var s=this._getProperties(e,i);null!=(t=this.rageclicks)&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(j(j({},s),{},{type:"rageclick"})),this._capture(s)}}_onMouseMove(e){!t7(e.target)&&nP(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(n){var t=n.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!R(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class nR{constructor(e){W(this,"_updateScrollData",()=>{this.context||(this.context={});var e,t,i,s,n=this.scrollElement(),r=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=r+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.context.lastScrollY=Math.ceil(r),this.context.maxScrollY=Math.max(r,null!=(e=this.context.maxScrollY)?e:0),this.context.maxScrollHeight=Math.max(o,null!=(t=this.context.maxScrollHeight)?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!=(i=this.context.maxContentY)?i:0),this.context.maxContentHeight=Math.max(l,null!=(s=this.context.maxContentHeight)?s:0)}),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){null==n||n.addEventListener("scroll",this._updateScrollData,!0),null==n||n.addEventListener("scrollend",this._updateScrollData,!0),null==n||n.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==n?void 0:n.document.documentElement;for(var e of C(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]){var t=null==n?void 0:n.document.querySelector(e);
1if(t)return t}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return n&&(n.scrollY||n.pageYOffset||n.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return n&&(n.scrollX||n.pageXOffset||n.document.documentElement.scrollLeft)||0}}var nT=B("[AutoCapture]");function n$(e,t){return t.length>e?t.slice(0,e)+"...":t}class nO{constructor(e){W(this,"_initialized",!1),W(this,"_isDisabledServerSide",null),W(this,"rageclicks",new nS),W(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,i=F(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}_addDomEventHandlers(){if(this.isBrowserSupported()){if(n&&u){var e=e=>{e=e||(null==n?void 0:n.event);try{this._captureEvent(e)}catch(e){nT.error("Failed to capture event",e)}},t=e=>{e=e||(null==n?void 0:n.event),this._captureEvent(e,m)};et(u,"submit",e,!1,!0),et(u,"change",e,!1,!0),et(u,"click",e,!1,!0),this.config.capture_copied_text&&(et(u,"copy",t,!1,!0),et(u,"cut",t,!1,!0))}}else nT.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}
1onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[eo]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,i=[];return null==(t=this._elementSelectors)||t.forEach(t=>{var s=null==u?void 0:u.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[eo];if(O(this._isDisabledServerSide)&&!M(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=null!=(t=this._isDisabledServerSide)?t:!!i;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var i,s=ic(e);it(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var r=t===m;if(s&&function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!n||!e||ie(e,"html")||!t9(e)||null!=i&&i.url_allowlist&&!ir(i.url_allowlist)||null!=i&&i.url_ignorelist&&ir(i.url_ignorelist))return!1;if(null!=i&&i.dom_event_allowlist){var o=i.dom_event_allowlist;if(o&&!o.some(e=>t.type===e))return!1}for(var a=!1,l=[e],c=!0,u=e;u.parentNode&&!ie(u,"body");)if(ii(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!(c=id(u)))break;if(s||iu.indexOf(c.tagName.toLowerCase())>-1)a=!0;else{var d=n.getComputedStyle(c);d&&"pointer"===d.getPropertyValue("cursor")&&(a=!0)}l.push(c),u=c}if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(void 0===i)return!0;var s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e){var r=s(n);if("object"==typeof r)return r.v}return!1}(l,i)||!function(e,t){var i=null==t?void 0:t.css_selector_allowlist;if(void 0===i)return!0;var s=function(e){if(i.some(t=>e.matches(t)))return{v:!0}};for(var n of e){var r=s(n);if("object"==typeof r)return r.v}return!1}(l,i))return!1;var h=n.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var _=e.tagName.toLowerCase();switch(_){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return a?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(iu.indexOf(_)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.config,r,r?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){for(var i,s,{e:r,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],d=e;d.parentNode&&!ie(d,"body");)ii(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var h,_=[],p={},g=!1,f=!1;if(Y(u,e=>{var t=ih(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&iw(g)&&g),y(io(e),"ph-no-capture")&&(f=!0),_.push(function(e,t,i,s){var n=e.tagName.toLowerCase(),r={tag_name:n};iu.indexOf(n)>-1&&!i&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?r.$el_text=n$(1024,iS(e)):r.$el_text=n$(1024,il(e)));var o=io(e);o.length>0&&(r.classes=o.filter(function(e){return""!==e})),Y(e.attributes,function(i){var n;if((!i_(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&iw(i.value)&&(!T(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=is(o).join(" ")),r["attr__"+i.name]=n$(1024,o)}});for(var a=1,l=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!t9(t));return t}(c);)a++,c.tagName===e.tagName&&l++;return r.nth_child=a,r.nth_of_type=l,r}(e,o,a,l)),K(p,function(e){if(!ih(e))return{};var t={};return Y(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&&iw(s)&&(t[i]=s)}}),t}(e))}),f)return{props:{},explicitNoCapture:f};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?_[0].$el_text=iS(e):_[0].$el_text=il(e)),g){_[0].attr__href=g;
1var v,m,b=null==(v=ti(g))?void 0:v.host,w=null==n||null==(m=n.location)?void 0:m.host;b&&w&&b!==w&&(h=g)}return{props:K({$event_type:r.type,$ce_version:1},c?{}:{$elements:_},{$elements_chain:_.map(e=>{var t,i,s,n={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)?C(t)?t:is(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return X(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return n.attributes[t]=i}),n}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))s+=".".concat(n.replace(/"/g,""));var r=j(j(j(j({},e.text?{text:e.text}:{}),{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),o={};return X(r).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return o[iE(t.toString())]=iE(i.toString())}),s+=":",s+=X(r).map(e=>{var[t,i]=e;return"".concat(t,'="').concat(i,'"')}).join("")}).join(";")},null!=(i=_[0])&&i.$el_text?{$el_text:null==(s=_[0])?void 0:s.$el_text}:{},h&&"click"===r.type?{$external_click_url:h}:{},p)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsC
1hainAsString});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===m){var c,u=ia(null==n||null==(c=n.getSelection())?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return P(null==u?void 0:u.querySelectorAll)}}var nL=B("[TracingHeaders]");class nA{constructor(e){W(this,"_restoreXHRPatch",void 0),W(this,"_restoreFetchPatch",void 0),W(this,"_startCapturing",()=>{var e,t,i,s;void 0===this._restoreXHRPatch&&(null==(e=f.__PosthogExtensions__)||null==(t=e.tracingHeadersPatchFns)||t._patchXHR(this.instance.sessionManager)),void 0===this._restoreFetchPatch&&(null==(i=f.__PosthogExtensions__)||null==(s=i.tracingHeadersPatchFns)||s._patchFetch(this.instance.sessionManager))}),this.instance=e}_loadScript(e){var t,i,s;null!=(t=f.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=f.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"tracing-headers",t=>{if(t)return nL.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(n1||(n1={}));class nM{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?n1.DENIED:this.storedConsent}isOptedOut(){return this.consent===n1.DENIED||this.consent===n1.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,+!!e,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return"1"===e?n1.GRANTED:"0"===e?n1.DENIED:n1.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?e5:e2;var t="localStorage"===e?e2:e5;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!ei([null==c?void 0:c.doNotTrack,null==c?void 0:c.msDoNotTrack,f.doNotTrack],e=>y([!0,1,"1","yes"],e))}}var nD=B("[ExceptionAutocapture]");class nN{constructor(e){var t;W(this,"originalOnUnhandledRejectionHandler",void 0),W(this,"startCapturing",()=>{var e,t,i,s;if(n&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var r=null==(e=f.__PosthogExtensions__)||null==(t=e.errorWrappingFunctions)?void 0:t.wrapOnError,o=null==(i=f.__PosthogExtensions__)||null==(s=i.errorWrappingFunctions)?void 0:s.wrapUnhandledRejection;if(r&&o)try{this.unwrapOnError=r(this.captureException.bind(this)),this.unwrapUnhandledRejection=o(this.captureException.bind(this))}catch(e){nD.error("failed to start",e),this.stopCapturing()}else nD.error("failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!(null==(t=this.instance.persistence)||!t.props[el]),this.startIfEnabled()}get isEnabled(){var e;return null!=(e=this.remoteEnabled)&&e}get isCapturing(){var e;return!(null==n||null==(e=n.onerror)||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(nD.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,i;this.hasHandlers&&e(),null==(t=f.__PosthogExtensions__)||null==(i=t.loadExternalDependency)||i.call(t,this.instance,"exception-autocapture",t=>{if(t)return nD.error("failed to load script",t);e()})}stopCapturing(){var e,t;null==(e=this.unwrapOnError)||e.call(this),null==(t=this.unwrapUnhandledRejection)||t.call(this)}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t,this.instance.persistence&&this.instance.persistence.register({[el]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}}var nq=B("[Web Vitals]");class nB{constructor(e){var t;W(this,"_enabledServerSide",!1),W(this,"_initialized",!1),W(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),W(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((e,t)=>
1j(j({},e),{},{["$web_vitals_".concat(t.name,"_event")]:j({},t),["$web_vitals_".concat(t.name,"_value")]:t.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),W(this,"_addToBuffer",e=>{var t,i=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(void 0===i)nq.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this._currentURL();void 0!==s&&(L(null==e?void 0:e.name)||L(null==e?void 0:e.value)?nq.error("Invalid metric received",e):this._maxAllowedValue&&e.value>=this._maxAllowedValue?nq.error("Ignoring metric with value >= "+this._maxAllowedValue,e):(this.buffer.url!==s&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),void 0===this.buffer.url&&(this.buffer.url=s),this.buffer.firstMetricTimestamp=void 0===this.buffer.firstMetricTimestamp?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(j(j({},e),{},{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),W(this,"_startCapturing",()=>{var e,t,i,s,n=f.__PosthogExtensions__;void 0===n||void 0===n.postHogWebVitalsCallbacks||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=n.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this._addToBuffer.bind(this)),this._initialized=!0):nq.error("web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[ec]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=F(this.instance.config.capture_performance)?null==(e=this.instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return void 0===i?(null==(t=this.instance.persistence)?void 0:t.props[ed])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(F(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=F(this.instance.config.capture_performance)&&A(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){var e=F(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return M(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(nq.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=F(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=F(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[ec]:t}),this.instance.persistence.register({[ed]:i})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,i,s;null!=(t=f.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=f.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"web-vitals",t=>{t?nq.error("failed to load script",t):e()})}_currentURL(){var e=n?n.location.href:void 0;return e||nq.error("Could not determine current URL"),e}}var nH={icontains:(e,t)=>!!n&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!n&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!n&&ts(t.href,e),not_regex:(e,t)=>!!n&&!ts(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class nU{constructor(e){var t=this;W(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.getWebExperiments(e=>{nU.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach(e
1=>{if(e.feature_flag_key){t._flagToExperiments&&(nU.logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t._flagToExperiments)||i.set(e.feature_flag_key,e));var i,s=t.instance.getFeatureFlag(e.feature_flag_key);T(s)&&e.variants[s]&&t.applyTransforms(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var n in e.variants){var r=e.variants[n];nU.matchesTestVariant(r)&&t.applyTransforms(e.name,n,r.transforms)}})},e)}),this.instance=e,this.instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())nU.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(L(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nU.logInfo("applying feature flags",e),e.forEach(e=>{var t;if(this._flagToExperiments&&null!=(t=this._flagToExperiments)&&t.has(e)){var i,s=this.instance.getFeatureFlag(e),n=null==(i=this._flagToExperiments)?void 0:i.get(e);s&&null!=n&&n.variants[s]&&this.applyTransforms(n.name,s,n.variants[s].transforms)}})}}previewWebExperiment(){var e=nU.getWindowLocation();if(null!=e&&e.search){var t=tr(null==e?void 0:e.search,"__experiment_id"),i=tr(null==e?void 0:e.search,"__experiment_variant");t&&i&&(nU.logInfo("previewing web experiments ".concat(t," && ").concat(i)),this.getWebExperiments(e=>{this.showPreviewWebExperiment(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.instance.config.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=".concat(this.instance.config.token)),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}showPreviewWebExperiment(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(nU.logInfo("Previewing web experiment [".concat(s[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(s[0].name,t,s[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!L(e.conditions)&&nU.matchUrlConditions(e)&&nU.matchUTMConditions(e)}static matchUrlConditions(e){if(L(e.conditions)||L(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,n,r=nU.getWindowLocation();return!!r&&(null==(i=e.conditions)||!i.url||nH[null!=(s=null==(n=e.conditions)?void 0:n.urlMatchType)?s:"icontains"](e.conditions.url,r))}
1static getWindowLocation(){return null==n?void 0:n.location}static matchUTMConditions(e){if(L(e.conditions)||L(null==(i=e.conditions)?void 0:i.utm))return!0;var t=t2.campaignParams();if(t.utm_source){var i,s,n,r,o,a,l,c,u,d,h,_,p,g,f,v,m,b=null==(s=e.conditions)||null==(n=s.utm)||!n.utm_campaign||(null==(r=e.conditions)||null==(o=r.utm)?void 0:o.utm_campaign)==t.utm_campaign,y=null==(a=e.conditions)||null==(l=a.utm)||!l.utm_source||(null==(c=e.conditions)||null==(u=c.utm)?void 0:u.utm_source)==t.utm_source,w=null==(d=e.conditions)||null==(h=d.utm)||!h.utm_medium||(null==(_=e.conditions)||null==(p=_.utm)?void 0:p.utm_medium)==t.utm_medium,S=null==(g=e.conditions)||null==(f=g.utm)||!f.utm_term||(null==(v=e.conditions)||null==(m=v.utm)?void 0:m.utm_term)==t.utm_term;return b&&w&&S&&y}return!1}static logInfo(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];q.info("[WebExperiments] ".concat(e),i)}applyTransforms(e,t,i,s){var n;this._is_bot()?nU.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){nU.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),i);var n,r,o=0,a=null==(n=document)?void 0:n.querySelectorAll(i.selector);null==a||a.forEach(e=>{o+=1,i.attributes&&i.attributes.forEach(t=>{switch(t.name){case"text":e.innerText=t.value;break;case"html":e.innerHTML=t.value;break;case"cssClass":e.className=t.value;break;default:e.setAttribute(t.name,t.value)}}),i.text&&(e.innerText=i.text),i.html&&(e.parentElement?e.parentElement.innerHTML=i.html:e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:s,$web_experiment_document_url:null==(r=nU.getWindowLocation())?void 0:r.href,$web_experiment_elements_modified:o})}}):(nU.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:s,$web_experiment_variant:t,$web_experiment_document_url:null==(n=nU.getWindowLocation())?void 0:n.href,$web_experiment_elements_modified:0}))}_is_bot(){return c&&this.instance?nw(c,this.instance.config.custom_blocked_useragents):void 0}}class nz{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var nj=["$set_once","$set"],nW=B("[SiteApps]");class nV{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var i=this.globalsForEvent(t);this.bufferedInvocations.push(i),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var e,t;return null==(e=f._POSTHOG_REMOTE_CONFIG)||null==(t=e[this.instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,n,r,o,a,l={},c=this.instance.get_property("$groups")||[];for(var[u,d]of Object.entries(this.instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:d};var{$set_once:h,$set:_}=e;return{event:j(j({},V(e,nj)),{},{properties:j(j(j({},e.properties),_?{$set:j(j({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{}),_)}:{}),h?{$set_once:j(j({},null!=(s=null==(n=e.properties)?void 0:n.$set_once)?s:{}),h)}:{}),elements_chain:null!=(r=null==(o=e.properties)?void 0:o.$elements_chain)?r:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var i=i=>{var s;for(var n of(this.apps[e.id].errored=!i,this.apps[e.id].loaded=!0,nW.info("Site app with id ".concat(e.id," ").concat(i?"loaded":"errored")),i&&this.bufferedInvocations.length&&(nW.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach(e
1=>{var i;return null==(i=t.processEvent)?void 0:i.call(t,e)})),Object.values(this.apps)))if(!n.loaded)return;null==(s=this.stopBuffering)||s.call(this)};try{var{processEvent:s}=e.init({posthog:this.instance,callback:e=>{i(e)}});s&&(t.processEvent=s)}catch(t){nW.error("Error while initializing PostHog app with config id ".concat(e.id),t),i(!1)}}onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t,i=this.globalsForEvent(e);for(var s of Object.values(this.apps))try{null==(t=s.processEvent)||t.call(s,i)}catch(t){nW.error("Error while processing event ".concat(e.event," for site app ").concat(s.id),t)}}}onRemoteConfig(e){var t,i,s,n=this;if(null!=(t=this.siteAppLoaders)&&t.length){if(!this.isEnabled)return void nW.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var r of this.siteAppLoaders)this.setupSiteApp(r);this.instance.on("eventCaptured",e=>this.onCapturedEvent(e))}else if(null==(i=this.stopBuffering)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var o=function(e,t){var i,s;f["__$$ph_site_app_".concat(e)]=n.instance,null==(i=f.__PosthogExtensions__)||null==(s=i.loadSiteApp)||s.call(i,n.instance,t,t=>{if(t)return nW.error("Error while initializing PostHog app with config id ".concat(e),t)})};for(var{id:a,url:l}of e.siteApps)o(a,l)}else nW.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var nG={},nJ=()=>{},nY="posthog",nK=!sE&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),nX=()=>{var e,t,i;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:!!T(i=null==(t=null==u?void 0:u.location)?void 0:t.hostname)&&"herokuapp.com"!==i.split(".").slice(-2).join("."),persistence:"localStorage+cookie",persistence_name:"",loaded:nJ,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:d&&T(null==d?void 0:d.search)&&-1!==d.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==n||null==(e=n.location)?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;q.error(t)},get_device_id:e=>e,_onCapture:nJ,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},nQ=e=>{var t={};void 0===e.process_person||(t.person_profiles=e.process_person),void 0===e.xhr_headers||(t.request_headers=e.xhr_headers),void 0===e.cookie_name||(t.persistence_name=e.cookie_name),void 0===e.disable_cookie||(t.disable_persistence=e.disable_cookie);var i=K({},t,e);return C(e.property_blacklist)&&(void 0===e.property_denylist?i.property_denylist=e.property_blacklist:C(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:q.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class nZ{constructor(){W(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){q.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class n0{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){W(this,"webPerformance",new nZ),W(this,"version",v.LIB_VERSION),W(this,"_internalEventEmitter",new sj),this.config=nX(),this.SentryIntegration=sN,this.sentryIntegration=e=>(function(e,t){var i=sD(e,t);return{name:sM,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new eW(this),this.toolbar=ne
1w sy(this),this.scrollManager=new nR(this),this.pageViewManager=new sz(this),this.surveys=new np(this),this.experiments=new nU(this),this.exceptions=new nz(this),this.rateLimiter=new nf(this),this.requestRouter=new sA(this),this.consent=new nM(this),this.people={set:(e,t,i)=>{var s=T(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=T(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>q.info('send "'.concat(null==e?void 0:e.event,'"'),e))}init(e,t,i){if(i&&i!==nY){var s,n=null!=(s=nG[i])?s:new n0;return n._init(e,t,i),nG[i]=n,nG[nY][i]=n,n}return this._init(e,t,i)}_init(e){var t,i,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;if(void 0===e||$(e))return q.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 q.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],o.person_profiles&&(this._initialPersonProfilesConfig=o.person_profiles),this.set_config(K({},nX(),nQ(o),{name:a,token:e})),this.config.on_xhr_error&&q.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=o.disable_compression?void 0:s.GZipJS,this.persistence=new t5(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new t5(j(j({},this.config),{},{persistence:"sessionStorage"}));var l=j({},this.persistence.props),c=j({},this.sessionPersistence.props);if(this._requestQueue=new sw(e=>this._send_retriable_request(e)),this._retryQueue=new sR(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new sO(this),this.sessionPropsManager=new nm(this.sessionManager,this.persistence)),new nA(this).startIfEnabledOrStop(),this.siteApps=new nV(this),null==(t=this.siteApps)||t.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new s_(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new nO(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new nF(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new nB(this),this.exceptionObserver=new nN(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new nI(this,nx),this.deadClicksAutocapture.startIfEnabled(),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&q.info("Starting in debug mode",{this:this,config:o,thisC:j({},this.config),p:l,s:c}),this._sync_opt_out_with_persistence(),void 0!==(null==(i=o.bootstrap)?void 0:i.distinctID)){var u,d,h=this.config.get_device_id(eQ()),_=null!=(u=o.bootstrap)&&u.isIdentifiedID?h:o.bootstrap.distinctID;this.persistence.set_property(eR,null!=(d=o.bootstrap)&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:_})}if(this._hasBootstrappedFeatureFlags()){var p,g,f=Object.keys((null==(p=o.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var t,i;return!(null==(t=o.bootstrap)||null==(i=t.featureFlags)||!i[e])}).reduce((e,t)=>{var i,s;return e[t]=(null==(i=o.bootstrap)||null==(s=i.featureFlags)?void 0:s[t])||!1,e},{}),m=Object.keys((null==(g=o.bootstrap)?void 0:g.featureFlagPayloads)||{}).filter(e=>f[e]).reduce((e,t)=>{var i,s,n,r;return null!=(i=o.bootstrap)&&null!=(s=i.featureFlagPayloads)&&s[t]&&(e[t]=null==(n=o.bootstrap)||null==(r=n.featureFlagPayloads)?void 0:r[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:f,featureFlagPayloads:m})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:eN,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(eQ());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(eR,"anonymous")}return null==n||null==(r=n.addEventListener)||r.call(n,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.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()||eQ();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(eR,"identified")),t()},n=i.user();"then"in n&&P(n.then)?n.then(e=>s(e)):s(n)}(e,()=>{var s;i.register((Promise&&Promise.resolve||sU.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()||(sU.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(sU.info("UserId set, identifying with PostHog"),e.identify(t.event.userId)
1);var s,n=e._calculate_event_properties(i,null!=(s=t.event.properties)?s:{},new Date);return t.event.properties=Object.assign({},n,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,"$pageview"),identify:e=>s(e,"$identify"),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this._loaded()):this._loaded(),P(this.config._onCapture)&&this.config._onCapture!==nJ&&(q.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this}_onRemoteConfig(e){var t,i,n,r,o,a,l,c,d;if(!u||!u.body)return q.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=y(e.supportedCompression,s.GZipJS)?s.GZipJS:y(e.supportedCompression,s.Base64)?s.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(n=this.sessionRecording)||n.onRemoteConfig(e),null==(r=this.autocapture)||r.onRemoteConfig(e),null==(o=this.heatmaps)||o.onRemoteConfig(e),null==(a=this.surveys)||a.onRemoteConfig(e),null==(l=this.webVitalsAutocapture)||l.onRemoteConfig(e),null==(c=this.exceptionObserver)||c.onRemoteConfig(e),null==(d=this.deadClicksAutocapture)||d.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){q.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new sg(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||J(this.__request_queue,e=>this._send_retriable_request(e)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null==(e=this._requestQueue)||e.unload(),null==(t=this._retryQueue)||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(nK?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=sx(e.url,{ip:+!!this.config.ip}),e.headers=j({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,n=j({},e);n.timeout=n.timeout||6e4,n.url=sx(n.url,{_:(new Date).getTime().toString(),ver:v.LIB_VERSION,compression:n.compression});var r=null!=(t=n.transport)?t:"fetch",o=null!=(i=null==(s=ei(sP,e=>e.transport===r))?void 0:s.method)?i:sP[0].method;if(!o)throw Error("No available transport method");o(n)})(j(j({},e),{},{callback:t=>{var i,s,n;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(s=(n=this.config).on_request_error)||s.call(n,t)),null==(i=e.callback)||i.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,i=[],s=[],n=[];J(e,e=>{e&&(C(t=e[0])?n.push(e):P(e)?e.call(this):C(e)&&"alias"===t?i.push(e):C(e)&&-1!==t.indexOf("capture")&&P(this[t])?n.push(e):s.push(e))});var r=function(e,t){J(e,function(e){if(C(e[0])){var i=t;Y(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};r(i,this),r(s,this),r(n,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(void 0!==e&&T(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var n=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var r,o,a,l,c=new Date,u=(null==i?void 0:i.timestamp)||c,d=eQ(),h={uuid:d,event:e,properties:this._calculate_event_properties(e,t||{},u,d)};n&&(h.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var _=this._calculate_set_once_properties(null==i?void 0:i.$set_once);_&&(h.$set_once=_),(r=h,o=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,a=e=>T(e)&&!O(o)?e.slice(0,o):e,l=new Set,h=function e(t,i){var s;return t!==Object(t)?a?a(t,i):t:l.has(t)?void 0:(l.add(t),C(t)?(s=[],J(t,t=>{s.push(e(t))})):(s={}
1,Y(t,(t,i)=>{l.has(t)||(s[i]=e(t,i))})),s)}(r)).timestamp=u,void 0===(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=c);var p=j(j({},h.properties.$set),h.$set);if(R(p)||this.setPersonPropertiesForFlags(p),!L(this.config.before_send)){var g=this._runBeforeSend(h);if(!g)return;h=g}this._internalEventEmitter.emit("eventCaptured",h);var f={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._send_retriable_request(f):this._requestQueue.enqueue(f),h}q.critical("This capture call is ignored due to client rate limiting.")}}else q.error("No event name provided to posthog.capture")}else q.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,i,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),r=j({},t);if(r.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(r.$cklsh_mode=!0),"$snapshot"===e){var o=j(j({},this.persistence.properties()),this.sessionPersistence.properties());return r.distinct_id=o.distinct_id,(!T(r.distinct_id)&&!A(r.distinct_id)||$(r.distinct_id))&&q.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),r}var a,l=t2.properties();if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId();r.$session_id=c,r.$window_id=d}if(this.sessionRecording&&(r.$recording_status=this.sessionRecording.status),this.requestRouter.region===sT.CUSTOM&&(r.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var h=this.sessionPropsManager.getSessionProps();r=K(r,h)}if(a="$pageview"===e?this.pageViewManager.doPageView(i,s):"$pageleave"===e?this.pageViewManager.doPageLeave(i):this.pageViewManager.doEvent(),r=K(r,a),"$pageview"===e&&u&&(r.title=u.title),void 0!==n){var _=i.getTime()-n;r.$duration=parseFloat((_/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(r.$browser_type=this._is_bot()?"bot":"browser"),(r=K({},l,this.persistence.properties(),this.sessionPersistence.properties(),r)).$is_identified=this._isIdentified(),C(this.config.property_denylist)?Y(this.config.property_denylist,function(e){delete r[e]}):q.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(q.error("sanitize_properties is deprecated. Use before_send instead"),r=p(r,e));var f=this._hasPersonProcessing();return r.$process_person_profile=f,f&&this._requirePersonProcessing("_calculate_event_properties"),r}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=K({},this.persistence.get_initial_props(),e||{}),i=this.config.sanitize_properties;return i&&(q.error("sanitize_properties is deprecated. Use before_send instead"),t=i(t,"$set_once")),R(t)?void 0:t}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)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}identify(e,t,i){if(!this.__loaded||!this.persistence)return q.uninitializedWarning("posthog.identify");if(A(e)&&(e=e.toString(),q.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))q.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(en)&&(this.unregister(en),this.register({distinct_id:e}));var n="anonymous"===(this.persistence.get_property(eR)||"anonymous");e!==s&&n?(this.persistence.set_property(eR,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(eF))}}else q.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:j(j({},s),{},{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else q.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(q.info("reset"),!this.__loaded)return q.uninitializedWarning("posthog.reset");var t,i,s,n,r,o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),null==(s=this.surveys)||s.reset(),null==(n=this.persistence)||n.set_property(eR,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:eN,$device_id:null},"");else{var a=this.config.get_device_id(eQ());this.register_once({distinct_id:a,$device_id:e?a:o},"")}}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(null!=e&&e.withTimestamp&&i){var n,r=null!=(n=e.timestampLookBack)?n:10;if(!i)return s;var o=Math.max(Math.floor(((new Date).getTime()-i)/1e3)-r,0);s+="?t=".concat(o)}return s}alias(e,t){return e===this.get_property(es)?(q.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(void 0===t&&(t=this.get_distinct_id()),e!==t?(this._register_single(en,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(q.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,i,s,n,r=j({},this.config);F(e)&&(K(this.config,nQ(e)),null==(t=this.persistence)||t.update_config(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new t5(j(j({},this.config),{},{persistence:"sessionStorage"})),e5.is_supported()&&"true"===e5.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(v.DEBUG=!0,q.info("set_config",{config:e,oldConfig:r,newConfig:j({},this.config)})),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t,i,s,n,r,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==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(r=this.sessionRecording)||r.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){var i,s=Error("PostHog syntheticException"),n=P(null==(i=f.__PosthogExtensions__)?void 0:i.parseErrorAsProperties)?f.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:s}):j({$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},t);this.exceptions.sendExceptionEvent(n)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:nY;return t!==nY&&(t=nY+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(eR))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(eR))}_hasPersonProcessing(){var e,t,i,s;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&
1!this._isIdentified()&&R(this.getGroups())&&(null==(e=this.persistence)||null==(t=e.props)||!t[en])&&(null==(i=this.persistence)||null==(s=i.props)||!s[eM]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(q.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(eM,!0),!0)}_sync_opt_out_with_persistence(){var e,t,i,s,n=this.consent.isOptedOut(),r=this.config.opt_out_persistence_by_default,o=this.config.disable_persistence||n&&!!r;(null==(e=this.persistence)?void 0:e.disabled)!==o&&(null==(i=this.persistence)||i.set_disabled(o)),(null==(t=this.sessionPersistence)?void 0:t.disabled)!==o&&(null==(s=this.sessionPersistence)||s.set_disabled(o))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(void 0===(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(t=null==e?void 0:e.captureEventName)?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return c?nw(c,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){u&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:u.title},{send_instantly:!0}))}debug(e){!1===e?(null==n||n.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==n||n.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(e){if(L(this.config.before_send))return e;var t=C(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(L(i=s(i))){var n="Event '".concat(e.event,"' was rejected in beforeSend function");return D(e.event)?q.warn("".concat(n,". This can cause unexpected behavior.")):q.info(n),null}i.properties&&!R(i.properties)||q.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return i}getPageViewId(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId}}!function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=Z(e.prototype[t[i]])}(n0,["identify"]);var n1,n2,n3=(n2=nG[nY]=new n0,function(){function e(){e.done||(e.done=!0,nK=!1,Y(nG,function(e){e._dom_loaded()}))}null!=u&&u.addEventListener&&("complete"===u.readyState?e():u.addEventListener("DOMContentLoaded",e,!1)),n&&et(n,"load",e,!0)}(),n2)}}]);
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.