1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,604570,e=>{"use strict";e.s(["default",()=>nz]);var t="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:t,s=Array.prototype,r=s.forEach,n=s.indexOf,o=null==i?void 0:i.navigator,a=null==i?void 0:i.document,l=null==i?void 0:i.location,c=null==i?void 0:i.fetch,u=null!=i&&i.XMLHttpRequest&&"withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:void 0,h=null==i?void 0:i.AbortController,d=null==o?void 0:o.userAgent,p=null!=t?t:{},g={DEBUG:!1,LIB_VERSION:"1.265.1"};function _(){return(_=Object.assign.bind()).apply(null,arguments)}function v(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var f=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function m(e,t){return -1!==e.indexOf(t)}var y=function(e){return e.trim()},b=function(e){return e.replace(/^\$/,"")},w=Array.isArray,E=Object.prototype,k=E.hasOwnProperty,x=E.toString,S=w||function(e){return"[object Array]"===x.call(e)},I=e=>"function"==typeof e,$=e=>e===Object(e)&&!S(e),F=e=>{if($(e)){for(var t in e)if(k.call(e,t))return!1;return!0}return!1},R=e=>void 0===e,P=e=>"[object String]"==x.call(e),T=e=>P(e)&&0===e.trim().length,C=e=>null===e,A=e=>R(e)||C(e),O=e=>"[object Number]"==x.call(e),M=e=>"[object Boolean]"===x.call(e),L=e=>m(f,e),D=[!0,"true",1,"1","yes"],N=e=>m(D,e),H=[!1,"false",0,"0","no"];function q(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),O(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),q(r||i,t,i,s))}class j{stop(){this.t&&(clearInterval(this.t),this.t=void 0)}constructor(e){this.i=e,this.o={},this.h=()=>{Object.keys(this.o).forEach(e=>{var t=this.m(e)+this.S;t>=this.$?delete this.o[e]:this.k(e,t)})},this.m=e=>this.o[String(e)],this.k=(e,t)=>{this.o[String(e)]=t},this.consumeRateLimit=e=>{var t,i=null!=(t=this.m(e))?t:this.$;if(0===(i=Math.max(i-1,0)))return!0;this.k(e,i);var s,r=0===i;return r&&(null==(s=this.I)||s.call(this,e)),r},this.I=this.i.I,this.$=q(this.i.bucketSize,0,100,this.i.P),this.S=q(this.i.refillRate,0,this.$,this.i.P),this.R=q(this.i.refillInterval,0,864e5,this.i.P),this.t=setInterval(()=>{this.h()},this.R)}}var B=e=>{var i={T:function(i){if(t&&(g.DEBUG||p.POSTHOG_DEBUG)&&!R(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[i])?t.console[i].__rrweb_original__:t.console[i],r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];s(e,...n)}},info:function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];i.T("log",...t)},warn:function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];i.T("warn",...t)},error:function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];i.T("error",...t)},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=>{i.error("You must initialize PostHog before calling "+e)},createLogger:t=>B(e+" "+t)};return i},U=B("[PostHog.js]"),z=U.createLogger,G=z("[ExternalScriptsLoader]"),V=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return G.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==a?void 0:a.querySelectorAll("script");if(s){for(var r,n=0;n<s.length;n++)if(r=function(){if(s[n].src===t){var e=s[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return r.v}var o=()=>{if(!a)return i("document not found");var s=a.createElement("script");
1if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");var r,n=a.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):a.body.appendChild(s)};null!=a&&a.body?o():null==a||a.addEventListener("DOMContentLoaded",o)};p.__PosthogExtensions__=p.__PosthogExtensions__||{},p.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var s="/static/"+t+".js?v="+e.version;"remote-config"===t&&(s="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5));var r=e.requestRouter.endpointFor("assets",s);V(e,r,i)},p.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);V(e,s,i)};var W={};function Y(e,t,i){if(S(e)){if(r&&e.forEach===r)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)===W)return}}}function X(e,t,i){if(!A(e)){if(S(e))return Y(e,t,i);if(e instanceof FormData){for(var s of e.entries())if(t.call(i,s[1],s[0])===W)return}else for(var r in e)if(k.call(e,r)&&t.call(i,e[r],r)===W)return}}var J=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 Y(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},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 Y(i,function(t){Y(t,function(t){e.push(t)})}),e};function Z(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}},ee=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){U.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),U.critical(e)}}},et=function(e){var t={};return X(e,function(e,i){(P(e)&&e.length>0||O(e))&&(t[i]=e)}),t},ei=["herokuapp.com","vercel.app","netlify.app"];function es(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function er(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}var en="$people_distinct_id",eo="__alias",ea="__timers",el="$autocapture_disabled_server_side",ec="$heatmaps_enabled_server_side",eu="$exception_capture_enabled_server_side",eh="$error_tracking_suppression_rules",ed="$error_tracking_capture_extension_exceptions",ep="$web_vitals_enabled_server_side",eg="$dead_clicks_enabled_server_side",e_="$web_vitals_allowed_metrics",ev="$session_recording_enabled_server_side",ef="$console_log_recording_enabled_server_side",em="$session_recording_network_payload_capture",ey="$session_recording_masking",eb="$session_recording_canvas_recording",ew="$replay_sample_rate",eE="$replay_minimum_duration",ek="$replay_script_config",ex="$sesid",eS="$session_is_sampled",eI="$session_recording_url_trigger_activated_session",e$="$session_recording_event_trigger_activated_session",eF="$enabled_feature_flags",eR="$early_access_features",eP="$feature_flag_details",eT="$stored_person_properties",eC="$stored_group_properties",eA="$surveys",eO="$surveys_activated",eM="$flag_call_reported",eL="$user_state",eD="$client_session_props",eN="$capture_rate_limit",eH="$initial_campaign_params",eq="$initial_referrer_info",ej="$initial_person_info",eB="$epp",eU="__POSTHOG_TOOLBAR__",ez="$posthog_cookieless",eG=[en,eo,"__cmpns",ea,ev,ec,ex,eF,eh,eL,eR,eP,eC,eT,eA,eM,eD,eN,eH,eq,eB,ej];function eV(e){return e instanceof Element&&(e.id===eU||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function eW(e){return!!e&&1===e.nodeType}function eY(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function eX(e){return!!e&&3===e.nodeType}function eJ(e){return!!e&&11===e.nodeType}function eK(e){return e?y(e).split(/\s+/):[]}function eZ(e){var i=null==t?void 0:t.location.href;return!!(i&&e&&e.some(e=>i.match(e)))}function eQ(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 eK(t)}function e0(e){return A(e)?null:y(e).split(/(\s+)/).filter(e=>ts(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function e1(e){var t="";return e6(e)&&!e4(e)&&e.childNodes&&e.childNodes.length&&X(e.childNodes,function(e){var i;eX(e)&&e.textContent&&(t+=null!=(i=e0(e.textContent))?i:"")}),y(t)}function e2(e){var t;return R(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var e3=["a","button","form","input","select","textarea","label"];function e5(e){var t=e.parentNode;return!(!t||!eW(t))&&t}function e6(e){for(var t=e;t.parentNode&&!eY(t,"body");t=t.parentNode){var i=eQ(t);if(m(i,"ph-sensitive")||m(i,"ph-no-capture"))return!1}if(m(eQ(e),"ph-include"))return!0;var s=e.type||"";if(P(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}
1var r=e.name||e.id||"";return!(P(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function e4(e){return!!(eY(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||eY(e,"select")||eY(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var e8="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",e7=RegExp("^(?:"+e8+")$"),e9=new RegExp(e8),te="\\d{3}-?\\d{2}-?\\d{4}",tt=RegExp("^("+te+")$"),ti=RegExp("("+te+")");function ts(e,t){return void 0===t&&(t=!0),!(A(e)||P(e)&&(e=y(e),(t?e7:e9).test((e||"").replace(/[- ]/g,""))||(t?tt:ti).test(e)))&&!0}function tr(e){var t=e1(e);return ts(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&X(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=e1(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){U.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function tn(e){return e.replace(/"|\\"/g,'\\"')}class to{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}constructor(){this.clicks=[]}}var ta="$copy_autocapture",tl=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),tc=["fatal","error","warning","log","info","debug"],tu=["localhost","127.0.0.1"],th=e=>{var t=null==a?void 0:a.createElement("a");return R(t)?null:(t.href=e,t)},td=function(e,t){void 0===t&&(t="&");var i,s,r=[];return X(e,function(e,t){R(e)||R(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)},tp=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!S(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){U.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},tg=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[0]||"",n=s[1],o=r.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");S(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},t_=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},tv=z("[AutoCapture]");function tf(e,t){return t.length>e?t.slice(0,e)+"...":t}class tm{get A(){var e,t,i=$(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}D(){if(this.isBrowserSupported()){if(t&&a){var e=e=>{e=e||(null==t?void 0:t.event);try{this.j(e)}catch(e){tv.error("Failed to capture event",e)}};if(er(a,"submit",e,{capture:!0}),er(a,"change",e,{capture:!0}),er(a,"click",e,{capture:!0}),this.A.capture_copied_text){var i=e=>{e=e||(null==t?void 0:t.event),this.j(e,ta)};er(a,"copy",i,{capture:!0}),er(a,"cut",i,{capture:!0})}}}else tv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.C&&(this.D(),this.C=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.O=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[el]:!!e.autocapture_opt_out}),this.M=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.F=e}getElementSelectors(e){var t,i=[];return null==(t=this.F)||t.forEach(t=>{var s=null==a?void 0:a.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[el];if(C(this.M)&&!M(i)&&!this.instance.L())return!1;var s=null!=(t=this.M)?t:!!i;return!!this.instance.config.autocapture&&!s}j(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var s,r=e2(e);eX(r)&&(r=r.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.j(e,"$rageclick");var n=i===ta;if(r&&function(e,i,s,r,n){if(void 0===s&&(s=void 0),!t||!e||eY(e,"html")||!eW(e)||null!=(o=s)&&o.url_allowlist&&!eZ(s.url_allowlist)||null!=(a=s)&&a.url_ignorelist&&eZ(s.url_ignorelist))return!1;if(null!=(l=s)&&l.dom_event_allowlist){var o,a,l,c=s.dom_event_allowlist;if(c&&!c.some(e=>i.type===e))return!1}for(var u=!1,h=[e],d=!0,p=e;p.parentNode&&!eY(p,"body");)if(eJ(p.parentNode))h.push(p.parentNode.host),p=p.parentNode.host;else{if(!(d=e5(p)))break;if(r||e3.indexOf(d.tagName.toLowerCase())>-1)u=!0;else{var g=t.getComputedStyle(d);g&&"pointer"===g.getPropertyValue("cursor")&&(u=!0)}h.push(d),p=d}if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(R(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(h,s)||!function(e,t){var i=null==t?void 0:t.css_selector_allowlist;if(R(i))return!0;var s,r=function(e){if(i.some(t=>e.matches(t)))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(h,s))return!1;var _=t.getComputedStyle(e);
1if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===i.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(i.type)>=0;default:return u?(n||["click"]).indexOf(i.type)>=0:(n||["click"]).indexOf(i.type)>=0&&(e3.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.A,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,i){for(var s,r,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=i,u=[e],h=e;h.parentNode&&!eY(h,"body");)eJ(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],g={},v=!1,f=!1;if(X(u,e=>{var t=e6(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&ts(v)&&v),m(eQ(e),"ph-no-capture")&&(f=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};e3.indexOf(r)>-1&&!i&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?n.$el_text=tf(1024,tr(e)):n.$el_text=tf(1024,e1(e)));var o=eQ(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),X(e.attributes,function(i){var r;if((!e4(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&ts(i.value)&&(!P(r=i.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var o=i.value;"class"===i.name&&(o=eK(o).join(" ")),n["attr__"+i.name]=tf(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&&!eW(t))return t}(c);)a++,c.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l)),J(g,function(e){if(!e6(e))return{};var t={};return X(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&&ts(s)&&(t[i]=s)}}),t}(e))}),f)return{props:{},explicitNoCapture:f};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=tr(e):p[0].$el_text=e1(e)),v){p[0].attr__href=v;var y,b,w=null==(y=th(v))?void 0:y.host,E=null==t||null==(b=t.location)?void 0:b.host;w&&E&&w!==E&&(d=v)}return{props:J({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?S(t)?t:eK(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Z(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=_({},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 Z(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return o[tn(t.toString())]=tn(i.toString())}),s+=":",s+=Z(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(s=p[0])&&s.$el_text?{$el_text:null==(r=p[0])?void 0:r.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.A.element_attribute_ignorelist,elementsChainAsString:this.O});if(a)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),i===ta){var c,u=e0(null==t||null==(c=t.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(i,o),!0}}}isBrowserSupported(){return I(null==a?void 0:a.querySelectorAll)}constructor(e){this.C=!1,this.M=null,this.rageclicks=new to,this.O=!1,this.instance=e,this.F=null}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return O(e)&&isFinite(e)&&Math.floor(e)===e});var ty="0123456789abcdef";class tb{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");
1var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new tb(r)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+ty.charAt(this.bytes[t]>>>4)+ty.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 tb(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}constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}}class tw{generate(){var e=this.generateOrAbort();if(R(e)){this.N=0;var t=this.generateOrAbort();if(R(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.N)this.N=e,this.B();else{if(!(e+1e4>this.N))return;this.U++,this.U>0x3ffffffffff&&(this.N++,this.B())}return tb.fromFieldsV7(this.N,Math.trunc(this.U/0x40000000),0x3fffffff&this.U,this.q.nextUint32())}B(){this.U=1024*this.q.nextUint32()+(1023&this.q.nextUint32())}constructor(){this.N=0,this.U=0,this.q=new tx}}var tE,tk=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};t&&!R(t.crypto)&&crypto.getRandomValues&&(tk=e=>crypto.getRandomValues(e));class tx{nextUint32(){return this.W>=this.H.length&&(tk(this.H),this.W=0),this.H[this.W++]}constructor(){this.H=new Uint32Array(8),this.W=1/0}}var tS=()=>tI().toString(),tI=()=>(tE||(tE=new tw)).generate(),t$="",tF=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,tR={G:()=>!!a,J:function(e){U.error("cookieStore error: "+e)},V:function(e){if(a){try{for(var t=e+"=",i=a.cookie.split(";").filter(e=>e.length),s=0;s<i.length;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},K:function(e){var t;try{t=JSON.parse(tR.V(e))||{}}catch(e){}return t},Y:function(e,t,i,s,r){if(a)try{var n="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=a),t$)return t$;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+tS();!t$&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",t$=n)}return t$}(e);if(!i){var s,r=(s=e.match(tF))?s[0]:"";r!==i&&U.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(a.location.hostname,s);if(i){var c=new Date;c.setTime(c.getTime()+24*i*36e5),n="; expires="+c.toUTCString()}r&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&U.warn("cookieStore warning: large cookie, len="+u.length),a.cookie=u,u}catch(e){return}},X:function(e,t){if(null!=a&&a.cookie)try{tR.Y(e,"",-1,t)}catch(e){return}}},tP=null,tT={G:function(){if(!C(tP))return tP;var e=!0;if(R(t))e=!1;else try{var i="__mplssupport__";tT.Y(i,"xyz"),'"xyz"'!==tT.V(i)&&(e=!1),tT.X(i)}catch(t){e=!1}return e||U.error("localStorage unsupported; falling back to cookie store"),tP=e,e},J:function(e){U.error("localStorage error: "+e)},V:function(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(e){tT.J(e)}return null},K:function(e){try{return JSON.parse(tT.V(e))||{}}catch(e){}return null},Y:function(e,i){try{null==t||t.localStorage.setItem(e,JSON.stringify(i))}catch(e){tT.J(e)}},X:function(e){try{null==t||t.localStorage.removeItem(e)}catch(e){tT.J(e)}}},tC=["distinct_id",ex,eS,eB,ej],tA=_({},tT,{K:function(e){try{var t={};try{t=tR.K(e)||{}}catch(e){}var i=J(t,JSON.parse(tT.V(e)||"{}"));return tT.Y(e,i),i}catch(e){}return null},Y:function(e,t,i,s,r,n){try{tT.Y(e,t,void 0,void 0,n);var o={};tC.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&tR.Y(e,o,i,s,r,n)}catch(e){tT.J(e)}},X:function(e,i){try{null==t||t.localStorage.removeItem(e),tR.X(e,i)}catch(e){tT.J(e)}}}),tO={}
1,tM={G:function(){return!0},J:function(e){U.error("memoryStorage error: "+e)},V:function(e){return tO[e]||null},K:function(e){return tO[e]||null},Y:function(e,t){tO[e]=t},X:function(e){delete tO[e]}},tL=null,tD={G:function(){if(!C(tL))return tL;if(tL=!0,R(t))tL=!1;else try{var e="__support__";tD.Y(e,"xyz"),'"xyz"'!==tD.V(e)&&(tL=!1),tD.X(e)}catch(e){tL=!1}return tL},J:function(e){U.error("sessionStorage error: ",e)},V:function(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(e){tD.J(e)}return null},K:function(e){try{return JSON.parse(tD.V(e))||null}catch(e){}return null},Y:function(e,i){try{null==t||t.sessionStorage.setItem(e,JSON.stringify(i))}catch(e){tD.J(e)}},X:function(e){try{null==t||t.sessionStorage.removeItem(e)}catch(e){tD.J(e)}}},tN=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class tH{get A(){return this._instance.config}get consent(){return this.Z()?tN.DENIED:this.tt}isOptedOut(){return"always"===this.A.cookieless_mode||this.consent===tN.DENIED||this.consent===tN.PENDING&&(this.A.opt_out_capturing_by_default||"on_reject"===this.A.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===tN.DENIED}optInOut(e){this.it.Y(this.et,+!!e,this.A.cookie_expiration,this.A.cross_subdomain_cookie,this.A.secure_cookie)}reset(){this.it.X(this.et,this.A.cross_subdomain_cookie)}get et(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get tt(){var e=this.it.V(this.et);return N(e)?tN.GRANTED:m(H,e)?tN.DENIED:tN.PENDING}get it(){if(!this.rt){var e=this.A.opt_out_capturing_persistence_type;this.rt="localStorage"===e?tT:tR;var t="localStorage"===e?tR:tT;t.V(this.et)&&(this.rt.V(this.et)||this.optInOut(N(t.V(this.et))),t.X(this.et,this.A.cross_subdomain_cookie))}return this.rt}Z(){return!!this.A.respect_dnt&&!!es([null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,p.doNotTrack],e=>N(e))}constructor(e){this._instance=e}}var tq=z("[Dead Clicks]"),tj=()=>!0,tB=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(eg)),s=e.instance.config.capture_dead_clicks;return M(s)?s:i};class tU{get lazyLoadedDeadClicksAutocapture(){return this.st}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[eg]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.nt(()=>{this.ot()})}nt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?tq.error("failed to load script",t):e()})}ot(){var e;if(a){if(!this.st&&null!=(e=p.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=$(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.st=p.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.st.start(a),tq.info("starting...")}}else tq.error("`document` not found. Cannot start.")}stop(){this.st&&(this.st.stop(),this.st=void 0,tq.info("stopping..."))}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}}var tz=z("[ExceptionAutocapture]");class tG{ft(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return $(e)?t=_({},t,e):(R(e)?this.ct:e)&&(t=_({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.A.capture_console_errors||this.A.capture_unhandled_errors||this.A.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(tz.info("enabled"),this.nt(this.lt))}nt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return tz.error("failed to load script",t);e()})}vt(){var e,t,i;null==(e=this.ht)||e.call(this),this.ht=void 0,null==(t=this.ut)||t.call(this),this.ut=void 0,null==(i=this.dt)||i.call(this),this.dt=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ct=!!t,this.A=this.ft(),this._instance.persistence&&this._instance.persistence.register({[eu]:this.ct}),this.startIfEnabled()}captureException(e){e.$exception_personURL=this._instance.requestRouter.endpointFor("ui")+"/project/"+this._instance.config.token+"/pers
1on/"+this._instance.get_distinct_id();var t,i=null!=(t=e.$exception_list[0].type)?t:"Exception";this.gt.consumeRateLimit(i)?tz.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}constructor(e){var i,s,r;this.lt=()=>{var e;if(t&&this.isEnabled&&null!=(e=p.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=p.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=p.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=p.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ht&&this.A.capture_unhandled_errors&&(this.ht=i(this.captureException.bind(this))),!this.ut&&this.A.capture_unhandled_rejections&&(this.ut=s(this.captureException.bind(this))),!this.dt&&this.A.capture_console_errors&&(this.dt=r(this.captureException.bind(this)))}catch(e){tz.error("failed to start",e),this.vt()}}},this._instance=e,this.ct=!(null==(i=this._instance.persistence)||!i.props[eu]),this.A=this.ft(),this.gt=new j({refillRate:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?s:1,bucketSize:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?r:10,refillInterval:1e4,P:tz}),this.startIfEnabled()}}function tV(e){return!R(Event)&&tW(e,Event)}function tW(e,t){try{return e instanceof t}catch(e){return!1}}function tY(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return tW(e,Error)}}function tX(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function tJ(e){return tX(e,"DOMError")}var tK=/\(error: (.*)\)/;function tZ(e,t,i,s){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return R(i)||(r.lineno=i),R(s)||(r.colno=s),r}var tQ,t0,t1,t2=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,t3=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,t5=/\((\S*)(?::(\d+))(?::(\d+))\)/,t6=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,t4=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,t8=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];var s=t.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return function(e,t){void 0===t&&(t=0);for(var i=[],r=e.split("\n"),n=t;n<r.length;n++){var o=r[n];if(!(o.length>1024)){var a=tK.test(o)?o.replace(tK,"$1"):o;if(!a.match(/\S*Error: /)){for(var l of s){var c=l(a);if(c){i.push(c);break}}if(i.length>=50)break}}}if(!i.length)return[];var u=Array.from(i);return u.reverse(),u.slice(0,50).map(e=>{var t;return _({},e,{filename:e.filename||((t=u)[t.length-1]||{}).filename,function:e.function||"?"})})}}([30,e=>{var t=t2.exec(e);if(t){var[,i,s,r]=t;return tZ(i,"?",+s,+r)}var n=t3.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var o=t5.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}var[a,l]=t7(n[1]||"?",n[2]);return tZ(l,a,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{var t=t6.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=t4.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}var s=t[3],r=t[1]||"?";return[r,s]=t7(r,s),tZ(s,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),t7=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},t9=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function ie(e,t){void 0===t&&(t=0);var i=e.stacktrace||e.stack||"",s=e&&it.test(e.message)?1:0;try{var r,n,o=(r=t8(i,s),n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var i=Object.keys(t);return t1&&i.length===t0||(t0=i.length,t1=i.reduce((i,s)=>{tQ||(tQ={});var r=tQ[s];if(r)i[r[0]]=r[1];else for(var n=e(s),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,c=t[s];if(l&&c){i[l]=c,tQ[s]=[l,c];break}}return i},{})),t1}
1(t8),r.forEach(e=>{e.filename&&(e.chunk_id=n[e.filename])}),r);return o.slice(0,o.length-t)}catch(e){}return[]}var it=/Minified React error #\d+;/i;function ii(e,t){return{$exception_list:function e(t,i){var s,r,n,o,a,l,c,u,h=(s=t,r=i,l=ie(s),c=null==(o=null==r?void 0:r.handled)||o,u=null!=(a=null==r?void 0:r.synthetic)&&a,{type:null!=r&&r.overrideExceptionType?r.overrideExceptionType:s.name,value:(n=s.message).error&&"string"==typeof n.error.message?String(n.error.message):String(n),stacktrace:{frames:l,type:"raw"},mechanism:{handled:c,synthetic:u}});return t.cause&&tY(t.cause)&&t.cause!==t?[h,...e(t.cause,{handled:null==i?void 0:i.handled,synthetic:null==i?void 0:i.synthetic})]:[h]}(e,t),$exception_level:"error"}}function is(e,t){var i,s,r,n=null==(i=null==t?void 0:t.handled)||i,o=null==(s=null==t?void 0:t.synthetic)||s,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!=(r=null==t?void 0:t.defaultExceptionType)?r:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:n,synthetic:o}};if(null!=t&&t.syntheticException){var l=ie(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function ir(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return I(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}class io{get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(U.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.bt&&this.bt(),this.bt=void 0,U.info("History API monitoring stopped")}monitorHistoryChanges(){var e,i;if(t&&t.history){var s=this;null!=(e=t.history.pushState)&&e.__posthog_wrapped__||ir(t.history,"pushState",e=>function(t,i,r){e.call(this,t,i,r),s.yt("pushState")}),null!=(i=t.history.replaceState)&&i.__posthog_wrapped__||ir(t.history,"replaceState",e=>function(t,i,r){e.call(this,t,i,r),s.yt("replaceState")}),this.wt()}}yt(e){try{var i,s=null==t||null==(i=t.location)?void 0:i.pathname;if(!s)return;s!==this._t&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._t=s}catch(t){U.error("Error capturing "+e+" pageview",t)}}wt(){if(!this.bt){var e=()=>{this.yt("popstate")};er(t,"popstate",e),this.bt=()=>{t&&t.removeEventListener("popstate",e)}}}constructor(e){var i;this._instance=e,this._t=(null==t||null==(i=t.location)?void 0:i.pathname)||""}}function ia(e){var t,i;return(null==(t=JSON.stringify(e,(i=[],function(e,t){if($(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 il=(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))(il||{}),ic=(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))(ic||{}),iu="[SessionRecording]",ih="redacted",id={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","bam.nr-data.net"]},ip=["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"],ig=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],i_=["/s/","/e/","/i/"];function iv(e,t,i,s){if(A(e))return e;var r=(null==t?void 0:t["content-length"])||new Blob([e]).size;return P(r)&&(r=parseInt(r)),r>i?iu+" "+s+" body too large to record ("+r+" bytes)":e}function im(e,t){if(A(e))return e;var i=e;return ts(i,!1)||(i=iu+" "+t+" body "+ih),X(ig,e=>{var s,r;null!=(s=i)&&s.length&&-1!==(null==(r=i)?void 0:r.indexOf(e))&&(i=iu+" "+t+" body "+ih+" as might contain: "+e)}),i}class iy{constructor(e,t){var i,s;void 0===t&&(t={}),this.St={},this.$t=e=>{if(!this.St[e]){this.St[e]=!0;var t,i,s=this.xt(e);null==(t=(i=this.i).onBlockedNode)||t.call(i,e,s)}},this.kt=e=>{var t=this.xt(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]},this.xt=e=>this._rrweb.mirror.getNode(e),this.Et=e=>{var t,i,s,r,n,o,a,l;return(null!=(t=null==(i=e.removes)?void 0:i.length)?t:0)+(null!=(s=null==(r=e.attributes)?void 0:r.length)?s:0)+(null!=(n=null==(o=e.texts)?void 0:o.length)?n:0)+(null!=(a=null==(l=e.adds)?void 0:l.length)?a:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,i=this.Et(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var[t]=this.kt(e.id);return!this.gt.consumeRateLimit(t)&&e}));var s=this.Et(t);return 0!==s||i===s?e:void 0},this._rrweb=e,this.i=t,this.gt=new j({bucketSize:null!=(i=this.i.bucketSize)?i:100,refillRate:null!=(s=this.i.refillRate)?s:10,refillInterval:1e3,I:this.$t,P:U})}}var ib=Uint8Array,iw=Uint16Array,iE=Uint32Array,ik=new ib([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]),ix=new ib([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]),iS=new ib([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iI=function(e,t){for(var i=new iw(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var r=new iE(i[30]);for(s=1;s<30;++s)for(var n=i[s];n<i[s+1];++n)r[n]=n-i[s]<<5|s;return[i,r]},i$=iI(ik,2),iF=i$[0],iR=i$[1];iF[28]=258,iR[258]=28;for(var iP=iI(ix,0)[1],iT=new iw(32768),iC=0;iC<32768;++iC){var iA=(43690&iC)>>>1|(21845&iC)<<1;iA=(61680&(iA=(52428&iA)>>>2|(13107&iA)<<2))>>>4|(3855&iA)<<4,iT[iC]=((65280&iA)>>>8|(255&iA)<<8)>>>1}var iO=function(e,t,i){for(var s=e.length,r=0,n=new iw(t);r<s;++r)++n[e[r]-1];var o,a=new iw(t);for(r=0;r<t;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new iw(1<<t);var l=15-t;for(r=0;r<s;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],h=a[e[r]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[iT[h]>>>l]=c}else for(o=new iw(s),r=0;r<s;++r)o[r]=iT[a[e[r]-1]++]>>>15-e[r];return o},iM=new ib(288);for(iC=0;iC<144;++iC)iM[iC]=8;for(iC=144;iC<256;++iC)iM[iC]=9;for(iC=256;iC<280;++iC)iM[iC]=7;for(iC=280;iC<288;++iC)iM[iC]=8;var iL=new ib(32);for(iC=0;iC<32;++iC)iL[iC]=5;var iD=iO(iM,9,0),iN=iO(iL,5,0),iH=function(e){return(e/8|0)+(7&e&&1)},iq=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof iw?iw:e instanceof iE?iE:ib)(i-t);return s.set(e.subarray(t,i)),s},ij=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},iB=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},iU=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new ib(0),0];if(1==r){var o=new ib(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,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;s<r;++s)n[s].s>d&&(d=n[s].s);var p=new iw(d+1),g=iz(i[u-1],p,0);if(g>t){s=0;var _=0,v=g-t,f=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s<r;++s){var m=n[s].s;if(!(p[m]>t))break;_+=f-(1<<g-p[m]),p[m]=t}for(_>>>=v;_>0;){var y=n[s].s;p[y]<t?_-=1<<t-p[y]++-1:++s}for(;s>=0&&_;--s){var b=n[s].s;p[b]==t&&(--p[b],++_)}g=t}return[new ib(p),g]},iz=function(e,t,i){return -1==e.s?Math.max(iz(e.l,t,i+1),iz(e.r,t,i+1)):t[e.s]=i},iG=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new iw(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},iV=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},iW=function(e,t,i){var s=i.length,r=iH(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;n<s;++n)e[r+n+4]=i[n];return 8*(r+4+s)},iY=function(e,t,i,s,r,n,o,a,l,c,u){ij(t,u++,i),++r[256];for(var h=iU(r,15),d=h[0],p=h[1],g=iU(n,15),_=g[0],v=g[1],f=iG(d),m=f[0],y=f[1],b=iG(_),w=b[0],E=b[1],k=new iw(19),x=0;x<m.length;++x)k[31&m[x]]++;for(x=0;x<w.length;++x)k[31&w[x]]++;for(var S=iU(k,7),I=S[0],$=S[1],F=19;F>4&&!I[iS[F-1]];--F);var R,P,T,C,A=c+5<<3,O=iV(r,iM)+iV(n,iL)+o,M=iV(r,d)+iV(n,_)+o+14+3*F+iV(k,I)+(2*k[16]+3*k[17]+7*k[18]);if(A<=O&&A<=M)return iW(t,u,e.subarray(l,l+c));if(ij(t,u,1+(M<O)),u+=2,M<O){R=iO(d,p,0),P=d,T=iO(_,v,0),C=_;var L=iO(I,$,0);for(ij(t,u,y-257),ij(t,u+5,E-1),ij(t,u+10,F-4),u+=14,x=0;x<F;++x)ij(t,u+3*x,I[iS[x]]);u+=3*F;for(var D=[m,w],N=0;N<2;++N){var H=D[N];for(x=0;x<H.length;++x){var q=31&H[x];ij(t,u,L[q]),u+=I[q],q>15&&(ij(t,u,H[x]>>>5&127),u+=H[x]>>>12)}}}else R=iD,P=iM,T=iN,C=iL;for(x=0;x<a;++x)if(s[x]>255){iB(t,u,R[(q=s[x]>>>18&31)+257]),u+=P[q+257],q>7&&(ij(t,u,s[x]>>>23&31),u+=ik[q]);var j=31&s[x];iB(t,u,T[j]),u+=C[j],j>3&&(iB(t,u,s[x]>>>5&8191),u+=ix[j])}else iB(t,u,R[s[x]]),u+=P[s[x]];return iB(t,u,R[256]),u+P[256]},iX=new iE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),iJ=function(){for(var e=new iE(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),iK=function(){var e=0xffffffff;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=iJ[255&i^t[s]]^i>>>8;e=i},d:function(){return 0xffffffff^e}}},iZ=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},iQ=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&&iZ(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 i0(e,t){void 0===t&&(t={});var i,s,r,n=iK(),o=e.length;n.p(e);var a=(s=t,r=10+((i=t).filename&&i.filename.length+1||0),function(e,t,i,s,r,n){var o=e.length,a=new ib(s+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(s,a.length-r),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=iW(l,c,e.subarray(u,h)):(l[u]=n,c=iW(l,c,e.subarray(u,o)))}else{for(var d=iX[t-1],p=d>>>13,g=8191&d,_=(1<<i)-1,v=new iw(32768),f=new iw(_+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new iE(25e3),E=new iw(288),k=new iw(32),x=0,S=0,I=(u=0,0),$=0,F=0;u<o;++u){var R=b(u),P=32767&u,T=f[R];
1if(v[P]=T,f[R]=P,$<=u){var C=o-u;if((x>7e3||I>24576)&&C>423){c=iY(e,l,0,w,E,k,S,I,F,u-F,c),I=x=S=0,F=u;for(var A=0;A<286;++A)E[A]=0;for(A=0;A<30;++A)k[A]=0}var O=2,M=0,L=g,D=P-T&32767;if(C>2&&R==b(u-D))for(var N=Math.min(p,C)-1,H=Math.min(32767,u),q=Math.min(258,C);D<=H&&--L&&P!=T;){if(e[u+O]==e[u+O-D]){for(var j=0;j<q&&e[u+j]==e[u+j-D];++j);if(j>O){if(O=j,M=D,j>N)break;var B=Math.min(D,j-2),U=0;for(A=0;A<B;++A){var z=u-D+A+32768&32767,G=z-v[z]+32768&32767;G>U&&(U=G,T=z)}}}D+=(P=T)-(T=v[P])+32768&32767}if(M){w[I++]=0x10000000|iR[O]<<18|iP[M];var V=31&iR[O],W=31&iP[M];S+=ik[V]+ix[W],++E[257+V],++k[W],$=u+O,++x}else w[I++]=e[u],++E[e[u]]}}c=iY(e,l,n,w,E,k,S,I,F,u-F,c)}return iq(a,0,s+iH(c)+r)}(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,r,8,!0)),l=a.length;return iQ(a,t),iZ(a,l-8,n.d()),iZ(a,l-4,o),a}function i1(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new ib(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},o=0;o<i;++o){if(r+5>s.length){var a=new ib(r+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);l<128||t?n(l):(l<2048?n(192|l>>>6):(l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return iq(s,0,r)}var i2="disabled",i3="sampled",i5="active",i6="buffering",i4="paused",i8="trigger",i7=i8+"_activated",i9=i8+"_pending",se=i8+"_"+i2;function st(e,t){return t.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))}class si{triggerStatus(e){var t=this.It.map(t=>t.triggerStatus(e));return t.includes(i7)?i7:t.includes(i9)?i9:se}stop(){this.It.forEach(e=>e.stop())}constructor(e){this.It=e}}class ss{triggerStatus(e){var t=new Set;for(var i of this.It)t.add(i.triggerStatus(e));switch(t.delete(se),t.size){case 0:return se;case 1:return Array.from(t)[0];default:return i9}}stop(){this.It.forEach(e=>e.stop())}constructor(e){this.It=e}}class sr{triggerStatus(){return i9}stop(){}}class sn{onRemoteConfig(e){var t,i;this.Pt=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this.Rt=(null==(i=e.sessionRecording)?void 0:i.urlBlocklist)||[]}Tt(e){var t;return 0===this.Pt.length?se:(null==(t=this._instance)?void 0:t.get_property(eI))===e?i7:i9}triggerStatus(e){var t=this.Tt(e),i=t===i7?i7:t===i9?i9:se;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:i}),i}checkUrlTriggerConditions(e,i,s){if(void 0!==t&&t.location.href){var r=t.location.href,n=this.urlBlocked,o=st(r,this.Rt);n&&o||(o&&!n?e():!o&&n&&i(),st(r,this.Pt)&&s("url"))}}stop(){}constructor(e){this.Pt=[],this.Rt=[],this.urlBlocked=!1,this._instance=e}}class so{triggerStatus(){var e=i9;return A(this.linkedFlag)&&(e=se),this.linkedFlagSeen&&(e=i7),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var i;if(this.linkedFlag=(null==(i=e.sessionRecording)?void 0:i.linkedFlag)||null,!A(this.linkedFlag)&&!this.linkedFlagSeen){var s=P(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,r=P(this.linkedFlag)?null:this.linkedFlag.variant;this.Ct=this._instance.onFeatureFlags((e,i)=>{var n=!1;if($(i)&&s in i){var o=i[s];n=M(o)?!0===o:r?o===r:!!o}this.linkedFlagSeen=n,n&&t(s,r)})}}stop(){this.Ct()}constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Ct=()=>{},this._instance=e}}class sa{onRemoteConfig(e){var t;this.Mt=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]}Ot(e){var t;return 0===this.Mt.length?se:(null==(t=this._instance)?void 0:t.get_property(e$))===e?i7:i9}triggerStatus(e){var t=this.Ot(e),i=t===i7?i7:t===i9?i9:se;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:i}),i}stop(){}constructor(e){this.Mt=[],this._instance=e}}function sl(e){return e.isRecordingEnabled?i6:i2}function sc(e){if(!e.receivedFlags)return i6;if(!e.isRecordingEnabled)return i2;if(e.urlTriggerMatching.urlBlocked)return i4;var t=!0===e.isSampled,i=new si([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);
1return t?i3:i===i7?i5:i===i9?i6:!1===e.isSampled?i2:i5}function su(e){if(!e.receivedFlags)return i6;if(!e.isRecordingEnabled)return i2;if(e.urlTriggerMatching.urlBlocked)return i4;var t=new ss([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),i=t!==se,s=M(e.isSampled);return i&&t===i9?i6:i&&t===se||s&&!e.isSampled?i2:!0===e.isSampled?i3:i5}var sh="[SessionRecording]",sd=z(sh);function sp(){var e;return null==p||null==(e=p.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}var sg=[ic.MouseMove,ic.MouseInteraction,ic.Scroll,ic.ViewportResize,ic.Input,ic.TouchMove,ic.MediaInteraction,ic.Drag],s_=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function sv(e){return function(e,t){for(var i="",s=0;s<e.length;)i+=String.fromCharCode(e[s++]);return i}(i0(i1(JSON.stringify(e))))}function sf(e){return e.type===il.Custom&&"sessionIdle"===e.data.tag}class sm{get sessionId(){return this.Ft}get At(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Dt}get jt(){if(!this._instance.sessionManager)throw Error(sh+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Lt(){var e,t;return this.Nt.triggerStatus(this.sessionId)===i9?6e4:null!=(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)?e:3e5}get zt(){var e=this._instance.get_property(eS);return M(e)?e:null}get Ut(){var e,t,i=null==(e=this.H)?void 0:e.data[(null==(t=this.H)?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.jt.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get qt(){var e=!!this._instance.get_property(ev),i=!this._instance.config.disable_session_recording;return t&&e&&i}get Bt(){var e=!!this._instance.get_property(ef),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}get Ht(){var e,t,i,s,r,n,o=this._instance.config.session_recording.captureCanvas,a=this._instance.get_property(eb),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:4,u=null!=(r=null!=(n=null==o?void 0:o.canvasQuality)?n:null==a?void 0:a.quality)?r:.4;if("string"==typeof u){var h=parseFloat(u);u=isNaN(h)?.4:h}return{enabled:l,fps:q(c,0,12,sd.createLogger("canvas recording fps"),4),quality:q(u,0,1,sd.createLogger("canvas recording quality"),.4)}}get Wt(){var e,t,i=this._instance.get_property(em),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},r=(null==s?void 0:s.recordHeaders)||(null==i?void 0:i.recordHeaders),n=(null==s?void 0:s.recordBody)||(null==i?void 0:i.recordBody),o=$(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 r||n||a?{recordHeaders:r,recordBody:n,recordPerformance:a}:void 0}get Gt(){var e,t,i,s,r,n,o=this._instance.get_property(ey),a={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(t=this._instance.config.session_recording)?void 0:t.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},l=null!=(s=null==a?void 0:a.maskAllInputs)?s:null==o?void 0:o.maskAllInputs,c=null!=(r=null==a?void 0:a.maskTextSelector)?r:null==o?void 0:o.maskTextSelector,u=null!=(n=null==a?void 0:a.blockSelector)?n:null==o?void 0:o.blockSelector;return R(l)&&R(c)&&R(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get Jt(){var e=this._instance.get_property(ew);return O(e)?e:null}get Vt(){var e=this._instance.get_property(eE);return O(e)?e:null}get status(){return this.Kt?this.Yt({receivedFlags:this.Kt,isRecordingEnabled:this.qt,isSampled:this.zt,urlTriggerMatching:this.Xt,eventTriggerMatching:this.Qt,linkedFlagMatching:this.Zt,sessionId:this.sessionId}):i6}startIfEnabledOrStop(e){this.qt?(this.bi(e),er(t,"beforeunload",this.li),er(t,"offline",this.ui),er(t,"online",this.vi),er(t,"visibilitychange",this.ci),this.yi(),this.wi(),A(this.ri)&&(this.ri=this._instance.on("eventCaptured",e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.Si(null==e?void 0:e.properties.$current_url):"";if(!t)return;this.di("$pageview",{href:t})}}catch(e){sd.error("Could not add $pageview to rrweb session",e)}})),this.si||(this.si=this.jt.onSessionId((e,t,i)=>{var s,r;i&&(this.di("$session_id_change",{sessionId:e,windowId:t,changeReason:i}),null==(s=this._instance)||null==(s=s.persistence)||s.unregister(e$),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(eI))}))):this.stopRecording()}stopRecording(){var e,i,s,r;this.Dt&&this.pi&&(this.pi(),this.pi=void 0,this.Dt=!1,null==t||t.removeEventListener("beforeunload",this.li),null==t||t.removeEventListener("offline",this.ui),null==t||t.removeEventListener("online",this.vi),null==t||t.removeEventListener("visibilitychange",this.ci),this.mi(),clearInterval(this.$i),null==(e=this.ri)||e.call(this),this.ri=void 0,null==(i=this.ai)||i.call(this),this.ai=void 0,null==(s=this.si)||s.call(this),this.si=void 0,null==(r=this.oi)||r.call(this),this.oi=void 0,this.Qt.stop(),this.Xt.stop(),this.Zt.stop(),sd.info("stopped"))}xi(){var e;null==(e=this._instance.persistence)||e.unregister(eS)}ki(e){var t,i=this.Ft!==e,s=this.Jt;if(O(s)){var r=this.zt,n=i||!M(r),o=n?function(e){for(var t=0,i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i)|0;return Math.abs(t)}(e)%100<q(100*s,0,100,U):r;n&&(o?this.Ei(i3):sd.warn("Sample rate ("+s+") has determined that this sessionId ("+e+") will not be sent to the server."),this.di("samplingDecisionMade",{sampleRate:s,isSampled:o})),null==(t=this._instance.persistence)||t.register({[eS]:o})}else this.xi()}onRemoteConfig(e){var t,i,s,r;this.di("$remote_config_received",e),this.Ii(e),null!=(t=e.sessionRecording)&&t.endpoint&&(this.fi=null==(r=e.sessionRecording)?void 0:r.endpoint),this.yi(),"any"===(null==(i=e.sessionRecording)?void 0:i.triggerMatchType)?(this.Yt=sc,this.Nt=new si([this.Qt,this.Xt])):(this.Yt=su,this.Nt=new ss([this.Qt,this.Xt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(s=e.sessionRecording)?void 0:s.triggerMatchType}),this.Xt.onRemoteConfig(e),this.Qt.onRemoteConfig(e),this.Zt.onRemoteConfig(e,(e,t)=>{this.Ei("linked_flag_matched",{flag:e,variant:t})}),this.Kt=!0,this.startIfEnabledOrStop()}yi(){O(this.Jt)&&A(this.oi)&&(this.oi=this.jt.onSessionId(e=>{this.ki(e)}))}Ii(e){if(this._instance.persistence){var t,i=this._instance.persistence,s=()=>{var t,s,r,n,o,a,l,c,u,h=null==(t=e.sessionRecording)?void 0:t.sampleRate,d=A(h)?null:parseFloat(h);A(d)&&this.xi();var p=null==(s=e.sessionRecording)?void 0:s.minimumDurationMilliseconds;i.register({[ev]:!!e.sessionRecording,[ef]:null==(r=e.sessionRecording)?void 0:r.consoleLogRecordingEnabled,[em]:_({capturePerformance:e.capturePerformance},null==(n=e.sessionRecording)?void 0:n.networkPayloadCapture),[ey]:null==(o=e.sessionRecording)?void 0:o.masking,[eb]:{enabled:null==(a=e.sessionRecording)?void 0:a.recordCanvas,fps:null==(l=e.sessionRecording)?void 0:l.canvasFps,quality:null==(c=e.sessionRecording)?void 0:c.canvasQuality},[ew]:d,[eE]:R(p)?null:p,[ek]:null==(u=e.sessionRecording)?void 0:u.scriptConfig})};s(),null==(t=this.ni)||t.call(this),this.ni=this.jt.onSessionId(s)}}log(e,t){var i;void 0===t&&(t="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}bi(e){if(!R(Object.assign)&&!R(Array.from)&&!(this.Dt||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var t;(this.Dt=!0,this.jt.checkAndGetSessionAndWindowId(),sp())?this.Pi():null==(t=p.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.Ri,e=>{if(e)return sd.error("could not load recorder",e);this.Pi()}),sd.info("starting"),this.status===i5&&this.Ei(e||"recording_initialized")}}get Ri(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(ek))?void 0:e.script)||"recorder"}Ti(e){var t;return 3===e.type&&-1!==sg.indexOf(null==(t=e.data)?void 0:t.source)}Ci(e){var t=this.Ti(e);t||this.ii||e.timestamp-this.ei>this.At&&(this.ii=!0,clearInterval(this.$i),this.di("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ei,threshold:this.At,bufferLength:this.H.data.length,bufferSize:this.H.size}),this.hi());var i=!1;if(t&&(this.ei=e.timestamp,this.ii)){var s="unknown"===this.ii;this.ii=!1,s||(this.di("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)}if(!this.ii){var{windowId:r,sessionId:n}=this.jt.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.Ft!==n,a=this.gi!==r;this.gi=r,this.Ft=n,o||a?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this.Mi()}}Oi(e){try{return e.rrwebMethod(),!0}catch(t){return this.ti.length<10?this.ti.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):sd.warn("could not emit queued rrweb event.",t,e),!1}}
1di(e,t){return this.Oi(s_(()=>sp().addCustomEvent(e,t)))}Fi(){return this.Oi(s_(()=>sp().takeFullSnapshot()))}Pi(){var e,t,i,s,r={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:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};for(var[n,o]of Object.entries(this._instance.config.session_recording||{}))n in r&&("maskInputOptions"===n?r.maskInputOptions=_({password:!0},o):r[n]=o);this.Ht&&this.Ht.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.Ht.fps},r.dataURLOptions={type:"image/webp",quality:this.Ht.quality}),this.Gt&&(r.maskAllInputs=null==(t=this.Gt.maskAllInputs)||t,r.maskTextSelector=null!=(i=this.Gt.maskTextSelector)?i:void 0,r.blockSelector=null!=(s=this.Gt.blockSelector)?s:void 0);var a=sp();if(a){this.Ai=null!=(e=this.Ai)?e:new iy(a,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var i="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";sd.info(i,{node:t}),this.log(sh+" "+i,"warn")}});var l=this.Di();this.pi=a(_({emit:e=>{this.onRRwebEmit(e)},plugins:l},r)),this.ei=Date.now(),this.ii=M(this.ii)?this.ii:"unknown",this.di("$session_options",{sessionRecordingOptions:r,activePlugins:l.map(e=>null==e?void 0:e.name)}),this.di("$posthog_config",{config:this._instance.config})}else sd.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Mi(){if(this.$i&&clearInterval(this.$i),!0!==this.ii){var e=this.Lt;e&&(this.$i=setInterval(()=>{this.Fi()},e))}}Di(){var e,t,i,s,r,n,o,a,l,c,u,h,d,g=[],v=null==(h=p.__PosthogExtensions__)||null==(h=h.rrwebPlugins)?void 0:h.getRecordConsolePlugin;v&&this.Bt&&g.push(v());var f=null==(d=p.__PosthogExtensions__)||null==(d=d.rrwebPlugins)?void 0:d.getRecordNetworkPlugin;return this.Wt&&I(f)&&(!tu.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?g.push(f((e=this._instance.config,t=this.Wt,r={payloadSizeLimitBytes:id.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...id.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...id.payloadHostDenyList]},n=!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=r.payloadSizeLimitBytes)?i:1e6),l=e=>(null!=e&&e.requestBody&&(e.requestBody=iv(e.requestBody,e.requestHeaders,s,"Request")),null!=e&&e.responseBody&&(e.responseBody=iv(e.responseBody,e.responseHeaders,s,"Response")),e),c=t=>{var i;return l(((e,t)=>{var i,s=th(e.name),r=0===t.indexOf("http")?null==(i=th(t))?void 0:i.pathname:t;"/"===r&&(r="");var n=null==s?void 0:s.pathname.replace(r||"","");if(!(s&&n&&i_.some(e=>0===n.indexOf(e))))return e})((A(i=t.requestHeaders)||X(Object.keys(null!=i?i:{}),e=>{ip.includes(e.toLowerCase())&&(i[e]=ih)}),t),e.api_host))},(u=I(e.session_recording.maskNetworkRequestFn))&&I(e.session_recording.maskCapturedNetworkRequestFn)&&U.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 _({},t,{name:null==i?void 0:i.url})}),r.maskRequestFn=I(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var i,s=c(t);return s&&null!=(i=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(s))?i:void 0}:e=>(function(e){if(!R(e))return e.requestBody=im(e.requestBody,"Request"),e.responseBody=im(e.responseBody,"Response"),e})(c(e)),_({},id,r,{recordHeaders:n,recordBody:o,recordPerformance:a,recordInitialRequests:a})))):sd.info("NetworkCapture not started because we are on localhost.")),g}onRRwebEmit(e){var t;if(this.ji(),e&&$(e)){if(e.type===il.Meta){var i=this.Si(e.data.href);if(this.Li=i,!i)return;e.data.href=i}else this.Ni();if(this.Xt.checkUrlTriggerConditions(()=>this.zi(),()=>this.Ui(),e=>this.qi(e)),!this.Xt.urlBlocked||e.type===il.Custom&&"recording paused"===e.data.tag){e.type===il.FullSnapshot&&this.Mi(),e.type===il.FullSnapshot&&this.Kt&&this.Nt.triggerStatus(this.sessionId)===i9&&this.mi();var s=this.Ai?this.Ai.throttleMutations(e):e;if(s){var r=function(e){if(e&&$(e)&&6===e.type&&$(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.Ci(r),!0!==this.ii||sf(r)){if(sf(r)){var n=r.data.payload;n&&(r.timestamp=n.lastActivityTimestamp+n.threshold)}var o=null==(t=this._instance.config.session_recording.compress_events)||t?function(e){if(1024>ia(e))return e;try{if(e.type===il.FullSnapshot)return _({},e,{data:sv(e.data),cv:"2024-10"});if(e.type===il.IncrementalSnapshot&&e.data.source===ic.Mutation)return _({},e,{cv:"2024-10",data:_({},e.data,{texts:sv(e.data.texts),attributes:sv(e.data.attributes),removes:sv(e.data.removes),adds:sv(e.data.adds)})});if(e.type===il.IncrementalSnapshot&&e.data.source===ic.StyleSheetRule)return _({},e,{cv:"2024-10",data:_({},e.data,{adds:e.data.adds?sv(e.data.adds):void 0,removes:e.data.removes?sv(e.data.removes):void 0})})}catch(e){sd.error("could not compress event - will use uncompressed event",e)}return e}(r):r,a={$snapshot_bytes:ia(o),$snapshot_data:o,$session_id:this.Ft,$window_id:this.gi};this.status!==i2?this.Bi(a):this.mi()}}}}}Ni(){if(!this._instance.config.capture_pageview&&t){var e=this.Si(t.location.href);this.Li!==e&&(this.di("$url_changed",{href:e}),this.Li=e)}}ji(){if(this.ti.length){var e=[...this.ti];
1this.ti=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this.Oi(e)})}}Si(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}mi(){return this.H={size:0,data:[],sessionId:this.Ft,windowId:this.gi},this.H}hi(){this.Hi&&(clearTimeout(this.Hi),this.Hi=void 0);var e=this.Vt,t=this.Ut,i=O(t)&&t>=0,s=O(e)&&i&&t<e;return this.status===i6||this.status===i4||this.status===i2||s?(this.Hi=setTimeout(()=>{this.hi()},2e3),this.H):(this.H.data.length>0&&(function e(t,i){if(void 0===i&&(i=6606028.8),t.size>=i&&t.data.length>1){var s=Math.floor(t.data.length/2),r=t.data.slice(0,s),n=t.data.slice(s);return[e({size:ia(r),data:r,sessionId:t.sessionId,windowId:t.windowId}),e({size:ia(n),data:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(e=>e)}return[t]})(this.H).forEach(e=>{this.Wi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:g.LIB_VERSION})}),this.mi())}Bi(e){var t,i=2+((null==(t=this.H)?void 0:t.data.length)||0);!this.ii&&(this.H.size+e.$snapshot_bytes+i>943718.4||this.H.sessionId!==this.Ft)&&(this.H=this.hi()),this.H.size+=e.$snapshot_bytes,this.H.data.push(e.$snapshot_data),this.Hi||this.ii||(this.Hi=setTimeout(()=>{this.hi()},2e3))}Wi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.fi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}qi(e){var t;this.Nt.triggerStatus(this.sessionId)===i9&&(null==(t=this._instance)||null==(t=t.persistence)||t.register({["url"===e?eI:e$]:this.Ft}),this.hi(),this.Ei(e+"_trigger_matched"))}zi(){this.Xt.urlBlocked||(this.Xt.urlBlocked=!0,clearInterval(this.$i),sd.info("recording paused due to URL blocker"),this.di("recording paused",{reason:"url blocker"}))}Ui(){this.Xt.urlBlocked&&(this.Xt.urlBlocked=!1,this.Fi(),this.Mi(),this.di("recording resumed",{reason:"left blocked url"}),sd.info("recording resumed"))}wi(){0!==this.Qt.Mt.length&&A(this.ai)&&(this.ai=this._instance.on("eventCaptured",e=>{try{this.Qt.Mt.includes(e.event)&&this.qi("event")}catch(e){sd.error("Could not activate event trigger",e)}}))}overrideLinkedFlag(){this.Zt.linkedFlagSeen=!0,this.Fi(),this.Ei("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[eS]:!0}),this.Fi(),this.Ei("sampling_overridden")}overrideTrigger(e){this.qi(e)}Ei(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),sd.info(e.replace("_"," "),t),m(["recording_initialized","session_id_changed"],e)||this.di(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.jt.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.H.data.length,$sdk_debug_replay_internal_buffer_size:this.H.size,$sdk_debug_current_session_duration:this.Ut,$sdk_debug_session_start:e}}constructor(e){if(this.Yt=sl,this.Kt=!1,this.ti=[],this.ii="unknown",this.ei=Date.now(),this.Nt=new sr,this.ri=void 0,this.si=void 0,this.ni=void 0,this.oi=void 0,this.ai=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.li=()=>{this.hi()},this.ui=()=>{this.di("browser offline",{})},this.vi=()=>{this.di("browser online",{})},this.ci=()=>{if(null!=a&&a.visibilityState){var e="window "+a.visibilityState;this.di(e,{})}},this._instance=e,this.Dt=!1,this.fi="/s/",this.pi=void 0,this.Kt=!1,!this._instance.sessionManager)throw sd.error("started without valid sessionManager"),Error(sh+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw Error(sh+' cannot be used with cookieless_mode="always"');this.Zt=new so(this._instance),this.Xt=new sn(this._instance),this.Qt=new sa(this._instance);var{sessionId:t,windowId:i}=this.jt.checkAndGetSessionAndWindowId();this.Ft=t,this.gi=i,this.H=this.mi(),this.At>=this.jt.sessionTimeoutMs&&sd.warn("session_idle_threshold_ms ("+this.At+") is greater than the session timeout ("+this.jt.sessionTimeoutMs+"). Session will never be detected as idle")}}var sy=z("[SegmentIntegration]"),sb="posthog-js";function sw(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if(!("*"===n||n.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var a,l,c,u,h,d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
1on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null==(a=t.exception)?void 0:a.values)||[],g=p.map(e=>_({},e,{stacktrace:e.stacktrace?_({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>_({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_personURL:d,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(h=p[0])?void 0:h.type,$sentry_tags:t.tags};return i&&s&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),o&&e.exceptions.sendExceptionEvent(v),t}}class sE{constructor(e,t,i,s,r,n){this.name=sb,this.setupOnce=function(o){o(sw(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}var sk=null!=t&&t.location?t_(t.location.hash,"__posthog")||t_(location.hash,"state"):null,sx="_postHogToolbarParams",sS=z("[Toolbar]"),sI=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(sI||{});class s${Gi(e){p.ph_toolbar_state=e}Ji(){var e;return null!=(e=p.ph_toolbar_state)?e:sI.UNINITIALIZED}maybeLoadToolbar(e,i,s){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===s&&(s=void 0),!t||!a)return!1;e=null!=e?e:t.location,s=null!=s?s:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(e){return!1}i=null==t?void 0:t.localStorage}var r,n=sk||t_(e.hash,"__posthog")||t_(e.hash,"state"),o=n?Q(()=>JSON.parse(atob(decodeURIComponent(n))))||Q(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:s?s.replaceState(s.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(i.getItem(sx)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}Vi(e){var t=p.ph_load_toolbar||p.ph_load_editor;!A(t)&&I(t)?t(e,this.instance):sS.warn("No toolbar load function found")}loadToolbar(e){var i,s=!(null==a||!a.getElementById(eU));if(!t||s)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=_({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(t.localStorage.setItem(sx,JSON.stringify(_({},n,{source:void 0}))),this.Ji()===sI.LOADED)?this.Vi(n):this.Ji()===sI.UNINITIALIZED&&(this.Gi(sI.LOADING),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return sS.error("[Toolbar] Failed to load",e),void this.Gi(sI.UNINITIALIZED);this.Gi(sI.LOADED),this.Vi(n)}),er(t,"turbolinks:load",()=>{this.Gi(sI.UNINITIALIZED),this.loadToolbar(n)})),!0}Ki(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}constructor(e){this.instance=e}}var sF=z("[TracingHeaders]");class sR{nt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return sF.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.nt(this.lt):(null==(e=this.Yi)||e.call(this),null==(t=this.Xi)||t.call(this),this.Yi=void 0,this.Xi=void 0)}constructor(e){this.Yi=void 0,this.Xi=void 0,this.lt=()=>{var e,t;R(this.Yi)&&(null==(e=p.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),R(this.Xi)&&(null==(t=p.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}}var sP=z("[Web Vitals]");class sT{get allowedMetrics(){var e,t,i=$(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return R(i)?(null==(t=this._instance.persistence)?void 0:t.props[e_])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return($(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}
1get re(){var e=$(this._instance.config.capture_performance)&&O(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=null==l?void 0:l.protocol;if("http:"!==e&&"https:"!==e)return sP.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=$(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:M(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return M(t)?t:this.Qi}startIfEnabled(){this.isEnabled&&!this.C&&(sP.info("enabled, starting..."),this.nt(this.lt))}onRemoteConfig(e){var t=$(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=$(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ep]:t}),this._instance.persistence.register({[e_]:i})),this.Qi=t,this.startIfEnabled()}nt(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",t=>{t?sP.error("failed to load script",t):e()})}ee(){var e=t?t.location.href:void 0;return e||sP.error("Could not determine current URL"),e}constructor(e){var t;this.Qi=!1,this.C=!1,this.H={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Zi=()=>{clearTimeout(this.te),0!==this.H.metrics.length&&(this._instance.capture("$web_vitals",this.H.metrics.reduce((e,t)=>_({},e,{["$web_vitals_"+t.name+"_event"]:_({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.H={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ie=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(R(i))sP.error("Could not read session ID. Dropping metrics!");else{this.H=this.H||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.ee();R(s)||(A(null==e?void 0:e.name)||A(null==e?void 0:e.value)?sP.error("Invalid metric received",e):this.re&&e.value>=this.re?sP.error("Ignoring metric with value >= "+this.re,e):(this.H.url!==s&&(this.Zi(),this.te=setTimeout(this.Zi,this.flushToCaptureTimeoutMs)),R(this.H.url)&&(this.H.url=s),this.H.firstMetricTimestamp=R(this.H.firstMetricTimestamp)?Date.now():this.H.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.H.metrics.push(_({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.H.metrics.length===this.allowedMetrics.length&&this.Zi()))}},this.lt=()=>{var e,t,i,s,r=p.__PosthogExtensions__;R(r)||R(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.ie.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.ie.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.ie.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.ie.bind(this)),this.C=!0):sP.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Qi=!(null==(t=this._instance.persistence)||!t.props[ep]),this.startIfEnabled()}}var sC=z("[Heatmaps]");function sA(e){return $(e)&&"clientX"in e&&"clientY"in e&&O(e.clientX)&&O(e.clientY)}class sO{get flushIntervalMilliseconds(){var e=5e3;return $(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 R(this.instance.config.capture_heatmaps)?R(this.instance.config.enable_heatmaps)?this.Qi:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.C||(sC.info("starting..."),this.ne(),this.se=setInterval(this.oe.bind(this),this.flushIntervalMilliseconds));else{var e,t;clearInterval(null!=(e=this.se)?e:void 0),null==(t=this.ae)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ec]:t}),this.Qi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.H;return this.H=void 0,e}le(e){this.he(e.originalEvent,"deadclick")}ne(){t&&a&&(er(t,"beforeunload",this.oe.bind(this)),er(a,"click",e=>this.he(e||(null==t?void 0:t.event)),{capture:!0}),er(a,"mousemove",e=>this.ue(e||(null==t?void 0:t.event)),{capture:!0}),this.ae=new tU(this.instance,tj,this.le.bind(this)),this.ae.startIfEnabled(),this.C=!0)}de(e,i){var s=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,i,s){for(var r=e;r&&eW(r)&&!eY(r,"body")&&r!==s;){if(m(i,null==t?void 0:t.getComputedStyle(r).position))return!0;r=e5(r)}return!1}(e2(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:s),target_fixed:o,type:i}}he(e,t){var i;if(void 0===t&&(t="click"),!eV(e.target)&&sA(e)){var s=this.de(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.ve(_({}
1,s,{type:"rageclick"})),this.ve(s)}}ue(e){!eV(e.target)&&sA(e)&&(clearTimeout(this.ce),this.ce=setTimeout(()=>{this.ve(this.de(e,"mousemove"))},500))}ve(e){if(t){var i=t.location.href;this.H=this.H||{},this.H[i]||(this.H[i]=[]),this.H[i].push(e)}}oe(){this.H&&!F(this.H)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}constructor(e){var t;this.rageclicks=new to,this.Qi=!1,this.C=!1,this.se=null,this.instance=e,this.Qi=!(null==(t=this.instance.persistence)||!t.props[ec])}}class sM{doPageView(e,i){var s,r=this.fe(e,i);return this.pe={pathname:null!=(s=null==t?void 0:t.location.pathname)?s:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.fe(e,null==(t=this.pe)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.pe)?void 0:e.pageViewId}}fe(e,t){var i=this.pe;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=r;if(!(R(n)||R(o)||R(a)||R(l)||R(c)||R(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:q(o/n,0,1,U),d=n<=1?1:q(a/n,0,1,U),p=l<=1?1:q(c/l,0,1,U),g=l<=1?1:q(u/l,0,1,U);s=J(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}constructor(e){this._instance=e}}var sL=function(e){var t,i,s,r,n="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++){var o=e.charCodeAt(r),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),C(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=r+1)}return i>t&&(n+=e.substring(t,e.length)),n},sD=!!u||!!c,sN="text/plain",sH=(e,t)=>{var[i,s]=e.split("?"),r=_({},t);null==s||s.split("&").forEach(e=>{var[t]=e.split("=");delete r[t]});var n=td(r);return i+"?"+(n=n?(s?s+"&":"")+n:s)},sq=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),sj=e=>{var{data:t,compression:i}=e;if(t){if(i===tl.GZipJS){var s=new Blob([i0(i1(sq(t)),{mtime:0})],{type:sN});return{contentType:sN,body:s,estimatedSize:s.size}}if(i===tl.Base64){var r=(e=>"data="+encodeURIComponent("string"==typeof e?e:sq(e)))(function(e){var t,i,s,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=sL(e);do t=(n=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=n>>12&63,s=n>>6&63,r=63&n,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(s)+o.charAt(r);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}(sq(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var n=sq(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},sB=[];c&&sB.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:r,estimatedSize:n}=null!=(t=sj(e))?t:{},o=new Headers;X(e.headers,function(e,t){o.append(t,e)}),s&&o.append("Content-Type",s);var a=e.url,l=null;if(h){var u=new h;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),e.timeout)}}c(a,_({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&52428.8>(n||0),body:r,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){U.error(e)}null==e.callback||e.callback(s)})).catch(t=>{U.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),u&&sB.push({transport:"XHR",method:e=>{var t,i=new u;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}
1=null!=(t=sj(e))?t:{};X(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(r)}}),null!=o&&o.sendBeacon&&sB.push({transport:"sendBeacon",method:e=>{var t=sH(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!=(i=sj(e))?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;o.sendBeacon(t,n)}catch(e){}}});var sU=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function sz(e,t,i){return sq({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var sG={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>sU(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!sU(t,e))),icontains:(e,t)=>t.map(sV).some(t=>e.map(sV).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(sV).every(t=>e.map(sV).every(e=>!t.includes(e)))},sV=e=>e.toLowerCase(),sW=z("[Error tracking]");class sY{onRemoteConfig(e){var t,i,s,r=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.ge=r,this._instance.persistence&&this._instance.persistence.register({[eh]:this.ge,[ed]:n})}get _e(){var e,t=!!this._instance.get_property(ed),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}sendExceptionEvent(e){if(this.me(e))sW.info("Skipping exception capture because a suppression rule matched");else{if(this._e||!this.be(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});sW.info("Skipping exception capture because it was thrown by an extension")}}me(e){var t=e.$exception_list;if(!t||!S(t)||0===t.length)return!1;var i=t.reduce((e,t)=>{var{type:i,value:s}=t;return P(i)&&i.length>0&&e.$exception_types.push(i),P(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.ge.some(e=>{var t=e.values.map(e=>{var t,s=sG[e.operator],r=S(e.value)?e.value:[e.value],n=null!=(t=i[e.key])?t:[];return r.length>0&&s(r,n)});return"OR"===e.type?t.some(Boolean):t.every(Boolean)})}be(e){var t=e.$exception_list;return!(!t||!S(t))&&t.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}constructor(e){var t,i;this.ge=[],this._instance=e,this.ge=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(eh))?t:[]}}var sX="Mobile",sJ="Android",sK="Tablet",sZ=sJ+" "+sK,sQ="iPad",s0="Apple",s1=s0+" Watch",s2="Safari",s3="BlackBerry",s5="Samsung",s6=s5+"Browser",s4=s5+" Internet",s8="Chrome",s7=s8+" OS",s9=s8+" iOS",re="Internet Explorer",rt=re+" "+sX,ri="Opera",rs=ri+" Mini",rr="Edge",rn="Microsoft "+rr,ro="Firefox",ra=ro+" iOS",rl="Nintendo",rc="PlayStation",ru="Xbox",rh=sJ+" "+sX,rd=sX+" "+s2,rp="Windows",rg=rp+" Phone",r_="Nokia",rv="Ouya",rf="Generic",rm=rf+" "+sX.toLowerCase(),ry=rf+" "+sK.toLowerCase(),rb="Konqueror",rw="(\\d+(\\.\\d+)?)",rE=RegExp("Version/"+rw),rk=RegExp(ru,"i"),rx=RegExp(rc+" \\w+","i"),rS=RegExp(rl+" \\w+","i"),rI=RegExp(s3+"|PlayBook|BB10","i"),r$={"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"},rF=function(e,t){let i;return t=t||"",m(e," OPR/")&&m(e,"Mini")?rs:m(e," OPR/")?ri:rI.test(e)?s3:m(e,"IE"+sX)||m(e,"WPDesktop")?rt:m(e,s6)?s4:m(e,rr)||m(e,"Edg/")?rn:m(e,"FBIOS")?"Facebook "+sX:m(e,"UCWEB")||m(e,"UCBrowser")?"UC Browser":m(e,"CriOS")?s9:m(e,"CrMo")||m(e,s8)?s8:m(e,sJ)&&m(e,s2)?rh:m(e,"FxiOS")?ra:m(e.toLowerCase(),rb.toLowerCase())?rb:(i=t)&&m(i,s0)||m(e,s2)&&!m(e,s8)&&!m(e,sJ)?m(e,sX)?rd:s2:m(e,ro)?ro:m(e,"MSIE")||m(e,"Trident/")?re:m(e,"Gecko")?ro:""},rR={[rt]:[RegExp("rv:"+rw)],[rn]:[RegExp(rr+"?\\/"+rw)],[s8]:[RegExp("("+s8+"|CrMo)\\/"+rw)],[s9]:[RegExp("CriOS\\/"+rw)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+rw)],[s2]:[rE],[rd]:[rE],[ri]:[RegExp("(Opera|OPR)\\/"+rw)],[ro]:[RegExp(ro+"\\/"+rw)],[ra]:[RegExp("FxiOS\\/"+rw)],[rb]:[RegExp("Konqueror[:/]?"+rw,"i")],[s3]:[RegExp(s3+" "+rw),rE],[rh]:[RegExp("android\\s"+rw,"i")],[s4]:[RegExp(s6+"\\/"+rw)],[re]:[RegExp("(rv:|MSIE )"+rw)],Mozilla:[RegExp("rv:"+rw)]},rP=function(e,t){var i=rR[rF(e,t)];if(R(i))return null;for(var s=0;s<i.length;s++){var r=i[s],n=e.match(r);if(n)return parseFloat(n[n.length-2])}return null},rT=[[RegExp(ru+"; "+ru+" (.*?)[);]","i"),e=>[ru,e&&e[1]||""]],[RegExp(rl,"i"),[rl,""]],[RegExp(rc,"i"),[rc,""]],[rI,[s3,""]],[RegExp(rp,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[rg,""];if(new RegExp(sX).test(t)&&!/IEMobile\b/.test(t))return[rp+" "+sX,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=r$[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[rp,s]}return[rp,""]}],[/((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=R(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+sJ+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+sJ+")","i"),e=>e&&e[2]?[sJ,[e[2],e[3],e[4]||"0"].join(".")]:[sJ,""]],[/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/,[s7,""]],[/Linux|debian/i,["Linux",""]]],rC=function(e){return rS.test(e)?rl:rx.test(e)?rc:rk.test(e)?ru:RegExp(rv,"i").test(e)?rv:RegExp("("+rg+"|WPDesktop)","i").test(e)?rg:/iPad/.test(e)?sQ:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?s1:rI.test(e)?s3:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(r_,"i").test(e)?r_:/(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(sX).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)?sJ:sZ:sJ:RegExp("(pda|"+sX+")","i").test(e)?rm:RegExp(sK,"i").test(e)&&!RegExp(sK+" pc","i").test(e)?ry:""},rA="https?://(.*)",rO=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rM=K(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rO),rL="<masked>",rD=["li_fat_id"];function rN(e,t,i){if(!a)return{};var s,r=t?K([],rO,i||[]):[],n=rH(tg(a.URL,r,rL),e);return J((s={},X(rD,function(e){var t=tR.V(e);s[e]=t||null}),s),n)}function rH(e,t){var i=rM.concat(t||[]),s={};return X(i,function(t){var i=tp(e,t);s[t]=i||null}),s}function rq(e){var t=e?0===e.search(rA+"google.([^/?]*)")?"google":0===e.search(rA+"bing.com")?"bing":0===e.search(rA+"yaho
1o.com")?"yahoo":0===e.search(rA+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!C(t)){i.$search_engine=t;var s=a?tp(a.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rj(){return navigator.language||navigator.userLanguage}function rB(){return(null==a?void 0:a.referrer)||"$direct"}function rU(e,t){var i=e?K([],rO,t||[]):[],s=null==l?void 0:l.href.substring(0,1e3);return{r:rB().substring(0,1e3),u:s?tg(s,i,rL):void 0}}function rz(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=th(i))?void 0:t.host};if(s){r.$current_url=s;var n=th(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname,J(r,rH(s))}return i&&J(r,rq(i)),r}function rG(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rV=z("[FeatureFlags]"),rW="$active_feature_flags",rY="$override_feature_flags",rX="$feature_flag_payloads",rJ="$override_feature_flag_payloads",rK="$feature_flag_request_id",rZ=e=>{var t={};for(var[i,s]of Z(e||{}))s&&(t[i]=s);return t},rQ=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class r0{flags(){if(this._instance.config.__preview_remote_config)this.ke=!0;else{var e=!this.Ie&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Pe({disableFlags:e})}}get hasLoadedFlags(){return this.we}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(eP),t=this._instance.get_property(rY),i=this._instance.get_property(rJ);if(!i&&!t)return e||{};var s=J({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=s[r],l=null==t?void 0:t[r],c=R(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,u=R(l)?a.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[r],d=_({},a,{enabled:c,variant:c?null!=u?u:null==a?void 0:a.variant:void 0});c!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),u!==(null==a?void 0:a.variant)&&(d.original_variant=null==a?void 0:a.variant),h&&(d.metadata=_({},null==a?void 0:a.metadata,{payload:h,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),s[r]=d}return this.ye||(rV.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ye=!0),s}getFlagVariants(){var e=this._instance.get_property(eF),t=this._instance.get_property(rY);if(!t)return e||{};for(var i=J({},e),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.ye||(rV.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ye=!0),i}getFlagPayloads(){var e=this._instance.get_property(rX),t=this._instance.get_property(rJ);if(!t)return e||{};for(var i=J({},e||{}),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.ye||(rV.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ye=!0),i}reloadFeatureFlags(){this.$e||this._instance.config.advanced_disable_feature_flags||this.Ie||(this.Ie=setTimeout(()=>{this.Pe()},5))}Re(){clearTimeout(this.Ie),this.Ie=void 0}ensureFlagsLoaded(){this.we||this.Se||this.Ie||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.$e=e}Pe(e){var t;if(this.Re(),!this._instance.L())if(this.Se)this.xe=!0;else{var i={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:_({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(eT)||{}),group_properties:this._instance.get_property(eC)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var s=this._instance.config.__preview_remote_config,r=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",n=this._instance.requestRouter.endpointFor("api",(s?"/flags/?v=2":"/flags/?v=2&config=true")+r);s&&(i.timezone=rG()),this.Se=!0,this._instance.Te({method:"POST",url:n,data:i,compression:this._instance.config.disable_compression?void 0:tl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,s,r,n=!0;200===e.statusCode&&(this.xe||(this.$anon_distinct_id=void 0),n=!1),this.Se=!1,this.ke||(this.ke=!0,this._instance.Ce(null!=(r=e.json)?r:{})),(!i.disable_flags||this.xe)&&((this.Ee=!n,e.json&&null!=(s=e.json.quotaLimited)&&s.includes(rQ.FeatureFlags))?rV.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(i.disable_flags||this.receivedFeatureFlags(null!=(t=e.json)?t:{},n),this.xe&&(this.xe=!1,this.Pe())))}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.we||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,r=this._instance.get_property(rK)||void 0,n=this._instance.get_property(eM)||{};if((t.send_event||!("send_event"in t))&&(!(e in n)||!n[e].includes(s))){S(n[e])?n[e].push(s):n[e]=[s],null==(l=this._instance.persistence)||l.register({[eM]:n});var o=this.getFeatureFlagDetails(e),a={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_bootstrapped_response:(null==(c=this._instance.config.bootstrap)||null==(c=c.featureFlags)?void 0:c[e])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[e])||null,$used_bootstrap_value:!this.Ee};R(null==o||null==(h=o.metadata)?void 0:h.version)||(a.$feature_flag_version=o.metadata.version);var l,c,u,h,d,p,g,_,v,f,m=null!=(d=null==o||null==(p=o.reason)?void 0:p.description)?d:null==o||null==(g=o.reason)?void 0:g.code;m&&(a.$feature_flag_reason=m),null!=o&&null!=(_=o.metadata)&&_.id&&(a.$feature_flag_id=o.metadata.id),R(null==o?void 0:o.original_variant)&&R(null==o?void 0:o.original_enabled)||(a.$feature_flag_original_response=R(o.original_variant)?o.original_enabled:o.original_variant),null!=o&&null!=(v=o.metadata)&&v.original_payload&&(a.$feature_flag_original_payload=null==o||null==(f=o.metadata)?void 0:f.original_payload),this._instance.capture("$feature_flag_called",a)}return i}rV.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token;this._instance.Te({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:i}
1,compression:this._instance.config.disable_compression?void 0:tl.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.we||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return R(i)?void 0:!!i}rV.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.we=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),r=this.getFlagsWithDetails();!function(e,t,i,s,r){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var n,o=((n=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(n).map(e=>{var t;return[e,null!=(t=n[e].variant)?t:n[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(n).filter(e=>n[e].enabled).filter(e=>{var t;return null==(t=n[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))):rV.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),a=o.flags,l=o.featureFlags,c=o.featureFlagPayloads;if(l){var u=e.requestId;if(S(l)){rV.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var d=0;d<l.length;d++)h[l[d]]=!0;t&&t.register({[rW]:l,[eF]:h})}else{var p=l,g=c,v=a;e.errorsWhileComputingFlags&&(p=_({},i,p),g=_({},s,g),v=_({},r,v)),t&&t.register(_({[rW]:Object.keys(rZ(p)),[eF]:p||{},[rX]:g||{},[eP]:v||{}},u?{[rK]:u}:{}))}}}(e,this._instance.persistence,i,s,r),this.Me(t)}}override(e,t){void 0===t&&(t=!1),rV.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return rV.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(rY),this._instance.persistence.unregister(rJ),void this.Me();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.ye=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(rY);else if(e.flags)if(S(e.flags)){for(var i={},s=0;s<e.flags.length;s++)i[e.flags[s]]=!0;this._instance.persistence.register({[rY]:i})}else this._instance.persistence.register({[rY]:e.flags})}return"payloads"in e&&(!1===e.payloads?this._instance.persistence.unregister(rJ):e.payloads&&this._instance.persistence.register({[rJ]:e.payloads})),void this.Me()}this.Me()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.we){var{flags:t,flagVariants:i}=this.Oe();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this._instance.get_property(eR)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(o.$early_access_feature_name=r.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=_({},this.getFlagVariants(),{[e]:t});null==(s=this._instance.persistence)||s.register({[rW]:Object.keys(rZ(a)),[eF]:a}),this.Me()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(eR),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance.Te({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(eR),null==(s=this._instance.persistence)||s.register({[eR]:r}),e(r)}}})}Oe(){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),{})}}Me(e){var{flags:t,flagVariants:i}=this.Oe();
1this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(eT)||{};this._instance.register({[eT]:_({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(eT)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(eC)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=_({},i[t],e[t]),delete e[t]}),this._instance.register({[eC]:_({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(eC)||{};this._instance.register({[eC]:_({},t,{[e]:{}})})}else this._instance.unregister(eC)}reset(){this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this.ke=!1,this.Ee=!1,this.$anon_distinct_id=void 0,this.Re(),this.ye=!1}constructor(e){this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this.ke=!1,this.Ee=!1,this._instance=e,this.featureFlagEventHandlers=[]}}var r1=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class r2{isDisabled(){return!!this.je}De(e){-1===r1.indexOf(e.persistence.toLowerCase())&&(U.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&tT.G()?tT:"localstorage+cookie"===t&&tA.G()?tA:"sessionstorage"===t&&tD.G()?tD:"memory"===t?tM:"cookie"===t?tR:tA.G()?tA:tR}properties(){var e={};return X(this.props,function(t,i){if(i===eF&&$(t))for(var s,r=Object.keys(t),o=0;o<r.length;o++)e["$feature/"+r[o]]=t[r[o]];else s=!1,(C(eG)?s:n&&eG.indexOf===n?-1!=eG.indexOf(i):(X(eG,function(e){if(s||(s=e===i))return W}),s))||(e[i]=t)}),e}load(){if(!this.je){var e=this.it.K(this.Ae);e&&(this.props=J({},e))}}save(){this.je||this.it.Y(this.Ae,this.props,this.Le,this.Ne,this.ze,this.A.debug)}remove(){this.it.X(this.Ae,!1),this.it.X(this.Ae,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if($(e)){R(t)&&(t="None"),this.Le=R(i)?this.Ue:i;var s=!1;if(X(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($(e)){this.Le=R(t)?this.Ue:t;var i=!1;if(X(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.Fe){var e=rN(this.A.custom_campaign_params,this.A.mask_personal_data_properties,this.A.custom_personal_data_properties);F(et(e))||this.register(e),this.Fe=!0}}update_search_keyword(){var e;this.register((e=null==a?void 0:a.referrer)?rq(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rB(),$referring_domain:null!=a&&a.referrer&&(null==(e=th(a.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[eH]||this.props[eq]||this.register_once({[ej]:rU(this.A.mask_personal_data_properties,this.A.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};X([eq,eH],t=>{var i=this.props[t];i&&X(i,function(t,i){e["$initial_"+b(i)]=t})});var t,i,s=this.props[ej];return s&&J(e,(t=rz(s),i={},X(t,function(e,t){i["$initial_"+b(t)]=e}),i)),e}safe_merge(e){return X(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Ue=this.Le=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var s=this.De(e),r=this.props;this.clear(),this.it=s,this.props=r,this.save()}}set_disabled(e){this.je=e,this.je?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ne&&(this.Ne=e,this.remove(),this.save())}set_secure(e){e!==this.ze&&(this.ze=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[ea]||{};i[e]=t,this.props[ea]=i,this.save()}remove_event_timer(e){var t=(this.props[ea]||{})[e];return R(t)||(delete this.props[ea][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}constructor(e,t){this.A=e,this.props={},this.Fe=!1,this.Ae=(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.it=this.De(e),this.load(),e.debug&&U.info("Persistence loaded",e.persistence,_({},this.props)),this.update_config(e,e,t),this.save()}}(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})({}),function(e){e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}({});var r3=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),r5=(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}({}),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}({}),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}({}),function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({})),r6=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_
1START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),r4=function(e){return e.Popover="popover",e.Inline="inline",e}({});class r8{on(e,t){return this.qe[e]||(this.qe[e]=[]),this.qe[e].push(t),()=>{this.qe[e]=this.qe[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.qe[e]||[])i(t);for(var s of this.qe["*"]||[])s(e,t)}constructor(){this.qe={},this.qe={}}}class r7{init(){var e,t;R(null==(e=this._instance)?void 0:e.Ye)||null==(t=this._instance)||t.Ye((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!R(null==(t=this._instance)?void 0:t.Ye)&&(e.forEach(e=>{var t,i;null==(t=this.Ke)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Ve)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Ve.has(e)||this.Ve.has(null==t?void 0:t.event))&&this.Ke&&(null==(i=this.Ke)?void 0:i.size)>0&&this.Ke.forEach(e=>{this.Xe(t,e)&&this.Be.emit("actionCaptured",e.name)})}Qe(e){this.onAction("actionCaptured",t=>e(t))}Xe(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.He(e,i))return!0;return!1}onAction(e,t){return this.Be.on(e,t)}Ge(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||!r7.Ze(s,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static Ze(e,i,s){switch(s){case"regex":return!!t&&sU(e,i);case"exact":return i===e;case"contains":return sU(e,r7.tr(i).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static tr(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Je(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.ir(e).some(e=>!(null!=t&&t.href&&!r7.Ze(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))&&!(null!=t&&t.text&&!r7.Ze(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!r7.Ze(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}ir(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}constructor(e){this.Be=new r8,this.He=(e,t)=>this.We(e,t)&&this.Ge(e,t)&&this.Je(e,t),this.We=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Ve=new Set,this.Ke=new Set}}var r9=z("[Surveys]"),ne="seenSurvey_",nt=e=>{var t=""+ne+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+ne+e.id+"_"+e.current_iteration),t},ni=[r3.Popover,r3.Widget,r3.API],ns={ignoreConditions:!1,ignoreDelay:!1,displayType:r4.Popover};class nr{register(e){var t;R(null==(t=this._instance)?void 0:t.Ye)||(this.sr(e),this.nr(e))}nr(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.ar&&(this.ar=new r7(this._instance),this.ar.init(),this.ar.Qe(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.ar)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.rr.get(t.name);i&&i.push(e.id),this.rr.set(t.name,i||[e.id])}}))}))}sr(e){var t;0!==e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}).length&&(null==(t=this._instance)||t.Ye((e,t)=>{this.onEvent(e,t)}
1),e.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach(t=>{if(t&&t.name){var i=this.er.get(t.name);i&&i.push(e.id),this.er.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,s=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[eO])||[];if("survey shown"===e&&t&&s.length>0){r9.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:s});var r,n=null==t||null==(r=t.properties)?void 0:r.$survey_id;if(n){var o=s.indexOf(n);o>=0&&(s.splice(o,1),this.lr(s))}}else this.er.has(e)&&(r9.info("survey event matched, updating activated surveys",{event:e,surveys:this.er.get(e)}),this.lr(s.concat(this.er.get(e)||[])))}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[eO])||[];this.rr.has(e)&&this.lr(i.concat(this.rr.get(e)||[]))}lr(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[eO]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[eO])||[]}getEventToSurveys(){return this.er}hr(){return this.ar}constructor(e){this._instance=e,this.er=new Map,this.rr=new Map}}class nn{onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(A(t))return r9.warn("Flags not loaded yet. Not loading surveys.");var i=S(t);this.ur=i?t.length>0:t,r9.info("flags response received, isSurveysEnabled: "+this.ur),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(ne)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.vr)r9.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)r9.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())r9.info("Not loading surveys in cookieless mode without consent.");else{var e=null==p?void 0:p.__PosthogExtensions__;if(e){if(!R(this.ur)||this._instance.config.advanced_enable_surveys){var t=this.ur||this._instance.config.advanced_enable_surveys;this.vr=!0;try{var i=e.generateSurveys;if(i)return void this.pr(i,t);var s=e.loadExternalDependency;if(!s)return void this.gr("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.gr("Could not load surveys script",i):this.pr(e.generateSurveys,t)})}catch(e){throw this.gr("Error initializing surveys",e),e}finally{this.vr=!1}}}else r9.error("PostHog Extensions not found.")}}pr(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new nr(this._instance),r9.info("Surveys loaded successfully"),this._r({isLoaded:!0})}gr(e,t){r9.error(e,t),this._r({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.cr.push(e),this._surveyManager&&this._r({isLoaded:!0}),()=>{this.cr=this.cr.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return r9.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(eA);if(i&&!t)return e(i,{isLoaded:!0});if(this.dr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.dr=!0,this._instance.Te({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{this.dr=!1;var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return r9.error(s),e([],{isLoaded:!1,error:s})}var r,n,o=t.json.surveys||[],a=o.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),null==(r=this._instance.persistence)||r.register({[eA]:o}),e(o,{isLoaded:!0})}})}catch(e){throw this.dr=!1,e}}_r(e){for(var t of this.cr)try{if(!e.isLoaded)return t([],e);
1this.getSurveys(t)}catch(e){r9.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!A(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);r9.warn("init was not called")}mr(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}br(e){if(A(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.mr(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(A(this._surveyManager))return r9.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.br(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return A(this._surveyManager)?(r9.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.br(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){var i;if(A(this._surveyManager))r9.warn("init was not called");else{var s="string"==typeof e?this.mr(e):e;if(null!=s&&s.id)if(ni.includes(s.type)){var r=null==a?void 0:a.querySelector(t);if(r)return null!=(i=s.appearance)&&i.surveyPopupDelaySeconds?(r9.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;r9.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,r),r9.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,r);r9.warn("Survey element not found")}else r9.warn("Surveys of type "+s.type+" cannot be rendered in the app");else r9.warn("Survey not found")}}displaySurvey(e,t){var i;if(A(this._surveyManager))r9.warn("init was not called");else{var s=this.mr(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=_({},s,{appearance:_({},s.appearance,{surveyPopupDelaySeconds:0})})),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void r9.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==r4.Inline?this._surveyManager.handlePopoverSurvey(r):this.renderSurvey(r,t.selector)}else r9.warn("Survey not found")}}constructor(e){this.ur=void 0,this._surveyManager=null,this.dr=!1,this.vr=!1,this.cr=[],this._instance=e,this._surveyEventReceiver=null}}var no=z("[RateLimiter]");class na{clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=(new Date).getTime(),n=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(eN))?t:{tokens:this.captureEventsBurstLimit,last:r};n.tokens+=(r-n.last)/1e3*this.captureEventsPerSecond,n.last=r,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var o=n.tokens<1;return o||e||(n.tokens=Math.max(0,n.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(s=this.instance.persistence)||s.set_property(eN,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{no.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void no.warn('could not rate limit - continuing. Error: "'+(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}}var nl=z("[RemoteConfig]");class nc{get remoteConfig(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}yr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(nl.error("PostHog Extensions not found. Cannot load remote config."),e())}wr(e){this._instance.Te({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return nl.info("Using preloaded remote config",this.remoteConfig),void this.Ce(this.remoteConfig);if(this._instance.L())return void nl.warn("Remote config is disabled. Falling back to local config.");this.yr(e=>{if(!e)return nl.info("No config found after loading remote JS config. Falling back to JSON."),void this.wr(e=>{this.Ce(e)});this.Ce(e)})}catch(e){nl.error("Error loading remote config",e)}}Ce(e){e?this._instance.config.__preview_remote_config?(this._instance.Ce(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):nl.info("__preview_remote_config is disabled. Logging config instead",e):nl.error("Failed to fetch remote config from PostHog.")}constructor(e){this._instance=e}}class nu{enqueue(e){this.$r.push(e),this.Ir||this.Pr()}unload(){this.Rr();var e=Object.values(this.$r.length>0?this.Tr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Er(_({},e,{transport:"sendBeacon"}))})}enable(){this.Sr=!1,this.Pr()}Pr(){var e=this;this.Sr||(this.Ir=setTimeout(()=>{if(this.Rr(),this.$r.length>0){var t=this.Tr();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&S(s.data)&&X(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Er(s)}()}},this.kr))}Rr(){clearTimeout(this.Ir),this.Ir=void 0}Tr(){var e={};return X(this.$r,t=>{var i,s=(t?t.batchKey:null)||t.url;R(e[s])&&(e[s]=_({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.$r=[],e}constructor(e,t){this.Sr=!0,this.$r=[],this.kr=q((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,U.createLogger("flush interval"),3e3),this.Er=e}}var nh=["retriesPerformedSoFar"];class nd{get length(){return this.$r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=v(e,nh);O(t)&&t>0&&(i.url=sH(i.url,{retry_count:t})),this._instance.Te(_({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Fr(_({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}Fr(e){var t,i,s,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=(s=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,r)))-t/2),Math.ceil(i+s)),o=Date.now()+n;this.$r.push({retryAt:o,requestOptions:e});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),U.warn(a),this.Cr||(this.Cr=!0,this.Ar())}Ar(){this.Dr&&clearTimeout(this.Dr),this.Dr=setTimeout(()=>{this.Or&&this.$r.length>0&&this.oe(),this.Ar()},this.Mr)}oe(){var e=Date.now(),t=[],i=this.$r.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.$r=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Dr&&(clearTimeout(this.Dr),this.Dr=void 0),this.$r))try{this._instance.Te(_({},e,{transport:"sendBeacon"}))}catch(e){U.error(e)}this.$r=[]}constructor(e){this.Cr=!1,this.Mr=3e3,this.$r=[],this._instance=e,this.$r=[],this.Or=!0,!R(t)&&"onLine"in t.navigator&&(this.Or=t.navigator.onLine,er(t,"online",()=>{this.Or=!0,this.oe()}),er(t,"offline",()=>{this.Or=!1}))}}class np{getContext(){return this.Lr}resetContext(){var e=this.Lr;return setTimeout(this.jr,0),e}
1startMeasuringScrollPosition(){er(t,"scroll",this.jr,{capture:!0}),er(t,"scrollend",this.jr,{capture:!0}),er(t,"resize",this.jr)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==t?void 0:t.document.documentElement;for(var e of S(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var i=null==t?void 0:t.document.querySelector(e);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return t&&(t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return t&&(t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft)||0}constructor(e){this.jr=()=>{this.Lr||(this.Lr={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Lr.lastScrollY=Math.ceil(n),this.Lr.maxScrollY=Math.max(n,null!=(e=this.Lr.maxScrollY)?e:0),this.Lr.maxScrollHeight=Math.max(o,null!=(t=this.Lr.maxScrollHeight)?t:0),this.Lr.lastContentY=a,this.Lr.maxContentY=Math.max(a,null!=(i=this.Lr.maxContentY)?i:0),this.Lr.maxContentHeight=Math.max(l,null!=(s=this.Lr.maxContentHeight)?s:0)},this._instance=e}}var ng=e=>rU(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class n_{zr(){return this.qr.props[eD]}getSetOnceProps(){var e,t=null==(e=this.zr())?void 0:e.props;return t?"r"in t?rz(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return X(et(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+b(i)]=t}),e}constructor(e,t,i,s){this.Nr=e=>{var t=this.zr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ur(this._instance)};this.qr.register({[eD]:i})}},this._instance=e,this.Br=t,this.qr=i,this.Ur=s||ng,this.Br.onSessionId(this.Nr)}}var nv=z("[SessionId]");class nf{get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return R(this.Hr)&&(this.Hr=[]),this.Hr.push(e),this.Ft&&e(this.Ft,this.gi),()=>{this.Hr=this.Hr.filter(t=>t!==e)}}Xr(){return"memory"!==this.A.persistence&&!this.qr.je&&tD.G()}ts(e){e!==this.gi&&(this.gi=e,this.Xr()&&tD.Y(this.Kr,e))}es(){return this.gi?this.gi:this.Xr()?tD.K(this.Kr):null}Qr(e,t,i){e===this.Ft&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Ft=e,this.qr.register({[ex]:[t,e,i]}))}rs(){if(this.Ft&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ft,this._sessionStartTimestamp];var e=this.qr.props[ex];return S(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Qr(null,null,null)}Zr(){er(t,"beforeunload",()=>
1{this.Xr()&&tD.X(this.Yr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.A.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[s,r,n]=this.rs(),o=this.es(),a=O(n)&&n>0&&Math.abs(i-n)>864e5,l=!1,c=!r,u=!e&&this.Wr(i,s);c||u||a?(r=this.Gr(),o=this.Jr(),nv.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.Jr(),l=!0);var h=0===s||!e||a?i:s,d=0===n?(new Date).getTime():n;return this.ts(o),this.Qr(r,h,d),e||this.Vr(),l&&this.Hr.forEach(e=>e(r,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:r,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:s}}Vr(){clearTimeout(this.ss),this.ss=setTimeout(()=>{var[e]=this.rs();this.Wr((new Date).getTime(),e)&&this.resetSessionId()},1.1*this.sessionTimeoutMs)}constructor(e,t,i){if(this.Hr=[],this.Wr=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.A=e.config,this.qr=e.persistence,this.gi=void 0,this.Ft=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Gr=t||tS,this.Jr=i||tS;var s,r=this.A.persistence_name||this.A.token,n=this.A.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*q(n,60,36e3,nv.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Vr(),this.Kr="ph_"+r+"_window_id",this.Yr="ph_"+r+"_primary_window_exists",this.Xr()){var o=tD.K(this.Kr),a=tD.K(this.Yr);o&&!a?this.gi=o:tD.X(this.Kr),tD.Y(this.Yr,!0)}if(null!=(s=this.A.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.A.bootstrap.sessionID);this.Qr(this.A.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){nv.error("Invalid sessionID in bootstrap",e)}this.Zr()}}var nm=["$set_once","$set"],ny=z("[SiteApps]");class nb{get isEnabled(){return!!this._instance.config.opt_in_site_apps}os(e,t){if(t){var i=this.globalsForEvent(t);this.ns.push(i),this.ns.length>1e3&&(this.ns=this.ns.slice(10))}}get siteAppLoaders(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ye(this.os.bind(this));this.ls=()=>{e(),this.ns=[],this.ls=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,o,a,l={},c=this._instance.get_property("$groups")||[];for(var[u,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:h};var{$set_once:d,$set:p}=e;return{event:_({},v(e,nm),{properties:_({},e.properties,p?{$set:_({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:_({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",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=this.apps[e.id],i=()=>{var i;!t.errored&&this.ns.length&&(ny.info("Processing "+this.ns.length+" events for site app with id "+e.id),this.ns.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.ls)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,ny.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{r(e)}});n&&(t.processEvent=n),s=!0}catch(t){ny.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){ny.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}hs(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}us(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){ny.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.hs(),void this._instance.on("eventCaptured",e=>this.us(e))):void ny.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.ls)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;p["__$$ph_site_app_"+e]=r._instance,null==(t=p.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,a,t=>{if(t)return ny.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else ny.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}constructor(e){this._instance=e,this.ns=[],this.apps={}}}var nw=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hub
1spot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],nE=function(e,t){if(!e)return!1;var i=e.toLowerCase();return nw.concat(t||[]).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},nk=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&nE(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>nE(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},nx=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),nS="i.posthog.com";class nI{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("."+nS,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.ds[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ds[this.apiHost]=nx.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ds[this.apiHost]=nx.EU:this.ds[this.apiHost]=nx.CUSTOM),this.ds[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if(this.region===nx.CUSTOM)return this.apiHost+t;var i=nS+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}constructor(e){this.ds={},this.instance=e}}var n$={icontains:(e,i)=>!!t&&i.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,i)=>!!t&&-1===i.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,i)=>!!t&&sU(i.href,e),not_regex:(e,i)=>!!t&&!sU(i.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class nF{onFeatureFlags(e){if(this._is_bot())nF.vs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(A(this.cs))return this.cs=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nF.vs("applying feature flags",e),e.forEach(e=>{var t;if(this.cs&&null!=(t=this.cs)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.cs)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.fs(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=nF.getWindowLocation();if(null!=e&&e.search){var t=tp(null==e?void 0:e.search,"__experiment_id"),i=tp(null==e?void 0:e.search,"__experiment_variant");t&&i&&(nF.vs("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.gs(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.Te({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}gs(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(nF.vs("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.fs(s[0].name,t,s[0].variants[t].transforms))}static ps(e){return!A(e.conditions)&&nF._s(e)&&nF.bs(e)}static _s(e){if(A(e.conditions)||A(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,r,n=nF.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||n$[null!=(s=null==(r=e.conditions)?void 0:r.urlMatchType)?s:"icontains"](e.conditions.url,n))}
1static getWindowLocation(){return null==t?void 0:t.location}static bs(e){if(A(e.conditions)||A(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rN();if(t.utm_source){var i,s,r,n,o,a,l,c,u,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,g=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==t.utm_term;return h&&p&&g&&d}return!1}static vs(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];U.info("[WebExperiments] "+e,i)}fs(e,t,i){this._is_bot()?nF.vs("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){nF.vs("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):nF.vs("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?nk(o,this._instance.config.custom_blocked_useragents):void 0}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{nF.vs("retrieved web experiments from the server"),t.cs=new Map,e.forEach(e=>{if(e.feature_flag_key){t.cs&&(nF.vs("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.cs)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);P(s)&&e.variants[s]&&t.fs(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];nF.ps(n)&&t.fs(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}}var nR=z("[PostHog ExternalIntegrations]"),nP={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nT{nt(e,t){var i;null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nR.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=p.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.nt(nP[e],()=>{var i;null==(i=p.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=p.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=p.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}constructor(e){this._instance=e}}var nC="[SessionRecording]",nA=z(nC);class nO{get started(){var e;return!(null==(e=this.ys)||!e.isStarted)}get status(){var e;return(null==(e=this.ys)?void 0:e.status)||"lazy_loading"}get qt(){var e=!!this._instance.get_property(ev),i=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return t&&e&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.qt||null==(t=this.ys)||!t.isStarted){var i=!R(Object.assign)&&!R(Array.from);this.qt&&i?(this.ws(e),nA.info("starting")):this.stopRecording()}}ws(e){var t,i,s;this.qt&&(null!=p&&null!=(t=p.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=p.__PosthogExtensions__)&&i.initSessionRecording?this.Pi(e):null==(s=p.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Ri,t=>{if(t)return nA.error("could not load recorder",t);this.Pi(e)}))}stopRecording(){var e;null==(e=this.ys)||e.stop()}onRemoteConfig(e){this.Ss=e;var t,i=this._instance.persistence;i&&i.register({[ev]:!!e.sessionRecording,[ek]:null==(t=e.sessionRecording)?void 0:t.scriptConfig}),this.ys?(this.ys.onRemoteConfig(e),this.Ss=void 0):this.ws(),this.startIfEnabledOrStop()}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.ys)&&i.log?this.ys.log(e,t):nA.warn("log called before recorder was ready")}get Ri(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(ek))?void 0:e.script)||"lazy-recorder"}Pi(e){var t,i;if(null==(t=p.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.ys||(this.ys=null==(i=p.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture,this.Ss&&(this.ys.onRemoteConfig(this.Ss),this.Ss=void 0)),this.ys.start(e)}onRRwebEmit(e){var t;null==(t=this.ys)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e;null==(e=this.ys)||e.overrideLinkedFlag()}overrideSampling(){var e;null==(e=this.ys)||e.overrideSampling()}overrideTrigger(e){var t;null==(t=this.ys)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.ys)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._instance=e,!this._instance.sessionManager)throw nA.error("started without valid sessionManager"),Error(nC+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw Error(nC+' cannot be used with cookieless_mode="always"')}}var nM={},nL=()=>{},nD="posthog",nN=!sD&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),nH=e=>{var i;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!P(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of ei)if(i===s)return!1;return!0}(null==a?void 0:a.location),persistence:"localStorage+cookie",persistence_name:"",loaded:nL,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==e||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",debug:l&&P(null==l?void 0:l.search)&&-1!==l.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;U.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nL,__preview_eager_load_replay:!0}},nq=e=>{var t={};
1R(e.process_person)||(t.person_profiles=e.process_person),R(e.xhr_headers)||(t.request_headers=e.xhr_headers),R(e.cookie_name)||(t.persistence_name=e.cookie_name),R(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),R(e.store_google)||(t.save_campaign_params=e.store_google),R(e.verbose)||(t.debug=e.verbose);var i=J({},t,e);return S(e.property_blacklist)&&(R(e.property_denylist)?i.property_denylist=e.property_blacklist:S(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:U.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class nj{get $s(){return this.__forceAllowLocalhost}set $s(e){U.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}constructor(){this.__forceAllowLocalhost=!1}}class nB{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}init(e,t,i){if(i&&i!==nD){var s,r=null!=(s=nM[i])?s:new nB;return r._init(e,t,i),nM[i]=r,nM[nD][i]=r,r}return this._init(e,t,i)}_init(e,i,s){if(void 0===i&&(i={}),R(e)||T(e))return U.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 U.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.Ts=i,this.Cs=[],i.person_profiles&&(this.Ps=i.person_profiles),this.set_config(J({},nH(i.defaults),nq(i),{name:s,token:e})),this.config.on_xhr_error&&U.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:tl.GZipJS;var r=this.Ms();this.persistence=new r2(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r2(_({},this.config,{persistence:"sessionStorage"}),r);var n=_({},this.persistence.props),o=_({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Os=new nu(e=>this.Fs(e),this.config.request_queue_config),this.As=new nd(this),this.__request_queue=[];var a="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(a||(this.sessionManager=new nf(this),this.sessionPropsManager=new n_(this,this.sessionManager,this.persistence)),new sR(this).startIfEnabledOrStop(),this.siteApps=new nb(this),null==(l=this.siteApps)||l.init(),a||(this.config.__preview_eager_load_replay?this.sessionRecording=new sm(this):this.sessionRecording=new nO(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new tm(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new sO(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new sT(this),this.exceptionObserver=new tG(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new tU(this,tB),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new io(this),this.historyAutocapture.startIfEnabled(),g.DEBUG=g.DEBUG||this.config.debug,g.DEBUG&&U.info("Starting in debug mode",{this:this,config:i,thisC:_({},this.config),p:n,s:o}),void 0!==(null==(c=i.bootstrap)?void 0:c.distinctID)){var l,c,u,h,d=this.config.get_device_id(tS()),p=null!=(u=i.bootstrap)&&u.isIdentifiedID?d:i.bootstrap.distinctID;this.persistence.set_property(eL,null!=(h=i.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:p})}if(this.Ds()){var v,f,m=Object.keys((null==(v=i.bootstrap)?void 0:v.featureFlags)||{}).filter(e=>{var t;return!(null==(t=i.bootstrap)||null==(t=t.featureFlags)||!t[e])}).reduce((e,t)=>{var s;return e[t]=(null==(s=i.bootstrap)||null==(s=s.featureFlags)?void 0:s[t])||!1,e},{}),y=Object.keys((null==(f=i.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter(e=>m[e]).reduce((e,t)=>
1{var s,r;return null!=(s=i.bootstrap)&&null!=(s=s.featureFlagPayloads)&&s[t]&&(e[t]=null==(r=i.bootstrap)||null==(r=r.featureFlagPayloads)?void 0:r[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:y})}if(a)this.register_once({distinct_id:ez,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(tS());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(eL,"anonymous")}return er(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.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()||tS();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(eL,"identified")),t()},r=i.user();"then"in r&&I(r.then)?r.then(e=>s(e)):s(r)}(e,()=>{var s;i.register((Promise&&Promise.resolve||sy.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()||(sy.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(sy.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,"$pageview"),identify:e=>s(e,"$identify"),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.js()):this.js(),I(this.config._onCapture)&&this.config._onCapture!==nL&&(U.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&U.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ce(e){var t,i,s,r,n,o,l,c;if(!a||!a.body)return U.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ce(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=m(e.supportedCompression,tl.GZipJS)?tl.GZipJS:m(e.supportedCompression,tl.Base64)?tl.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Ps?this.Ps:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(s=this.sessionRecording)||s.onRemoteConfig(e),null==(r=this.autocapture)||r.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(o=this.webVitalsAutocapture)||o.onRemoteConfig(e),null==(l=this.exceptionObserver)||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(c=this.deadClicksAutocapture)||c.onRemoteConfig(e)}js(){try{this.config.loaded(this)}catch(e){U.critical("`loaded` function failed",e)}this.Ls(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Ns()},1),new nc(this).load(),this.featureFlags.flags()}Ls(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Os)||e.enable())}_dom_loaded(){this.is_capturing()&&Y(this.__request_queue,e=>this.Fs(e)),this.__request_queue=[],this.Ls()}_handle_unload(){var e,t;this.config.request_batching?(this.zs()&&this.capture("$pageleave"),null==(e=this.Os)||e.unload(),null==(t=this.As)||t.unload()):this.zs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Te(e){this.__loaded&&(nN?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=sH(e.url,{ip:+!!this.config.ip}),e.headers=_({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(e=>{var t,i,s,r=_({},e);r.timeout=r.timeout||6e4,r.url=sH(r.url,{_:(new Date).getTime().toString(),ver:g.LIB_VERSION,compression:r.compression});var n=null!=(t=r.transport)?t:"fetch",o=sB.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),a=null!=(i=null==(s=es(o,e=>e.transport===n))?void 0:s.method)?i:o[0].method;if(!a)throw Error("No available transport method");a(r)})(_({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(s=this.config).on_request_error)||i.call(s,t)),null==e.callback||e.callback(t)}}))))}Fs(e){this.As?this.As.retriableRequest(e):this.Te(e)}_execute_array(e){var t,i=[],s=[],r=[];Y(e,e=>{e&&(S(t=e[0])?r.push(e):I(e)?e.call(this):S(e)&&"alias"===t?i.push(e):S(e)&&-1!==t.indexOf("capture")&&I(this[t])?r.push(e):s.push(e))});var n=function(e,t){Y(e,function(e){if(S(e[0])){var i=t;X(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(s,this),n(r,this)}Ds(){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.Os){if(this.is_capturing())if(!R(e)&&P(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var r=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==r||!r.isRateLimited){null!=t&&t.$current_url&&!P(null==t?void 0:t.$current_url)&&(U.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var n=new Date,o=(null==i?void 0:i.timestamp)||n,a=tS(),l={uuid:a,event:e,properties:this.calculateEventProperties(e,t||{},o,a)};r&&(l.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),(null==i?void 0:i.$set)&&(l.$set=null==i?void 0:i.$set);var c,u=this.Us(null==i?void 0:i.$set_once);if(u&&(l.$set_once=u),(h=l,d=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,p=e=>P(e)&&!C(d)?e.slice(0,d):e,g=new Set,l=function e(t,i){var s;return t!==Object(t)?p?p(t,i):t:g.has(t)?void 0:(g.add(t),S(t)?(s=[],Y(t,t=>{s.push(e(t))})):(s={},X(t,(t,i)=>{g.has(t)||(s[i]=e(t,i))})),s)}(h)).timestamp=o,R(null==i?void 0:i.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=n),e===r5.DISMISSED||e===r5.SENT){var h,d,p,g,v,f,m,y=null==t?void 0:t[r6.SURVEY_ID],b=null==t?void 0:t[r6.SURVEY_ITERATION];c={id:y,current_iteration:b},localStorage.getItem(nt(c))||localStorage.setItem(nt(c),"true"),l.$set=_({},l.$set,{[(v={id:y,current_iteration:b},m="$survey_"+(f=e===r5.SENT?"responded":"dismissed")+"/"+v.id,v.current_iteration&&v.current_iteration>0&&(m="$survey_"+f+"/"+v.id+"/"+v.current_iteration),m)]:!0})}var w=_({},l.properties.$set,l.$set);if(F(w)||this.setPersonPropertiesForFlags(w),!A(this.config.before_send)){var E=this.qs(l);if(!E)return;l=E}this.ks.emit("eventCaptured",l);var k={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,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.Fs(k):this.Os.enqueue(k),l}U.critical("This capture call is ignored due to client rate limiting.")}}else U.error("No event name provided to posthog.capture")}else U.uninitializedWarning("posthog.capture")}Ye(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,i,s,r,n){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;var o,c=n?void 0:this.persistence.remove_event_timer(e),u=_({},i);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(u.$cookieless_mode=!0),"$snapshot"===e){var h=_({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=h.distinct_id,(!P(u.distinct_id)&&!O(u.distinct_id)||T(u.distinct_id))&&U.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var p,v=function(e,i){if(!d)return{};var s,r,n=e?K([],rO,i||[]):[],[o,a]=function(e){for(var t=0;t<rT.length;t++){var[i,s]=rT[t],r=i.exec(e),n=r&&(I(s)?s(r,e):s);if(n)return n}return["",""]}(d);return J(et({$os:o,$os_version:a,$browser:rF(d,navigator.vendor),$device:rC(d),$device_type:(r=rC(d))===sQ||r===sZ||"Kobo"===r||"Kindle Fire"===r||r===ry?sK:r===rl||r===ru||r===rc||r===rv?"Console":r===s1?"Wearable":r?sX:"Desktop",$timezone:rG(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:tg(null==l?void 0:l.href,n,rL),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:rP(d,navigator.vendor),$browser_language:rj(),$browser_language_prefix:"string"==typeof(s=rj())?s.split("-")[0]:void 0,$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHe
1ight,$viewport_width:null==t?void 0:t.innerWidth,$lib:"web",$lib_version:g.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:m}=this.sessionManager.checkAndGetSessionAndWindowId(n,s.getTime());u.$session_id=f,u.$window_id=m}this.sessionPropsManager&&J(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&J(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(o=this.As)?void 0:o.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nx.CUSTOM&&(u.$lib_custom_api_host=this.config.api_host),p="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,r),u=J(u,p),"$pageview"===e&&a&&(u.title=a.title),!R(c)){var y=s.getTime()-c;u.$duration=parseFloat((y/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=J({},v,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),S(this.config.property_denylist)?X(this.config.property_denylist,function(e){delete u[e]}):U.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(U.error("sanitize_properties is deprecated. Use before_send instead"),u=b(u,e));var w=this.Bs();return u.$process_person_profile=w,w&&!n&&this.Hs("_calculate_event_properties"),u}Us(e){if(!this.persistence||!this.Bs()||this.xs)return e;var t,i=J({},this.persistence.get_initial_props(),(null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(U.error("sanitize_properties is deprecated. Use before_send instead"),i=s(i,"$set_once")),this.xs=!0,F(i)?void 0:i}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)}Ws(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,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.ks.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=ns),this.surveys.displaySurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return U.uninitializedWarning("posthog.identify");if(O(e)&&(e=e.toString(),U.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()))U.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.');else if(e!==ez){if(this.Hs("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(eo)&&(this.unregister(eo),this.register({distinct_id:e}));var r="anonymous"===(this.persistence.get_property(eL)||"anonymous");e!==s&&r?(this.persistence.set_property(eL,"identified"),this.setPersonPropertiesForFlags(_({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Rs=sz(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(eM))}}else U.critical('The string "'+ez+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else U.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Hs("posthog.setPersonProperties")){var i=sz(this.get_distinct_id(),e,t);this.Rs!==i?(this.setPersonPropertiesForFlags(_({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Rs=i):U.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Hs("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:_({},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 U.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Hs("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(U.info("reset"),!this.__loaded)return U.uninitializedWarning("posthog.reset");var t,i,s,r,n=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(s=this.persistence)||s.set_property(eL,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.Rs=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ez,$device_id:null},"");else{var o=this.config.get_device_id(tS());this.register_once({distinct_id:o,$device_id:e?o:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}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/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(en)?(U.critical("Attempting to create alias for existing People user - aborting."),-2):this.Hs("posthog.alias")?(R(t)&&(t=this.get_distinct_id()),e!==t?(this.Ws(eo,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(U.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=_({},this.config);if($(e)){J(this.config,nq(e));var i,s,r,n,o,a=this.Ms();null==(i=this.persistence)||i.update_config(this.config,t,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r2(_({},this.config,{persistence:"sessionStorage"}),a),tT.G()&&"true"===tT.V("ph_debug")&&(this.config.debug=!0),this.config.debug&&(g.DEBUG=!0,U.info("set_config",{config:e,oldConfig:t,newConfig:_({},this.config)})),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(r=this.autocapture)||r.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.Gs(),null==(o=this.externalIntegrations)||o.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(_({},function(e,t){var{error:i,event:s}=e,r={$exception_list:[]},n=i||s;if(tJ(n)||tX(n,"DOMException")){if("stack"in n)r=ii(n,t);else{var o=n.name||(tJ(n)?"DOMError":"DOMException"),a=n.message?o+": "+n.message:o;r=is(a,_({},t,{overrideExceptionType:tJ(n)?"DOMError":"DOMException",defaultExceptionMessage:a}))}return"code"in n&&(r.$exception_DOMException_code=""+n.code),r}if(tX(n,"ErrorEvent")&&n.error)return ii(n.error,t);if(tY(n))return ii(n,t);if(tX(n,"Object")||tV(n))return function(e,t){var i,s,r,n=null==(s=null==t?void 0:t.handled)||s,o=null==(r=null==t?void 0:t.synthetic)||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:tV(e)?e.constructor.name:"Error",value:"Non-Error 'exception' captured with keys: "+function(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");
1if(!(r.length>t))return s===i.length||r.length<=t?r:r.slice(0,t)+"..."}return""}(e),mechanism:{handled:n,synthetic:o}};if(null!=t&&t.syntheticException){var l=ie(null==t?void 0:t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:P(i=e.level)&&!T(i)&&tc.indexOf(i)>=0?e.level:"error"}}(n,t);if(R(i)&&P(s)){var l="Error",c=s,u=s.match(t9);return u&&(l=u[1],c=u[2]),is(c,_({},t,{overrideExceptionType:l,defaultExceptionMessage:c}))}return is(n,t)}(e instanceof Error?{error:e,event:e.message}:{event:e},{syntheticException:i}),t))}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:nD;return t!==nD&&(t=nD+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(eL))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(eL))}Bs(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&F(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[eo])&&(null==(t=this.persistence)||null==(t=t.props)||!t[eB]))}zs(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Bs()||this.Hs("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Hs(e){return"never"===this.config.person_profiles?(U.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ws(eB,!0),!0)}Ms(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}Gs(){var e,t,i,s,r=this.Ms();return(null==(e=this.persistence)?void 0:e.je)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.je)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){if("always"!==this.config.cookieless_mode){var t;"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),this.sessionManager=new nf(this),this.persistence&&(this.sessionPropsManager=new n_(this,this.sessionManager,this.persistence)),this.sessionRecording=new sm(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Gs(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(R(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.Ns()}else U.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Gs(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ez,$device_id:null}),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,this.Ns())):U.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===tN.GRANTED?"granted":e===tN.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Gs()}_is_bot(){return o?nk(o,this.config.custom_blocked_useragents):void 0}Ns(){a&&("visible"===a.visibilityState?this.Es||(this.Es=!0,this.capture("$pageview",{title:a.title},{send_instantly:!0}),this.Is&&(a.removeEventListener("visibilitychange",this.Is),this.Is=null)):this.Is||(this.Is=this.Ns.bind(this),er(a,"visibilitychange",this.Is)))}
1debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==t||t.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}))}L(){var e,t,i,s,r=this.Ts||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(U.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!R(r[e]),s=t in r&&!R(r[t]),i?r[e]:!!s&&(U&&U.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}qs(e){if(A(this.config.before_send))return e;var t=S(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(A(i=s(i))){var r="Event '"+e.event+"' was rejected in beforeSend function";return L(e.event)?U.warn(r+". This can cause unexpected behavior."):U.info(r),null}i.properties&&!F(i.properties)||U.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.pe)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}constructor(){this.webPerformance=new nj,this.xs=!1,this.version=g.LIB_VERSION,this.ks=new r8,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nH(),this.SentryIntegration=sE,this.sentryIntegration=e=>(function(e,t){var i=sw(e,t);return{name:sb,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Es=!1,this.Is=null,this.Ps=null,this.Rs=null,this.featureFlags=new r0(this),this.toolbar=new s$(this),this.scrollManager=new np(this),this.pageViewManager=new sM(this),this.surveys=new nn(this),this.experiments=new nF(this),this.exceptions=new sY(this),this.rateLimiter=new na(this),this.requestRouter=new nI(this),this.consent=new tH(this),this.externalIntegrations=new nT(this),this.people={set:(e,t,i)=>{var s=P(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=P(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>U.info('send "'+(null==e?void 0:e.event)+'"',e))}}!function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=ee(e.prototype[t[i]])}(nB,["identify"]);var nU,nz=(nU=nM[nD]=new nB,function(){function e(){e.done||(e.done=!0,nN=!1,X(nM,function(e){e._dom_loaded()}))}null!=a&&a.addEventListener?"complete"===a.readyState?e():er(a,"DOMContentLoaded",e,{capture:!1}):t&&U.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),nU)}]);
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.