PageSourceSearch

https://openknowledge.ai/vc-ap-c5a1c4/_next/static/immutable/chunks/0p-idxcwco3m5.js

js openknowledge.ai collected 2026-10-03 22:10:39 UTC 169,100 bytes, 1 lines download raw bytes

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

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.