PageSourceSearch

https://eidros.ai/_next/static/chunks/9da6db1e-8897270b127a5ed0.js

js eidros.ai collected 2026-10-02 01:10:58 UTC 186,557 bytes, 1 lines download raw bytes

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

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.