1var e,t,i,s,r,n,o,a,l,c,u,h,d,p,g,_,f,v,m,y,b,w,E,S,k,x,I,C,$,F,P,R,T,A,O,L,M,D,N,j,q,B,H,U,z,G,W,V,Y,K,J,Z,X,Q,ee,te,ie,se,re,ne,oe,ae,le,ce,ue,he,de,pe,ge,_e,fe,ve,me,ye,be,we,Ee,Se,ke,xe,Ie,Ce,$e,Fe,Pe,Re,Te,Ae,Oe,Le,Me,De,Ne,je,qe,Be,He,Ue,ze,Ge,We,Ve,Ye,Ke,Je,Ze,Xe,Qe,et,tt,it,st,rt,nt,ot,at,lt,ct,ut,ht,dt,pt,gt,_t,ft,vt,mt,yt,bt,wt,Et,St,kt,xt,It,Ct,$t,Ft,Pt,Rt,Tt,At,Ot,Lt,Mt,Dt,Nt,jt,qt,Bt,Ht,Ut,zt,Gt,Wt,Vt,Yt,Kt,Jt,Zt,Xt,Qt,ei,ti,ii,si,ri,ni,oi,ai,li,ci,ui,hi,di,pi,gi,_i,fi,vi,mi,yi,bi,wi,Ei,Si,ki,xi,Ii,Ci,$i,Fi,Pi,Ri,Ti,Ai,Oi,Li,Mi,Di,Ni,ji,qi,Bi,Hi,Ui,zi,Gi,Wi,Vi,Yi,Ki,Ji,Zi,Xi,Qi,es,ts,is,ss,rs,ns,os,as,ls,cs,us,hs,ds,ps,gs,_s,fs,vs,ms,ys,bs,ws,Es,Ss,ks,xs,Is,Cs,$s,Fs,Ps,Rs,Ts,As,Os,Ls,Ms,Ds,Ns,js,qs,Bs,Hs,Us,zs,Gs,Ws,Vs,Ys,Ks,Js,Zs,Xs,Qs,er,tr,ir,sr,rr,nr,or,ar,lr,cr,ur,hr,dr,pr,gr,_r,fr,vr,mr,yr,br,wr,Er,Sr,kr,xr,Ir,Cr,$r,Fr,Pr,Rr,Tr,Ar,Or,Lr,Mr,Dr,Nr,jr,qr,Br,Hr,Ur,zr,Gr,Wr,Vr,Yr,Kr,Jr,Zr,Xr,Qr,en,tn,sn,rn,nn,on,an,ln,cn,un,hn,dn,pn,gn,_n,fn,vn,mn,yn,bn,wn,En,Sn,kn,xn,In,Cn,$n,Fn,Pn,Rn,Tn,An,On,Ln,Mn;import{o as Dn}from"./C_JJxWoe.js";import{Dr as Nn,Vr as jn,Zn as qn}from"./CGcjPoY7.js";import{t as Bn}from"./PPnH9BIT2.js";import{t as Hn}from"./FuoKoyBF2.js";import{t as Un}from"./DkCG08zi2.js";function zn(e,t){return-1!==e.indexOf(t)}function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){var t,i,s;for(t=1;t<arguments.length;t++)for(s in i=arguments[t])({}).hasOwnProperty.call(i,s)&&(e[s]=i[s]);return e},Gn.apply(null,arguments)}function Wn(e,t){var i,s;if(null==e)return{};for(s in i={},e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}function Vn(e,t,i){if(I(e))if(n&&e.forEach===n)e.forEach(t,i);else if("length"in e&&e.length===+e.length)for(var s=0,r=e.length;s<r;s++)if(s in e&&t.call(i,e[s],s)===z)return}function Yn(e,t,i){var s,r;if(!O(e)){if(I(e))return Vn(e,t,i);if(D(e)){for(s of e.entries())if(t.call(i,s[1],s[0])===z)return}else for(r in e)if(k.call(e,r)&&t.call(i,e[r],r)===z)return}}function Kn(e){for(var t=Object.keys(e),i=t.length,s=new Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}function Jn(e){var t,i,s=null==e?void 0:e.hostname;if(!R(s))return!1;for(i of(t=s.split(".").slice(-2).join("."),J))if(t===i)return!1;return!0}function Zn(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function Xn(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};e?.addEventListener(t,i,{capture:r,passive:n})}function Qn(e){return e instanceof Element&&(e.id===Ae||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function eo(e){return!!e&&1===e.nodeType}function to(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function io(e){return!!e&&3===e.nodeType}function so(e){return!!e&&11===e.nodeType}function ro(e){return e?b(e).split(/\s+/):[]}function no(e){var t=null==i?void 0:i.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function oo(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 ro(t)}function ao(e){return O(e)?null:b(e).split(/(\s+)/).filter(e=>go(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function lo(e){var t="";return ho(e)&&!po(e)&&e.childNodes&&e.childNodes.length&&Yn(e.childNodes,function(e){var i;io(e)&&e.textContent&&(t+=null!==(i=ao(e.textContent))&&void 0!==i?i:"")}),b(t)}function co(e){return P(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}function uo(e){var t=e.parentNode;return!(!t||!eo(t))&&t}function ho(e){var t,i,s,r;for(t=e;t.parentNode&&!to(t,"body");t=t.parentNode)if(zn(i=oo(t),"ph-sensitive")||zn(i,"ph-no-capture"))return!1;if(zn(oo(e),"ph-include"))return!0;if(s=e.type||"",R(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}return r=e.name||e.id||"",!R(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 po(e){return!!(to(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||to(e,"select")||to(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function go(e,t){if(void 0===t&&(t=!0),O(e))return!1;if(R(e)){if(e=b(e),(t?Ne:je).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Be:He).test(e))return!1}return!0}function _o(e){var t=lo(e);return go(t=(t+" "+fo(e)).trim())?t:""}function fo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Yn(e.childNodes,function(e){var i,s;if(e&&"span"===(null==(i=e.tagName)?void 0:i.toLowerCase()))try{s=lo(e),t=(t+" "+s).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+fo(e)).trim())}catch(e){q.error("[AutoCapture]",e)}}),t}function vo(e){return function(e){return e.map(e=>{var t,i,s,r,n,o="";if(e.tag_name&&(o+=e.tag_name),e.attr_class)for(s of(e.attr_class.sort(),e.attr_class))o+="."+s.replace(/"/g,"");return r=Gn({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),n={},Kn(r).sort((e,t)=>
1{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return n[mo(t.toString())]=mo(i.toString())}),(o+=":")+Kn(n).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")}(function(e){return e.map(e=>{var t,i,s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:yo(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Kn(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s})}(e))}function mo(e){return e.replace(/"|\\"/g,'\\"')}function yo(e){var t=e.attr__class;return t?I(t)?t:ro(t):void 0}function bo(e,t){return t.length>e?t.slice(0,e)+"...":t}function wo(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!eo(t));return t}function Eo(e,t,i,s,r){return t>i&&(q.warn("min cannot be greater than max."),t=i),L(e)?e>i?(s&&q.warn(s+" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(s&&q.warn(s+" cannot be less than min: "+t+". Using min value instead."),t):e:(s&&q.warn(s+" must be a number. using max or fallback. max: "+i+", fallback: "+r),Eo(r||i,t,i,s))}function So(e){return!P(Event)&&ko(e,Event)}function ko(e,t){try{return e instanceof t}catch(e){return!1}}function xo(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return ko(e,Error)}}function Io(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function Co(e){return Io(e,"DOMError")}function $o(e,t,i,s){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?Ct:t,in_app:!0};return P(i)||(r.lineno=i),P(s)||(r.colno=s),r}function Fo(e){return e[e.length-1]||{}}function Po(e,t){var i,s,r,n;void 0===t&&(t=0),i=e.stacktrace||e.stack||"",s=function(e){return e&&jt.test(e.message)?1:0}(e);try{return n=function(e,t){var i=function(e){var t,i=globalThis._posthogChunkIds;return i?(t=Object.keys(i),Mt&&t.length===Lt||(Lt=t.length,Mt=t.reduce((t,s)=>{var r,n,o,a,l,c;if(Ot||(Ot={}),r=Ot[s])t[r[0]]=r[1];else for(o=(n=e(s)).length-1;o>=0;o--)if(l=null==(a=n[o])?void 0:a.filename,c=i[s],l&&c){t[l]=c,Ot[s]=[l,c];break}return t},{})),Mt):{}}(t);return e.forEach(e=>{e.filename&&(e.chunk_id=i[e.filename])}),e}((r=At)(i,s),r),n.slice(0,n.length-t)}catch(e){}return[]}function Ro(e,t){var i=function(e,t){var i,s,r=Po(e),n=null===(i=null==t?void 0:t.handled)||void 0===i||i,o=null!==(s=null==t?void 0:t.synthetic)&&void 0!==s&&s;return{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;return t.error&&"string"==typeof t.error.message?String(t.error.message):String(t)}(e),stacktrace:{frames:r,type:"raw"},mechanism:{handled:n,synthetic:o}}}(e,t);return e.cause&&xo(e.cause)&&e.cause!==e?[i,...Ro(e.cause,{handled:null==t?void 0:t.handled,synthetic:null==t?void 0:t.synthetic})]:[i]}function To(e,t){return{$exception_list:Ro(e,t),$exception_level:"error"}}function Ao(e,t){var i,s,r,n,o=null===(i=null==t?void 0:t.handled)||void 0===i||i,a=null===(s=null==t?void 0:t.synthetic)||void 0===s||s,l={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:a}};return null!=t&&t.syntheticException&&(n=Po(t.syntheticException,1)).length&&(l.stacktrace={frames:n,type:"raw"}),{$exception_list:[l],$exception_level:"error"}}function Oo(e){return R(e)&&!T(e)&&y.indexOf(e)>=0}function Lo(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return C(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}function Mo(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}function Do(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>
11){var i=Math.floor(e.data.length/2),s=e.data.slice(0,i),r=e.data.slice(i);return[Do({size:Mo(s),data:s,sessionId:e.sessionId,windowId:e.windowId}),Do({size:Mo(r),data:r,sessionId:e.sessionId,windowId:e.windowId})].flatMap(e=>e)}return[e]}function No(e,t,i,s){if(O(e))return e;var r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return R(r)&&(r=parseInt(r)),r>i?Ut+" "+s+" body too large to record ("+r+" bytes)":e}function jo(e,t){if(O(e))return e;var i=e;return go(i,!1)||(i=Ut+" "+t+" body "+zt),Yn(Vt,e=>{var s,r;null!=(s=i)&&s.length&&-1!==(null==(r=i)?void 0:r.indexOf(e))&&(i=Ut+" "+t+" body "+zt+" as might contain: "+e)}),i}e=Dn(jn(),1),t=Dn(qn(),1),i=window,s="undefined"!=typeof globalThis?globalThis:i,r=Array.prototype,n=r.forEach,o=r.indexOf,a=null==s?void 0:s.navigator,l=null==s?void 0:s.document,c=null==s?void 0:s.location,u=null==s?void 0:s.fetch,h=null!=s&&s.XMLHttpRequest&&"withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:void 0,d=null==s?void 0:s.AbortController,p=null==a?void 0:a.userAgent,g=null!=i?i:{},_={DEBUG:!1,LIB_VERSION:"1.257.1"},f="$copy_autocapture",v=["$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"],m=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),y=["fatal","error","warning","log","info","debug"],b=function(e){return e.trim()},w=function(e){return e.replace(/^\$/,"")},E=Array.isArray,S=Object.prototype,k=S.hasOwnProperty,x=S.toString,I=E||function(e){return"[object Array]"===x.call(e)},C=e=>"function"==typeof e,$=e=>e===Object(e)&&!I(e),F=e=>{if($(e)){for(var t in e)if(k.call(e,t))return!1;return!0}return!1},P=e=>void 0===e,R=e=>"[object String]"==x.call(e),T=e=>R(e)&&0===e.trim().length,A=e=>null===e,O=e=>P(e)||A(e),L=e=>"[object Number]"==x.call(e),M=e=>"[object Boolean]"===x.call(e),D=e=>e instanceof FormData,N=e=>zn(v,e),j=e=>{var t={t:function(t){if(i&&(_.DEBUG||g.POSTHOG_DEBUG)&&!P(i.console)&&i.console){for(var s=("__rrweb_original__"in i.console[t]?i.console[t].__rrweb_original__:i.console[t]),r=arguments.length,n=new 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,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("log",...i)},warn:function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("warn",...i)},error:function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling "+e)},createLogger:t=>j(e+" "+t)};return t},B=(q=j("[PostHog.js]")).createLogger,H=B("[ExternalScriptsLoader]"),U=(e,t,i)=>{var s,r,n;if(e.config.disable_external_dependency_loading)return H.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");if(s=null==l?void 0:l.querySelectorAll("script"))for(r=0;r<s.length;r++)if(s[r].src===t)return i();n=()=>{var s,r,n;return l?((s=l.createElement("script")).type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>i(void 0,e),s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),s?void((n=l.querySelectorAll("body > script")).length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):l.body.appendChild(s)):i("prepare_external_dependency_script returned null")):i("document not found")},null!=l&&l.body?n():l?.addEventListener("DOMContentLoaded",n)},g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var s,r="/static/"+t+".js?v="+e.version;"remote-config"===t&&(r="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(s=3e5,r=r+"&t="+Math.floor(Date.now()/s)*s),U(e,e.requestRouter.endpointFor("assets",r),i)},g.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{U(e,e.requestRouter.endpointFor("api",t),i)},z={},G=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Vn(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},W=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Vn(i,function(t){Vn(t,function(t){e.push(t)})}),e},V=function(e){try{return e()}catch(e){return}},Y=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){q.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),q.critical(e)}}},K=function(e){var t={};return Yn(e,function(e,i){(R(e)&&e.length>0||L(e))&&(t[i]=e)}),t},J=["herokuapp.com","vercel.app","netlify.app"],Q="$autocapture_disabled_server_side",te="$exception_capture_enabled_server_side",se="$web_vitals_enabled_server_side",re="$dead_clicks_enabled_server_side",ne="$web_vitals_allowed_metrics",ae="$console_log_recording_enabled_server_side",le="$session_recording_network_payload_capture",ce="$session_recording_masking",ue="$session_recording_canvas_recording",he="$replay_sample_rate",de="$replay_minimum_duration",pe="$replay_script_config",_e="$session_is_sampled",fe="$session_recording_url_trigger_activated_session",ve="$session_recording_event_trigger_activated_session",ke="$surveys_activated",Ae="__POSTHOG_TOOLBAR__",Oe="$posthog_cookieless",Le=["$people_distinct_id",Z="__alias","__cmpns",X="__timers",oe="$session_recording_enabled_server_side",ee="$heatmaps_enabled_server_side",ge="$sesid",me="$enabled_feature_flags",ie="$error_tracking_suppression_rules",Ie="$user_state",ye="$early_access_features",be="$feature_flag_details",Ee="$stored_group_properties",we="$stored_person_properties",Se="$surveys",xe="$flag_call_reported",Ce="$client_session_props",$e="$capture_rate_limit",Fe="$initial_campaign_params",Pe="$initial_referrer_info",Te="$epp",Re="$initial_person_info"],Me=["a","button","form","input","select","textarea","label"],De="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11}
1)|((?:2131|1800|35[0-9]{3})[0-9]{11})",Ne=new RegExp("^(?:"+De+")$"),je=new RegExp(De),qe="\\d{3}-?\\d{2}-?\\d{4}",Be=new RegExp("^("+qe+")$"),He=new RegExp("("+qe+")"),Ue=class{constructor(){this.clicks=[]}isRageClick(e,t,i){var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<30&&i-s.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}},ze=["localhost","127.0.0.1"],Ge=e=>{var t=null==l?void 0:l.createElement("a");return P(t)?null:(t.href=e,t)},We=function(e,t){var i,s,r;return void 0===t&&(t="&"),r=[],Yn(e,function(e,t){P(e)||P(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)},Ve=function(e,t){var i,s,r,n,o;for(s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++)if((n=s[r].split("="))[0]===t){i=n;break}if(!I(i)||i.length<2)return"";o=i[1];try{o=decodeURIComponent(o)}catch(e){q.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ye=function(e,t,i){var s,r,n,o,a,l,c,u,h,d,p;if(!e||!t||!t.length)return e;for(r=(s=e.split("#"))[0]||"",n=s[1],a=(o=r.split("?"))[1],l=o[0],c=(a||"").split("&"),u=[],h=0;h<c.length;h++)d=c[h].split("="),I(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]));return p=l,null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},Ke=function(e,t){var i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},Je=B("[AutoCapture]"),Ze=class{constructor(e){this.i=!1,this.o=null,this.rageclicks=new Ue,this.h=!1,this.instance=e,this.m=null}get S(){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}$(){var e,t;this.isBrowserSupported()?i&&l&&(e=e=>{e=e||(null==i?void 0:i.event);try{this.k(e)}catch(i){Je.error("Failed to capture event",i)}},Xn(l,"submit",e,{capture:!0}),Xn(l,"change",e,{capture:!0}),Xn(l,"click",e,{capture:!0}),this.S.capture_copied_text&&(t=e=>{e=e||(null==i?void 0:i.event),this.k(e,f)},Xn(l,"copy",t,{capture:!0}),Xn(l,"cut",t,{capture:!0}))):Je.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.h=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Q]:!!e.autocapture_opt_out}),this.o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.m=e}getElementSelectors(e){var t,i=[];return null==(t=this.m)||t.forEach(t=>{(null==l?void 0:l.querySelectorAll(t))?.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i,s=null==(e=this.instance.persistence)?void 0:e.props[Q],r=this.o;return!(A(r)&&!M(s)&&!this.instance.I()||(i=null!==(t=this.o)&&void 0!==t?t:!!s,!this.instance.config.autocapture||i))}k(e,t){var s,r,n,o,a,l,c;if(void 0===t&&(t="$autocapture"),this.isEnabled&&(io(r=co(e))&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.k(e,"$rageclick"),n=t===f,r&&function(e,t,s,r,n){var o,a,l,c,u,h,d,p,g,_,f;if(void 0===s&&(s=void 0),!i||!e||to(e,"html")||!eo(e))return!1;if(null!=(o=s)&&o.url_allowlist&&!no(s.url_allowlist))return!1;if(null!=(a=s)&&a.url_ignorelist&&no(s.url_ignorelist))return!1;if(null!=(l=s)&&l.dom_event_allowlist&&(c=s.dom_event_allowlist)&&!c.some(e=>t.type===e))return!1;for(u=!1,h=[e],d=!0,p=e;p.parentNode&&!to(p,"body");)if(so(p.parentNode))h.push(p.parentNode.host),p=p.parentNode.host;else{if(!(d=uo(p)))break;(r||Me.indexOf(d.tagName.toLowerCase())>-1||(g=i.getComputedStyle(d))&&"pointer"===g.getPropertyValue("cursor"))&&(u=!0),h.push(d),p=d}if(!function(e,t){var i,s,r,n=null==t?void 0:t.element_allowlist;if(P(n))return!0;for(r of(s=function(e){if(n.some(t=>e.tagName.toLowerCase()===t))return{v:!0}},e))if(i=s(r))return i.v;return!1}(h,s))return!1;if(!function(e,t){var i,s,r,n=null==t?void 0:t.css_selector_allowlist;if(P(n))return!0;for(r of(s=function(e){if(n.some(t=>e.matches(t)))return{v:!0}},e))if(i=s(r))return i.v;return!1}(h,s))return!1;if((_=i.getComputedStyle(e))&&"pointer"===_.getPropertyValue("cursor")&&"click"===t.type)return!0;switch(f=e.tagName.toLowerCase()){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return u?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(Me.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.S,n,n?["copy","cut"]:void 0))){var{props:u,explicitNoCapture:h}=function(e,t){for(var s,r,n,o,a,l,c,u,h,d,p,{e:g,maskAllElementAttributes:_,maskAllText:f,elementAttributeIgnoreList:v,elementsC
1hainAsString:m}=t,y=[e],b=e;b.parentNode&&!to(b,"body");)so(b.parentNode)?(y.push(b.parentNode.host),b=b.parentNode.host):(y.push(b.parentNode),b=b.parentNode);return r=[],n={},o=!1,a=!1,Yn(y,e=>{var t=ho(e);"a"===e.tagName.toLowerCase()&&(o=e.getAttribute("href"),o=t&&o&&go(o)&&o),zn(oo(e),"ph-no-capture")&&(a=!0),r.push(function(e,t,i,s){var r,n,o,a,l=e.tagName.toLowerCase(),c={tag_name:l};for(Me.indexOf(l)>-1&&!i&&("a"===l.toLowerCase()||"button"===l.toLowerCase()?c.$el_text=bo(1024,_o(e)):c.$el_text=bo(1024,lo(e))),(r=oo(e)).length>0&&(c.classes=r.filter(function(e){return""!==e})),Yn(e.attributes,function(i){var r,n;po(e)&&-1===["name","id","class","aria-label"].indexOf(i.name)||null!=s&&s.includes(i.name)||t||!go(i.value)||(r=i.name,R(r)&&("_ngcontent"===r.substring(0,10)||"_nghost"===r.substring(0,7)))||(n=i.value,"class"===i.name&&(n=ro(n).join(" ")),c["attr__"+i.name]=bo(1024,n))}),n=1,o=1,a=e;a=wo(a);)n++,a.tagName===e.tagName&&o++;return c.nth_child=n,c.nth_of_type=o,c}(e,_,f,v)),G(n,function(e){if(!ho(e))return{};var t={};return Yn(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&&go(s)&&(t[i]=s)}}),t}(e))}),a?{props:{},explicitNoCapture:a}:(f||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?r[0].$el_text=_o(e):r[0].$el_text=lo(e)),o&&(r[0].attr__href=o,u=null==(l=Ge(o))?void 0:l.host,h=null==i||null==(c=i.location)?void 0:c.host,u&&h&&u!==h&&(s=o)),{props:G({$event_type:g.type,$ce_version:1},m?{}:{$elements:r},{$elements_chain:vo(r)},null!=(d=r[0])&&d.$el_text?{$el_text:null==(p=r[0])?void 0:p.$el_text}:{},s&&"click"===g.type?{$external_click_url:s}:{},n)})}(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString:this.h});if(h)return!1;if((o=this.getElementSelectors(r))&&o.length>0&&(u.$element_selectors=o),"$copy_autocapture"===t){if(l=ao(null==i||null==(a=i.getSelection())?void 0:a.toString()),c=e.type||"clipboard",!l)return!1;u.$selected_content=l,u.$copy_type=c}return this.instance.capture(t,u),!0}}isBrowserSupported(){return C(null==l?void 0:l.querySelectorAll)}},Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return L(e)&&isFinite(e)&&Math.floor(e)===e}),Xe="0123456789abcdef",Qe=class e{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,i,s,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(r)||t<0||i<0||s<0||r<0||t>0xffffffffffff||i>4095||s>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|i>>>8,n[7]=i,n[8]=128|s>>>24,n[9]=s>
1>>16,n[10]=s>>>8,n[11]=s,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new e(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Xe.charAt(this.bytes[t]>>>4)+Xe.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){var t,i;for(t=0;t<16;t++)if(0!==(i=this.bytes[t]-e.bytes[t]))return Math.sign(i);return 0}},et=class{constructor(){this.P=0,this.R=0,this.T=new st}generate(){var e,t=this.generateOrAbort();if(P(t)){if(this.P=0,e=this.generateOrAbort(),P(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.M();else{if(!(e+1e4>this.P))return;this.R++,this.R>4398046511103&&(this.P++,this.M())}return Qe.fromFieldsV7(this.P,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.T.nextUint32())}M(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}},it=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new 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},i&&!P(i.crypto)&&crypto.getRandomValues&&(it=e=>crypto.getRandomValues(e)),st=class{constructor(){this.C=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.C.length&&(it(this.C),this.F=0),this.C[this.F++]}},rt=()=>nt().toString(),nt=()=>(tt||(tt=new et)).generate(),ot="",at=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,lt={O:()=>!!l,A:function(e){q.error("cookieStore error: "+e)},D:function(e){var t,i,s,r;if(l){try{for(t=e+"=",i=l.cookie.split(";").filter(e=>e.length),s=0;s<i.length;s++){for(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}},L:function(e){var t;try{t=JSON.parse(lt.D(e))||{}}catch(e){}return t},j:function(e,t,i,s,r){var n,o,a,c,u;if(l)try{return n="",o="",a=function(e,t){var i,s;return t?(i=function(e,t){var i,s,r,n,o;if(void 0===t&&(t=l),ot)return ot;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+rt();!ot&&s--;)o=r+"=1;domain=."+(n=i.slice(s).join("."))+";path=/",t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",ot=n);return ot}(e),i||(s=(e=>{var t=e.match(at);return t?t[0]:""})(e),s!==i&&q.info("Warning: cookie subdomain discovery mismatch",s,i),i=s),i?"; domain=."+i:""):""}(l.location.hostname,s),i&&((c=new Date).setTime(c.getTime()+24*i*60*60*1e3),n="; expires="+c.toUTCString()),r&&(o="; secure"),(u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o).length>3686.4&&q.warn("cookieStore warning: large cookie, len="+u.length),l.cookie=u,u}catch(e){return}},N:function(e,t){try{lt.j(e,"",-1,t)}catch(e){return}}},ct=null,ut={O:function(){var e,t;if(!A(ct))return ct;if(e=!0,P(i))e=!1;else try{t="__mplssupport__",ut.j(t,"xyz"),'"xyz"'!==ut.D(t)&&(e=!1),ut.N(t)}catch(i){e=!1}return e||q.error("localStorage unsupported; falling back to cookie store"),ct=e,e},A:function(e){q.error("localStorage error: "+e)},D:function(e){try{return null==i?void 0:i.localStorage.getItem(e)}catch(i){ut.A(i)}return null},L:function(e){try{return JSON.parse(ut.D(e))||{}}catch(e){}return null},j:function(e,t){try{i?.localStorage.setItem(e,JSON.stringify(t))}catch(i){ut.A(i)}},N:function(e){try{i?.localStorage.removeItem(e)}catch(i){ut.A(i)}}},ht=["distinct_id",ge,_e,Te,Re],dt=Gn({},ut,{L:function(e){var t,i;try{t={};try{t=lt.L(e)||{}}catch(e){}return i=G(t,JSON.parse(ut.D(e)||"{}")),ut.j(e,i),i}catch(e){}return null},j:function(e,t,i,s,r,n){try{ut.j(e,t,void 0,void 0,n);var o={};ht.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&<.j(e,o,i,s,r,n)}catch(e){ut.A(e)}},N:function(e,t){try{i?.localStorage.removeItem(e),lt.N(e,t)}catch(i){ut.A(i)}}}),pt={},gt={O:function(){return!0},A:function(e){q.error("memoryStorage error: "+e)},D:function(e){return pt[e]||null},L:function(e){return pt[e]||null},j:function(e,t){pt[e]=t},N:function(e){delete pt[e]}},_t=null,ft={O:function(){if(!A(_t))return _t;if(_t=!0,P(i))_t=!1;else try{var e="__support__";ft.j(e,"xyz"),'"xyz"'!==ft.D(e)&&(_t=!1),ft.N(e)}catch(i){_t=!1}return _t},A:function(e){q.error("sessionStorage error: ",e)},D:function(e){try{return null==i?void 0:i.sessionStorage.getItem(e)}catch(i){ft.A(i)}return null},L:function(e){try{return JSON.parse(ft.D(e))||null}catch(e){}return null},j:function(e,t){try{i?.sessionStorage.setItem(e,JSON.stringify(t))}catch(i){ft.A(i)}},N:function(e){try{i?.sessionStorage.removeItem(e)}catch(i){ft.A(i)}}}
1,vt=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({}),mt=class{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.U()?vt.DENIED:this.q}isOptedOut(){return this.consent===vt.DENIED||this.consent===vt.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.B.j(this.H,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.B.N(this.H,this.S.cross_subdomain_cookie)}get H(){var{token:e,opt_out_capturing_cookie_prefix:t}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get q(){var e=this.B.D(this.H);return"1"===e?vt.GRANTED:"0"===e?vt.DENIED:vt.PENDING}get B(){var e,t;return this.W||(e=this.S.opt_out_capturing_persistence_type,this.W="localStorage"===e?ut:lt,(t="localStorage"===e?lt:ut).D(this.H)&&(this.W.D(this.H)||this.optInOut("1"===t.D(this.H)),t.N(this.H,this.S.cross_subdomain_cookie))),this.W}U(){return!!this.S.respect_dnt&&!!Zn([null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,g.doNotTrack],e=>zn([!0,1,"1","yes"],e))}},yt=B("[Dead Clicks]"),bt=()=>!0,wt=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(re)),s=e.instance.config.capture_dead_clicks;return M(s)?s:i},Et=class{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[re]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.J(()=>{this.V()})}J(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?yt.error("failed to load script",t):e()})}V(){var e,t;l?!this.G&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&((t=$(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{}).__onCapture=this.onCapture,this.G=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.G.start(l),yt.info("starting...")):yt.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,yt.info("stopping..."))}},St=class{constructor(e){this.K={},this.Y=()=>{Object.keys(this.K).forEach(e=>{var t=this.X(e)+this.Z;t>=this.tt?delete this.K[e]:this.it(e,t)})},this.X=e=>this.K[String(e)],this.it=(e,t)=>{this.K[String(e)]=t},this.consumeRateLimit=e=>{var t,i,s,r=null!==(t=this.X(e))&&void 0!==t?t:this.tt;return 0===(r=Math.max(r-1,0))||(this.it(e,r),(s=0===r)&&(null==(i=this.et)||i.call(this,e)),s)},this.rt=e,this.et=this.rt.et,this.tt=Eo(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=Eo(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=Eo(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.Y()},this.st)}},kt=B("[ExceptionAutocapture]"),xt=class{constructor(e){var t,s,r;this.nt=()=>{var e,t,s,r;if(i&&this.isEnabled&&null!=(e=g.__PosthogExtensions__)&&e.errorWrappingFunctions){t=g.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=g.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=g.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ot&&this.S.capture_unhandled_errors&&(this.ot=t(this.captureException.bind(this))),!this.lt&&this.S.capture_unhandled_rejections&&(this.lt=s(this.captureException.bind(this))),!this.ut&&this.S.capture_console_errors&&(this.ut=r(this.captureException.bind(this)))}catch(i){kt.error("failed to start",i),this.ht()}}},this._instance=e,this.dt=!(null==(t=this._instance.persistence)||!t.props[te]),this.S=this.vt(),this.ct=new St({refillRate:null!==(s=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==s?s:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4}),this.startIfEnabled()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return $(e)?t=Gn({},t,e):(P(e)?this.dt:e)&&(t=Gn({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(kt.info("enabled"),this.J(this.nt))}J(e){var t,i;
1null!=(t=g.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return kt.error("failed to load script",t);e()})}ht(){var e,t,i;null==(e=this.ot)||e.call(this),this.ot=void 0,null==(t=this.lt)||t.call(this),this.lt=void 0,null==(i=this.ut)||i.call(this),this.ut=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.dt=!!t||!1,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[te]:this.dt}),this.startIfEnabled()}captureException(e){var t,i;e.$exception_personURL=this._instance.requestRouter.endpointFor("ui")+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id(),i=null!==(t=e.$exception_list[0].type)&&void 0!==t?t:"Exception",this.ct.consumeRateLimit(i)?kt.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}},It=/\(error: (.*)\)/,Ct="?",$t=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ft=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Pt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,At=function(){var e,t,i,s;for(e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return s=t.sort((e,t)=>e[0]-t[0]).map(e=>e[1]),function(e,t){var i,r,n,o,a,l,c;for(void 0===t&&(t=0),i=[],r=e.split("\n"),n=t;n<r.length;n++)if(!((o=r[n]).length>1024||(a=It.test(o)?o.replace(It,"$1"):o).match(/\S*Error: /))){for(l of s)if(c=l(a)){i.push(c);break}if(i.length>=50)break}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>Gn({},e,{filename:e.filename||Fo(t).filename,function:e.function||Ct}))}(i)}}([30,e=>{var t,i,s=$t.exec(e);if(s){var[,r,n,o]=s;return $o(r,Ct,+n,+o)}if(t=Ft.exec(e)){t[2]&&0===t[2].indexOf("eval")&&(i=Pt.exec(t[2]))&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]);var[a,l]=Dt(t[1]||Ct,t[2]);return $o(l,a,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,e=>{var t,i,s,r=Rt.exec(e);if(r)return r[3]&&r[3].indexOf(" > eval")>-1&&(t=Tt.exec(r[3]))&&(r[1]=r[1]||"eval",r[3]=t[1],r[4]=t[2],r[5]=""),i=r[3],s=r[1]||Ct,[s,i]=Dt(s,i),$o(i,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}]),Dt=(e,t)=>
1{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:Ct,i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Nt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,jt=/Minified React error #\d+;/i,qt=class{constructor(e){var t;this._instance=e,this.ft=(null==i||null==(t=i.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(q.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.gt&&this.gt(),this.gt=void 0,q.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t,s;i&&i.history&&(s=this,null!=(e=i.history.pushState)&&e.__posthog_wrapped__||Lo(i.history,"pushState",e=>function(t,i,r){e.call(this,t,i,r),s._t("pushState")}),null!=(t=i.history.replaceState)&&t.__posthog_wrapped__||Lo(i.history,"replaceState",e=>function(t,i,r){e.call(this,t,i,r),s._t("replaceState")}),this.bt())}_t(e){try{var t,s=null==i||null==(t=i.location)?void 0:t.pathname;if(!s)return;s!==this.ft&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ft=s}catch(i){q.error("Error capturing "+e+" pageview",i)}}bt(){if(!this.gt){var e=()=>{this._t("popstate")};Xn(i,"popstate",e),this.gt=()=>{i&&i.removeEventListener("popstate",e)}}}},Bt=(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))(Bt||{}),Ht=(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))(Ht||{}),Ut="[SessionRecording]",zt="redacted",Gt={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"]},Wt=["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"],Vt=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Yt=["/s/","/e/","/i/"],Kt=(e,t)=>{var i,s,r,n={payloadSizeLimitBytes:Gt.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Gt.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Gt.payloadHostDenyList]},o=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,l=!1!==e.capture_performance&&t.recordPerformance,c=(i=n,r=Math.min(1e6,null!==(s=i.payloadSizeLimitBytes)&&void 0!==s?s:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=No(e.requestBody,e.requestHeaders,r,"Request")),null!=e&&e.responseBody&&(e.responseBody=No(e.responseBody,e.responseHeaders,r,"Response")),e)),u=t=>{return c(((e,t)=>{var i,s,r=Ge(e.name),n=0===t.indexOf("http")?null==(i=Ge(t))?void 0:i.pathname:t;if("/"===n&&(n=""),s=null==r?void 0:r.pathname.replace(n||"",""),!(r&&s&&Yt.some(e=>0===s.indexOf(e))))return e})((s=(i=t).requestHeaders,O(s)||Yn(Object.keys(null!=s?s:{}),e=>{Wt.includes(e.toLowerCase())&&(s[e]=zt)}),i),e.api_host));var i,s}
1,h=C(e.session_recording.maskNetworkRequestFn);return h&&C(e.session_recording.maskCapturedNetworkRequestFn)&&q.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var i=e.session_recording.maskNetworkRequestFn({url:t.name});return Gn({},t,{name:null==i?void 0:i.url})}),n.maskRequestFn=C(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var i,s=u(t);return s&&null!==(i=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(s))&&void 0!==i?i:void 0}:e=>function(e){if(!P(e))return e.requestBody=jo(e.requestBody,"Request"),e.responseBody=jo(e.responseBody,"Response"),e}(u(e)),Gn({},Gt,n,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},Jt=class{constructor(e,t){var i,s;void 0===t&&(t={}),this.yt={},this.wt=e=>{var t,i,s;this.yt[e]||(this.yt[e]=!0,s=this.St(e),null==(t=(i=this.rt).onBlockedNode)||t.call(i,e,s))},this.$t=e=>{var t,i=this.St(e);return"svg"!==(null==i?void 0:i.nodeName)&&i instanceof Element&&(t=i.closest("svg"))?[this._rrweb.mirror.getId(t),t]:[e,i]},this.St=e=>this._rrweb.mirror.getNode(e),this.kt=e=>{var t,i,s,r,n,o,a,l;return(null!==(t=null==(i=e.removes)?void 0:i.length)&&void 0!==t?t:0)+(null!==(s=null==(r=e.attributes)?void 0:r.length)&&void 0!==s?s:0)+(null!==(n=null==(o=e.texts)?void 0:o.length)&&void 0!==n?n:0)+(null!==(a=null==(l=e.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=e=>{var t,i,s;return 3!==e.type||0!==e.data.source?e:(t=e.data,i=this.kt(t),t.attributes&&(t.attributes=t.attributes.filter(e=>{var[t]=this.$t(e.id);return!this.ct.consumeRateLimit(t)&&e})),0!==(s=this.kt(t))||i===s?e:void 0)},this._rrweb=e,this.rt=t,this.ct=new St({bucketSize:null!==(i=this.rt.bucketSize)&&void 0!==i?i:100,refillRate:null!==(s=this.rt.refillRate)&&void 0!==s?s:10,refillInterval:1e3,et:this.wt})}},Zt=Uint8Array,Xt=Uint16Array,Qt=Uint32Array,ei=new Zt([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]),ti=new Zt([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]),ii=new Zt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),si=function(e,t){var i,s,r,n;for(i=new Xt(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];for(r=new Qt(i[30]),s=1;s<30;++s)for(n=i[s];n<i[s+1];++n)r[n]=n-i[s]<<5|s;return[i,r]},ni=(ri=si(ei,2))[0],oi=ri[1],ni[28]=258,oi[258]=28;for(ai=si(ti,0)[1],li=new Xt(32768),ci=0;ci<32768;++ci)ui=(61680&(ui=(52428&(ui=(43690&ci)>>>1|(21845&ci)<<1))>>>2|(13107&ui)<<2))>>>4|(3855&ui)<<4,li[ci]=((65280&ui)>>>8|(255&ui)<<8)>>>1;for(hi=function(e,t,i){var s,r,n,o,a,l,c,u,h,d;for(s=e.length,r=0,n=new Xt(t);r<s;++r)++n[e[r]-1];for(a=new Xt(t),r=0;r<t;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){for(o=new Xt(1<<t),l=15-t,r=0;r<s;++r)if(e[r])for(c=r<<4|e[r],u=t-e[r],d=(h=a[e[r]-1]++<<u)|(1<<u)-1;h<=d;++h)o[li[h]>>>l]=c}else for(o=new Xt(s),r=0;r<s;++r)o[r]=li[a[e[r]-1]++]>>>15-e[r];return o},di=new Zt(288),ci=0;ci<144;++ci)di[ci]=8;for(ci=144;ci<256;++ci)di[ci]=9;for(ci=256;ci<280;++ci)di[ci]=7;for(ci=280;ci<288;++ci)di[ci]=8;for(pi=new Zt(32),ci=0;ci<32;++ci)pi[ci]=5;function qo(e,t){var i,s,r,n;return void 0===t&&(t={}),i=$i(),s=e.length,i.p(e),n=(r=Fi(e,t,Ti(t),8)).length,Ri(r,t),Pi(r,n-8,i.d()),Pi(r,n-4,s),r}function Bo(e,t){var i,s,r,n,o,a,l=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(i=new Zt(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;n<l;++n)s+5>i.length&&((o=new Zt(s+8+(l-n<<1))).set(i),i=o),(a=e.charCodeAt(n))<128||t?r(a):a<2048?(r(192|a>>>6),r(128|63&a)):a>55295&&a<57344?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a));return vi(i,0,s)}function Ho(e,t){return t.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))}function Uo(e){return e.isRecordingEnabled?Mi:Ai}function zo(e){if(!e.receivedFlags)return Mi;if(!e.isRecordingEnabled)return Ai;if(e.urlTriggerMatching.urlBlocked)return Di;var t=!0===e.isSampled,i=new Hi([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Oi:i===ji?Li:i===qi?Mi:!1===e.isSampled?Ai:Li}function Go(e){if(!e.receivedFlags)return Mi;if(!e.isRecordingEnabled)return Ai;if(e.urlTriggerMatching.urlBlocked)return Di;var t=new Ui([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),i=t!==Bi,s=M(e.isSampled);return i&&t===qi?Mi:i&&t===Bi||s&&!e.isSampled?Ai:!0===e.isSampled?Oi:Li}function Wo(){var e;return null==g||null==(e=g.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}function Vo(e){return function(e){var t,i,s;for(t="",i=0;i<e.length;
1)s=e[i++],t+=String.fromCharCode(s);return t}(qo(Bo(JSON.stringify(e))))}function Yo(e){return e.type===Bt.Custom&&"sessionIdle"===e.data.tag}function Ko(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"]}=void 0===t?{}:t;return t=>{var o,a,l,c,u,h,d,p,g;return"*"!==n&&!n.includes(t.level)||!e.__loaded||(t.tags||(t.tags={}),h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id()),t.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0})),p=(d=(null==(o=t.exception)?void 0:o.values)||[]).map(e=>Gn({},e,{stacktrace:e.stacktrace?Gn({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>Gn({},e,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(a=d[0])?void 0:a.value)||t.message,$exception_type:null==(l=d[0])?void 0:l.type,$exception_personURL:h,$exception_level:t.level,$exception_list:p,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=d[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(u=d[0])?void 0:u.type,$sentry_tags:t.tags},i&&s&&(g.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),e.exceptions.sendExceptionEvent(g)),t}}function Jo(e){return $(e)&&"clientX"in e&&"clientY"in e&&L(e.clientX)&&L(e.clientY)}function Zo(e,t,i){return ys({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}function Xo(e,t,i){if(!l)return{};var s,r=t?W([],wr,i||[]):[],n=Qo(Ye(l.URL,r,Sr),e);return G((s={},Yn(kr,function(e){var t=lt.D(e);s[e]=t||null}),s),n)}function Qo(e,t){var i=Er.concat(t||[]),s={};return Yn(i,function(t){s[t]=Ve(e,t)||null}),s}function ea(e){var t,i=function(e){return e?0===e.search(br+"google.([^/?]*)")?"google":0===e.search(br+"bing.com")?"bing":0===e.search(br+"yahoo.com")?"yahoo":0===e.search(br+"duckduckgo.com")?"duckduckgo":null:null}(e),s="yahoo"!=i?"q":"p",r={};return A(i)||(r.$search_engine=i,(t=l?Ve(l.referrer,s):"").length&&(r.ph_keyword=t)),r}function ta(){return navigator.language||navigator.userLanguage}function ia(){return(null==l?void 0:l.referrer)||"$direct"}function sa(e,t){var i=e?W([],wr,t||[]):[],s=null==c?void 0:c.href.substring(0,1e3);return{r:ia().substring(0,1e3),u:s?Ye(s,i,Sr):void 0}}function ra(e){var t,i,{r:s,u:r}=e,n={$referrer:s,$referring_domain:null==s?void 0:"$direct"==s?"$direct":null==(i=Ge(s))?void 0:i.host};return r&&(n.$current_url=r,t=Ge(r),n.$host=null==t?void 0:t.host,n.$pathname=null==t?void 0:t.pathname,G(n,Qo(r))),s&&G(n,ea(s)),n}function na(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(i){return}}function oa(){try{return(new Date).getTimezoneOffset()}catch(i){return}}function aa(e,t){if(!p)return{};var s,r,n,o=e?W([],wr,t||[]):[],[a,l]=function(e){var t;for(t=0;t<mr.length;t++){var[i,s]=mr[t],r=i.exec(e),n=r&&(C(s)?s(r,e):s);if(n)return n}return["",""]}(p);return G(K({$os:a,$os_version:l,$browser:_r(p,navigator.vendor),$device:yr(p),$device_type:(r=p,n=yr(r),n===Ts||n===Rs||"Kobo"===n||"Kindle Fire"===n||n===nr?Ps:n===Ks||n===Zs||n===Js||n===sr?"Console":n===As?"Wearable":n?Cs:"Desktop"),$timezone:na(),$timezone_offset:oa()}),{$current_url:Ye(null==c?void 0:c.href,o,Sr),$host:null==c?void 0:c.host,$pathname:null==c?void 0:c.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:vr(p,navigator.vendor),$browser_language:ta(),$browser_language_prefix:(s=ta(),"string"==typeof s?s.split("-")[0]:void 0),$screen_height:null==i?void 0:i.screen.height,$screen_width:null==i?void 0:i.screen.width,$viewport_height:null==i?void 0:i.innerHeight,$viewport_width:null==i?void 0:i.innerWidth,$lib:"web",$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}function la(e){return e.replace(/([A-Z])/g,e=>`_${e.toLowerCase()}`).replace(/^_/,"")}gi=hi(di,9,0),_i=hi(pi,5,0),fi=function(e){return(e/8|0)+(7&e&&1)},vi=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof Xt?Xt:e instanceof Qt?Qt:Zt)(i-t);return s.set(e.subarray(t,i)),s},mi=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},yi=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},bi=function(e,t){var i,s,r,n,o,a,l,c,u,h,d,p,g,_,f,v,m,y,b;for(i=[],s=0;s<e.length;++s)e[s]&&i.push({s,f:e[s]});if(r=i.length,n=i.slice(),!r)return[new Zt(0),0];if(1==r)return(o=new Zt(i[0].s+1))[i[0].s]=1,[o,1];for(i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001}),a=i[0],l=i[1],c=0,u=1,h=2,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};for(d=n[0].s,s=1;s<r;++s)n[s].s>d&&(d=n[s].s);if(p=new Xt(d+1),(g=wi(i[u-1],p,0))>t){for(s=0,_=0,v=1<<(f=g-t),n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s<r&&(m=n[s].s,p[m]>t);++s)_+=v-(1<<g-p[m]),p[m]=t;for(_>>>=f;_>0;)y=n[s].s,p[y]<t?_-=1<<t-p[y]++-1:++s;for(;s>=0&&_;--s)b=n[s].s,p[b]==t&&(--p[b],++_);g=t}return[new Zt(p),g]},wi=function(e,t,i){return-1==e.s?Math.max(wi(e.l,t,i+1),wi(e.r,t,i+1)):t[e.s]=i},Ei=function(e){var t,i,s,r,n,o,a;for(t=e.length;t&&!e[--t];);for(i=new Xt(++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]},Si=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},ki=function(e,t,i){var s,r=i.length,n=fi(t+2);for(e[n]=255&r,e[n+1]=r>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1],s=0;s<r;++s)e[n+s+4]=i[s];return 8*(n+4+r)},xi=function(e,t,i,s,r,n,o,a,l,c,u){var h,d,p,g,_,f,v,m,y,b,w,E,S,k,x,I,C,$,F,P,R,T,A,O,L,M,D,N,j,q,B;for(mi(t,u++,i),++r[256],d=(h=bi(r,15))[0],p=h[1],_=(g=bi(n,15))[0],f=g[1],m=(v=Ei(d))[0],y=v[1],w=(b=Ei(_))[0],E=b[1],S=new Xt(19),k=0;k<m.length;++k)S[31&m[k]]++;for(k=0;k<w.length;++k)S[31&w[k]]++;for(I=(x=bi(S,7))[0],C=x[1],$=19;$>4&&!I[ii[$-1]];--$);if(A=c+5<<3,O=Si(r,di)+Si(n,pi)+o,L=Si(r,d)+Si(n,_)+o+14+3*$+Si(S,I)+(2*S[16]+3*S[17]+7*S[18]),A<=O&&A<=L)return ki(t,u,e.subarray(l,l+c));if(mi(t,u,1+(L<O)),u+=2,L<O){for(F=hi(d,p,0),P=d,R=hi(_,f,0),T=_,M=hi(I,C,0),mi(t,u,y-257),mi(t,u+5,E-1),mi(t,u+10,$-4),u+=14,k=0;k<$;++k)mi(t,u+3*k,I[ii[k]]);for(u+=3*$,D=[m,w],N=0;N<2;++N)for(j=D[N],k=0;k<j.length;++k)q=31&j[k],mi(t,u,M[q]),u+=I[q],q>15&&(mi(t,u,j[k]>>>5&127),u+=j[k]>>>12)}else F=gi,P=di,R=_i,T=pi;for(k=0;k<a;++k)s[k]>255?(q=s[k]>>>18&31,yi(t,u,F[q+257]),u+=P[q+257],q>7&&(mi(t,u,s[k]>>>23&31),u+=ei[q]),B=31&s[k],yi(t,u,R[B]),u+=T[B],B>3&&(yi(t,u,s[k]>>>5&8191),u+=ti[B])):(yi(t,u,F[s[k]]),u+=P[s[k]]);return yi(t,u,F[256]),u+P[256]},Ii=new Qt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ci=function(){var e,t,i,s;for(e=new Qt(256),t=0;t<256;++t){for(i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),$i=function(){var e=4294967295;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=Ci[255&i^t[s]]^i>>>8;e=i},d:function(){return 4294967295^e}}},Fi=function(e,t,i,s,r){return function(e,t,i,s,r,n){var o,a,l,c,u,h,d,p,g,_,f,v,m,y,b,w,E,S,k,x,I,C,$,F,P,R,T,A,O,L,M,D,N,j,q,B,H,U,z=e.length,G=new Zt(s+z+5*(1+Math.floor(z/7e3))+r),W=G.subarray(s,G.length-r),V=0;if(!t||z<8)for(o=0;o<=z;o+=65535)(a=o+65535)<z?V=ki(W,V,e.subarray(o,a)):(W[o]=n,V=ki(W,V,e.subarray(o,z)));else{for(c=(l=Ii[t-1])>>>13,u=8191&l,h=(1<<i)-1,d=new Xt(32768),p=new Xt(h+1),g=Math.ceil(i/3),_=2*g,f=function(t){return(e[t]^e[t+1]<<g^e[t+2]<<_)&h},v=new Qt(25e3),m=new Xt(288),y=new Xt(32),b=0,w=0,o=0,E=0,S=0,k=0;o<z;++o)if(I=32767&o,C=p[x=f(o)],d[I]=C,p[x]=I,S<=o){if($=z-o,(b>7e3||E>24576)&&$>423){for(V=xi(e,W,0,v,m,y,w,E,k,o-k,V),E=b=w=0,k=o,F=0;F<286;++F)m[F]=0;for(F=0;F<30;++F)y[F]=0}if(P=2,R=0,T=u,A=I-C&32767,$>
12&&x==f(o-A))for(O=Math.min(c,$)-1,L=Math.min(32767,o),M=Math.min(258,$);A<=L&&--T&&I!=C;){if(e[o+P]==e[o+P-A]){for(D=0;D<M&&e[o+D]==e[o+D-A];++D);if(D>P){if(P=D,R=A,D>O)break;for(N=Math.min(A,D-2),j=0,F=0;F<N;++F)(B=(q=o-A+F+32768&32767)-d[q]+32768&32767)>j&&(j=B,C=q)}}A+=(I=C)-(C=d[I])+32768&32767}R?(v[E++]=268435456|oi[P]<<18|ai[R],H=31&oi[P],U=31&ai[R],w+=ei[H]+ti[U],++m[257+H],++y[U],S=o+P,++b):(v[E++]=e[o],++m[e[o]])}V=xi(e,W,n,v,m,y,w,E,k,o-k,V)}return vi(G,0,s+fi(V)+r)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,i,s,!r)},Pi=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},Ri=function(e,t){var i,s=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Pi(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),s)for(e[3]=8,i=0;i<=s.length;++i)e[i+10]=s.charCodeAt(i)},Ti=function(e){return 10+(e.filename&&e.filename.length+1||0)},Oi="sampled",Li="active",Mi="buffering",Di="paused",ji=(Ni="trigger")+"_activated",qi=Ni+"_pending",Bi=Ni+"_"+(Ai="disabled"),Hi=class{constructor(e){this.xt=e}triggerStatus(e){var t=this.xt.map(t=>t.triggerStatus(e));return t.includes(ji)?ji:t.includes(qi)?qi:Bi}stop(){this.xt.forEach(e=>e.stop())}},Ui=class{constructor(e){this.xt=e}triggerStatus(e){var t,i=new Set;for(t of this.xt)i.add(t.triggerStatus(e));switch(i.delete(Bi),i.size){case 0:return Bi;case 1:return Array.from(i)[0];default:return qi}}stop(){this.xt.forEach(e=>e.stop())}},zi=class{triggerStatus(){return qi}stop(){}},Gi=class{constructor(e){this.Et=[],this.It=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,i;this.Et=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this.It=(null==(i=e.sessionRecording)?void 0:i.urlBlocklist)||[]}Pt(e){var t;return 0===this.Et.length?Bi:(null==(t=this._instance)?void 0:t.get_property(fe))===e?ji:qi}triggerStatus(e){var t=this.Pt(e),i=t===ji?ji:t===qi?qi:Bi;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:i}),i}checkUrlTriggerConditions(e,t,s){if(void 0!==i&&i.location.href){var r=i.location.href,n=this.urlBlocked,o=Ho(r,this.It);n&&o||(o&&!n?e():!o&&n&&t(),Ho(r,this.Et)&&s("url"))}}stop(){}},Wi=class{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=e}triggerStatus(){var e=qi;return O(this.linkedFlag)&&(e=Bi),this.linkedFlagSeen&&(e=ji),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var i,s,r;this.linkedFlag=(null==(i=e.sessionRecording)?void 0:i.linkedFlag)||null,O(this.linkedFlag)||this.linkedFlagSeen||(s=R(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,r=R(this.linkedFlag)?null:this.linkedFlag.variant,this.Rt=this._instance.onFeatureFlags((e,i)=>{var n,o=!1;$(i)&&s in i&&(n=i[s],o=M(n)?!0===n:r?n===r:!!n),this.linkedFlagSeen=o,o&&t(s,r)}))}stop(){this.Rt()}},Vi=class{constructor(e){this.Tt=[],this._instance=e}onRemoteConfig(e){var t;this.Tt=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]}Mt(e){var t;return 0===this.Tt.length?Bi:(null==(t=this._instance)?void 0:t.get_property(ve))===e?ji:qi}triggerStatus(e){var t=this.Mt(e),i=t===ji?ji:t===qi?qi:Bi;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:i}),i}stop(){}},Ki=B(Yi="[SessionRecording]"),Ji=[Ht.MouseMove,Ht.MouseInteraction,Ht.Scroll,Ht.ViewportResize,Ht.Input,Ht.TouchMove,Ht.MediaInteraction,Ht.Drag],Zi=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}),Xi=class{get sessionId(){return this.Ct}get Ft(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get At(){if(!this._instance.sessionManager)throw new Error(Yi+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var e,t;return this.Lt.triggerStatus(this.sessionId)===qi?6e4:null!==(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:3e5}get jt(){var e=this._instance.get_property(_e);return M(e)?e:null}get Nt(){var e,t,i=null==(e=this.C)?void 0:e.data[(null==(t=this.C)?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.At.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get zt(){var e=!!this._instance.get_property(oe),t=!this._instance.config.disable_session_recording;return i&&e&&t}get Ut(){var e=!!this._instance.get_property(ae),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}get qt(){var e,t,i,s,r,n,o,a=this._instance.config.session_recording.captureCanvas,l=this._instance.get_property(ue),c=null!==(e=null!==(t=null==a?void 0:a.recordCanvas)&&void 0!==t?t:null==l?void 0:l.enabled)&&void 0!==e&&e,u=null!==(i=null!==(s=null==a?void 0:a.canvasFps)&&void 0!==s?s:null==l?void 0:l.fps)&&void 0!==i?i:4,h=null!==(r=null!==(n=null==a?void 0:a.canvasQuality)&&void 0!==n?n:null==l?void 0:l.quality)&&void 0!==r?r:.4;return"string"==typeof h&&(o=parseFloat(h),h=isNaN(o)?.4:o),{enabled:c,fps:Eo(u,0,12,"canvas recording fps",4),quality:Eo(h,0,1,"canvas recording quality",.4)}}get Bt(){var e,t,i=this._instance.get_property(le),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 Ht(){var e,t,i,s,r,n,o=this._instance.get_property(ce),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)&&void 0!==s?s:null==o?void 0:o.maskAllInputs,c=null!==(r=null==a?void 0:a.maskTextSelector)&&void 0!==r?r:null==o?void 0:o.maskTextSelector,u=null!==(n=null==a?void 0:a.blockSelector)&&void 0!==n?n:null==o?void 0:o.blockSelector;return P(l)&&P(c)&&P(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get Wt(){var e=this._instance.get_property(he);return L(e)?e:null}get Gt(){var e=this._instance.get_property(de);return L(e)?e:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.jt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):Mi}constructor(e){if(this.Vt=Uo,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.Lt=ne
1w zi,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this.ni=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.oi=()=>{this.ai()},this.li=()=>{this.ui("browser offline",{})},this.hi=()=>{this.ui("browser online",{})},this.di=()=>{if(null!=l&&l.visibilityState){var e="window "+l.visibilityState;this.ui(e,{})}},this._instance=e,this.Ot=!1,this.vi="/s/",this.ci=void 0,this.Jt=!1,!this._instance.sessionManager)throw Ki.error("started without valid sessionManager"),new Error(Yi+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(Yi+" cannot be used with __preview_experimental_cookieless_mode.");this.Xt=new Wi(this._instance),this.Kt=new Gi(this._instance),this.Yt=new Vi(this._instance);var{sessionId:t,windowId:i}=this.At.checkAndGetSessionAndWindowId();this.Ct=t,this.fi=i,this.C=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&Ki.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.zt?(this.gi(e),Xn(i,"beforeunload",this.oi),Xn(i,"offline",this.li),Xn(i,"online",this.hi),Xn(i,"visibilitychange",this.di),this.mi(),this.bi(),O(this.ii)&&(this.ii=this._instance.on("eventCaptured",e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.yi(null==e?void 0:e.properties.$current_url):"";if(!t)return;this.ui("$pageview",{href:t})}}catch(e){Ki.error("Could not add $pageview to rrweb session",e)}})),this.ei||(this.ei=this.At.onSessionId((e,t,i)=>{var s,r;i&&(this.ui("$session_id_change",{sessionId:e,windowId:t,changeReason:i}),null==(s=this._instance)||null==(s=s.persistence)||s.unregister(ve),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(fe))}))):this.stopRecording()}stopRecording(){var e,t,s,r;this.Ot&&this.ci&&(this.ci(),this.ci=void 0,this.Ot=!1,i?.removeEventListener("beforeunload",this.oi),i?.removeEventListener("offline",this.li),i?.removeEventListener("online",this.hi),i?.removeEventListener("visibilitychange",this.di),this.pi(),clearInterval(this.wi),null==(e=this.ii)||e.call(this),this.ii=void 0,null==(t=this.ni)||t.call(this),this.ni=void 0,null==(s=this.ei)||s.call(this),this.ei=void 0,null==(r=this.si)||r.call(this),this.si=void 0,this.Yt.stop(),this.Kt.stop(),this.Xt.stop(),Ki.info("stopped"))}Si(){var e;null==(e=this._instance.persistence)||e.unregister(_e)}$i(e){var t,i,s,r,n=this.Ct!==e,o=this.Wt;L(o)?(i=this.jt,r=(s=n||!M(i))?function(e,t){return function(e){for(var t=0,i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;return Math.abs(t)}(e)%100<Eo(100*t,0,100)}(e,o):i,s&&(r?this.ki(Oi):Ki.warn("Sample rate ("+o+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ui("samplingDecisionMade",{sampleRate:o,isSampled:r})),null==(t=this._instance.persistence)||t.register({[_e]:r})):this.Si()}onRemoteConfig(e){var t,i,s,r;this.ui("$remote_config_received",e),this.xi(e),null!=(t=e.sessionRecording)&&t.endpoint&&(this.vi=null==(r=e.sessionRecording)?void 0:r.endpoint),this.mi(),"any"===(null==(i=e.sessionRecording)?void 0:i.triggerMatchType)?(this.Vt=zo,this.Lt=new Hi([this.Yt,this.Kt])):(this.Vt=Go,this.Lt=new Ui([this.Yt,this.Kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(s=e.sessionRecording)?void 0:s.triggerMatchType}),this.Kt.onRemoteConfig(e),this.Yt.onRemoteConfig(e),this.Xt.onRemoteConfig(e,(e,t)=>{this.ki("linked_flag_matched",{flag:e,variant:t})}),this.Jt=!0,this.startIfEnabledOrStop()}mi(){L(this.Wt)&&O(this.si)&&(this.si=this.At.onSessionId(e=>{this.$i(e)}))}xi(e){if(this._instance.persistence){var t,i=this._instance.persistence,s=()=>{var t,s,r,n,o,a,l,c,u,h,d=null==(t=e.sessionRecording)?void 0:t.sampleRate,p=O(d)?null:parseFloat(d);O(p)&&this.Si(),h=null==(s=e.sessionRecording)?void 0:s.minimumDurationMilliseconds,i.register({[oe]:!!e.sessionRecording,[ae]:null==(r=e.sessionRecording)?void 0:r.consoleLogRecordingEnabled,[le]:Gn({capturePerformance:e.capturePerformance},null==(n=e.sessionRecording)?void 0:n.networkPayloadCapture),[ce]:null==(o=e.sessionRecording)?void 0:o.masking,[ue]:{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},[he]:p,[de]:P(h)?null:h,[pe]:null==(u=e.sessionRecording)?void 0:u.scriptConfig})};s(),null==(t=this.ri)||t.call(this),this.ri=this.At.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()})}gi(e){var t;P(Object.assign)||P(Array.from)||this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut()||(this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),Wo()?this.Ei():null==(t=g.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.Ii,e=>{if(e)return Ki.error("could not load recorder",e);this.Ei()}),Ki.info("starting"),this.status===Li&&this.ki(e||"recording_initialized"))}get Ii(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(pe))?void 0:e.script)||"recorder"}Pi(e){var t;return 3===e.type&&-1!==Ji.indexOf(null==(t=e.data)?void 0:t.source)}Ri(e){var t,i,s=this.Pi(e);if(s||this.Zt||e.timestamp-this.ti>this.Ft&&(this.Zt=!0,clearInterval(this.wi),this.ui("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ti,threshold:this.Ft,bufferLength:this.C.data.length,bufferSize:this.C.size}),this.ai()),t=!1,s&&(this.ti=e.timestamp,this.Zt)&&(i="unknown"===this.Zt,this.Zt=!1,i||(this.ui("sessionNoLongerIdle",{reason:"user activity",type:e.type}),t=!0)),!this.Zt){var{windowId:r,sessionId:n}=this.At.checkAndGetSessionAndWindowId(!s,e.timestamp),o=this.Ct!==n,a=this.fi!==r;this.fi=r,this.Ct=n,o||a?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):t&&this.Ti()}}Mi(e){try{return e.rrwebMethod(),!0}catch(s){return this.Qt.length<10?this.Qt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Ki.warn("could not emit queued rrweb event.",s,e),!1}}ui(e,t){return this.Mi(Zi(()=>Wo().addCustomEvent(e,t)))}Ci(){return this.Mi(Zi(()=>Wo().takeFullSnapshot()))}Ei(){var e,t,i,s,r,n,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{}
1,collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},a=this._instance.config.session_recording;for(var[l,c]of Object.entries(a||{}))l in o&&("maskInputOptions"===l?o.maskInputOptions=Gn({password:!0},c):o[l]=c);this.qt&&this.qt.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.qt.fps},o.dataURLOptions={type:"image/webp",quality:this.qt.quality}),this.Ht&&(o.maskAllInputs=null===(t=this.Ht.maskAllInputs)||void 0===t||t,o.maskTextSelector=null!==(i=this.Ht.maskTextSelector)&&void 0!==i?i:void 0,o.blockSelector=null!==(s=this.Ht.blockSelector)&&void 0!==s?s:void 0),(r=Wo())?(this.Fi=null!==(e=this.Fi)&&void 0!==e?e:new Jt(r,{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";Ki.info(i,{node:t}),this.log(Yi+" "+i,"warn")}}),n=this.Oi(),this.ci=r(Gn({emit:e=>{this.onRRwebEmit(e)},plugins:n},o)),this.ti=Date.now(),this.Zt=M(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:o,activePlugins:n.map(e=>null==e?void 0:e.name)}),this.ui("$posthog_config",{config:this._instance.config})):Ki.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ti(){if(this.wi&&clearInterval(this.wi),!0!==this.Zt){var e=this.Dt;e&&(this.wi=setInterval(()=>{this.Ci()},e))}}Oi(){var e,t,i,s=[],r=null==(e=g.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;
1return r&&this.Ut&&s.push(r()),i=null==(t=g.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin,this.Bt&&C(i)&&(!ze.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(i(Kt(this._instance.config,this.Bt))):Ki.info("NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t,i,s,r,n,o,a,l;if(this.Ai(),e&&$(e)){if(e.type===Bt.Meta){if(i=this.yi(e.data.href),this.Di=i,!i)return;e.data.href=i}else this.Li();this.Kt.checkUrlTriggerConditions(()=>this.ji(),()=>this.Ni(),e=>this.zi(e)),(!this.Kt.urlBlocked||(s=e).type===Bt.Custom&&"recording paused"===s.data.tag)&&(e.type===Bt.FullSnapshot&&this.Ti(),e.type===Bt.FullSnapshot&&this.Jt&&this.Lt.triggerStatus(this.sessionId)===qi&&this.pi(),(r=this.Fi?this.Fi.throttleMutations(e):e)&&(n=function(e){var t,i,s=e;if(s&&$(s)&&6===s.type&&$(s.data)&&"rrweb/console@1"===s.data.plugin){for(s.data.payload.payload.length>10&&(s.data.payload.payload=s.data.payload.payload.slice(0,10),s.data.payload.payload.push("...[truncated]")),t=[],i=0;i<s.data.payload.payload.length;i++)s.data.payload.payload[i]&&s.data.payload.payload[i].length>2e3?t.push(s.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):t.push(s.data.payload.payload[i]);return s.data.payload.payload=t,e}return e}(r),this.Ri(n),(!0!==this.Zt||Yo(n))&&(Yo(n)&&(o=n.data.payload)&&(n.timestamp=o.lastActivityTimestamp+o.threshold),a=null===(t=this._instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(Mo(e)<1024)return e;try{if(e.type===Bt.FullSnapshot)return Gn({},e,{data:Vo(e.data),cv:"2024-10"});if(e.type===Bt.IncrementalSnapshot&&e.data.source===Ht.Mutation)return Gn({},e,{cv:"2024-10",data:Gn({},e.data,{texts:Vo(e.data.texts),attributes:Vo(e.data.attributes),removes:Vo(e.data.removes),adds:Vo(e.data.adds)})});if(e.type===Bt.IncrementalSnapshot&&e.data.source===Ht.StyleSheetRule)return Gn({},e,{cv:"2024-10",data:Gn({},e.data,{adds:e.data.adds?Vo(e.data.adds):void 0,removes:e.data.removes?Vo(e.data.removes):void 0})})}catch(e){Ki.error("could not compress event - will use uncompressed event",e)}return e}(n):n,l={$snapshot_bytes:Mo(a),$snapshot_data:a,$session_id:this.Ct,$window_id:this.fi},this.status!==Ai?this.Ui(l):this.pi())))}}Li(){if(!this._instance.config.capture_pageview&&i){var e=this.yi(i.location.href);this.Di!==e&&(this.ui("$url_changed",{href:e}),this.Di=e)}}Ai(){if(this.Qt.length){var e=[...this.Qt];this.Qt=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this.Mi(e)})}}yi(e){var t,i,s=this._instance.config.session_recording;return s.maskNetworkRequestFn?(i={url:e},null==(t=i=s.maskNetworkRequestFn(i))?void 0:t.url):e}pi(){return this.C={size:0,data:[],sessionId:this.Ct,windowId:this.fi},this.C}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var e=this.Gt,t=this.Nt,i=L(t)&&t>=0,s=L(e)&&i&&t<e;return this.status===Mi||this.status===Di||this.status===Ai||s?(this.qi=setTimeout(()=>{this.ai()},2e3),this.C):(this.C.data.length>0&&Do(this.C).forEach(e=>{this.Bi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:_.LIB_VERSION})}),this.pi())}Ui(e){var t,i=2+((null==(t=this.C)?void 0:t.data.length)||0);!this.Zt&&(this.C.size+e.$snapshot_bytes+i>943718.4||this.C.sessionId!==this.Ct)&&(this.C=this.ai()),this.C.size+=e.$snapshot_bytes,this.C.data.push(e.$snapshot_data),this.qi||this.Zt||(this.qi=setTimeout(()=>{this.ai()},2e3))}Bi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.vi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var t;this.Lt.triggerStatus(this.sessionId)===qi&&(null==(t=this._instance)||null==(t=t.persistence)||t.register({["url"===e?fe:ve]:this.Ct}),this.ai(),this.ki(e+"_trigger_matched"))}ji(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),Ki.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Ci(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),Ki.info("recording resumed"))}bi(){0!==this.Yt.Tt.length&&O(this.ni)&&(this.ni=this._instance.on("eventCaptured",e=>{try{this.Yt.Tt.includes(e.event)&&this.zi("event")}catch(e){Ki.error("Could not activate event trigger",e)}}))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Ci(),this.ki("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[_e]:!0}),this.Ci(),this.ki("sampling_overridden")}overrideTrigger(e){this.zi(e)}ki(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),Ki.info(e.replace("_"," "),t),zn(["recording_initialized","session_id_changed"],e)||this.ui(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.At.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.C.data.length,$sdk_debug_replay_internal_buffer_size:this.C.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}
1},Qi=B("[SegmentIntegration]"),es="posthog-js",ts=class{constructor(e,t,i,s,r){this.name=es,this.setupOnce=function(n){n(Ko(e,{organization:t,projectId:i,prefix:s,severityAllowList:r}))}}},is=null!=i&&i.location?Ke(i.location.hash,"__posthog")||Ke(location.hash,"state"):null,ss="_postHogToolbarParams",rs=B("[Toolbar]"),ns=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(ns||{}),os=class{constructor(e){this.instance=e}Hi(e){g.ph_toolbar_state=e}Wi(){var e;return null!==(e=g.ph_toolbar_state)&&void 0!==e?e:ns.UNINITIALIZED}maybeLoadToolbar(e,t,s){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===s&&(s=void 0),!i||!l)return!1;e=null!=e?e:i.location,s=null!=s?s:i.history;try{if(!t){try{i.localStorage.setItem("test","test"),i.localStorage.removeItem("test")}catch(i){return!1}t=null==i?void 0:i.localStorage}var r,n=is||Ke(e.hash,"__posthog")||Ke(e.hash,"state"),o=n?V(()=>JSON.parse(atob(decodeURIComponent(n))))||V(()=>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(t.getItem(ss)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(i){return!1}}Gi(e){var t=g.ph_load_toolbar||g.ph_load_editor;!O(t)&&C(t)?t(e,this.instance):rs.warn("No toolbar load function found")}loadToolbar(e){var t,s,r,n=!(null==l||!l.getElementById(Ae));return!(!i||n||(t="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=Gn({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},t?{instrument:!1}:{}),i.localStorage.setItem(ss,JSON.stringify(Gn({},s,{source:void 0}))),this.Wi()===ns.LOADED?this.Gi(s):this.Wi()===ns.UNINITIALIZED&&(this.Hi(ns.LOADING),null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return rs.error("[Toolbar] Failed to load",e),void this.Hi(ns.UNINITIALIZED);this.Hi(ns.LOADED),this.Gi(s)}),Xn(i,"turbolinks:load",()=>{this.Hi(ns.UNINITIALIZED),this.loadToolbar(s)})),0))}Ji(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)}},as=B("[TracingHeaders]"),ls=class{constructor(e){this.Vi=void 0,this.Ki=void 0,this.nt=()=>{var e,t;P(this.Vi)&&(null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.get_distinct_id(),this._instance.sessionManager)),P(this.Ki)&&(null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}J(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return as.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.J(this.nt):(null==(e=this.Vi)||e.call(this),null==(t=this.Ki)||t.call(this),this.Vi=void 0,this.Ki=void 0)}},cs=B("[Web Vitals]"),us=9e5,hs=class{constructor(e){var t;this.Yi=!1,this.i=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),0!==this.C.metrics.length&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((e,t)=>Gn({},e,{["$web_vitals_"+t.name+"_event"]:Gn({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Zi=e=>{var t,i,s=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);P(s)?cs.error("Could not read session ID. Dropping metrics!"):(this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0},i=this.te(),P(i)||(O(null==e?void 0:e.name)||O(null==e?void 0:e.value)?cs.error("Invalid metric received",e):this.ie&&e.value>=this.ie?cs.error("Ignoring metric with value >= "+this.ie,e):(this.C.url!==i&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),P(this.C.url)&&(this.C.url=i),this.C.firstMetricTimestamp=P(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.C.metrics.push(Gn({},e,{$current_url:i,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Xi())))},this.nt=()=>{var e,t,i,s,r=g.__PosthogExtensions__;P(r)||P(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Zi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Zi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Zi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Zi.bind(this)),this.i=!0):cs.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Yi=!(null==(t=this._instance.persistence)||!t.props[se]),this.startIfEnabled()}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 P(i)?(null==(t=this._instance.persistence)?void 0:t.props[ne])||["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 ie(){var e=$(this._instance.config.capture_performance)&&L(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:us;return 0<e&&e<=6e4?us:e}get isEnabled(){var e,t=null==c?void 0:c.protocol;return"http:"!==t&&"https:"!==t?(cs.info("Web Vitals are disabled on non-http/https protocols"),!1):(e=$(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,M(e)?e:this.Yi)}startIfEnabled(){this.isEnabled&&!this.i&&(cs.info("enabled, starting..."),this.J(this.nt))}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({[se]:t}),this._instance.persistence.register({[ne]:i})),this.Yi=t,this.startIfEnabled()}J(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",t=>{t?cs.error("failed to load script",t):e()})}te(){var e=i?i.location.href:void 0;return e||cs.error("Could not determine current URL"),e}},ds=B("[Heatmaps]"),ps=class{constructor(e){var t;this.rageclicks=new Ue,this.Yi=!1,this.i=!1,this.ee=null,this.instance=e,this.Yi=!(null==(t=this.instance.persistence)||!t.props[ee])}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 P(this.instance.config.capture_heatmaps)?P(this.instance.config.enable_heatmaps)?this.Yi:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.i)return;ds.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this.ee)&&void 0!==e?e:void 0),null==(t=this.ne)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ee]:t}),this.Yi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}oe(e){this.ae(e.originalEvent,"deadclick")}re(){i&&l&&(Xn(i,"beforeunload",this.se.bind(this)),Xn(l,"click",e=>this.ae(e||(null==i?void 0:i.event)),{capture:!0}),Xn(l,"mousemove",e=>this.le(e||(null==i?void 0:i.event)),{capture:!0}),this.ne=new Et(this.instance,bt,this.oe.bind(this)),this.ne.startIfEnabled(),this.i=!0)}ue(e,t){var s=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,s){for(var r=e;r&&eo(r)&&!to(r,"body");){if(r===s)return!1;if(zn(t,null==i?void 0:i.getComputedStyle(r).position))return!0;r=uo(r)}return!1}(co(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:s),target_fixed:o,type:t}}ae(e,t){var i,s;void 0===t&&(t="click"),!Qn(e.target)&&Jo(e)&&(s=this.ue(e,t),null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.he(Gn({},s,{type:"rageclick"})),this.he(s))}le(e){!Qn(e.target)&&Jo(e)&&(clearTimeout(this.de),this.de=setTimeout(()=>{this.he(this.ue(e,"mousemove"))},500))}he(e){if(i){var t=i.location.href;this.C=this.C||{},this.C[t]||(this.C[t]=[]),this.C[t].push(e)}}se(){this.C&&!F(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},gs=class{constructor(e){this._instance=e}doPageView(e,t){var s,r=this.ve(e,t);return this.ce={pathname:null!==(s=null==i?void 0:i.location.pathname)&&void 0!==s?s:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ve(e,null==(t=this.ce)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ce)?void 0:e.pageViewId}}ve(e,t){var i,s,r,n,o,a,l=this.ce;if(!l)return{$pageview_id:t};if(i={$pageview_id:t,$prev_pageview_id:l.pageViewId},(s=this._instance.scrollManager.getContext())&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:c,lastScrollY:u,maxScrollY:h,maxContentHeight:d,lastContentY:p,maxContentY:g}=s;P(c)||P(u)||P(h)||P(d)||P(p)||P(g)||(c=Math.ceil(c),u=Math.ceil(u),h=Math.ceil(h),d=Math.ceil(d),p=Math.ceil(p),g=Math.ceil(g),r=c<=1?1:Eo(u/c,0,1),n=c<=1?1:Eo(h/c,0,1),o=d<=1?1:Eo(p/d,0,1),a=d<=1?1:Eo(g/d,0,1),i=G(i,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:r,$prev_pageview_max_scroll:h,$prev_pageview_max_scroll_percentage:n,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:o,$prev_pageview_max_content:g,$prev_pageview_max_content_percentage:a}))}return l.pathname&&(i.$prev_pageview_pathname=l.pathname),l.timestamp&&(i.$prev_pageview_duration=(e.getTime()-l.timestamp.getTime())/1e3),i}},_s=function(e){var t,i,s,r,n,o,a="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++)o=null,(n=e.charCodeAt(r))<128?i++:o=n>127&&n<2048?String.fromCharCode(n>>6|192,63&n|128):String.fromCharCode(n>>12|224,n>>6&63|128,63&n|128),A(o)||(i>t&&(a+=e.substring(t,i)),a+=o,t=i=r+1);return i>t&&(a+=e.substring(t,e.length)),a},fs=!!h||!!u,vs="text/plain",ms=(e,t)=>{var i,[s,r]=e.split("?"),n=Gn({},t);
1return r?.split("&").forEach(e=>{var[t]=e.split("=");delete n[t]}),s+"?"+((i=We(n))?(r?r+"&":"")+i:r)},ys=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),bs=e=>{var t,i,s,r,{data:n,compression:o}=e;if(n)return o===m.GZipJS?(t=qo(Bo(ys(n)),{mtime:0}),i=new Blob([t],{type:vs}),{contentType:vs,body:i,estimatedSize:i.size}):o===m.Base64?(s=(e=>"data="+encodeURIComponent("string"==typeof e?e:ys(e)))(function(e){var t,i,s,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=_s(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}(ys(n))),{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}):{contentType:"application/json",body:r=ys(n),estimatedSize:new Blob([r]).size}},ws=[],u&&ws.push({transport:"fetch",method:e=>{var t,i,s,r,n,{contentType:o,body:a,estimatedSize:l}=null!==(r=bs(e))&&void 0!==r?r:{},c=new Headers;Yn(e.headers,function(e,t){c.append(t,e)}),o&&c.append("Content-Type",o),t=e.url,i=null,d&&(s=new d,i={signal:s.signal,timeout:setTimeout(()=>s.abort(),e.timeout)}),u(t,Gn({method:(null==e?void 0:e.method)||"GET",headers:c,keepalive:"POST"===e.method&&(l||0)<52428.8,body:a,signal:null==(n=i)?void 0:n.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){q.error(e)}null==e.callback||e.callback(s)})).catch(t=>{q.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>i?clearTimeout(i.timeout):null)}}),h&&ws.push({transport:"XHR",method:e=>{var t,i=new h;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=null!==(t=bs(e))&&void 0!==t?t:{};Yn(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),i.withCredentials=!0,i.onreadystatechange=()=>{if(4===i.readyState){var t={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!=a&&a.sendBeacon&&ws.push({transport:"sendBeacon",method:e=>{var t=ms(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!==(i=bs(e))&&void 0!==i?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;a.sendBeacon(t,n)}catch(e){}}}),Es=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}},Ss={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=>Es(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Es(t,e))),icontains:(e,t)=>t.map(ks).some(t=>e.map(ks).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ks).every(t=>e.map(ks).every(e=>!t.includes(e)))},ks=e=>e.toLowerCase(),xs=B("[Error tracking]"),Is=class{constructor(e){var t,i;this.fe=[],this._instance=e,this.fe=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(ie))&&void 0!==t?t:[]}onRemoteConfig(e){var t,i,s=null!==(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[];this.fe=s,this._instance.persistence&&this._instance.persistence.register({[ie]:this.fe})}sendExceptionEvent(e){if(!this.pe(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});xs.info("Skipping exception capture because a suppression rule matched")}pe(e){var t,i=e.$exception_list;return!(!i||!I(i)||0===i.length)&&(t=i.reduce((e,t)=>{var{type:i,value:s}=t;return R(i)&&i.length>0&&e.$exception_types.push(i),R(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]}),this.fe.some(e=>{var i=e.values.map(e=>{var i,s=Ss[e.operator],r=I(e.value)?e.value:[e.value],n=null!==(i=t[e.key])&&void 0!==i?i:[];return r.length>0&&s(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)}))}},Rs=(Fs="Android")+" "+(Ps="Tablet"),Ts="iPad",As="Apple Watch",Ls="BlackBerry",Ms="SamsungBrowser",Ds="Samsung Internet",js=(Ns="Chrome")+" OS",qs=Ns+" "+($s="iOS"),Hs=(Bs="Internet Explorer")+" "+(Cs="Mobile"),zs=(Us="Opera")+" Mini",Ws="Microsoft "+(Gs="Edge"),Ys=(Vs="Firefox")+" "+$s,Ks="Nintendo",Js="PlayStation",Zs="Xbox",Xs=Fs+" "+Cs,Qs=Cs+" "+(Os="Safari"),tr=(er="Windows")+" Phone",ir="Nokia",sr="Ouya",rr="Generic "+Cs.toLowerCase(),nr="Generic "+Ps.toLowerCase(),or="Konqueror",ar="(\\d+(\\.\\d+)?)",lr=new RegExp("Version/"+ar),cr=new RegExp(Zs,"i"),ur=new RegExp(Js+" \\w+","i"),hr=new RegExp(Ks+" \\w+","i"),dr=new RegExp(Ls+"|PlayBook|BB10","i"),pr={"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"},gr=(e,t)=>t&&zn(t,"Apple")||function(e){return zn(e,Os)&&!zn(e,Ns)&&!zn(e,Fs)}(e),_r=function(e,t){return t=t||"",zn(e," OPR/")&&zn(e,"Mini")?zs:zn(e," OPR/")?Us:dr.test(e)?Ls:zn(e,"IE"+Cs)||zn(e,"WPDesktop")?Hs:zn(e,Ms)?Ds:zn(e,Gs)||zn(e,"Edg/")?Ws:zn(e,"FBIOS")?"Facebook "+Cs:zn(e,"UCWEB")||zn(e,"UCBrowser")?"UC Browser":zn(e,"CriOS")?qs:zn(e,"CrMo")||zn(e,Ns)?Ns:zn(e,Fs)&&zn(e,Os)?Xs:zn(e,"FxiOS")?Ys:zn(e.toLowerCase(),or.toLowerCase())?or:gr(e,t)?zn(e,Cs)?Qs:Os:zn(e,Vs)?Vs:zn(e,"MSIE")||zn(e,"Trident/")?Bs:zn(e,"Gecko")?Vs:""},fr={[Hs]:[new RegExp("rv:"+ar)],[Ws]:[new RegExp(Gs+"?\\/"+ar)],[Ns]:[new RegExp("("+Ns+"|CrMo)\\/"+ar)],[qs]:[new RegExp("CriOS\\/"+ar)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ar)],[Os]:[lr],[Qs]:[lr],[Us]:[new RegExp("(Opera|OPR)\\/"+ar)],[Vs]:[new RegExp(Vs+"\\/"+ar)],[Ys]:[new RegExp("FxiOS\\/"+ar)],[or]:[new RegExp("Konqueror[:/]?"+ar,"i")],[Ls]:[new RegExp(Ls+" "+ar),lr],[Xs]:[new RegExp("android\\s"+ar,"i")],[Ds]:[new RegExp(Ms+"\\/"+ar)],[Bs]:[new RegExp("(rv:|MSIE )"+ar)],Mozilla:[new RegExp("rv:"+ar)]},vr=function(e,t){var i,s,r,n=fr[_r(e,t)];if(P(n))return null;for(i=0;i<n.length;i++)if(s=n[i],r=e.match(s))return parseFloat(r[r.length-2]);return null},mr=[[new RegExp(Zs+"; "+Zs+" (.*?)[);]","i"),e=>[Zs,e&&e[1]||""]],[new RegExp(Ks,"i"),[Ks,""]],[new RegExp(Js,"i"),[Js,""]],[dr,[Ls,""]],[new RegExp(er,"i"),(e,t)=>{var i,s;return/Phone/.test(t)||/WPDesktop/.test(t)?[tr,""]:new RegExp(Cs).test(t)&&!/IEMobile\b/.test(t)?[er+" "+Cs,""]:(i=/Windows NT ([0-9.]+)/i.exec(t))&&i[1]?(s=pr[i[1]]||"",/arm/i.test(t)&&(s="RT"),[er,s]):[er,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[$s,[e[3],e[4],e[5]||"0"].join(".")]:[$s,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=P(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Fs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Fs+")","i"),e=>e&&e[2]?[Fs,[e[2],e[3],e[4]||"0"].join(".")]:[Fs,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[js,""]],[/Linux|debian/i,["Linux",""]]],yr=function(e){return hr.test(e)?Ks:ur.test(e)?Js:cr.test(e)?Zs:new RegExp(sr,"i").test(e)?sr:new RegExp("("+tr+"|WPDesktop)","i").test(e)?tr:/iPad/.test(e)?Ts:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?As:dr.test(e)?Ls:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ir,"i").test(e)?ir:/(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(Cs).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)?Fs:Rs:Fs:new RegExp("(pda|"+Cs+")","i").test(e)?rr:new RegExp(Ps,"i").test(e)&&!new RegExp(Ps+" pc","i").test(e)?nr:""},br="https?://(.*)",Er=W(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],wr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"]),Sr="<masked>",kr=["li_fat_id"],xr=B("[FeatureFlags]"),Ir="$active_feature_flags",Cr="$override_feature_flags",$r="$feature_flag_payloads",Fr="$override_feature_flag_payloads",Pr="$feature_flag_request_id",Rr=e=>{var t={};for(var[i,s]of Kn(e||{}))s&&(t[i]=s);return t},Tr=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(e=>{var i;return[e,null!==(i=t[e].variant)&&void 0!==i?i:t[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(e=>t[e].enabled).filter(e=>{var i;return null==(i=t[e].metadata)?void 0:i.payload}).map(e=>{var i;return[e,null==(i=t[e].metadata)?void 0:i.payload]}))):xr.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},Ar=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({}),Or=class{constructor(e){this.ge=!1,this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.we=!0;else{var e=!this.$e&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ke({disableFlags:e})}}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e,t,i,s,r,n,o,a,l,c,u=this._instance.get_property(be),h=this._instance.get_property(Cr),d=this._instance.get_property(Fr);if(!d&&!h)return u||{};for(t of(e=G({},u||{}),[...new Set([...Object.keys(d||{}),...Object.keys(h||{})])]))r=e[t],n=null==h?void 0:h[t],o=P(n)?null!==(i=null==r?void 0:r.enabled)&&void 0!==i&&i:!!n,a=P(n)?r.variant:"string"==typeof n?n:void 0,l=null==d?void 0:d[t],c=Gn({},r,{enabled:o,variant:o?null!=a?a:null==r?void 0:r.variant:void 0}),o!==(null==r?void 0:r.enabled)&&(c.original_enabled=null==r?void 0:r.enabled),a!==(null==r?void 0:r.variant)&&(c.original_variant=null==r?void 0:r.variant),l&&(c.metadata=Gn({},null==r?void 0:r.metadata,{payload:l,original_payload:null==r||null==(s=r.metadata)?void 0:s.payload})),e[t]=c;return this.ge||(xr.warn(" Overriding feature flag details!",{flagDetails:u,overriddenPayloads:d,finalDetails:e}),this.ge=!0),e}getFlagVariants(){var e,t,i,s=this._instance.get_property(me),r=this._instance.get_property(Cr);if(!r)return s||{};for(e=G({},s),t=Object.keys(r),i=0;i<t.length;i++)e[t[i]]=r[t[i]];return this.ge||(xr.warn(" Overriding feature flags!",{enabledFlags:s,overriddenFlags:r,finalFlags:e}),this.ge=!0),e}getFlagPayloads(){var e,t,i,s=this._instance.get_property($r),r=this._instance.get_property(Fr);if(!r)return s||{};for(e=G({},s||{}),t=Object.keys(r),i=0;i<t.length;i++)e[t[i]]=r[t[i]];return this.ge||(xr.warn(" Overriding feature flag payloads!",{flagPayloads:s,overriddenPayloads:r,finalPayloads:e}),this.ge=!0),e}reloadFeatureFlags(){this.be||this._instance.config.advanced_disable_feature_flags||this.$e||(this.$e=setTimeout(()=>{this.ke()},5))}xe(){clearTimeout(this.$e),this.$e=void 0}ensureFlagsLoaded(){this._e||this.me||this.$e||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.be=e}ke(e){var t,i,s,r,n,o;this.xe(),this._instance.I()||(this.me?this.ye=!0:(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:Gn({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(we)||{}),group_properties:this._instance.get_property(Ee)},(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),r=(s=this._instance.config.__preview_remote_config)?"/flags/?v=2":"/flags/?v=2&config=true",n=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("api",r+n),s&&(i.timezone=na()),this.me=!0,this._instance.Ee({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:m.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,s,r,n=!0;200===e.statusCode&&(this.ye||(this.$anon_distinct_id=void 0),n=!1),this.me=!1,this.we||(this.we=!0,this._instance.Ie(null!==(s=e.json)&&void 0!==s?s:{})),i.disable_flags&&!this.ye||(this.Se=!n,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(Ar.FeatureFlags)?xr.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!==(r=e.json)&&void 0!==r?r:{},n),this.ye&&(this.ye=!1,this.ke())))}})))}getFeatureFlag(e,t){var i,s,r,n,o,a,l,c,u,h,d,p,g,_,f,v,m;if(void 0===t&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0)return s=""+(i=this.getFlagVariants()[e]),r=this._instance.get_property(Pr)||void 0,n=this._instance.get_property(xe)||{},!t.send_event&&"send_event"in t||e in n&&n[e].includes(s)||(I(n[e])?n[e].push(s):n[e]=[s],null==(o=this._instance.persistence)||o.register({[xe]:n}),_=this.getFeatureFlagDetails(e),f={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_bootstrapped_response:(null==(a=this._instance.config.bootstrap)||null==(a=a.featureFlags)?void 0:a[e])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])||null,$used_bootstrap_value:!this.Se},P(null==_||null==(c=_.metadata)?void 0:c.version)||(f.$feature_flag_version=_.metadata.version),(m=null!==(u=null==_||null==(h=_.reason)?void 0:h.description)&&void 0!==u?u:null==_||null==(d=_.reason)?void 0:d.code)&&(f.$feature_flag_reason=m),null!=_&&null!=(p=_.metadata)&&p.id&&(f.$feature_flag_id=_.metadata.id),P(null==_?void 0:_.original_variant)&&P(null==_?void 0:_.original_enabled)||(f.$feature_flag_original_response=P(_.original_variant)?_.original_enabled:_.original_variant),null!=_&&null!=(g=_.metadata)&&g.original_payload&&(f.$feature_flag_original_payload=null==_||null==(v=_.metadata)?void 0:v.original_payload),this._instance.capture("$feature_flag_called",f)),i;xr.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.Ee({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:m.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._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);xr.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._e=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),r=this.getFlagsWithDetails();(function(e,t,i,s,r){var n,o,a,l,c,u,h,d,p,g;if(void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={}),o=(n=Tr(e)).flags,a=n.featureFlags,l=n.featureFlagPayloads,a)if(c=e.requestId,I(a)){if(xr.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version."),u={},a)for(h=0;h<a.length;h++)u[a[h]]=!0;t&&t.register({[Ir]:a,[me]:u})}else d=a,p=l,g=o,e.errorsWhileComputingFlags&&(d=Gn({},i,d),p=Gn({},s,p),g=Gn({},r,g)),t&&t.register(Gn({[Ir]:Object.keys(Rr(d)),[me]:d||{},[$r]:p||{},[be]:g||{}},c?{[Pr]:c}:{}))})(e,this._instance.persistence,i,s,r),this.Pe(t)}}override(e,t){void 0===t&&(t=!1),xr.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){var t,i,s,r;if(!this._instance.__loaded||!this._instance.persistence)return xr.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(Cr),this._instance.persistence.unregister(Fr),void this.Pe();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(i=e,this.ge=Boolean(null!==(t=i.suppressWarning)&&void 0!==t&&t),"flags"in i)if(!1===i.flags)this._instance.persistence.unregister(Cr);else if(i.flags)if(I(i.flags)){for(s={},r=0;r<i.flags.length;r++)s[i.flags[r]]=!0;this._instance.persistence.register({[Cr]:s})}else this._instance.persistence.register({[Cr]:i.flags});return"payloads"in i&&(!1===i.payloads?this._instance.persistence.unregister(Fr):i.payloads&&this._instance.persistence.register({[Fr]:i.payloads})),void this.Pe()}this.Pe()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._e){var{flags:t,flagVariants:i}=this.Re();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,s,r=(this._instance.get_property(ye)||[]).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),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1),s=Gn({},this.getFlagVariants(),{[e]:t}),null==(i=this._instance.persistence)||i.register({[Ir]:Object.keys(Rr(s)),[me]:s}),this.Pe()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(ye),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance.Ee({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)return s=t.json.earlyAccessFeatures,null==(i=this._instance.persistence)||i.register({[ye]:s}),e(s)}})}Re(){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),{})}}Pe(e){var{flags:t,flagVariants:i}=this.Re();this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(we)||{};this._instance.register({[we]:Gn({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(we)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Ee)||{};
10!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=Gn({},i[t],e[t]),delete e[t]}),this._instance.register({[Ee]:Gn({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Ee)||{};this._instance.register({[Ee]:Gn({},t,{[e]:{}})})}else this._instance.unregister(Ee)}reset(){this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$anon_distinct_id=void 0,this.xe(),this.ge=!1}},Lr=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Mr=class{constructor(e,t){this.S=e,this.props={},this.Te=!1,this.Me=(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.B=this.Ce(e),this.load(),e.debug&&q.info("Persistence loaded",e.persistence,Gn({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Fe}Ce(e){-1===Lr.indexOf(e.persistence.toLowerCase())&&(q.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&ut.O()?ut:"localstorage+cookie"===t&&dt.O()?dt:"sessionstorage"===t&&ft.O()?ft:"memory"===t?gt:"cookie"===t?lt:dt.O()?dt:lt}properties(){var e={};return Yn(this.props,function(t,i){var s,r,n,a,l;if(i===me&&$(t))for(s=Object.keys(t),r=0;r<s.length;r++)e["$feature/"+s[r]]=t[s[r]];else a=i,l=!1,(A(n=Le)?l:o&&n.indexOf===o?-1!=n.indexOf(a):(Yn(n,function(e){if(l||(l=e===a))return z}),l))||(e[i]=t)}),e}load(){if(!this.Fe){var e=this.B.L(this.Me);e&&(this.props=G({},e))}}save(){this.Fe||this.B.j(this.Me,this.props,this.Oe,this.Ae,this.De,this.S.debug)}remove(){this.B.N(this.Me,!1),this.B.N(this.Me,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if($(e)){P(t)&&(t="None"),this.Oe=P(i)?this.Le:i;var s=!1;if(Yn(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.Oe=P(t)?this.Le:t;var i=!1;if(Yn(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.Te){var e=Xo(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);F(K(e))||this.register(e),this.Te=!0}}update_search_keyword(){var e;this.register((e=null==l?void 0:l.referrer)?ea(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ia(),$referring_domain:null!=l&&l.referrer&&(null==(e=Ge(l.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Fe]||this.props[Pe]||this.register_once({[Re]:sa(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e,t,i,s={};return Yn([Pe,Fe],e=>{var t=this.props[e];t&&Yn(t,function(e,t){s["$initial_"+w(t)]=e})}),(i=this.props[Re])&&G(s,(e=ra(i),t={},Yn(e,function(e,i){t["$initial_"+w(i)]=e}),t)),s}safe_merge(e){return Yn(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Le=this.Oe=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.Ce(e),r=this.props;this.clear(),this.B=s,this.props=r,this.save()}}set_disabled(e){this.Fe=e,this.Fe?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ae&&(this.Ae=e,this.remove(),this.save())}set_secure(e){e!==this.De&&(this.De=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[X]||{};i[e]=t,this.props[X]=i,this.save()}remove_event_timer(e){var t=(this.props[X]||{})[e];
1return P(t)||(delete this.props[X][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}},Dr=class{constructor(){this.je={},this.je={}}on(e,t){return this.je[e]||(this.je[e]=[]),this.je[e].push(t),()=>{this.je[e]=this.je[e].filter(e=>e!==t)}}emit(e,t){var i,s;for(i of this.je[e]||[])i(t);for(s of this.je["*"]||[])s(e,t)}},Nr=class e{constructor(e){this.Ne=new Dr,this.ze=(e,t)=>this.Ue(e,t)&&this.qe(e,t)&&this.Be(e,t),this.Ue=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.He=new Set,this.We=new Set}init(){var e,t;P(null==(e=this._instance)?void 0:e.Ge)||null==(t=this._instance)||t.Ge((e,t)=>{this.on(e,t)})}register(e){var t,i,s,r;!P(null==(t=this._instance)?void 0:t.Ge)&&(e.forEach(e=>{var t,i;null==(t=this.We)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.He)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)&&(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.He.has(e)||this.He.has(null==t?void 0:t.event))&&this.We&&(null==(i=this.We)?void 0:i.size)>0&&this.We.forEach(e=>{this.Je(t,e)&&this.Ne.emit("actionCaptured",e.name)})}Ve(e){this.onAction("actionCaptured",t=>e(t))}Je(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.ze(e,i))return!0;return!1}onAction(e,t){return this.Ne.on(e,t)}qe(t,i){if(null!=i&&i.url){var s,r=null==t||null==(s=t.properties)?void 0:s.$current_url;if(!r||"string"!=typeof r)return!1;if(!e.Ke(r,null==i?void 0:i.url,(null==i?void 0:i.url_matching)||"contains"))return!1}return!0}static Ke(t,s,r){switch(r){case"regex":return!!i&&Es(t,s);case"exact":return s===t;case"contains":return Es(t,e.Ye(s).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static Ye(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Be(t,i){if((null!=i&&i.href||null!=i&&i.tag_name||null!=i&&i.text)&&!this.Xe(t).some(t=>!(null!=i&&i.href&&!e.Ke(t.href||"",null==i?void 0:i.href,(null==i?void 0:i.href_matching)||"exact")||null!=i&&i.tag_name&&t.tag_name!==(null==i?void 0:i.tag_name)||null!=i&&i.text&&!e.Ke(t.text||"",null==i?void 0:i.text,(null==i?void 0:i.text_matching)||"exact")&&!e.Ke(t.$el_text||"",null==i?void 0:i.text,(null==i?void 0:i.text_matching)||"exact"))))return!1;if(null!=i&&i.selector){var s,r=null==t||null==(s=t.properties)?void 0:s.$element_selectors;if(!r)return!1;if(!r.includes(null==i?void 0:i.selector))return!1}return!0}Xe(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}},jr=B("[Surveys]"),qr="seenSurvey_",Br=(e,t)=>{var i="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(i="$survey_"+t+"/"+e.id+"/"+e.current_iteration),i},Hr=class{constructor(e){this._instance=e,this.Qe=new Map,this.Ze=new Map}register(e){var t;P(null==(t=this._instance)?void 0:t.Ge)||(this.tr(e),this.ir(e))}ir(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.er&&(this.er=new Nr(this._instance),this.er.init(),this.er.Ve(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.er)||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.Ze.get(t.name);i&&i.push(e.id),this.Ze.set(t.name,i||[e.id])}}))}))}tr(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.Ge((e,t)=>{this.onEvent(e,t)}),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.Qe.get(t.name);i&&i.push(e.id),this.Qe.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,s,r,n,o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[ke])||[];"survey shown"===e&&t&&o.length>0?(jr.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:o}),(r=null==t||null==(s=t.properties)?void 0:s.$survey_id)&&(n=o.indexOf(r))>=0&&(o.splice(n,1),this.rr(o))):this.Qe.has(e)&&(jr.info("survey event matched, updating activated surveys",{event:e,surveys:this.Qe.get(e)}),this.rr(o.concat(this.Qe.get(e)||[])))}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[ke])||[];this.Ze.has(e)&&this.rr(i.concat(this.Ze.get(e)||[]))}rr(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ke]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[ke])||[]}getEventToSurveys(){return this.Qe}sr(){return this.er}},Ur=class{constructor(e){this.nr=void 0,this.ar=null,this.lr=!1,this.ur=!1,this.hr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t,i=e.surveys;if(O(i))return jr.warn("Flags not loaded yet. Not loading surveys.");t=I(i),this.nr=t?i.length>0:i,jr.info("flags response received, isSurveysEnabled: "+this.nr),this.loadIfEnabled()}reset(){var e,t,i;for(localStorage.removeItem("lastSeenSurveyDate"),e=[],t=0;t<localStorage.length;t++)(null!=(i=localStorage.key(t))&&i.startsWith(qr)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i);
1e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){var e,t,i,s;if(!this.ar)if(this.ur)jr.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)jr.info("Disabled. Not loading surveys.");else if(e=null==g?void 0:g.__PosthogExtensions__){if(t=this.nr,!P(t)){this.ur=!0;try{if(i=e.generateSurveys)return void this.dr(i,t);if(!(s=e.loadExternalDependency))return void this.vr("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.vr("Could not load surveys script",i):this.dr(e.generateSurveys,t)})}catch(e){throw this.vr("Error initializing surveys",e),e}finally{this.ur=!1}}}else jr.error("PostHog Extensions not found.")}dr(e,t){this.ar=e(this._instance,t),this._surveyEventReceiver=new Hr(this._instance),jr.info("Surveys loaded successfully"),this.cr({isLoaded:!0})}vr(e,t){jr.error(e,t),this.cr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.hr.push(e),this.ar&&this.cr({isLoaded:!0}),()=>{this.hr=this.hr.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return jr.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Se);if(i&&!t)return e(i,{isLoaded:!0});if(this.lr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.lr=!0,this._instance.Ee({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=>{var i,s,r,n,o,a;return this.lr=!1,200===(s=t.statusCode)&&t.json?(a=(o=t.json.surveys||[]).filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))),a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),null==(i=this._instance.persistence)||i.register({[Se]:o}),e(o,{isLoaded:!0})):(r="Surveys API could not be loaded, status: "+s,jr.error(r),e([],{isLoaded:!1,error:r}))}})}catch(e){throw this.lr=!1,e}}cr(e){for(var t of this.hr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(e){jr.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!O(this.ar))return this.ar.getActiveMatchingSurveys(e,t);jr.warn("init was not called")}pr(e){var t=null;return this.getSurveys(i=>{var s;t=null!==(s=i.find(t=>t.id===e))&&void 0!==s?s:null}),t}gr(e){if(O(this.ar))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.pr(e):e;return t?this.ar.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(O(this.ar))return jr.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return O(this.ar)?(jr.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,n=null!==(s=t.find(t=>t.id===e))&&void 0!==s?s:null;n?(r=this.gr(n),i({visible:r.eligible,disabledReason:r.reason})):i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(O(this.ar))jr.warn("init was not called");else{var i=this.pr(e),s=null==l?void 0:l.querySelector(t);i?s?this.ar.renderSurvey(i,s):jr.warn("Survey element not found"):jr.warn("Survey not found")}}},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"}({}),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}({}),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"}({}),zr=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),Gr=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}({}),Wr=B("[RateLimiter]"),Vr=class{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=>{Wr.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void Wr.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}clientRateLimitContext(e){var t,i,s,r,n,o;return void 0===e&&(e=!1),r=(new Date).getTime(),(n=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property($e))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:r}).tokens+=(r-n.last)/1e3*this.captureEventsPerSecond,n.last=r,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit),(o=n.tokens<1)||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($e,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}},Yr=B("[RemoteConfig]"),Kr=class{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_r(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(Yr.error("PostHog Extensions not found. Cannot load remote config."),e())}mr(e){this._instance.Ee({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 Yr.info("Using preloaded remote config",this.remoteConfig),void this.Ie(this.remoteConfig);if(this._instance.I())return void Yr.warn("Remote config is disabled. Falling back to local config.");this._r(e=>{if(!e)return Yr.info("No config found after loading remote JS config. Falling back to JSON."),void this.mr(e=>{this.Ie(e)});this.Ie(e)})}catch(i){Yr.error("Error loading remote config",i)}}Ie(e){e?this._instance.config.__preview_remote_config?(this._instance.Ie(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):Yr.info("__preview_remote_config is disabled. Logging config instead",e):Yr.error("Failed to fetch remote config from PostHog.")}},Jr=3e3,Zr=class{constructor(e,t){this.br=!0,this.yr=[],this.wr=Eo((null==t?void 0:t.flush_interval_ms)||Jr,250,5e3,"flush interval",Jr),this.Sr=e}enqueue(e){this.yr.push(e),this.$r||this.kr()}unload(){this.Er();var e=this.yr.length>0?this.Ir():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Sr(Gn({},e,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.kr()}kr(){var e=this;this.br||(this.$r=setTimeout(()=>{var t,i,s;if(this.Er(),this.yr.length>0)for(s in i=function(){var i=t[s],r=(new Date).getTime();i.data&&I(i.data)&&Yn(i.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Sr(i)},t=this.Ir())i()},this.wr))}Er(){clearTimeout(this.$r),this.$r=void 0}Ir(){var e={};return Yn(this.yr,t=>{var i,s=t,r=(s?s.batchKey:null)||s.url;P(e[r])&&(e[r]=Gn({},s,{data:[]})),null==(i=e[r].data)||i.push(s.data)}),this.yr=[],e}},Xr=["retriesPerformedSoFar"],Qr=class{constructor(e){this.Pr=!1,this.Rr=3e3,this.yr=[],this._instance=e,this.yr=[],this.Tr=!0,!P(i)&&"onLine"in i.navigator&&(this.Tr=i.navigator.onLine,Xn(i,"online",()=>{this.Tr=!0,this.se()}),Xn(i,"offline",()=>{this.Tr=!1}))}get length(){return this.yr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=Wn(e,Xr);L(t)&&t>0&&(i.url=ms(i.url,{retry_count:t})),this._instance.Ee(Gn({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Mr(Gn({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}Mr(e){var t,i,s,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1,t=function(e){var t=3e3*Math.pow(2,e),i=t/2,s=Math.min(18e5,t),r=(Math.random()-.5)*(s-i);return Math.ceil(s+r)}(r),i=Date.now()+t,this.yr.push({retryAt:i,requestOptions:e}),s="Enqueued failed request for retry in "+t,navigator.onLine||(s+=" (Browser is offline)"),q.warn(s),this.Pr||(this.Pr=!0,this.Cr())}Cr(){this.Fr&&clearTimeout(this.Fr),this.Fr=setTimeout(()=>{this.Tr&&this.yr.length>0&&this.se(),this.Cr()},this.Rr)}se(){var e=Date.now(),t=[],i=this.yr.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.yr=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Fr&&(clearTimeout(this.Fr),this.Fr=void 0),this.yr))try{this._instance.Ee(Gn({},e,{transport:"sendBeacon"}))}catch(e){q.error(e)}this.yr=[]}},en=class{constructor(e){this.Or=()=>{var e,t,i,s,r,n,o,a,l;this.Ar||(this.Ar={}),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.Ar.lastScrollY=Math.ceil(n),this.Ar.maxScrollY=Math.max(n,null!==(e=this.Ar.maxScrollY)&&void 0!==e?e:0),this.Ar.maxScrollHeight=Math.max(o,null!==(t=this.Ar.maxScrollHeight)&&void 0!==t?t:0),this.Ar.last
1ContentY=a,this.Ar.maxContentY=Math.max(a,null!==(i=this.Ar.maxContentY)&&void 0!==i?i:0),this.Ar.maxContentHeight=Math.max(l,null!==(s=this.Ar.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}getContext(){return this.Ar}resetContext(){var e=this.Ar;return setTimeout(this.Or,0),e}startMeasuringScrollPosition(){Xn(i,"scroll",this.Or,{capture:!0}),Xn(i,"scrollend",this.Or,{capture:!0}),Xn(i,"resize",this.Or)}scrollElement(){var e,t;if(!this._instance.config.scroll_root_selector)return null==i?void 0:i.document.documentElement;for(e of I(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector])if(t=null==i?void 0:i.document.querySelector(e))return t}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return i&&(i.scrollY||i.pageYOffset||i.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return i&&(i.scrollX||i.pageXOffset||i.document.documentElement.scrollLeft)||0}},tn=e=>sa(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties),sn=class{constructor(e,t,i,s){this.Dr=e=>{var t,i=this.Lr();i&&i.sessionId===e||(t={sessionId:e,props:this.jr(this._instance)},this.Nr.register({[Ce]:t}))},this._instance=e,this.zr=t,this.Nr=i,this.jr=s||tn,this.zr.onSessionId(this.Dr)}Lr(){return this.Nr.props[Ce]}getSetOnceProps(){var e,t=null==(e=this.Lr())?void 0:e.props;return t?"r"in t?ra(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 Yn(K(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+w(i)]=t}),e}},rn=B("[SessionId]"),nn=class{constructor(e,t,i){var s,r,n,o,a,l;if(this.Ur=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");if(this.S=e.config,this.Nr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qr=t||rt,this.Br=i||rt,r=this.S.persistence_name||this.S.token,n=this.S.session_idle_timeout_seconds||1800,this._sessionTimeoutMs=1e3*Eo(n,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hr(),this.Wr="ph_"+r+"_window_id",this.Gr="ph_"+r+"_primary_window_exists",this.Jr()&&(o=ft.L(this.Wr),a=ft.L(this.Gr),o&&!a?this.fi=o:ft.N(this.Wr),ft.j(this.Gr,!0)),null!=(s=this.S.bootstrap)&&s.sessionID)try{l=(()=>{var e=this.S.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(),this.Vr(this.S.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){rn.error("Invalid sessionID in bootstrap",e)}this.Kr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return P(this.Ur)&&(this.Ur=[]),this.Ur.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.Ur=this.Ur.filter(t=>t!==e)}}Jr(){return"memory"!==this.S.persistence&&!this.Nr.Fe&&ft.O()}Yr(e){e!==this.fi&&(this.fi=e,this.Jr()&&ft.j(this.Wr,e))}Xr(){return this.fi?this.fi:this.Jr()?ft.L(this.Wr):null}Vr(e,t,i){e===this.Ct&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Ct=e,this.Nr.register({[ge]:[t,e,i]}))}Qr(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.Nr.props[ge];return I(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Vr(null,null,null)}Kr(){Xn(i,"beforeunload",()=>{this.Jr()&&ft.N(this.Gr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){var i,s;if(void 0===e&&(e=!1),void 0===t&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var r=t||(new Date).getTime(),[n,o,a]=this.Qr(),l=this.Xr(),c=L(a)&&a>0&&Math.abs(r-a)>864e5,u=!1,h=!o,d=!e&&Math.abs(r-n)>this.sessionTimeoutMs;
1return h||d||c?(o=this.qr(),l=this.Br(),rn.info("new session ID generated",{sessionId:o,windowId:l,changeReason:{noSessionId:h,activityTimeout:d,sessionPastMaximumLength:c}}),a=r,u=!0):l||(l=this.Br(),u=!0),i=0===n||!e||c?r:n,s=0===a?(new Date).getTime():a,this.Yr(l),this.Vr(o,i,s),e||this.Hr(),u&&this.Ur.forEach(e=>e(o,l,u?{noSessionId:h,activityTimeout:d,sessionPastMaximumLength:c}:void 0)),{sessionId:o,windowId:l,sessionStartTimestamp:s,changeReason:u?{noSessionId:h,activityTimeout:d,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:n}}Hr(){clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}},on=["$set_once","$set"],an=B("[SiteApps]"),ln=class{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var i=this.globalsForEvent(t);this.ts.push(i),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ge(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,i,s,r,n,o,a,l,c,u;if(!e)throw new Error("Event payload is required");for(var[h,d]of(l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{},Object.entries(u)))l[h]={id:c[h],type:h,properties:d};var{$set_once:p,$set:g}=e;return{event:Gn({},Wn(e,on),{properties:Gn({},e.properties,g?{$set:Gn({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:Gn({},null!==(s=null==(r=e.properties)?void 0:r.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.ts.length&&(an.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.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.rs)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,an.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){an.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){an.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ss(){var e,t,i=this.siteAppLoaders||[];for(e of i)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(t of i)this.setupSiteApp(t)}ns(e){var t,i;if(0!==Object.keys(this.apps).length)for(i of(t=this.globalsForEvent(e),Object.values(this.apps)))try{null==i.processEvent||i.processEvent(t)}catch(t){an.error("Error while processing event "+e.event+" for site app "+i.id,t)}}onRemoteConfig(e){var t,i,s,r,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",e=>this.ns(e))):void an.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.rs)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled)for(var{id:o,url:a}of(r=function(e){var t;g["__$$ph_site_app_"+e]=n._instance,null==(t=g.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,t=>{if(t)return an.error("Error while initializing PostHog app with config id "+e,t)})},e.siteApps))r(o);else an.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},cn=["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","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"],un=function(e,t){if(!e)return!1;var i=e.toLowerCase();return cn.concat(t||[]).some(e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)})},hn=function(e,t){var i,s;if(!e)return!1;if((i=e.userAgent)&&un(i,t))return!0;try{if(null!=(s=null==e?void 0:e.userAgentData)&&s.brands&&s.brands.some(e=>un(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},dn=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),pn="i.posthog.com",gn=class{constructor(e){this.os={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+pn,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.os[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=dn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=dn.EU:this.os[this.apiHost]=dn.CUSTOM),this.os[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===dn.CUSTOM)return this.apiHost+t;var i=pn+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}},_n={icontains:(e,t)=>!!i&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!i&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!i&&Es(t.href,e),not_regex:(e,t)=>!!i&&!Es(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},fn=class e{constructor(t){var i=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),i.getWebExperiments(t=>{e.ls("retrieved web experiments from the server"),i.us=new Map,t.forEach(t=>{var s,r,n,o;if(t.feature_flag_key)i.us&&(e.ls("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(s=i.us)||s.set(t.feature_flag_key,t)),r=i._instance.getFeatureFlag(t.feature_flag_key),R(r)&&t.variants[r]&&i.hs(t.name,r,t.variants[r].transforms);else if(t.variants)for(n in t.variants)o=t.variants[n],e.ds(o)&&i.hs(t.name,n,o.transforms)})},t)},this._instance=t,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(t){if(this._is_bot())e.ls("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(O(this.us))return this.us=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.ls("applying feature flags",t),t.forEach(e=>{var t,i,s,r;this.us&&null!=(t=this.us)&&t.has(e)&&(s=this._instance.getFeatureFlag(e),r=null==(i=this.us)?void 0:i.get(e),s&&null!=r&&r.variants[s]&&this.hs(r.name,s,r.variants[s].transforms))})}}previewWebExperiment(){var t,i,s=e.getWindowLocation();null!=s&&s.search&&(t=Ve(null==s?void 0:s.search,"__experiment_id"),i=Ve(null==s?void 0:s.search,"__experiment_variant"),t&&i&&(e.ls("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.vs(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.Ee({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([])})}vs(t,i,s){var r=s.filter(e=>e.id===t);r&&r.length>0&&(e.ls("Previewing web experiment ["+r[0].name+"] with variant ["+i+"]"),this.hs(r[0].name,i,r[0].variants[i].transforms))}
1static ds(t){return!O(t.conditions)&&e.cs(t)&&e.fs(t)}static cs(t){var i,s,r,n,o;return!(!O(t.conditions)&&!O(null==(i=t.conditions)?void 0:i.url))||!!(o=e.getWindowLocation())&&(null==(s=t.conditions)||!s.url||_n[null!==(r=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==r?r:"icontains"](t.conditions.url,o))}static getWindowLocation(){return null==i?void 0:i.location}static fs(e){var t,i,s,r,n,o,a,l,c,u,h,d,p,g;return!(!O(e.conditions)&&!O(null==(t=e.conditions)?void 0:t.utm))||!!(i=Xo()).utm_source&&(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)==i.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)==i.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)==i.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)==i.utm_term,h&&p&&g&&d)}static ls(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];q.info("[WebExperiments] "+e,i)}hs(t,i,s){this._is_bot()?e.ls("Refusing to render web experiment since the viewer is a likely bot"):"control"!==i?s.forEach(s=>{var r;s.selector&&(e.ls("applying transform of variant "+i+" for experiment "+t+" ",s),(null==(r=document)?void 0:r.querySelectorAll(s.selector))?.forEach(e=>{var t=e;s.html&&(t.innerHTML=s.html),s.css&&t.setAttribute("style",s.css)}))}):e.ls("Control variants leave the page unmodified.")}_is_bot(){return a&&this._instance?hn(a,this._instance.config.custom_blocked_useragents):void 0}},vn=B("[PostHog ExternalIntegrations]"),mn={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},yn=class{constructor(e){this._instance=e}J(e,t){var i;null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return vn.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=g.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.J(mn[e],()=>{var i;null==(i=g.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=g.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=g.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!==(e=this._instance.config.integrations)&&void 0!==e?e:{}))i(s)}},bn={},wn=()=>{},En="posthog",Sn=!fs&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),kn=e=>{var t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Jn(null==l?void 0:l.location),persistence:"localStorage+cookie",persistence_name:"",loaded:wn,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:c&&R(null==c?void 0:c.search)&&-1!==c.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==i||null==(t=i.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",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_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;q.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:Jr},error_tracking:{},_onCapture:wn}},xn=e=>{var t,i={};return P(e.process_person)||(i.person_profiles=e.process_person),P(e.xhr_headers)||(i.request_headers=e.x
1hr_headers),P(e.cookie_name)||(i.persistence_name=e.cookie_name),P(e.disable_cookie)||(i.disable_persistence=e.disable_cookie),P(e.store_google)||(i.save_campaign_params=e.store_google),P(e.verbose)||(i.debug=e.verbose),t=G({},i,e),I(e.property_blacklist)&&(P(e.property_denylist)?t.property_denylist=e.property_blacklist:I(e.property_denylist)?t.property_denylist=[...e.property_blacklist,...e.property_denylist]:q.error("Invalid value for property_denylist config: "+e.property_denylist)),t},In=class{constructor(){this.__forceAllowLocalhost=!1}get ps(){return this.__forceAllowLocalhost}set ps(e){q.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Cn=class e{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new In,this.gs=!1,this.version=_.LIB_VERSION,this._s=new Dr,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=kn(),this.SentryIntegration=ts,this.sentryIntegration=e=>function(e,t){var i=Ko(e,t);return{name:es,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bs=!1,this.ys=null,this.ws=null,this.Ss=null,this.featureFlags=new Or(this),this.toolbar=new os(this),this.scrollManager=new en(this),this.pageViewManager=new gs(this),this.surveys=new Ur(this),this.experiments=new fn(this),this.exceptions=new Is(this),this.rateLimiter=new Vr(this),this.requestRouter=new gn(this),this.consent=new mt(this),this.externalIntegrations=new yn(this),this.people={set:(e,t,i)=>{var s=R(e)?{[e]:t}:e;this.setPersonProperties(s),i?.({})},set_once:(e,t,i)=>{var s=R(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),i?.({})}},this.on("eventCaptured",e=>q.info('send "'+(null==e?void 0:e.event)+'"',e))}init(t,i,s){if(s&&s!==En){var r,n=null!==(r=bn[s])&&void 0!==r?r:new e;return n._init(t,i,s),bn[s]=n,bn[En][s]=n,n}return this._init(t,i,s)}_init(e,t,s){var r,n,o,a,l,c,u,h,d,p,g,f,v,y;return void 0===t&&(t={}),P(e)||T(e)?(q.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this):this.__loaded?(q.warn("You have already initialized PostHog! Re-initializing is a no-op"),this):(this.__loaded=!0,this.config={},this.$s=t,this.ks=[],t.person_profiles&&(this.ws=t.person_profiles),this.set_config(G({},kn(t.defaults),xn(t),{name:s,token:e})),this.config.on_xhr_error&&q.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:m.GZipJS,o=this.xs(),this.persistence=new Mr(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Mr(Gn({},this.config,{persistence:"sessionStorage"}),o),a=Gn({},this.persistence.props),l=Gn({},this.sessionPersistence.props),this.register({$initialization_time:(new Date).toISOString()}),this.Es=new Zr(e=>this.Is(e),this.config.request_queue_config),this.Ps=new Qr(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new nn(this),this.sessionPropsManager=new sn(this,this.sessionManager,this.persistence)),new ls(this).startIfEnabledOrStop(),this.siteApps=new ln(this),null==(r=this.siteApps)||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Xi(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Ze(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new ps(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new hs(this),this.exceptionObserver=new xt(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Et(this,wt),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new qt(this),this.historyAutocapture.startIfEnabled(),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&q.info("Starting in debug mode",{this:this,config:t,thisC:Gn({},this.config),p:a,s:l}),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)&&(h=this.config.get_device_id(rt()),d=null!=(c=t.bootstrap)&&c.isIdentifiedID?h:t.bootstrap.distinctID,this.persistence.set_property(Ie,null!=(u=t.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})),this.Rs()&&(f=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])}).reduce((e,i)=>{var s;return e[i]=(null==(s=t.bootstrap)||null==(s=s.featureFlags)?void 0:s[i])||!1,e},{}),v=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlagPayloads)||{}).filter(e=>f[e]).reduce((e,i)=>{var s,r;return null!=(s=t.bootstrap)&&null!=(s=s.featureFlagPayloads)&&s[i]&&(e[i]=null==(r=t.bootstrap)||null==(r=r.featureFlagPayloads)?void 0:r[i]),e},{}),this.featureFlags.receivedFeatureFlags({featureFlags:f,featureFlagPayloads:v})),this.config.__preview_experimental_cookieless_mode?this.register_once({distinct_id:Oe,$device_id:null},""):this.get_distinct_id()||(y=this.config.get_device_id(rt()),this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(Ie,"anonymous")),Xn(i,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i,s,r=e.config.segment;if(!r)return t();i=i=>{var s=()=>i.anonymousId()||rt();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(Ie,"identified")),t()},"then"in(s=r.user())&&C(s.then)?s.then(e=>i(e)):i(s)}(e,()=>{i.register((e=>{Promise&&Promise.resolve||Qi.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Qi.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Qi.info("UserId set, identifying with PostHog"),e.identify(t.event.userId)
1);var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this.Ts()):this.Ts(),C(this.config._onCapture)&&this.config._onCapture!==wn&&(q.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&q.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)}Ie(e){var t,i,s,r,n,o,a,c;if(!l||!l.body)return q.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ie(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=zn(e.supportedCompression,m.GZipJS)?m.GZipJS:zn(e.supportedCompression,m.Base64)?m.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ws?this.ws:"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==(a=this.exceptionObserver)||a.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(c=this.deadClicksAutocapture)||c.onRemoteConfig(e)}Ts(){try{this.config.loaded(this)}catch(i){q.critical("`loaded` function failed",i)}this.Ms(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Cs()},1),new Kr(this).load(),this.featureFlags.flags()}Ms(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this.Es)||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Vn(this.__request_queue,e=>this.Is(e)),this.__request_queue=[],this.Ms()}_handle_unload(){var e,t;this.config.request_batching?(this.Fs()&&this.capture("$pageleave"),null==(e=this.Es)||e.unload(),null==(t=this.Ps)||t.unload()):this.Fs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Ee(e){this.__loaded&&(Sn?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ms(e.url,{ip:this.config.ip?1:0}),e.headers=Gn({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r,n,o=Gn({},e);if(o.timeout=o.timeout||6e4,o.url=ms(o.url,{_:(new Date).getTime().toString(),ver:_.LIB_VERSION,compression:o.compression}),r=null!==(t=o.transport)&&void 0!==t?t:"fetch",n=null!==(i=null==(s=Zn(ws,e=>e.transport===r))?void 0:s.method)&&void 0!==i?i:ws[0].method,!n)throw new Error("No available transport method");n(o)})(Gn({},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)}}))))}Is(e){this.Ps?this.Ps.retriableRequest(e):this.Ee(e)}_execute_array(e){var t,i,s=[],r=[],n=[];Vn(e,e=>{e&&(t=e[0],I(t)?n.push(e):C(e)?e.call(this):I(e)&&"alias"===t?s.push(e):I(e)&&-1!==t.indexOf("capture")&&C(this[t])?n.push(e):r.push(e))}),i=function(e,t){Vn(e,function(e){if(I(e[0])){var i=t;Yn(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)},i(s,this),i(r,this),i(n,this)}Rs(){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,r,n,o,a,l,c,u,h,d,p,g,_,f;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Es){if(!this.consent.isOptedOut())if(!P(e)&&R(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){if(null==(r=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext())||!r.isRateLimited){if(null!=t&&t.$current_url&&!R(null==t?void 0:t.$current_url)&&(q.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(),n=new Date,o=(null==i?void 0:i.timestamp)||n,l={uuid:a=rt(),event:e,properties:this.calculateEventProperties(e,t||{},o,a)},r&&(l.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),null!=i&&i.$set&&(l.$set=null==i?void 0:i.$set),(h=this.Os(null==i?void 0:i.$set_once))&&(l.$set_once=h),(l=function(e,t){return i=e,s=e=>R(e)&&!A(t)?e.slice(0,t):e,r=new Set,function e(t,i){return t!==Object(t)?s?s(t):t:r.has(t)?void 0:(r.add(t),I(t)?(n=[],Vn(t,t=>{n.push(e(t))})):(n={},Yn(t,(t,i)=>{r.has(t)||(n[i]=e(t))})),n);var n}(i);var i,s,r}(l,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=o,P(null==i?void 0:i.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=n),(e===zr.DISMISSED||e===zr.SENT)&&(d=null==t?void 0:t[Gr.SURVEY_ID],p=null==t?void 0:t[Gr.SURVEY_ITERATION],localStorage.setItem((u=""+qr+(c={id:d,current_iteration:p}).id,c.current_iteration&&c.current_iteration>0&&(u=""+qr+c.id+"_"+c.current_iteration),u),"true"),l.$set=Gn({},l.$set,{[Br({id:d,current_iteration:p},e===zr.SENT?"responded":"dismissed")]:!0})),g=Gn({},l.properties.$set,l.$set),F(g)||this.setPersonPropertiesForFlags(g),!O(this.config.before_send)){if(!(_=this.As(l)))return;l=_}return this._s.emit("eventCaptured",l),f={method:"POST",url:null!==(s=null==i?void 0:i._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:null==i?void 0:i._batchKey},!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Is(f):this.Es.enqueue(f),l}q.critical("This capture call is ignored due to client rate limiting.")}}else q.error("No event name provided to posthog.capture")}else q.uninitializedWarning("posthog.capture")}Ge(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,r){var n,o,a,c,u,h,d,g,_;if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;if(n=r?void 0:this.persistence.remove_event_timer(e),(o=Gn({},t)).token=this.config.token,o.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(o.$cookieless_mode=!0),"$snapshot"===e)return a=Gn({},this.persistence.properties(),this.sessionPersistence.properties()),o.distinct_id=a.distinct_id,(!R(o.distinct_id)&&!L(o.distinct_id)||T(o.distinct_id))&&q.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o;if(u=aa(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties),this.sessionManager){var{sessionId:f,windowId:v}=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime());o.$session_id=f,o.$window_id=v}this.sessionPropsManager&&G(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&G(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(h=this.Ps)?void 0:h.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}return this.requestRouter.region===dn.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),c="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewM
1anager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=G(o,c),"$pageview"===e&&l&&(o.title=l.title),P(n)||(d=i.getTime()-n,o.$duration=parseFloat((d/1e3).toFixed(3))),p&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=G({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),I(this.config.property_denylist)?Yn(this.config.property_denylist,function(e){delete o[e]}):q.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist),(g=this.config.sanitize_properties)&&(q.error("sanitize_properties is deprecated. Use before_send instead"),o=g(o,e)),_=this.Ds(),o.$process_person_profile=_,_&&!r&&this.Ls("_calculate_event_properties"),o}Os(e){var t,i,s;return this.persistence&&this.Ds()?this.gs?e:(i=G({},this.persistence.get_initial_props(),(null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps())||{},e||{}),(s=this.config.sanitize_properties)&&(q.error("sanitize_properties is deprecated. Use before_send instead"),i=s(i,"$set_once")),this.gs=!0,F(i)?void 0:i):e}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)}js(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._s.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))&&void 0!==t?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)}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){var s,r,n;if(!this.__loaded||!this.persistence)return q.uninitializedWarning("posthog.identify");L(e)&&(e=e.toString(),q.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e?["distinct_id","distinctid"].includes(e.toLowerCase())?q.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'):e!==Oe?this.Ls("posthog.identify")&&(s=this.get_distinct_id(),this.register({$user_id:e}),this.get_property("$device_id")||(r=s,this.register_once({$had_persisted_distinct_id:!0,$device_id:r},"")),e!==s&&e!==this.get_property(Z)&&(this.unregister(Z),this.register({distinct_id:e})),n="anonymous"===(this.persistence.get_property(Ie)||"anonymous"),e!==s&&n?(this.persistence.set_property(Ie,"identified"),this.setPersonPropertiesForFlags(Gn({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Ss=Zo(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(xe))):q.critical('The string "'+Oe+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'):q.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ls("posthog.setPersonProperties")){var i=Zo(this.get_distinct_id(),e,t);this.Ss!==i?(this.setPersonPropertiesForFlags(Gn({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ss=i):q.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Ls("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Gn({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else q.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Ls("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,r,n,o;if(q.info("reset"),!this.__loaded)return q.uninitializedWarning("posthog.reset");n=this.get_property("$device_id"),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(Ie,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.Ss=null,this.config.__preview_experimental_cookieless_mode?this.register_once({distinct_id:Oe,$device_id:null},""):(o=this.config.get_device_id(rt()),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)&&void 0!==e?e:""}get_session_replay_url(e){var t,i;if(!this.sessionManager)return"";var{sessionId:s,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+s);if(null!=e&&e.withTimestamp&&r){if(i=null!==(t=e.timestampLookBack)&&void 0!==t?t:10,!r)return n;n+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-i,0)}return n}alias(e,t){return e===this.get_property("$people_distinct_id")?(q.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ls("posthog.alias")?(P(t)&&(t=this.get_distinct_id()),e!==t?(this.js(Z,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(q.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,i,s,r,n,o,a=Gn({},this.config);$(e)&&(G(this.config,xn(e)),o=this.xs(),null==(t=this.persistence)||t.update_config(this.config,a,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Mr(Gn({},this.config,{persistence:"sessionStorage"}),o),ut.O()&&"true"===ut.D("ph_debug")&&(this.config.debug=!0),this.config.debug&&(_.DEBUG=!0,q.info("set_config",{config:e,oldConfig:a,newConfig:Gn({},this.config)})),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(r=this.heatmaps)||r.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ns(),null==(n=this.externalIntegrations)||n.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=new Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(Gn({},function(e,t){var i,s,r,n,o,a,{error:l,event:c}=e,u={$exception_list:[]},h=l||c;return Co(h)||function(e){return Io(e,"DOMException")}(h)?(i=h,function(e){return"stack"in e}(h)?u=To(h,t):(s=i.name||(Co(i)?"DOMError":"DOMException"),u=Ao(r=i.message?s+": "+i.message:s,Gn({},t,{overrideExceptionType:Co(i)?"DOMError":"DOMException",defaultExceptionMessage:r}
1))),"code"in i&&(u.$exception_DOMException_code=""+i.code),u):function(e){return Io(e,"ErrorEvent")}(h)&&h.error?To(h.error,t):xo(h)?To(h,t):function(e){return Io(e,"Object")}(h)||So(h)?function(e,t){var i,s,r,n=null===(i=null==t?void 0:t.handled)||void 0===i||i,o=null===(s=null==t?void 0:t.synthetic)||void 0===s||s,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:So(e)?e.constructor.name:"Error",value:"Non-Error 'exception' captured with keys: "+function(e,t){var i,s,r;if(void 0===t&&(t=40),(i=Object.keys(e)).sort(),!i.length)return"[object has no keys]";for(s=i.length;s>0;s--)if(!((r=i.slice(0,s).join(", ")).length>t))return s===i.length||r.length<=t?r:r.slice(0,t)+"...";return""}(e),mechanism:{handled:n,synthetic:o}};return null!=t&&t.syntheticException&&(r=Po(null==t?void 0:t.syntheticException,1)).length&&(a.stacktrace={frames:r,type:"raw"}),{$exception_list:[a],$exception_level:Oo(e.level)?e.level:"error"}}(h,t):P(l)&&R(c)?(n="Error",o=c,(a=c.match(Nt))&&(n=a[1],o=a[2]),Ao(o,Gn({},t,{overri
1deExceptionType:n,defaultExceptionMessage:o}))):Ao(h,t)}((e=>e instanceof Error)(e)?{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)&&void 0!==e?e:En;return t!==En&&(t=En+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Ie))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Ie))}Ds(){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[Z])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Te]))}Fs(){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.Ds()||this.Ls("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ls(e){return"never"===this.config.person_profiles?(q.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.js(Te,!0),!0)}xs(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Ns(){var e,t,i,s,r=this.xs();return(null==(e=this.persistence)?void 0:e.Fe)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Fe)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Ns(),(P(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Cs()}opt_out_capturing(){this.consent.optInOut(!1),this.Ns()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Ns()}_is_bot(){return a?hn(a,this.config.custom_blocked_useragents):void 0}Cs(){l&&("visible"===l.visibilityState?this.bs||(this.bs=!0,this.capture("$pageview",{title:l.title},{send_instantly:!0}),this.ys&&(l.removeEventListener("visibilitychange",this.ys),this.ys=null)):this.ys||(this.ys=this.Cs.bind(this),Xn(l,"visibilitychange",this.ys)))}debug(e){!1===e?(i?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(i?.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}))}I(){var e,t,i,s,r,n,o=this.$s||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(q.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):(i="advanced_disable_decide",s=q,r=(t="advanced_disable_flags")in(e=o)&&!P(e[t]),n=i in e&&!P(e[i]),r?e[t]:!!n&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]))}As(e){var t,i,s;if(O(this.config.before_send))return e;for(i of(t=e,I(this.config.before_send)?this.config.before_send:[this.config.before_send])){if(t=i(t),O(t))return s="Event '"+e.event+"' was rejected in beforeSend function",N(e.event)?q.warn(s+". This can cause unexpected behavior."):q.info(s),null;t.properties&&!F(t.properties)||q.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return t}getPageViewId(){var e;
1return null==(e=this.pageViewManager.ce)?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)})}},function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=Y(e.prototype[t[i]])}(Cn,["identify"]),$n=bn[En]=new Cn,function(){function e(){e.done||(e.done=!0,Sn=!1,Yn(bn,function(e){e._dom_loaded()}))}null!=l&&l.addEventListener?"complete"===l.readyState?e():Xn(l,"DOMContentLoaded",e,{capture:!1}):i&&q.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Fn=$n,Pn=i=>{const[s,r]=e.useState(!1);return{isDragging:s,dragProps:{draggable:!0,onDragEnd:()=>{r(!1)},onDragStart:e=>{t.flushSync(()=>{r(!0)}),i.current&&(e.dataTransfer.dropEffect="link",e.dataTransfer?.setDragImage(i.current,0,0))}}}},Rn=function(e){return e.SIGN_UP_CLICKED="Sign Up Button Clicked",e.FEATURES_CTA_CLICKED="Feature Group CTA Clicked",e.PRICING_CYCLE_TOGGLED="Pricing Billing Cycle Toggled",e.PRICING_CONTACT_CLICKED="Pricing Contact Us Link Clicked",e.PRICING_PLAN_SELECTED="Pricing Plan Selected",e.DESKTOP_APP_DOWNLOADED="Desktop App Downloaded",e.FIGMA_PLUGIN_DEMO="Figma Plugin Demo Clicked",e.FIGMA_PLUGIN_INSTALL="Figma Plugin Install Clicked",e.ASKS_PLUS_TRIAL_CLICKED="Asks Plus Trial Clicked",e.ASKS_BOOK_DEMO_CLICKED="Asks Book Demo Clicked",e.QUALITY_VIDEO_PLAY="Quality Video Play Clicked",e.QUALITY_VIDEO_COMPLETED="Quality Video Watched Completely",e.QUALITY_VIDEO_HEARTBEAT="Quality Video Playing Heartbeat",e.AGENTS_WAITLIST="Agents Waitlist",e.REVIEWS_WAITLIST="Reviews Waitlist",e.MOBILE_DIFFS_WAITLIST="Mobile Diffs Waitlist",e.CONTACT_SALES="Contact Sales",e}({}),Tn=class e{static track(t,i){try{Fn.capture(t,i?e.normalizeProperties(i):{})}catch(r){}}static normalizeProperties(e){const t={};for(const[i,s]of Object.entries(e))t[la(i)]="boolean"==typeof s?s.toString():s;return t}},An=Nn(),On=e.forwardRef((e,i)=>(0,t.createPortal)((0,An.jsx)("div",{ref:i,"aria-hidden":!0,className:Un.visuallyOffscreen,children:e.children}),document.body)),Ln={root:"I_mUeq_root","variant-dimmed":"I_mUeq_variant-dimmed","variant-fade":"I_mUeq_variant-fade","variant-none":"I_mUeq_variant-none","variant-primary":"I_mUeq_variant-primary","variant-underline":"I_mUeq_variant-underline"},Mn=e.forwardRef((t,i)=>{const{tab:s,track:r,href:n,onClick:o,variant:a,className:l,active:c,dragImage:u,...h}=t,d=e.useRef(null),{isDragging:p,dragProps:g}=Pn(d);return(0,An.jsxs)(Hn,{ref:i,...h,className:Bn(l,Ln.root,a&&Ln[`variant-${a}`]),href:n,target:s?"_blank":void 0,rel:s?"noopener noreferrer":"noopener","aria-current":c?"page":void 0,onClick:e=>{o?.(e),r&&!e.defaultPrevented&&Tn.track(r.event,r.properties)},...u?g:{},children:[t.children,p&&u&&(0,An.jsx)(On,{ref:d,children:u})]})});export{Fn as a,Pn as i,Tn as n,Rn as r,Mn as t};
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.