posthog-js 1.453.1 → 1.453.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/external-scripts-loader.js +1 -1
- package/dist/integrity.json +27 -27
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.cjs +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.cjs +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.no-external.cjs +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/surveys-preview.js +1 -1
- package/dist/surveys-preview.js.map +1 -1
- package/dist/surveys.js +1 -1
- package/dist/surveys.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +4 -4
package/dist/module.slim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var t,e=["retriesPerformedSoFar"];function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e,i,r,s,n,o){try{var a=t[n](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise(function(s,n){var o=t.apply(e,i);function a(t){r(o,s,n,a,h,"next",t)}function h(t){r(o,s,n,a,h,"throw",t)}a(void 0)})}}var n="u">typeof window?window:void 0,o="u">typeof globalThis?globalThis:n,a=null==o?void 0:o.navigator,h=null==o?void 0:o.document,l=null==o?void 0:o.location,u=null==o?void 0:o.fetch,d=null!=o&&o.XMLHttpRequest&&"withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:void 0,v=null==o?void 0:o.AbortController,c=null==o?void 0:o.CompressionStream,_=null==a?void 0:a.userAgent,p="undefined"!=typeof globalThis?globalThis:n;p&&"undefined"==typeof self&&(p.self=p),p&&"undefined"==typeof File&&(p.File=function(){});var f=null!=n?n:{},g="0.12.1",m={DEBUG:!1,LIB_VERSION:g,LIB_NAME:"browser-common",JS_SDK_VERSION:g},b=/*#__PURE__*/function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),y=["$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"],w=["token"];function S(t,e){return-1!==t.indexOf(e)}var x=function(t){return t.replace(/^\$/,"")},E=Object.prototype,T=E.hasOwnProperty,k=E.toString,I=Array.isArray||function(t){return"[object Array]"===k.call(t)},P=t=>"function"==typeof t,R=t=>t===Object(t)&&!I(t),O=t=>{if(R(t)){for(var e in t)if(T.call(t,e))return!1;return!0}return!1},C=t=>void 0===t,A=t=>"[object String]"==k.call(t),M=t=>A(t)&&0===t.trim().length,N=t=>null===t,D=t=>C(t)||N(t),F=t=>"[object Number]"==k.call(t)&&t==t,B=t=>F(t)&&t>0,U=t=>"[object Boolean]"===k.call(t),j=t=>S(y,t),L=t=>S(w,t);function z(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Error)}}var q=[!0,"true",1,"1","yes"],W=t=>S(q,t),H=[!1,"false",0,"0","no"],G=["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","pinterestbot","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","lightpanda","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"],V=/* @__PURE__ */new Map,J=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=function(t,e){for(var i="",r=0;e.length>r;r++){var s=e[r];i+=s.length+":"+s}return t.length+":"+t+"|"+e.length+":"+i}(t,e),r=V.get(i);if(void 0!==r)return r;var s=t.toLowerCase(),n=G.concat(e).some(t=>-1!==s.indexOf(t.toLowerCase()));return 256>V.size||V.clear(),V.set(i,n),n};function K(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),F(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),K(null!=s?s:i,e,i,r))}var Y="Mobile",X="Android",Q="Tablet",Z="Android Tablet",tt="iPad",et="Apple Watch",it="Safari",rt="BlackBerry",st="Samsung Internet",nt="Chrome",ot="Chrome iOS",at="Internet Explorer",ht="Internet Explorer Mobile",lt="Opera",ut="Microsoft Edge",dt="Firefox",vt="Firefox iOS",ct="Nintendo",_t="PlayStation",pt="Xbox",ft="Android Mobile",gt="Mobile Safari",mt="Windows",bt="Windows Phone",yt="Nokia",wt="Ouya",$t="Generic tablet",St="Konqueror",xt="Oculus Browser",Et="Vivaldi",Tt="Yandex",kt="Whale",It="DuckDuckGo",Pt="Pale Moon",Rt="Waterfox",Ot="Brave",Ct="Claude",At="Codex",Mt="ChatGPT",Nt="Google Search App",Dt=/* @__PURE__ */new RegExp("Version/(\\d+(\\.\\d+)?)"),Ft=/* @__PURE__ */new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Bt=/* @__PURE__ */new RegExp(pt,"i"),Ut=/* @__PURE__ */new RegExp("PlayStation \\w+","i"),jt=/* @__PURE__ */new RegExp("Nintendo \\w+","i"),Lt=/* @__PURE__ */new RegExp("BlackBerry|PlayBook|BB10","i"),zt={"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"},qt=function(t,e,i,r){e=e||"";var s=function(t){return null!=t&&t.brave?Ot:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&S(t,"GSA/")?Nt:S(t," OPR/")&&S(t,"Mini")?"Opera Mini":S(t," OPR/")?lt:Lt.test(t)?rt:S(t,"IEMobile")||S(t,"WPDesktop")?ht:S(t,"OculusBrowser")?xt:S(t,"SamsungBrowser")?st:S(t,"Edge")||S(t,"Edg/")?ut:S(t,"Vivaldi/")?Et:S(t,"YaBrowser/")?Tt:S(t,"Whale/")?kt:S(t,"DuckDuckGo/")||S(t,"Ddg/")?It:S(t,"Claude/")?Ct:S(t,"Codex/")?At:S(t,"ChatGPT/")?Mt:S(t,"FBIOS")?"Facebook Mobile":S(t,"UCWEB")||S(t,"UCBrowser")?"UC Browser":S(t,"CriOS")?ot:S(t,"CrMo")||S(t,nt)?nt:S(t,X)&&S(t,it)?ft:S(t,"FxiOS")?vt:S(t.toLowerCase(),St.toLowerCase())?St:S(t,"Brave/")?Ot:((t,e)=>e&&S(e,"Apple")||function(t){return S(t,it)&&!S(t,nt)&&!S(t,X)}(t))(t,e)?S(t,Y)?gt:it:S(t,"PaleMoon/")?Pt:S(t,"Waterfox/")?Rt:S(t,dt)?dt:S(t,"MSIE")||S(t,"Trident/")?at:S(t,"Gecko")?dt:"")},Wt={[ht]:[/* @__PURE__ */new RegExp("rv:(\\d+(\\.\\d+)?)")],[ut]:[/* @__PURE__ */new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[nt]:[/* @__PURE__ */new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ot]:[/* @__PURE__ */new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[/* @__PURE__ */new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[it]:[Dt],[gt]:[Dt],[lt]:[/* @__PURE__ */new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[dt]:[/* @__PURE__ */new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[vt]:[/* @__PURE__ */new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[St]:[/* @__PURE__ */new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[rt]:[/* @__PURE__ */new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Dt],[ft]:[/* @__PURE__ */new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[st]:[/* @__PURE__ */new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[xt]:[/* @__PURE__ */new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Et]:[/* @__PURE__ */new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Tt]:[/* @__PURE__ */new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[kt]:[/* @__PURE__ */new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Ot]:[/* @__PURE__ */new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Ct]:[Ft],[At]:[Ft],[Mt]:[Ft],[It]:[/* @__PURE__ */new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Pt]:[/* @__PURE__ */new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Rt]:[/* @__PURE__ */new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Nt]:[/* @__PURE__ */new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[at]:[/* @__PURE__ */new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[/* @__PURE__ */new RegExp("rv:(\\d+(\\.\\d+)?)")]},Ht=function(t,e,i,r){var s=Wt[qt(t,e,i,r)];if(C(s))return null;for(var n=0;s.length>n;n++){var o=t.match(s[n]);if(o)return parseFloat(o[o.length-2])}return null},Gt=[[/* @__PURE__ */new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[pt,t&&t[1]||""]],[/* @__PURE__ */new RegExp(ct,"i"),[ct,""]],[/* @__PURE__ */new RegExp(_t,"i"),[_t,""]],[Lt,[rt,""]],[/* @__PURE__ */new RegExp(mt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[bt,""];if(new RegExp(Y).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=zt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[mt,r]}return[mt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=C(t[2])?t[3]:t[2]),["watchOS",e]}],[/* @__PURE__ */new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[X,[t[2],t[3],t[4]||"0"].join(".")]:[X,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Vt=function(t){return jt.test(t)?ct:Ut.test(t)?_t:Bt.test(t)?pt:new RegExp(wt,"i").test(t)?wt:/* @__PURE__ */new RegExp("(Windows Phone|WPDesktop)","i").test(t)?bt:/iPad/.test(t)?tt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?et:Lt.test(t)?rt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(yt,"i").test(t)?yt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Y).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?X:Z:/* @__PURE__ */new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(Q,"i").test(t)&&!/* @__PURE__ */new RegExp("Tablet pc","i").test(t)?$t:""},Jt=/\bFBAV\/(\d+(?:\.\d+)*)/i,Kt=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Jt],[/\bFBAN\/EMA\b/i,"Facebook Lite",Jt],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Jt],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Yt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xt(t,e){return"string"==typeof(i=t)&&Yt.test(i)?t:e();var i}function Qt(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function Zt(t){return t?t.split("#")[0]:t}var te,ee=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],ie="NativeGzipValidationError",re=t=>t.length>=2&&31===t[0]&&139===t[1],se=(t,e)=>t===b.GZipJS||e===b.GZipJS||"gzip"===e,ne=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),oe=t=>{throw Qt(ie,"Native gzip produced invalid output: "+t)},ae=0,he=!1,le=/*#__PURE__*/function(){var t=s(function*(t,e){18>t.size&&oe("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());re(i)&&8===i[2]||oe("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer()),s=e.length>>>0;r.getUint32(4,!0)!==s&&oe("invalid-size"),(he||3>ae)&&(r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(te)return te;te=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;te[t]=e>>>0}return te})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&(he=!0,oe("invalid-crc")),ae++)});return function(e,i){return t.apply(this,arguments)}}();function ue(){return ue=s(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then(()=>o.close()).catch(/*#__PURE__*/function(){var t=s(function*(t){try{yield o.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),h=new Response(n.readable).blob(),l=(yield Promise.all([h,a]))[0];return yield le(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),ue.apply(this,arguments)}var de,ve=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={N(e){var r;try{r=typeof window>"u"?void 0:window}catch(t){return}for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;s>o;o++)n[o-1]=arguments[o];r&&(m.DEBUG||r.POSTHOG_DEBUG||i)&&!C(r.console)&&r.console&&("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>ve(t+" "+e,i)};return r},ce=/* @__PURE__ */ve("[PostHog.js]"),_e=(t,e)=>ce.createLogger(t,e),pe={"conversations.js":"sha384-Mz0mYEh/oXRxhqmWKRo8SkoCaH/Dd6F367KHBUJCe3apjb2BcdkKjnW1BR96Tx6Y","crisp-chat-integration.js":"sha384-qVSPPiM5PHJlVNpiLPyETnf0VXOGevtCqjm2K8EmWnKpLQnY/TMu+iLJ8wWLW8iA","dead-clicks-autocapture.js":"sha384-mhYAvGr01N2b2UN3UKXYpwoV5B0OHu/ghNIPiTEEefliWodVTZn9Z6a0GSigRjsG","exception-autocapture.js":"sha384-F/fSZE+cj7O//TRJ+JCQlJGTD5o2XBCDsPXuE1eA7HcBSkFklSQFzyOt2eKBo+iL","intercom-integration.js":"sha384-gWEoUxf+HEPSZ4GZthxep/3LlEectgXxzj8uWkW7dnvRRV6AKkHXtZEmcb0OqOvn","lazy-recorder.js":"sha384-oxymDFGPrnaY/7z+W1PbkQXspJXEHpwIVbDkSXtECjjILNL/LLrYN3KwWzl8gpyx","logs.js":"sha384-HGXa+FeVH5JwY3bwubM1EJrP+LG95rh6oU9TbtzHZLs1ECpl5mCXv5FcYF8SgNjk","product-tours.js":"sha384-2YKOQYIomTGU6qhSGJdQ1GZBAqWB3iPiuaqsVC+BvHdsfinWa0tzEdL2u4jURQid","recorder.js":"sha384-88LswkBOqtAt/RoXzLE7k7Mu58QaEmmnL+18tkw1RT7WaOZPxnbzUoMnHBC+TsPB","surveys.js":"sha384-moIeSCFtuakPpyV1YaTV7k5pbaWmzlWKG55sqdE9ors2fXn8iwasQ0DKOmg7Yvt4","tracing-headers.js":"sha384-kiUbaGGMgA6klTPefqr6nHeeTCejdA62XyCxqOySP2gLNe+wl/TDX0KflMiSMNJ2","web-vitals-soft-navs.js":"sha384-recN8i2tLQWaeNtCAnErAmFlgg4+33FAHvs8l84aE+SHr6oqLAPwhFVZdP4SfKT6","web-vitals-with-attribution-soft-navs.js":"sha384-f9L4YQQre9lKeUzyvy2Kt4dHLIXECipeMmbr7SPQAOqLi+ZCHbh1I1g/OwsK/zrp","web-vitals-with-attribution.js":"sha384-QVSLDmgzPE1K6g6gBB8QKx/YDQbI2ot0gAcajFIAkGf34SWA3oe6m+WzcmbzpVjD","web-vitals.js":"sha384-wNvgQ2MIesvfVwpUOblaIO/5weiMjR0Ld1eSNtW14MURV24BwfW8Svo6TsBJ3Bk9"},fe=/^sha384-[A-Za-z0-9+/]{64}$/,ge=t=>{var e;return null!=t&&t.config.require_subresource_integrity?t.__loadExternalDependency:null==(e=f.__PosthogExtensions__)?void 0:e.loadExternalDependency},me=_e("[ExternalScriptsLoader]"),be=t=>{var e=null==h?void 0:h.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},ye=(t,e,i)=>{i?me.critical(e):me.warn(e),t(e)},we=(t,e,i,r)=>{if(t.config.disable_external_dependency_loading)return me.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=()=>{if(null==h||h.removeEventListener("DOMContentLoaded",s),t.config.disable_external_dependency_loading)return i("Loading of external scripts is disabled");if(!h)return i("document not found");var o=h.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",r&&(o.integrity=r),o.src=e,o.onload=t=>{o.__posthog_loading_callback_fired=!0,i(void 0,t)},o.onerror=t=>{o.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(o=t.config.prepare_external_dependency_script(o)),!o)return i("prepare_external_dependency_script returned null");if(r&&(!o.src||o.integrity!==r||"anonymous"!==o.crossOrigin))return ye(i,"prepare_external_dependency_script must keep src, integrity and crossOrigin 'anonymous' for "+e,!0);if(t.config.disable_external_dependency_loading)return i("Loading of external scripts is disabled");var a=be(o.src);if(a){if(a.integrity!==o.integrity||a.crossOrigin!==o.crossOrigin||a.nonce!==o.nonce)return i("Existing script conflicts with prepared script policy");if(a.__posthog_loading_callback_fired)return i();var l=a.__posthog_loading_error;return l?i(l):(a.addEventListener("load",t=>{a.__posthog_loading_callback_fired=!0,i(void 0,t)}),void a.addEventListener("error",t=>{a.__posthog_loading_error=t,i(t)}))}if(!h.body)return n();if("head"===t.config.external_scripts_inject_target)h.head.appendChild(o);else{var u,d=h.querySelectorAll("body > script");d.length>0?null==(u=d[0].parentNode)||u.insertBefore(o,d[0]):h.body.appendChild(o)}},n=()=>{null==h||h.addEventListener("DOMContentLoaded",s)};null!=h&&h.body||be(e)?s():n()},$e={},Se=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};f.__PosthogExtensions__=f.__PosthogExtensions__||{};var xe=(t,e,i)=>{if(t.config.require_subresource_integrity){if("remote-config"===e||"toolbar"===e)return ye(i,e+" can't be integrity-verified, so it is not loaded with require_subresource_integrity");if(!h||!("integrity"in h.createElement("script")))return ye(i,"This browser does not support Subresource Integrity",!0);var r=e+".js",s=pe[r];return A(s)&&fe.test(s)?void we(t,t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+r),i,s):ye(i,"No integrity hash for "+r,!0)}if("remote-config"!==e){var n=t.config.strict_script_versioning;if(n){var o=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),a=$e[o];if("fallback"===n&&a){if(be(a))return void we(t,a,i);delete $e[o]}we(t,o,"fallback"===n?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var n,a=Se(t,e);$e[o]=a;var h=be(o);null==h||null==(n=h.parentNode)||n.removeChild(h),we(t,a,i)}else i(void 0,s)}:i)}else we(t,Se(t,e),i)}else we(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)};de=xe,f.__PosthogExtensions__.loadExternalDependency=xe,f.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{if(t.config.require_subresource_integrity)return ye(i,"Site apps can't be integrity-verified, so "+e+" is not loaded with require_subresource_integrity");we(t,t.requestRouter.endpointFor("api",e),i)},m.DEBUG=!1,m.LIB_VERSION="1.453.1",m.LIB_NAME="web";var Ee=m,Te="$early_access_features",ke="$active_feature_flags",Ie="$feature_flag_details",Pe="$feature_flag_errors",Re="$feature_flag_evaluated_at",Oe="$feature_flag_request_id",Ce="$minimal_flag_called_events",Ae="$enabled_feature_flags",Me="$stored_group_properties",Ne="$stored_person_properties",De="$flag_call_reported",Fe="$flag_call_reported_session_id",Be="$feature_flag_payloads",Ue="$override_feature_flags",je="$override_feature_flag_payloads",Le="visibilitychange",ze="$autocapture_disabled_server_side",qe="$surveys",We="$surveys_loaded_at",He="$surveys_activated",Ge="$surveys_activated_session",Ve="$surveys_activated_timestamps",Je="$people_distinct_id",Ke="distinct_id",Ye="$device_id",Xe="$device_model",Qe="__alias",Ze="__cmpns",ti="$fbc",ei="$fbc_persistence",ii="$fbp",ri="$fbp_persistence",si="__timers",ni="$heatmaps_enabled_server_side",oi="$exception_capture_enabled_server_side",ai="$error_tracking_suppression_rules",hi="$error_tracking_capture_extension_exceptions",li="$web_vitals_enabled_server_side",ui="$dead_clicks_enabled_server_side",di="$product_tours_enabled_server_side",vi="$logs_capture_enabled_server_side",ci="$web_vitals_allowed_metrics",_i="$session_recording_remote_config",pi="$session_recording_enabled_server_side",fi="$replay_sample_rate",gi="$replay_override_sampling",mi="$replay_override_linked_flag",bi="$replay_override_url_trigger",yi="$replay_override_event_trigger",wi="$sesid",$i="$session_is_sampled",Si="$session_past_minimum_duration",xi="$session_recording_url_trigger_activated_session",Ei="$session_recording_event_trigger_activated_session",Ti="$debug_first_full_snapshot_timestamp",ki="$sess_rec_flush_size",Ii="$groups",Pi="ph_product_tours",Ri="$product_tours_activated",Oi="$product_tours_activated_session",Ci="$conversations_widget_session_id",Ai="$conversations_ticket_id",Mi="$conversations_widget_state",Ni="$conversations_user_traits",Di="$user_state",Fi="$client_session_props",Bi="$capture_rate_limit",Ui="$initial_campaign_params",ji="$initial_referrer_info",Li="$initial_person_info",zi="$epp",qi="$posthog_cookieless",Wi="$cookieless_mode",Hi="$sdk_debug_extensions_init_method",Gi="$sdk_debug_extensions_init_time_ms",Vi="$sdk_debug_recording_script_not_loaded",Ji="$sdk_debug_replay_stale_config",Ki="$sdk_debug_replay_event_trigger_status",Yi="$sdk_debug_replay_linked_flag_trigger_status",Xi="$sdk_debug_replay_matched_recording_trigger_groups",Qi="$sdk_debug_replay_pending_trigger_conditions",Zi="$sdk_debug_replay_remote_trigger_matching_config",tr="$sdk_debug_replay_trigger_groups_count",er="$sdk_debug_replay_url_trigger_status",ir="$session_recording_start_reason",rr="anonymous",sr="identified",nr="identified_only",or="beforeunload",ar="$pageview",hr="$pageleave",lr="$identify",ur="$groupidentify";function dr(t,e){I(t)&&t.forEach(e)}function vr(t,e){if(!D(t))if(I(t))t.forEach(e);else if((t=>t instanceof FormData)(t))t.forEach((t,i)=>e(t,i));else for(var i in t)T.call(t,i)&&e(t[i],i)}var cr=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(t[n]=s[n]);return t},_r=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ce.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ce.critical(t)}}},pr=function(t){var e={};return vr(t,function(t,i){(A(t)&&t.length>0||F(t))&&(e[i]=t)}),e};function fr(t){var e=i({},t);for(var r of["name","message","stack","cause","errors"])try{r in t&&(e[r]=t[r])}catch(t){}return e}var gr=["herokuapp.com","vercel.app","netlify.app"];function mr(t){var e=null==t?void 0:t.hostname;if(!A(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of gr)if(i===r)return!1;return!0}function br(t,e,i,r){var s=null!=r?r:{},n=s.capture,o=s.passive;null==t||t.addEventListener(e,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var yr,wr,$r=t=>{if(h){try{for(var e=t+"=",i=h.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},Sr=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,s){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>i||0>r||0>s||e>0xffffffffffff||i>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=/* @__PURE__ */new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|i>>>8,n[7]=i,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new t(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}},xr=class{generate(){var t=this.generateOrAbort();if(!C(t))return t;this.Mt=0;var e=this.generateOrAbort();if(C(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=(()=>{var t=Date.now();return F(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Mt)this.Mt=t,this.Tt();else{if(this.Mt>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Mt++,this.Tt())}return Sr.fromFieldsV7(this.Mt,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.At.nextUint32())}Tt(){this.It=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Mt=0,this.It=0,this.At=new Tr}},Er=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t},Tr=class{nextUint32(){return this.Rt.length>this.Et||((null!=yr?yr:yr="u">typeof window&&!C(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch(e){return Er(t)}}:Er)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=/* @__PURE__ */new Uint32Array(8),this.Et=1/0}},kr=()=>Ir().toString(),Ir=()=>(wr||(wr=new xr)).generate(),Pr="",Rr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Or=null,Cr={Ot(){if(!N(Or))return Or;if(Or=!1,h)try{var t="__ph_cookie_support_"+kr();Cr.$t(t,"xyz"),Or='"xyz"'===$r(t),Cr.Ft(t)}catch(t){Or=!1}return Or},Dt(t){ce.error("cookieStore error: "+t)},Lt:$r,Pt(t){var e;try{e=JSON.parse(Cr.Lt(t))||{}}catch(t){}return e},$t(t,e,i,r,s){if(!h)return!1;try{var n="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=h),Pr)return Pr;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),s="dmn_chk_"+kr();!Pr&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",Pr=n)}return Pr}(t);if(!i){var r=(t=>{var e=t.match(Rr);return e?e[0]:""})(t);r!==i&&ce.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,r);if(i){var l=/* @__PURE__ */new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ce.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(t){return!1}},Ft(t,e){if(null!=h&&h.cookie&&(!e||!N($r(t))))try{Cr.$t(t,"",-1,e)}catch(t){return}}},Ar=null,Mr={Ot(){if(!N(Ar))return Ar;var t=!0;if(C(n))t=!1;else try{var e="__mplssupport__";Mr.$t(e,"xyz"),'"xyz"'!==Mr.Lt(e)&&(t=!1),Mr.Ft(e)}catch(e){t=!1}return t||ce.error("localStorage unsupported; falling back to cookie store"),Ar=t,t},Dt(t){ce.error("localStorage error: "+t)},Lt(t){try{return null==n?void 0:n.localStorage.getItem(t)}catch(t){Mr.Dt(t)}return null},Pt(t){try{return JSON.parse(Mr.Lt(t))||{}}catch(t){}return null},$t(t,e){try{return null==n||n.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Mr.Dt(t)}return!1},Ft(t){try{null==n||n.localStorage.removeItem(t)}catch(t){Mr.Dt(t)}}},Nr=[Ne,ke,Ae,Ie,Be,Oe,Re,Pe,De],Dr=[Ye,Ke,wi,$i,zi,Li,ei,Di],Fr=t=>t+"_cpm",Br=["__proto__","constructor","prototype"],Ur=t=>{if(!R(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Br.indexOf(i)&&(e[i]=t[i])}),e},jr=function(t,e){void 0===e&&(e=[]);var i={};return[...Dr,...e].forEach(e=>{var r=t[e];C(r)||N(r)||""===r||(i[e]=r)}),i},Lr=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,i=Math.imul(i^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},zr=(t,e)=>({p:e,f:Lr(JSON.stringify(t))}),qr=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=Cr.Pt(Fr(t)),r=(null==i?void 0:i.f)===Lr(e)&&I(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Wr=(t,e)=>e+"|"+(Cr.Lt(Fr(t))||""),Hr={},Gr={Ot:()=>!0,Dt(t){ce.error("memoryStorage error: "+t)},Lt:t=>t in Hr?Hr[t]:null,Pt:t=>t in Hr?Hr[t]:null,$t:(t,e)=>(Hr[t]=e,!0),Ft(t){delete Hr[t]}},Vr=null,Jr={Ot(){if(!N(Vr))return Vr;if(Vr=!0,C(n))Vr=!1;else try{var t="__support__";Jr.$t(t,"xyz"),'"xyz"'!==Jr.Lt(t)&&(Vr=!1),Jr.Ft(t)}catch(t){Vr=!1}return Vr},Dt(t){ce.error("sessionStorage error: ",t)},Lt(t){try{return null==n?void 0:n.sessionStorage.getItem(t)}catch(t){Jr.Dt(t)}return null},Pt(t){try{return JSON.parse(Jr.Lt(t))||null}catch(t){}return null},$t(t,e){try{return null==n||n.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Jr.Dt(t)}return!1},Ft(t){try{null==n||n.sessionStorage.removeItem(t)}catch(t){Jr.Dt(t)}}},Kr=class{constructor(t){this._instance=t}get Br(){return this._instance.config}get consent(){return this.Ua()?0:this.Wa}isOptedOut(){return"always"===this.Br.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Br.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Br.opt_out_capturing_by_default}optInOut(t){this.Va.$t(this.Ga,t?1:0,this.Br.cookie_expiration,this.Br.cross_subdomain_cookie,this.Br.secure_cookie)}reset(){this.Va.Ft(this.Ga,this.Br.cross_subdomain_cookie)}get Ga(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get Wa(){var t=this.Va.Lt(this.Ga);return W(t)?1:S(H,t)?0:-1}get Va(){var t=this.Br.opt_out_capturing_persistence_type,e="localStorage"===t?Mr:Cr,i=e.Ot()?e:Gr;if(!this.Qa||this.Qa!==i){this.Qa=i;var r="localStorage"===t?Cr:Mr;r.Lt(this.Ga)&&(this.Qa.Lt(this.Ga)||this.optInOut(W(r.Lt(this.Ga))),r.Ft(this.Ga,this.Br.cross_subdomain_cookie))}return this.Qa}Ua(){return!!this.Br.respect_dnt&&[null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,f.doNotTrack,null==a?void 0:a.globalPrivacyControl].some(t=>W(t))}},Yr=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],Xr=/* @__PURE__ */(()=>[...Yr,"+","-","−","–"])(),Qr=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(ui)),r=t.instance.config.capture_dead_clicks;return U(r)?r:!!R(r)||i},Zr=_e("[SegmentIntegration]");function ts(t,e,r){void 0===r&&(r=!0);var s=t.config.segment;if(!s)return e();var n,o=(t=>P(t.register))(n=s)?{analytics:n}:n,a=o.analytics,h=o.filterProperties;!function(t,e,i,r){var s=e=>{var s=()=>e.anonymousId()||kr();t.config.get_device_id=s,r&&e.id()&&(t.register({distinct_id:e.id(),$device_id:s()}),t.persistence.set_property(Di,sr)),i(r?void 0:e.anonymousId()||void 0)},n=e.user();"then"in n&&P(n.then)?n.then(s):s(n)}(t,a,r=>{a.register(function(t,e,r){var s=(void 0===r?{}:r).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Zr.warn("This browser does not have Promise support, and can not use the segment integration");var n=(r,n)=>{if(!n)return r;var o=!!e&&r.event.anonymousId===e&&!r.event.userId;o||r.event.userId||r.event.anonymousId===t.get_distinct_id()||(Zr.info("No userId set, resetting PostHog"),t.reset()),o||(e=void 0),r.event.userId&&r.event.userId!==t.get_distinct_id()&&(Zr.info("UserId set, identifying with PostHog"),t.identify(r.event.userId));var a=t.calculateEventProperties(n,r.event.properties);if(!D(s)){var h=r.event.properties||{},l={};for(var u of Object.keys(a))T.call(h,u)||(l[u]=a[u]);var d=((t,e)=>{var r=I(t)?t:[t],s=i({},e);for(var n of r)try{if(s=n(s),D(s))return null}catch(t){return Zr.error("Error in Segment filterProperties:",t),null}return s})(s,l);if(D(d))return r;a=d}return r.event.properties=Object.assign({},a,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return n(t,t.event.event)},page(t){return n(t,ar)},identify(t){return n(t,lr)},screen(t){return n(t,"$screen")}}}(t,r,{filterProperties:h})).then(()=>{e()},t=>{Zr.error("Failed to register the Segment integration",t),e()})},r)}var es="posthog-js";function is(t,e){var r=void 0===e?{}:e,s=r.organization,n=r.projectId,o=r.prefix,a=r.severityAllowList,h=void 0===a?["error"]:a,l=r.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var r,a,l,d,v,c;if("*"!==h&&!h.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var _=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=_,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(r=e.exception)?void 0:r.values)||[],f=p.map(t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>i({},t,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(l=p[0])?void 0:l.type,$exception_level:e.level,$exception_list:f,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return s&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+s+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}var rs=class{constructor(t,e,i,r,s,n){this.name=es,this.setupOnce=function(o){o(is(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}},ss=class{constructor(t){this.Ya=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ce.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Xa=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.tu()}tu(){var t;this.eu=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Ya)}destroy(){var t;null==(t=this.eu)||t.call(this),this.eu=void 0}doPageView(t,e){var i,r=this.iu(t,e);return this.Xa={pathname:null!==(i=null==n?void 0:n.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.iu(t,null==(e=this.Xa)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Xa)?void 0:t.pageViewId}}iu(t,e){var i=this.Xa;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,o=s.lastScrollY,a=s.maxScrollY,h=s.maxContentHeight,l=s.lastContentY,u=s.maxContentY;if(!(C(n)||C(o)||C(a)||C(h)||C(l)||C(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),h=Math.ceil(h),l=Math.ceil(l),u=Math.ceil(u);var d=n>1?K(o/n,0,1,ce):1,v=n>1?K(a/n,0,1,ce):1,c=h>1?K(l/h,0,1,ce):1,_=h>1?K(u/h,0,1,ce):1;r=cr(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}},ns=["flags","surveys"],os={[Je]:{exposure:"hidden"},[Qe]:{exposure:"hidden"},[Ze]:{exposure:"hidden"},[si]:{exposure:"hidden"},[ei]:{exposure:"hidden"},[ri]:{exposure:"hidden"},[ze]:{exposure:"event"},[ni]:{exposure:"hidden"},[vi]:{exposure:"hidden"},[oi]:{exposure:"event"},[ai]:{exposure:"hidden"},[hi]:{exposure:"event"},[li]:{exposure:"event"},[ui]:{exposure:"event"},[di]:{exposure:"hidden"},[ci]:{exposure:"event"},[_i]:{exposure:"hidden"},[pi]:{exposure:"hidden"},[wi]:{exposure:"hidden"},[$i]:{exposure:"event"},[fi]:{exposure:"event",shouldSkipFromEventProperties:t=>N(t)},[Si]:{exposure:"event"},[xi]:{exposure:"event"},[Ei]:{exposure:"event"},[Ti]:{exposure:"event"},[ki]:{exposure:"hidden"},[Ae]:{exposure:"hidden",storageGroup:"flags"},[ke]:{exposure:"hidden",storageGroup:"flags"},[Te]:{exposure:"hidden"},[Ie]:{exposure:"hidden",storageGroup:"flags"},[Be]:{exposure:"hidden",storageGroup:"flags"},[Oe]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ce]:{exposure:"hidden",storageGroup:"flags"},[Ue]:{exposure:"hidden"},[je]:{exposure:"hidden"},[Ne]:{exposure:"hidden"},[Me]:{exposure:"hidden"},[qe]:{exposure:"hidden",storageGroup:"surveys"},[We]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[He]:{exposure:"event"},[Ge]:{exposure:"hidden"},[Ve]:{exposure:"hidden"},[Pi]:{exposure:"hidden"},[Ri]:{exposure:"hidden"},[Oi]:{exposure:"hidden"},[Ci]:{exposure:"event"},[Ai]:{exposure:"event"},[Mi]:{exposure:"event"},[Ni]:{exposure:"event"},[De]:{exposure:"hidden"},[Fe]:{exposure:"hidden"},[Ii]:{exposure:"event"},[Pe]:{exposure:"hidden"},[Re]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Di]:{exposure:"hidden"},[Fi]:{exposure:"hidden"},[Bi]:{exposure:"hidden"},[Ui]:{exposure:"hidden"},[ji]:{exposure:"hidden"},[Li]:{exposure:"hidden"},[zi]:{exposure:"hidden"},[gi]:{exposure:"event"},[mi]:{exposure:"event"},[bi]:{exposure:"event"},[yi]:{exposure:"event"},[Hi]:{exposure:"event"},[Gi]:{exposure:"event"},[Vi]:{exposure:"hidden"},[Ji]:{exposure:"hidden"},[Ki]:{exposure:"hidden"},[Yi]:{exposure:"hidden"},[Xi]:{exposure:"hidden"},[Qi]:{exposure:"hidden"},[Zi]:{exposure:"hidden"},[tr]:{exposure:"hidden"},[er]:{exposure:"hidden"},[ir]:{exposure:"event"}},as=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],hs=t=>{var e=os[t];if(e)return e;for(var i of as){var r=i[1];if(0===t.indexOf(i[0]))return r}};function ls(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}var us=t=>{var e,i=null==(e=typeof document>"u"?void 0:document)?void 0:e.createElement("a");return C(i)?null:(i.href=t,i)},ds=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>z(e)?(null!=i||(i=/* @__PURE__ */new WeakMap),i.has(e)||i.set(e,fr(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return s=[],null!==(r=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(e))return"[Circular]";s.push(e)}return e}}))&&void 0!==r?r:"null"}var r,s},vs=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split(/=(.*)/);if(n[0]===e){i=n;break}}if(!I(i)||2>i.length)return"";var o=i[1].replace(/\+/g," ");try{o=decodeURIComponent(o)}catch(t){ce.error("Skipping decoding for malformed query param: "+o)}return o},cs=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split(/#(.*)/),s=r[1],n=(r[0]||"").split(/\?(.*)/),o=n[1],a=n[0],h=(o||"").split("&"),l=[],u=0;h.length>u;u++){for(var d=h[u].split("?"),v=0;d.length>v&&!e.includes(d[v].split("=")[0]);)v++;l.push(d.length>v?d.slice(0,v).concat(d[v].split("=")[0]+"="+i).join("?"):h[u])}var c=a;return null!=o&&(c+="?"+l.join("&")),null!=s&&(c+="#"+s),c},_s=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],ps=/* @__PURE__ */(()=>["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",..._s])(),fs="<masked>",gs=["li_fat_id"];function ms(t,e){var i=ps.concat(e||[]),r={};return vr(i,function(e){var i=vs(t,e);r[e]=i||null}),r}function bs(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!N(e)){r.$search_engine=e;var s=h?vs(h.referrer,i):"";s.length&&(r.ph_keyword=s)}return r}function ys(){return navigator.language||navigator.userLanguage}var ws="$direct";function $s(){return(null==h?void 0:h.referrer)||ws}function Ss(t,e,i){var r;void 0===i&&(i=!1);var s=t?[..._s,...e||[]]:[],n=null==(r=i?Zt(null==l?void 0:l.href):null==l?void 0:l.href)?void 0:r.substring(0,1e3);return{r:$s().substring(0,1e3),u:n?cs(n,s,fs):void 0}}function xs(t,e){var i;void 0===e&&(e=!1);var r=t.r,s=t.u,n=e?Zt(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==ws?ws:null==(i=us(r))?void 0:i.host};if(n){o.$current_url=n;var a=us(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,cr(o,ms(n))}return r&&cr(o,bs(r)),o}function Es(){try{/* @__PURE__ */
|
|
1
|
+
var t,e=["retriesPerformedSoFar"];function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e,i,r,s,n,o){try{var a=t[n](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise(function(s,n){var o=t.apply(e,i);function a(t){r(o,s,n,a,h,"next",t)}function h(t){r(o,s,n,a,h,"throw",t)}a(void 0)})}}var n="u">typeof window?window:void 0,o="u">typeof globalThis?globalThis:n,a=null==o?void 0:o.navigator,h=null==o?void 0:o.document,l=null==o?void 0:o.location,u=null==o?void 0:o.fetch,d=null!=o&&o.XMLHttpRequest&&"withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:void 0,v=null==o?void 0:o.AbortController,c=null==o?void 0:o.CompressionStream,_=null==a?void 0:a.userAgent,p="undefined"!=typeof globalThis?globalThis:n;p&&"undefined"==typeof self&&(p.self=p),p&&"undefined"==typeof File&&(p.File=function(){});var f=null!=n?n:{},g="0.12.2",m={DEBUG:!1,LIB_VERSION:g,LIB_NAME:"browser-common",JS_SDK_VERSION:g},b=/*#__PURE__*/function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),y=["$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"],w=["token"];function S(t,e){return-1!==t.indexOf(e)}var x=function(t){return t.replace(/^\$/,"")},E=Object.prototype,T=E.hasOwnProperty,k=E.toString,I=Array.isArray||function(t){return"[object Array]"===k.call(t)},P=t=>"function"==typeof t,R=t=>t===Object(t)&&!I(t),O=t=>{if(R(t)){for(var e in t)if(T.call(t,e))return!1;return!0}return!1},C=t=>void 0===t,A=t=>"[object String]"==k.call(t),M=t=>A(t)&&0===t.trim().length,N=t=>null===t,D=t=>C(t)||N(t),F=t=>"[object Number]"==k.call(t)&&t==t,B=t=>F(t)&&t>0,U=t=>"[object Boolean]"===k.call(t),j=t=>S(y,t),L=t=>S(w,t);function z(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Error)}}var q=[!0,"true",1,"1","yes"],W=t=>S(q,t),H=[!1,"false",0,"0","no"],G=["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","pinterestbot","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","lightpanda","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"],V=/* @__PURE__ */new Map,J=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=function(t,e){for(var i="",r=0;e.length>r;r++){var s=e[r];i+=s.length+":"+s}return t.length+":"+t+"|"+e.length+":"+i}(t,e),r=V.get(i);if(void 0!==r)return r;var s=t.toLowerCase(),n=G.concat(e).some(t=>-1!==s.indexOf(t.toLowerCase()));return 256>V.size||V.clear(),V.set(i,n),n};function K(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),F(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),K(null!=s?s:i,e,i,r))}var Y="Mobile",X="Android",Q="Tablet",Z="Android Tablet",tt="iPad",et="Apple Watch",it="Safari",rt="BlackBerry",st="Samsung Internet",nt="Chrome",ot="Chrome iOS",at="Internet Explorer",ht="Internet Explorer Mobile",lt="Opera",ut="Microsoft Edge",dt="Firefox",vt="Firefox iOS",ct="Nintendo",_t="PlayStation",pt="Xbox",ft="Android Mobile",gt="Mobile Safari",mt="Windows",bt="Windows Phone",yt="Nokia",wt="Ouya",$t="Generic tablet",St="Konqueror",xt="Oculus Browser",Et="Vivaldi",Tt="Yandex",kt="Whale",It="DuckDuckGo",Pt="Pale Moon",Rt="Waterfox",Ot="Brave",Ct="Claude",At="Codex",Mt="ChatGPT",Nt="Google Search App",Dt=/* @__PURE__ */new RegExp("Version/(\\d+(\\.\\d+)?)"),Ft=/* @__PURE__ */new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Bt=/* @__PURE__ */new RegExp(pt,"i"),Ut=/* @__PURE__ */new RegExp("PlayStation \\w+","i"),jt=/* @__PURE__ */new RegExp("Nintendo \\w+","i"),Lt=/* @__PURE__ */new RegExp("BlackBerry|PlayBook|BB10","i"),zt={"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"},qt=function(t,e,i,r){e=e||"";var s=function(t){return null!=t&&t.brave?Ot:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&S(t,"GSA/")?Nt:S(t," OPR/")&&S(t,"Mini")?"Opera Mini":S(t," OPR/")?lt:Lt.test(t)?rt:S(t,"IEMobile")||S(t,"WPDesktop")?ht:S(t,"OculusBrowser")?xt:S(t,"SamsungBrowser")?st:S(t,"Edge")||S(t,"Edg/")?ut:S(t,"Vivaldi/")?Et:S(t,"YaBrowser/")?Tt:S(t,"Whale/")?kt:S(t,"DuckDuckGo/")||S(t,"Ddg/")?It:S(t,"Claude/")?Ct:S(t,"Codex/")?At:S(t,"ChatGPT/")?Mt:S(t,"FBIOS")?"Facebook Mobile":S(t,"UCWEB")||S(t,"UCBrowser")?"UC Browser":S(t,"CriOS")?ot:S(t,"CrMo")||S(t,nt)?nt:S(t,X)&&S(t,it)?ft:S(t,"FxiOS")?vt:S(t.toLowerCase(),St.toLowerCase())?St:S(t,"Brave/")?Ot:((t,e)=>e&&S(e,"Apple")||function(t){return S(t,it)&&!S(t,nt)&&!S(t,X)}(t))(t,e)?S(t,Y)?gt:it:S(t,"PaleMoon/")?Pt:S(t,"Waterfox/")?Rt:S(t,dt)?dt:S(t,"MSIE")||S(t,"Trident/")?at:S(t,"Gecko")?dt:"")},Wt={[ht]:[/* @__PURE__ */new RegExp("rv:(\\d+(\\.\\d+)?)")],[ut]:[/* @__PURE__ */new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[nt]:[/* @__PURE__ */new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ot]:[/* @__PURE__ */new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[/* @__PURE__ */new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[it]:[Dt],[gt]:[Dt],[lt]:[/* @__PURE__ */new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[dt]:[/* @__PURE__ */new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[vt]:[/* @__PURE__ */new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[St]:[/* @__PURE__ */new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[rt]:[/* @__PURE__ */new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Dt],[ft]:[/* @__PURE__ */new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[st]:[/* @__PURE__ */new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[xt]:[/* @__PURE__ */new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Et]:[/* @__PURE__ */new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Tt]:[/* @__PURE__ */new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[kt]:[/* @__PURE__ */new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Ot]:[/* @__PURE__ */new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Ct]:[Ft],[At]:[Ft],[Mt]:[Ft],[It]:[/* @__PURE__ */new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Pt]:[/* @__PURE__ */new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Rt]:[/* @__PURE__ */new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Nt]:[/* @__PURE__ */new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[at]:[/* @__PURE__ */new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[/* @__PURE__ */new RegExp("rv:(\\d+(\\.\\d+)?)")]},Ht=function(t,e,i,r){var s=Wt[qt(t,e,i,r)];if(C(s))return null;for(var n=0;s.length>n;n++){var o=t.match(s[n]);if(o)return parseFloat(o[o.length-2])}return null},Gt=[[/* @__PURE__ */new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[pt,t&&t[1]||""]],[/* @__PURE__ */new RegExp(ct,"i"),[ct,""]],[/* @__PURE__ */new RegExp(_t,"i"),[_t,""]],[Lt,[rt,""]],[/* @__PURE__ */new RegExp(mt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[bt,""];if(new RegExp(Y).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=zt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[mt,r]}return[mt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=C(t[2])?t[3]:t[2]),["watchOS",e]}],[/* @__PURE__ */new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[X,[t[2],t[3],t[4]||"0"].join(".")]:[X,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Vt=function(t){return jt.test(t)?ct:Ut.test(t)?_t:Bt.test(t)?pt:new RegExp(wt,"i").test(t)?wt:/* @__PURE__ */new RegExp("(Windows Phone|WPDesktop)","i").test(t)?bt:/iPad/.test(t)?tt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?et:Lt.test(t)?rt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(yt,"i").test(t)?yt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Y).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?X:Z:/* @__PURE__ */new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(Q,"i").test(t)&&!/* @__PURE__ */new RegExp("Tablet pc","i").test(t)?$t:""},Jt=/\bFBAV\/(\d+(?:\.\d+)*)/i,Kt=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Jt],[/\bFBAN\/EMA\b/i,"Facebook Lite",Jt],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Jt],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Yt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xt(t,e){return"string"==typeof(i=t)&&Yt.test(i)?t:e();var i}function Qt(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function Zt(t){return t?t.split("#")[0]:t}var te,ee=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],ie="NativeGzipValidationError",re=t=>t.length>=2&&31===t[0]&&139===t[1],se=(t,e)=>t===b.GZipJS||e===b.GZipJS||"gzip"===e,ne=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),oe=t=>{throw Qt(ie,"Native gzip produced invalid output: "+t)},ae=0,he=!1,le=/*#__PURE__*/function(){var t=s(function*(t,e){18>t.size&&oe("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());re(i)&&8===i[2]||oe("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer()),s=e.length>>>0;r.getUint32(4,!0)!==s&&oe("invalid-size"),(he||3>ae)&&(r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(te)return te;te=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;te[t]=e>>>0}return te})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&(he=!0,oe("invalid-crc")),ae++)});return function(e,i){return t.apply(this,arguments)}}();function ue(){return ue=s(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then(()=>o.close()).catch(/*#__PURE__*/function(){var t=s(function*(t){try{yield o.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),h=new Response(n.readable).blob(),l=(yield Promise.all([h,a]))[0];return yield le(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),ue.apply(this,arguments)}var de,ve=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={N(e){var r;try{r=typeof window>"u"?void 0:window}catch(t){return}for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;s>o;o++)n[o-1]=arguments[o];r&&(m.DEBUG||r.POSTHOG_DEBUG||i)&&!C(r.console)&&r.console&&("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>ve(t+" "+e,i)};return r},ce=/* @__PURE__ */ve("[PostHog.js]"),_e=(t,e)=>ce.createLogger(t,e),pe={"conversations.js":"sha384-Mz0mYEh/oXRxhqmWKRo8SkoCaH/Dd6F367KHBUJCe3apjb2BcdkKjnW1BR96Tx6Y","crisp-chat-integration.js":"sha384-qVSPPiM5PHJlVNpiLPyETnf0VXOGevtCqjm2K8EmWnKpLQnY/TMu+iLJ8wWLW8iA","dead-clicks-autocapture.js":"sha384-mhYAvGr01N2b2UN3UKXYpwoV5B0OHu/ghNIPiTEEefliWodVTZn9Z6a0GSigRjsG","exception-autocapture.js":"sha384-F/fSZE+cj7O//TRJ+JCQlJGTD5o2XBCDsPXuE1eA7HcBSkFklSQFzyOt2eKBo+iL","intercom-integration.js":"sha384-gWEoUxf+HEPSZ4GZthxep/3LlEectgXxzj8uWkW7dnvRRV6AKkHXtZEmcb0OqOvn","lazy-recorder.js":"sha384-E9actjCOuNrSEF4o4/9PaEhfEuuAyBAXUZRNfUWKKgZWhopS6NfvS3NbHgdGTunm","logs.js":"sha384-HGXa+FeVH5JwY3bwubM1EJrP+LG95rh6oU9TbtzHZLs1ECpl5mCXv5FcYF8SgNjk","product-tours.js":"sha384-2YKOQYIomTGU6qhSGJdQ1GZBAqWB3iPiuaqsVC+BvHdsfinWa0tzEdL2u4jURQid","recorder.js":"sha384-88LswkBOqtAt/RoXzLE7k7Mu58QaEmmnL+18tkw1RT7WaOZPxnbzUoMnHBC+TsPB","surveys.js":"sha384-0umwTuK8V5T6mxHb2nFh9n+HimihDbD0yYMLdP1J49ZKTt4HcQKkxUBeiUKYAKMO","tracing-headers.js":"sha384-kiUbaGGMgA6klTPefqr6nHeeTCejdA62XyCxqOySP2gLNe+wl/TDX0KflMiSMNJ2","web-vitals-soft-navs.js":"sha384-recN8i2tLQWaeNtCAnErAmFlgg4+33FAHvs8l84aE+SHr6oqLAPwhFVZdP4SfKT6","web-vitals-with-attribution-soft-navs.js":"sha384-f9L4YQQre9lKeUzyvy2Kt4dHLIXECipeMmbr7SPQAOqLi+ZCHbh1I1g/OwsK/zrp","web-vitals-with-attribution.js":"sha384-QVSLDmgzPE1K6g6gBB8QKx/YDQbI2ot0gAcajFIAkGf34SWA3oe6m+WzcmbzpVjD","web-vitals.js":"sha384-wNvgQ2MIesvfVwpUOblaIO/5weiMjR0Ld1eSNtW14MURV24BwfW8Svo6TsBJ3Bk9"},fe=/^sha384-[A-Za-z0-9+/]{64}$/,ge=t=>{var e;return null!=t&&t.config.require_subresource_integrity?t.__loadExternalDependency:null==(e=f.__PosthogExtensions__)?void 0:e.loadExternalDependency},me=_e("[ExternalScriptsLoader]"),be=t=>{var e=null==h?void 0:h.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},ye=(t,e,i)=>{i?me.critical(e):me.warn(e),t(e)},we=(t,e,i,r)=>{if(t.config.disable_external_dependency_loading)return me.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=()=>{if(null==h||h.removeEventListener("DOMContentLoaded",s),t.config.disable_external_dependency_loading)return i("Loading of external scripts is disabled");if(!h)return i("document not found");var o=h.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",r&&(o.integrity=r),o.src=e,o.onload=t=>{o.__posthog_loading_callback_fired=!0,i(void 0,t)},o.onerror=t=>{o.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(o=t.config.prepare_external_dependency_script(o)),!o)return i("prepare_external_dependency_script returned null");if(r&&(!o.src||o.integrity!==r||"anonymous"!==o.crossOrigin))return ye(i,"prepare_external_dependency_script must keep src, integrity and crossOrigin 'anonymous' for "+e,!0);if(t.config.disable_external_dependency_loading)return i("Loading of external scripts is disabled");var a=be(o.src);if(a){if(a.integrity!==o.integrity||a.crossOrigin!==o.crossOrigin||a.nonce!==o.nonce)return i("Existing script conflicts with prepared script policy");if(a.__posthog_loading_callback_fired)return i();var l=a.__posthog_loading_error;return l?i(l):(a.addEventListener("load",t=>{a.__posthog_loading_callback_fired=!0,i(void 0,t)}),void a.addEventListener("error",t=>{a.__posthog_loading_error=t,i(t)}))}if(!h.body)return n();if("head"===t.config.external_scripts_inject_target)h.head.appendChild(o);else{var u,d=h.querySelectorAll("body > script");d.length>0?null==(u=d[0].parentNode)||u.insertBefore(o,d[0]):h.body.appendChild(o)}},n=()=>{null==h||h.addEventListener("DOMContentLoaded",s)};null!=h&&h.body||be(e)?s():n()},$e={},Se=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};f.__PosthogExtensions__=f.__PosthogExtensions__||{};var xe=(t,e,i)=>{if(t.config.require_subresource_integrity){if("remote-config"===e||"toolbar"===e)return ye(i,e+" can't be integrity-verified, so it is not loaded with require_subresource_integrity");if(!h||!("integrity"in h.createElement("script")))return ye(i,"This browser does not support Subresource Integrity",!0);var r=e+".js",s=pe[r];return A(s)&&fe.test(s)?void we(t,t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+r),i,s):ye(i,"No integrity hash for "+r,!0)}if("remote-config"!==e){var n=t.config.strict_script_versioning;if(n){var o=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),a=$e[o];if("fallback"===n&&a){if(be(a))return void we(t,a,i);delete $e[o]}we(t,o,"fallback"===n?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var n,a=Se(t,e);$e[o]=a;var h=be(o);null==h||null==(n=h.parentNode)||n.removeChild(h),we(t,a,i)}else i(void 0,s)}:i)}else we(t,Se(t,e),i)}else we(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)};de=xe,f.__PosthogExtensions__.loadExternalDependency=xe,f.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{if(t.config.require_subresource_integrity)return ye(i,"Site apps can't be integrity-verified, so "+e+" is not loaded with require_subresource_integrity");we(t,t.requestRouter.endpointFor("api",e),i)},m.DEBUG=!1,m.LIB_VERSION="1.453.2",m.LIB_NAME="web";var Ee=m,Te="$early_access_features",ke="$active_feature_flags",Ie="$feature_flag_details",Pe="$feature_flag_errors",Re="$feature_flag_evaluated_at",Oe="$feature_flag_request_id",Ce="$minimal_flag_called_events",Ae="$enabled_feature_flags",Me="$stored_group_properties",Ne="$stored_person_properties",De="$flag_call_reported",Fe="$flag_call_reported_session_id",Be="$feature_flag_payloads",Ue="$override_feature_flags",je="$override_feature_flag_payloads",Le="visibilitychange",ze="$autocapture_disabled_server_side",qe="$surveys",We="$surveys_loaded_at",He="$surveys_activated",Ge="$surveys_activated_session",Ve="$surveys_activated_timestamps",Je="$people_distinct_id",Ke="distinct_id",Ye="$device_id",Xe="$device_model",Qe="__alias",Ze="__cmpns",ti="$fbc",ei="$fbc_persistence",ii="$fbp",ri="$fbp_persistence",si="__timers",ni="$heatmaps_enabled_server_side",oi="$exception_capture_enabled_server_side",ai="$error_tracking_suppression_rules",hi="$error_tracking_capture_extension_exceptions",li="$web_vitals_enabled_server_side",ui="$dead_clicks_enabled_server_side",di="$product_tours_enabled_server_side",vi="$logs_capture_enabled_server_side",ci="$web_vitals_allowed_metrics",_i="$session_recording_remote_config",pi="$session_recording_enabled_server_side",fi="$replay_sample_rate",gi="$replay_override_sampling",mi="$replay_override_linked_flag",bi="$replay_override_url_trigger",yi="$replay_override_event_trigger",wi="$sesid",$i="$session_is_sampled",Si="$session_past_minimum_duration",xi="$session_recording_url_trigger_activated_session",Ei="$session_recording_event_trigger_activated_session",Ti="$debug_first_full_snapshot_timestamp",ki="$sess_rec_flush_size",Ii="$groups",Pi="ph_product_tours",Ri="$product_tours_activated",Oi="$product_tours_activated_session",Ci="$conversations_widget_session_id",Ai="$conversations_ticket_id",Mi="$conversations_widget_state",Ni="$conversations_user_traits",Di="$user_state",Fi="$client_session_props",Bi="$capture_rate_limit",Ui="$initial_campaign_params",ji="$initial_referrer_info",Li="$initial_person_info",zi="$epp",qi="$posthog_cookieless",Wi="$cookieless_mode",Hi="$sdk_debug_extensions_init_method",Gi="$sdk_debug_extensions_init_time_ms",Vi="$sdk_debug_recording_script_not_loaded",Ji="$sdk_debug_replay_stale_config",Ki="$sdk_debug_replay_event_trigger_status",Yi="$sdk_debug_replay_linked_flag_trigger_status",Xi="$sdk_debug_replay_matched_recording_trigger_groups",Qi="$sdk_debug_replay_pending_trigger_conditions",Zi="$sdk_debug_replay_remote_trigger_matching_config",tr="$sdk_debug_replay_trigger_groups_count",er="$sdk_debug_replay_url_trigger_status",ir="$session_recording_start_reason",rr="anonymous",sr="identified",nr="identified_only",or="beforeunload",ar="$pageview",hr="$pageleave",lr="$identify",ur="$groupidentify";function dr(t,e){I(t)&&t.forEach(e)}function vr(t,e){if(!D(t))if(I(t))t.forEach(e);else if((t=>t instanceof FormData)(t))t.forEach((t,i)=>e(t,i));else for(var i in t)T.call(t,i)&&e(t[i],i)}var cr=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(t[n]=s[n]);return t},_r=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ce.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ce.critical(t)}}},pr=function(t){var e={};return vr(t,function(t,i){(A(t)&&t.length>0||F(t))&&(e[i]=t)}),e};function fr(t){var e=i({},t);for(var r of["name","message","stack","cause","errors"])try{r in t&&(e[r]=t[r])}catch(t){}return e}var gr=["herokuapp.com","vercel.app","netlify.app"];function mr(t){var e=null==t?void 0:t.hostname;if(!A(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of gr)if(i===r)return!1;return!0}function br(t,e,i,r){var s=null!=r?r:{},n=s.capture,o=s.passive;null==t||t.addEventListener(e,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var yr,wr,$r=t=>{if(h){try{for(var e=t+"=",i=h.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},Sr=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,s){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>i||0>r||0>s||e>0xffffffffffff||i>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=/* @__PURE__ */new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|i>>>8,n[7]=i,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new t(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}},xr=class{generate(){var t=this.generateOrAbort();if(!C(t))return t;this.Mt=0;var e=this.generateOrAbort();if(C(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=(()=>{var t=Date.now();return F(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Mt)this.Mt=t,this.Tt();else{if(this.Mt>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Mt++,this.Tt())}return Sr.fromFieldsV7(this.Mt,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.At.nextUint32())}Tt(){this.It=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Mt=0,this.It=0,this.At=new Tr}},Er=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t},Tr=class{nextUint32(){return this.Rt.length>this.Et||((null!=yr?yr:yr="u">typeof window&&!C(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch(e){return Er(t)}}:Er)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=/* @__PURE__ */new Uint32Array(8),this.Et=1/0}},kr=()=>Ir().toString(),Ir=()=>(wr||(wr=new xr)).generate(),Pr="",Rr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Or=null,Cr={Ot(){if(!N(Or))return Or;if(Or=!1,h)try{var t="__ph_cookie_support_"+kr();Cr.$t(t,"xyz"),Or='"xyz"'===$r(t),Cr.Ft(t)}catch(t){Or=!1}return Or},Dt(t){ce.error("cookieStore error: "+t)},Lt:$r,Pt(t){var e;try{e=JSON.parse(Cr.Lt(t))||{}}catch(t){}return e},$t(t,e,i,r,s){if(!h)return!1;try{var n="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=h),Pr)return Pr;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),s="dmn_chk_"+kr();!Pr&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",Pr=n)}return Pr}(t);if(!i){var r=(t=>{var e=t.match(Rr);return e?e[0]:""})(t);r!==i&&ce.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,r);if(i){var l=/* @__PURE__ */new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ce.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(t){return!1}},Ft(t,e){if(null!=h&&h.cookie&&(!e||!N($r(t))))try{Cr.$t(t,"",-1,e)}catch(t){return}}},Ar=null,Mr={Ot(){if(!N(Ar))return Ar;var t=!0;if(C(n))t=!1;else try{var e="__mplssupport__";Mr.$t(e,"xyz"),'"xyz"'!==Mr.Lt(e)&&(t=!1),Mr.Ft(e)}catch(e){t=!1}return t||ce.error("localStorage unsupported; falling back to cookie store"),Ar=t,t},Dt(t){ce.error("localStorage error: "+t)},Lt(t){try{return null==n?void 0:n.localStorage.getItem(t)}catch(t){Mr.Dt(t)}return null},Pt(t){try{return JSON.parse(Mr.Lt(t))||{}}catch(t){}return null},$t(t,e){try{return null==n||n.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Mr.Dt(t)}return!1},Ft(t){try{null==n||n.localStorage.removeItem(t)}catch(t){Mr.Dt(t)}}},Nr=[Ne,ke,Ae,Ie,Be,Oe,Re,Pe,De],Dr=[Ye,Ke,wi,$i,zi,Li,ei,Di],Fr=t=>t+"_cpm",Br=["__proto__","constructor","prototype"],Ur=t=>{if(!R(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Br.indexOf(i)&&(e[i]=t[i])}),e},jr=function(t,e){void 0===e&&(e=[]);var i={};return[...Dr,...e].forEach(e=>{var r=t[e];C(r)||N(r)||""===r||(i[e]=r)}),i},Lr=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,i=Math.imul(i^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},zr=(t,e)=>({p:e,f:Lr(JSON.stringify(t))}),qr=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=Cr.Pt(Fr(t)),r=(null==i?void 0:i.f)===Lr(e)&&I(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Wr=(t,e)=>e+"|"+(Cr.Lt(Fr(t))||""),Hr={},Gr={Ot:()=>!0,Dt(t){ce.error("memoryStorage error: "+t)},Lt:t=>t in Hr?Hr[t]:null,Pt:t=>t in Hr?Hr[t]:null,$t:(t,e)=>(Hr[t]=e,!0),Ft(t){delete Hr[t]}},Vr=null,Jr={Ot(){if(!N(Vr))return Vr;if(Vr=!0,C(n))Vr=!1;else try{var t="__support__";Jr.$t(t,"xyz"),'"xyz"'!==Jr.Lt(t)&&(Vr=!1),Jr.Ft(t)}catch(t){Vr=!1}return Vr},Dt(t){ce.error("sessionStorage error: ",t)},Lt(t){try{return null==n?void 0:n.sessionStorage.getItem(t)}catch(t){Jr.Dt(t)}return null},Pt(t){try{return JSON.parse(Jr.Lt(t))||null}catch(t){}return null},$t(t,e){try{return null==n||n.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Jr.Dt(t)}return!1},Ft(t){try{null==n||n.sessionStorage.removeItem(t)}catch(t){Jr.Dt(t)}}},Kr=class{constructor(t){this._instance=t}get Br(){return this._instance.config}get consent(){return this.Ua()?0:this.Wa}isOptedOut(){return"always"===this.Br.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Br.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Br.opt_out_capturing_by_default}optInOut(t){this.Va.$t(this.Ga,t?1:0,this.Br.cookie_expiration,this.Br.cross_subdomain_cookie,this.Br.secure_cookie)}reset(){this.Va.Ft(this.Ga,this.Br.cross_subdomain_cookie)}get Ga(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get Wa(){var t=this.Va.Lt(this.Ga);return W(t)?1:S(H,t)?0:-1}get Va(){var t=this.Br.opt_out_capturing_persistence_type,e="localStorage"===t?Mr:Cr,i=e.Ot()?e:Gr;if(!this.Qa||this.Qa!==i){this.Qa=i;var r="localStorage"===t?Cr:Mr;r.Lt(this.Ga)&&(this.Qa.Lt(this.Ga)||this.optInOut(W(r.Lt(this.Ga))),r.Ft(this.Ga,this.Br.cross_subdomain_cookie))}return this.Qa}Ua(){return!!this.Br.respect_dnt&&[null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,f.doNotTrack,null==a?void 0:a.globalPrivacyControl].some(t=>W(t))}},Yr=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],Xr=/* @__PURE__ */(()=>[...Yr,"+","-","−","–"])(),Qr=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(ui)),r=t.instance.config.capture_dead_clicks;return U(r)?r:!!R(r)||i},Zr=_e("[SegmentIntegration]");function ts(t,e,r){void 0===r&&(r=!0);var s=t.config.segment;if(!s)return e();var n,o=(t=>P(t.register))(n=s)?{analytics:n}:n,a=o.analytics,h=o.filterProperties;!function(t,e,i,r){var s=e=>{var s=()=>e.anonymousId()||kr();t.config.get_device_id=s,r&&e.id()&&(t.register({distinct_id:e.id(),$device_id:s()}),t.persistence.set_property(Di,sr)),i(r?void 0:e.anonymousId()||void 0)},n=e.user();"then"in n&&P(n.then)?n.then(s):s(n)}(t,a,r=>{a.register(function(t,e,r){var s=(void 0===r?{}:r).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Zr.warn("This browser does not have Promise support, and can not use the segment integration");var n=(r,n)=>{if(!n)return r;var o=!!e&&r.event.anonymousId===e&&!r.event.userId;o||r.event.userId||r.event.anonymousId===t.get_distinct_id()||(Zr.info("No userId set, resetting PostHog"),t.reset()),o||(e=void 0),r.event.userId&&r.event.userId!==t.get_distinct_id()&&(Zr.info("UserId set, identifying with PostHog"),t.identify(r.event.userId));var a=t.calculateEventProperties(n,r.event.properties);if(!D(s)){var h=r.event.properties||{},l={};for(var u of Object.keys(a))T.call(h,u)||(l[u]=a[u]);var d=((t,e)=>{var r=I(t)?t:[t],s=i({},e);for(var n of r)try{if(s=n(s),D(s))return null}catch(t){return Zr.error("Error in Segment filterProperties:",t),null}return s})(s,l);if(D(d))return r;a=d}return r.event.properties=Object.assign({},a,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return n(t,t.event.event)},page(t){return n(t,ar)},identify(t){return n(t,lr)},screen(t){return n(t,"$screen")}}}(t,r,{filterProperties:h})).then(()=>{e()},t=>{Zr.error("Failed to register the Segment integration",t),e()})},r)}var es="posthog-js";function is(t,e){var r=void 0===e?{}:e,s=r.organization,n=r.projectId,o=r.prefix,a=r.severityAllowList,h=void 0===a?["error"]:a,l=r.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var r,a,l,d,v,c;if("*"!==h&&!h.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var _=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=_,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(r=e.exception)?void 0:r.values)||[],f=p.map(t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>i({},t,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(l=p[0])?void 0:l.type,$exception_level:e.level,$exception_list:f,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return s&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+s+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}var rs=class{constructor(t,e,i,r,s,n){this.name=es,this.setupOnce=function(o){o(is(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}},ss=class{constructor(t){this.Ya=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ce.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Xa=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.tu()}tu(){var t;this.eu=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Ya)}destroy(){var t;null==(t=this.eu)||t.call(this),this.eu=void 0}doPageView(t,e){var i,r=this.iu(t,e);return this.Xa={pathname:null!==(i=null==n?void 0:n.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.iu(t,null==(e=this.Xa)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Xa)?void 0:t.pageViewId}}iu(t,e){var i=this.Xa;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,o=s.lastScrollY,a=s.maxScrollY,h=s.maxContentHeight,l=s.lastContentY,u=s.maxContentY;if(!(C(n)||C(o)||C(a)||C(h)||C(l)||C(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),h=Math.ceil(h),l=Math.ceil(l),u=Math.ceil(u);var d=n>1?K(o/n,0,1,ce):1,v=n>1?K(a/n,0,1,ce):1,c=h>1?K(l/h,0,1,ce):1,_=h>1?K(u/h,0,1,ce):1;r=cr(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}},ns=["flags","surveys"],os={[Je]:{exposure:"hidden"},[Qe]:{exposure:"hidden"},[Ze]:{exposure:"hidden"},[si]:{exposure:"hidden"},[ei]:{exposure:"hidden"},[ri]:{exposure:"hidden"},[ze]:{exposure:"event"},[ni]:{exposure:"hidden"},[vi]:{exposure:"hidden"},[oi]:{exposure:"event"},[ai]:{exposure:"hidden"},[hi]:{exposure:"event"},[li]:{exposure:"event"},[ui]:{exposure:"event"},[di]:{exposure:"hidden"},[ci]:{exposure:"event"},[_i]:{exposure:"hidden"},[pi]:{exposure:"hidden"},[wi]:{exposure:"hidden"},[$i]:{exposure:"event"},[fi]:{exposure:"event",shouldSkipFromEventProperties:t=>N(t)},[Si]:{exposure:"event"},[xi]:{exposure:"event"},[Ei]:{exposure:"event"},[Ti]:{exposure:"event"},[ki]:{exposure:"hidden"},[Ae]:{exposure:"hidden",storageGroup:"flags"},[ke]:{exposure:"hidden",storageGroup:"flags"},[Te]:{exposure:"hidden"},[Ie]:{exposure:"hidden",storageGroup:"flags"},[Be]:{exposure:"hidden",storageGroup:"flags"},[Oe]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ce]:{exposure:"hidden",storageGroup:"flags"},[Ue]:{exposure:"hidden"},[je]:{exposure:"hidden"},[Ne]:{exposure:"hidden"},[Me]:{exposure:"hidden"},[qe]:{exposure:"hidden",storageGroup:"surveys"},[We]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[He]:{exposure:"event"},[Ge]:{exposure:"hidden"},[Ve]:{exposure:"hidden"},[Pi]:{exposure:"hidden"},[Ri]:{exposure:"hidden"},[Oi]:{exposure:"hidden"},[Ci]:{exposure:"event"},[Ai]:{exposure:"event"},[Mi]:{exposure:"event"},[Ni]:{exposure:"event"},[De]:{exposure:"hidden"},[Fe]:{exposure:"hidden"},[Ii]:{exposure:"event"},[Pe]:{exposure:"hidden"},[Re]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Di]:{exposure:"hidden"},[Fi]:{exposure:"hidden"},[Bi]:{exposure:"hidden"},[Ui]:{exposure:"hidden"},[ji]:{exposure:"hidden"},[Li]:{exposure:"hidden"},[zi]:{exposure:"hidden"},[gi]:{exposure:"event"},[mi]:{exposure:"event"},[bi]:{exposure:"event"},[yi]:{exposure:"event"},[Hi]:{exposure:"event"},[Gi]:{exposure:"event"},[Vi]:{exposure:"hidden"},[Ji]:{exposure:"hidden"},[Ki]:{exposure:"hidden"},[Yi]:{exposure:"hidden"},[Xi]:{exposure:"hidden"},[Qi]:{exposure:"hidden"},[Zi]:{exposure:"hidden"},[tr]:{exposure:"hidden"},[er]:{exposure:"hidden"},[ir]:{exposure:"event"}},as=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],hs=t=>{var e=os[t];if(e)return e;for(var i of as){var r=i[1];if(0===t.indexOf(i[0]))return r}};function ls(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}var us=t=>{var e,i=null==(e=typeof document>"u"?void 0:document)?void 0:e.createElement("a");return C(i)?null:(i.href=t,i)},ds=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>z(e)?(null!=i||(i=/* @__PURE__ */new WeakMap),i.has(e)||i.set(e,fr(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return s=[],null!==(r=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(e))return"[Circular]";s.push(e)}return e}}))&&void 0!==r?r:"null"}var r,s},vs=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split(/=(.*)/);if(n[0]===e){i=n;break}}if(!I(i)||2>i.length)return"";var o=i[1].replace(/\+/g," ");try{o=decodeURIComponent(o)}catch(t){ce.error("Skipping decoding for malformed query param: "+o)}return o},cs=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split(/#(.*)/),s=r[1],n=(r[0]||"").split(/\?(.*)/),o=n[1],a=n[0],h=(o||"").split("&"),l=[],u=0;h.length>u;u++){for(var d=h[u].split("?"),v=0;d.length>v&&!e.includes(d[v].split("=")[0]);)v++;l.push(d.length>v?d.slice(0,v).concat(d[v].split("=")[0]+"="+i).join("?"):h[u])}var c=a;return null!=o&&(c+="?"+l.join("&")),null!=s&&(c+="#"+s),c},_s=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],ps=/* @__PURE__ */(()=>["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",..._s])(),fs="<masked>",gs=["li_fat_id"];function ms(t,e){var i=ps.concat(e||[]),r={};return vr(i,function(e){var i=vs(t,e);r[e]=i||null}),r}function bs(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!N(e)){r.$search_engine=e;var s=h?vs(h.referrer,i):"";s.length&&(r.ph_keyword=s)}return r}function ys(){return navigator.language||navigator.userLanguage}var ws="$direct";function $s(){return(null==h?void 0:h.referrer)||ws}function Ss(t,e,i){var r;void 0===i&&(i=!1);var s=t?[..._s,...e||[]]:[],n=null==(r=i?Zt(null==l?void 0:l.href):null==l?void 0:l.href)?void 0:r.substring(0,1e3);return{r:$s().substring(0,1e3),u:n?cs(n,s,fs):void 0}}function xs(t,e){var i;void 0===e&&(e=!1);var r=t.r,s=t.u,n=e?Zt(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==ws?ws:null==(i=us(r))?void 0:i.host};if(n){o.$current_url=n;var a=us(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,cr(o,ms(n))}return r&&cr(o,bs(r)),o}function Es(){try{/* @__PURE__ */
|
|
2
2
|
return(new Date).getTimezoneOffset()}catch(t){return}}var Ts={flags:Re,surveys:We},ks=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Is=t=>t+"_cookie_identity_change_pending",Ps=t=>{var e="",i=0;for(var r of t){var s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+s>1e3)break;e+=r,i+=s}return e},Rs="main",Os=[Ae,ke,Ie,Be,Oe,Re,Ce,Ne],Cs=t=>-1!==Os.indexOf(t),As=[ei,ri],Ms=t=>-1!==As.indexOf(t),Ns=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},Ds=t=>{if(!t)return{};var e=JSON.parse(t);return R(e)?e:{}},Fs=(t,e)=>{vr(t,(i,r)=>{var s=hs(r);s&&"event"!==s.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},Bs=class{constructor(t,e,r,s){if(void 0===r&&(r=!0),void 0===s&&(s=!t.cookieless_mode),this.nu={},this.su=!1,this.ru=!1,this.ou=!1,this.lu=!1,this.au=!1,this.uu=/* @__PURE__ */new Map,this.cu=!1,this.hu=!1,this.du=!1,this.vu=/* @__PURE__ */new Set,this.fu=/* @__PURE__ */new Set,this.Br=t,this.pu=r,this.props={},this.gu=void 0,this.mu=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.gi=t.disable_persistence||!!e,this.Va=this.yu(t),this.ou=this.bu(t),this.load(s),this._u(),t.debug&&ce.info("Persistence loaded",t.persistence,i({},this.props)),this.update_config(t,t,e),this.save(),n){var o=()=>this.flush();br(n,"beforeunload",o,{capture:!1}),br(n,"pagehide",o,{capture:!1}),this.wu=t=>{if(this.su&&(!t.storageArea||t.storageArea===(null==n?void 0:n.localStorage))&&t.key)if(t.key!==this.mu){if(this.ou){var e=ns.find(e=>t.key===this.ku(e));e&&this.Su(t.key,e)}}else this.Su(t.key,Rs)},br(n,"storage",this.wu)}}reconcileFeatureFlagsBeforeMerge(){return!(this.gi||this.au||this.cu)&&this.xu()}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.uu.get(e);if(Cs(e)&&!0!==r)if(!0!==i){var s=new Set(r||[]);i.forEach(t=>s.add(t)),s.size&&this.$u(e,s)}else this.$u(e,!0)})}onCrossTabFeatureFlagChange(t){return this.fu.add(t),()=>this.fu.delete(t)}destroy(){this.wu&&n&&(n.removeEventListener("storage",this.wu),this.wu=void 0),this.fu.clear()}Su(t,e,i){if(void 0===i&&(i=!0),this.gi)return!1;var r,s;try{if(s=Mr.Lt(t),N(s)){var n=this.Cu(e);return n.storageValue=null,e!==Rs?n.persisted=!1:this.Tu({}),!1}r=Ds(s)}catch(t){return!1}e===Rs&&this.Tu(r);var o=e===Rs?r:Mr.Pt(this.mu);if(o&&this.Mu(o))return!1;var a=this.Iu(r,e,i);return e===Rs&&this.ou&&!Ns(this.Eu().main,r)||this.Au(r,e,!0,s),a}Mu(t){var e=this.props[Ke],i=t[Ke];return!C(e)&&!C(i)&&e!==i}Au(t,e,i,r){var s=this.Cu(e);s.storageValue=r,e!==Rs&&(s.persisted=i);try{s.fingerprint=this.Ru(t,e)}catch(t){s.fingerprint=void 0}}Iu(t,e,i){var r=!1;return Os.forEach(i=>{var s,n=null==(s=hs(i))?void 0:s.storageGroup;if(!(e===Rs&&this.ou&&n||e!==Rs&&n!==e)){var o=i in t,a=this.Pu(i,o?t[i]:void 0),h=this.uu.has(i)?i in this.props:o;h===i in this.props&&Ns(a,this.props[i])||(h?this.Ou(i,a,!1):this.Fu(i,!1),r=!0)}}),r&&i&&this.fu.forEach(t=>t()),r}Tu(t){var e=this.ru&&this.Br.cookieWinsOnConflict?[...Dr,...this.Br.cookie_persisted_properties||[]]:[];As.forEach(i=>{this.vu.has(i)||-1!==e.indexOf(i)||(i in t?Ns(t[i],this.props[i])||this.Ou(i,t[i],!1):i in this.props&&this.Fu(i,!1))})}Lu(){return this.ru&&this.su&&!this.Br.cookieWinsOnConflict}Du(){if(this.Lu()){var t;try{t=Cr.Lt(this.mu)||void 0}catch(t){return}if(t&&t!==this.Nu){var e;this.Nu=t;try{e=Ur(JSON.parse(t))}catch(t){return}As.forEach(t=>{!(t in e)||t in this.props||this.vu.has(t)||this.Ou(t,e[t],!1)})}}}ju(t){if(this.Lu())try{var e=JSON.stringify(jr(t,this.Br.cookie_persisted_properties||[])),i=Cr.Lt(this.mu)||void 0;i===e&&(this.Nu=i)}catch(t){}}xu(){if(!this.su)return!1;try{this.du=!1;var t,e=Mr.Lt(this.mu),i=this.Cu(Rs),r=!1,s=!1;if(e!==i.storageValue)if(N(e))A(i.storageValue)&&this.Tu({}),i.storageValue=null;else{if(t=Ds(e),this.Tu(t),this.du=!this.hu&&this.Mu(t),this.du)return!1;s=this.Iu(t,Rs,!1),!this.ou||Ns(this.Eu().main,t)?this.Au(t,Rs,!0,e):i.storageValue=e,r=!0}return this.ou&&ns.forEach(e=>{var i=Mr.Lt(this.ku(e)),n=this.Cu(e),o=t||{},a=r&&Os.some(t=>{var i;return(null==(i=hs(t))?void 0:i.storageGroup)===e&&t in o});if(i!==n.storageValue||a){if(N(i))return n.storageValue=null,n.persisted=!1,void(a&&(s=this.Iu(o,e,!1)||s));var h=Ds(i);s=this.Iu(h,e,!1)||s,this.Au(h,e,!0,i)}}),s}catch(t){return!1}}$u(t,e){this.uu.set(t,e);var i=hs(t);null!=i&&i.volatile||(this.Cu((this.ou?null==i?void 0:i.storageGroup:void 0)||Rs).fingerprint=void 0,this.qu(t))}Bu(){Os.forEach(t=>this.uu.set(t,!0))}_u(){if(this.su)try{var t=Mr.Lt(this.mu),e=Ds(t);this.Cu(Rs).storageValue=t,Os.forEach(t=>{var i,r=this.ou?null==(i=hs(t))?void 0:i.storageGroup:void 0,s=r?Mr.Lt(this.ku(r)):null;if(r){var n=this.Cu(r);n.storageValue=s,n.persisted=!N(s)}var o=r&&!N(s)?Ds(s):e;t in this.props?this.zu(t,o[t],this.props[t]):t in o&&this.$u(t,!0)})}catch(t){}}Pu(t,e){var r=this.uu.get(t);if(!r)return e;if(!0===r)return this.props[t];if("$active_feature_flags"===t){var s=new Set(I(e)?e:[]),n=new Set(I(this.props[t])?this.props[t]:[]);return r.forEach(t=>n.has(t)?s.add(t):s.delete(t)),Array.from(s)}var o=R(e)?i({},e):{},a=R(this.props[t])?this.props[t]:{};return r.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}zu(t,e,i){if(Cs(t)){var r=this.uu.get(t);if(!0!==r){var s=e;if(this.su)try{var n,o=this.ou?null==(n=hs(t))?void 0:n.storageGroup:void 0,a=o?this.ku(o):this.mu;s=Ds(Mr.Lt(a))[t]}catch(t){}var h=new Set(r||[]);if("$active_feature_flags"===t){if(!C(e)&&!I(e)||!C(s)&&!I(s)||!I(i))return void this.$u(t,!0);var l=new Set(e||[]),u=new Set(s||[]),d=new Set(i);
|
|
3
3
|
/* @__PURE__ */new Set([...l,...d]).forEach(t=>{l.has(t)!==d.has(t)&&h.add(t)}),h.forEach(t=>{u.has(t)===d.has(t)&&h.delete(t)})}else{if(!R(i))return void(Ns(s,i)?this.uu.delete(t):this.$u(t,!0));if(!C(e)&&!R(e)||C(e)&&O(i)&&C(s))return void this.$u(t,!0);var v=R(e)?e:{},c=R(s)?s:{};
|
|
4
4
|
/* @__PURE__ */new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&Ns(v[t],i[t])||h.add(t)}),h.forEach(t=>{t in c==t in i&&Ns(c[t],i[t])&&h.delete(t)})}h.size?this.$u(t,h):this.uu.delete(t)}}}Hu(){var t,e=null==(t=this.Br)?void 0:t.persistence_save_debounce_ms;return F(e)&&e>0?e:0}Uu(t){if(this.Br.cookieWinsOnConflict&&"localstorage+cookie"===this.Br.persistence.toLowerCase())if(t)try{var e=jr(t,this.Br.cookie_persisted_properties||[]),i=zr(e,this.Br.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),s=Cr.Lt(this.mu)||void 0;s&&Wr(this.mu,s)===r&&(this.Wu=r,this.Vu=s)}catch(t){}else try{var n=Cr.Lt(this.mu)||void 0;this.Wu=n?Wr(this.mu,n):void 0,this.Vu=n}catch(t){}}syncCookieProperties(){return this.Gu(this.Br)}Gu(t,e){if(void 0===e&&(e=!1),this.gi&&!e||this.au||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=Cr.Lt(this.mu)||void 0}catch(t){}if(!i||i===this.Vu)return!1;var r,s=Wr(this.mu,i);try{r=Ur(JSON.parse(i))}catch(t){return!1}if((Cr.Lt(this.mu)||void 0)!==i)return!1;this.Wu=s,this.Vu=i;var n=qr(this.mu,i),o=[...Dr,...n.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(C(e)||N(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),O(r))return!1;var h="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,l=this.props,u=l[Ke],d=l[Di],v=cr({},l);[...Dr,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(h||"distinct_id"!==t&&"$user_state"!==t)){var e=v[t];(n.isValid||-1===Dr.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=cr(v,r),Os.forEach(t=>{var e=t in this.props;t in l===e&&Ns(l[t],this.props[t])||(e?this.zu(t,l[t],this.props[t]):this.$u(t,!0))}),!h||"$user_state"in r||"$user_state"in this.props||this.Ou(Di,rr);var c=this.props[Ke],_=this.props[Di];return!h||c===u&&_===d||(this.hu=!0,this.lu=!0,Jr.$t(Is(this.mu),!0),this.Fu(Ne),this.Fu(ke),this.Fu(Ae),this.Fu(Ie),this.Fu(Be),this.Fu(Oe),this.Fu(Re),this.Fu(Pe),this.Fu(De),"anonymous"!==_||"identified"!==d&&"anonymous"!==r.$user_state&&(C(u)||c===u)||(Fs(this.props,r),this.Fu(Me)),"identified"===_?this.props.$user_id=c:delete this.props.$user_id,this.Fu(Qe)),!0}consumeCookieIdentityChange(){var t=Is(this.mu),e=this.lu||!!Jr.Lt(t);return this.lu=!1,e&&Jr.Ft(t),e}Qu(t){return void 0===t&&(t=!1),!(this.au||this.gi&&!t||!this.Br.cookieWinsOnConflict||"localstorage+cookie"!==this.Br.persistence.toLowerCase()||(this.au=!0,0))}Ju(){this.au&&(C(this.Zu)||(clearTimeout(this.Zu),this.Zu=void 0),delete this.nu[Rs],this.Ku(!0))}Yu(t){if(void 0===t&&(t=!0),this.au)try{t?this.Ju():C(this.Zu)||(clearTimeout(this.Zu),this.Zu=void 0)}finally{this.au=!1}}isDisabled(){return!!this.gi}yu(t){-1===ks.indexOf(t.persistence.toLowerCase())&&(ce.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,r=function(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=!1),void 0===r&&(r=()=>!1);var s=[...Dr,...t];return i({},Mr,{Pt(t){try{var i,n={};try{i=Cr.Lt(t)||void 0,n=i?Ur(JSON.parse(i)):{}}catch(t){}var o,a=JSON.parse(Mr.Lt(t)||"{}");if(e){var h=qr(t,i),l=[...Dr,...h.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];N(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e||(u[t]=e)});var d="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var v,c=a[Ke],_=null!==(v=a.$user_state)&&void 0!==v?v:"anonymous";s.forEach(t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(d||"distinct_id"!==t&&"$user_state"!==t)){var e=a[t];(h.isValid||-1===Dr.indexOf(t)||!1!==e&&0!==e)&&delete a[t]}}),!d||"$user_state"in n||"$user_state"in a||(a[Di]=rr),!d||("distinct_id"in u?u[Ke]:a[Ke])===c&&("$user_state"in u?u[Di]:a[Di])===_||(Nr.forEach(t=>delete a[t]),"identified"===u.$user_state&&"distinct_id"in u?a.$user_id=u[Ke]:delete a.$user_id,"identified"!==u.$user_state&&(delete a[Ii],delete a[Me]),delete a.__alias)}o=cr(a,u)}else o=cr(n,a);return r()||Mr.$t(t,o),o}catch(t){}return null},$t(i,r,s,n,o,a){var h=Mr.$t(i,r,void 0,void 0,a);try{var l=jr(r,t);if(Object.keys(l).length){if(e){var u=Fr(i),d=zr(l,t);if(Cr.$t(u,d,s,n,o,a),Cr.Lt(u)!==JSON.stringify(d)){Cr.Ft(u,n);var v=jr(r);return Cr.$t(i,v,s,n,o,a),h}}Cr.$t(i,l,s,n,o,a)}}catch(t){Mr.Dt(t)}return h},Ft(t,e){try{null==n||n.localStorage.removeItem(t),Cr.Ft(t,e),Cr.Ft(Fr(t),e)}catch(t){Mr.Dt(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.gi),s=!1,o=!1,a=t.persistence.toLowerCase();return"localstorage"===a&&Mr.Ot()?(e=Mr,o=!0):"localstorage+cookie"===a&&r.Ot()?(e=r,o=!0,s=!0):"sessionstorage"===a&&Jr.Ot()?e=Jr:"memory"===a?e=Gr:"cookie"===a&&Cr.Ot()?(e=Cr,s=!0):r.Ot()?(e=r,o=!0,s=!0):Cr.Ot()?(e=Cr,s=!0):e=Gr,this.su=o,this.ru=s,e}ku(t){return this.mu+"__"+t}bu(t){return this.su&&!!t.split_storage}properties(){var t={};return vr(this.props,(e,i)=>{var r=hs(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}}),t}load(t){if(void 0===t&&(t=!1),!this.gi||t){var e=this.Br.cookieWinsOnConflict&&"localstorage+cookie"===this.Br.persistence.toLowerCase(),i=e?Mr.Pt(this.mu):null,r={};if(e)try{vr(r=Ur(Cr.Pt(this.mu)),(t,e)=>{(C(t)||N(t)||""===t)&&delete r[e]})}catch(t){}var s=this.Va.Pt(this.mu);if(s&&(this.props=cr({},s)),this.ou&&this.Xu(),e&&s){var n,o,a=null==i?void 0:i[Ke],h=null!==(n=null==i?void 0:i.$user_state)&&void 0!==n?n:"anonymous",l=s[Ke],u=null!==(o=s.$user_state)&&void 0!==o?o:"anonymous";if(l!==a||u!==h){this.lu=!0,this.gi||Jr.$t(Is(this.mu),!0);var d=cr({},this.props);Nr.forEach(t=>delete d[t]),"anonymous"!==u||"identified"!==h&&"anonymous"!==r.$user_state&&(C(a)||l===a)||(Fs(d,r),delete d[Me]),this.props=d;var v=/* @__PURE__ */new Set;Nr.forEach(t=>{var e,i=null==(e=hs(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{if(!this.gi){var e={};vr(this.props,(i,r)=>{var s;(null==(s=hs(r))?void 0:s.storageGroup)===t&&(e[r]=i)}),O(e)?(Mr.Ft(this.ku(t)),this.nu[t]={}):Mr.$t(this.ku(t),e)&&(this.nu[t]={persisted:!0,fingerprint:this.Ru(e,t)})}})}}Jr.Lt(Is(this.mu))&&(this.lu=!0)}}Xu(){for(var t of ns){var e=Mr.Pt(this.ku(t));if(e&&!O(e)){var i=this.Cu(t);i.persisted=!0,this.tc(t)||(i.fingerprint=this.Ru(e,t)),this.ec(t,e)||cr(this.props,e)}}}tc(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=hs(e))?void 0:i.storageGroup)===t})}ec(t,e){var i=Ts[t];if(!i)return!1;var r=e[i],s=this.props[i];return F(r)&&F(s)&&s>r}refreshKey(t){this.nc([t])}nc(t){if(!this.gi){var e,i=!1,r=()=>(i||(e=this.Va.Pt(this.mu),i=!0),e);t.forEach(t=>{var e;if(!this.vu.has(t)){var i=this.ou?null==(e=hs(t))?void 0:e.storageGroup:void 0,s=i?Mr.Pt(this.ku(i)):r();if(s&&t in s)this.Ou(t,s[t],!1);else{if(i){var n=r();if(n&&t in n)return void this.Ou(t,n[t],!1)}this.Fu(t,!1)}}})}}refreshMetaIdentifiers(){this.gi||(this.sc()?this.rc():this.nc(As))}rc(){var t=this.oc();(C(t)||t!==this.lc)&&(this.nc(As),this.ac(t))}ac(t){void 0===t&&(t=this.oc()),this.lc=0===this.vu.size?t:void 0}refreshMetaIdentifiersBeforeCapture(){this.gi||this.au||(this.sc()||this.Du(),this.rc())}sc(){return this.Va===Cr||this.Va===Jr||this.Va===Gr}oc(){var t=this.Va.Lt(this.mu);return A(t)?t:void 0}save(){if(!this.gi){var t=this.Hu();t>0?C(this.Zu)&&(this.Zu=setTimeout(()=>{this.Zu=void 0,this.Ku()},t)):this.Ku()}}flush(){C(this.Zu)||(clearTimeout(this.Zu),this.Zu=void 0,this.Ku())}Ku(t){if(void 0===t&&(t=!1),!(this.gi||this.au&&!t)){t||(this.syncCookieProperties(),this.sc()&&this.refreshMetaIdentifiers());var e=!t&&!this.cu;e||(this.du=!1);var i=!!e&&this.xu();if(this.du)this.Br.debug&&ce.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(t||this.Du(),this.ou)return this.uc(),void(i&&this.fu.forEach(t=>t()));var r=this.cc(this.Va,this.mu,this.props,Rs);"written"===r&&(this.Uu(this.props),this.ju(this.props)),"failed"!==r&&(this.uu.clear(),this.hu=!1,this.vu.clear()),"written"===r&&this.ac(),i&&this.fu.forEach(t=>t())}}}uc(){var t=this,e=this.Eu(),i=e.main,r=e.groups,s=this.cc(this.Va,this.mu,i,Rs);"written"===s&&(this.Uu(i),this.ju(i)),"failed"!==s&&(this.hu=!1,this.vu.clear(),Os.forEach(t=>{var e;null!=(e=hs(t))&&e.storageGroup||this.uu.delete(t)})),"written"===s&&this.ac();var n=function(e){var i,s=r[e];if(O(s)&&(null==(i=t.nu[e])||!i.persisted))return Os.forEach(i=>{var r;(null==(r=hs(i))?void 0:r.storageGroup)===e&&t.uu.delete(i)}),1;var n=t.cc(Mr,t.ku(e),s,e);"failed"!==n&&Os.forEach(i=>{var r=hs(i);(null==r?void 0:r.storageGroup)!==e||"written"!==n&&r.volatile||t.uu.delete(i)})};for(var o of ns)if(n(o))continue}Eu(){var t={},e={flags:{},surveys:{}};return vr(this.props,(i,r)=>{var s,n=null==(s=hs(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i}),{main:t,groups:e}}Ru(t,e){if(e===Rs)return JSON.stringify(t)+"|"+this.hc+"|"+this.dc+"|"+this.vc;var i={};return vr(t,(t,e)=>{var r;i[e]=null!=(r=hs(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}cc(t,e,i,r){var s,n=this.Cu(r);if(r!==Rs&&!n.dirty&&!C(n.fingerprint))return"skipped";try{if((s=this.Ru(i,r))===n.fingerprint)return n.dirty=!1,"skipped"}catch(t){s=void 0}return t.$t(e,i,this.hc,this.dc,this.vc,this.Br.debug)?(n.dirty=!1,r!==Rs&&(n.persisted=!0),C(s)||(n.fingerprint=s),this.su&&(n.storageValue=Mr.Lt(e)),"written"):(this.Br.debug&&ce.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.Bu(),C(this.Zu)||(clearTimeout(this.Zu),this.Zu=void 0),this.Va.Ft(this.mu,!1),this.Va.Ft(this.mu,!0),!i&&this.pu)for(var r of ns)Mr.Ft(this.ku(r));i?delete this.nu[Rs]:this.nu={},this.Wu=void 0,this.Vu=void 0,this.Nu=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(R(t)){this.syncCookieProperties(),C(e)&&(e="None"),this.hc=C(i)?this.fc:i;var r=!1;if(vr(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Ou(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(R(t)){this.syncCookieProperties(),this.hc=C(e)?this.fc:e;var i=!1;if(vr(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||R(e)||I(e))&&(this.Ou(r,e),i=!0)}),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.Fu(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==h?void 0:h.URL;if(t!==this.gu){var e=function(t,e,i){if(!h)return{};var r,s=e?[..._s,...i||[]]:[],n=ms(cs(h.URL,s,fs),t);return cr((r={},vr(gs,function(t){var e=$r(t);r[t]=e||null}),r),n)}(this.Br.custom_campaign_params,this.Br.mask_personal_data_properties,this.Br.custom_personal_data_properties),i=!O(pr(e));return i&&this.register(e),this.gu=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==h?void 0:h.referrer)?bs(t):{})}update_referrer_info(){var t;this.register_once({$referrer:$s(),$referring_domain:null!=h&&h.referrer&&(null==(t=us(h.referrer))?void 0:t.host)||ws},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=Ss(this.Br.mask_personal_data_properties,this.Br.custom_personal_data_properties,this.Br.disable_capture_url_hashes);this.register_once({[Li]:this.ru?{r:Ps(t.r),u:t.u?Ps(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};vr([ji,Ui],e=>{var i=this.props[e];i&&vr(i,function(e,i){t["$initial_"+x(i)]=e})});var e=this.props[Li];return e&&cr(t,function(t,e){void 0===e&&(e=!1);var i=xs(t,e),r={};return vr(i,function(t,e){r["$initial_"+x(e)]=t}),r}(e,this.Br.disable_capture_url_hashes)),t}safe_merge(t){return vr(this.props,function(e,i){i in t||(t[i]=e)}),t}update_config(t,e,r){var s=t.persistence!==e.persistence,n=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every((t,e)=>t===r[e])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),o=s||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,h=t.disable_persistence||!!r,l=!!this.gi&&!h;h||this.Gu(e,l),this.Br=t,!h&&(s||n||a)&&(this.Wu=void 0,this.Vu=void 0,this.Nu=void 0,this.Gu(i({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=o||a?this.yu(t):this.Va;this.gc();var d=this.bu(t),v=o||d!==this.ou,c=!h&&(v||t.cross_subdomain_cookie!==this.dc||t.secure_cookie!==this.vc)&&this.Qu(l);this.cu=v;try{if(this.fc=this.hc=t.cookie_expiration,this.set_disabled(h),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),v){var _=this.props;this.clear(),this.Va=u,this.ou=d,this.props=_,this.save()}else a&&(this.Va=u,h||(delete this.nu[Rs],this.Ku()))}finally{this.cu=!1,c&&this.Yu()}}gc(){var t=this.props[Li];if(this.ru&&R(t)&&"string"==typeof t.r){var e=Ps(t.r),r="string"==typeof t.u?Ps(t.u):t.u;e===t.r&&r===t.u||this.Ou(Li,i({},t,{r:e,u:r}))}}set_disabled(t){this.gi=t,this.gi?this.remove():this.save()}set_cross_subdomain(t){t!==this.dc&&(this.dc=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.vc&&(this.vc=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.Ou(si,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return C(i)||(delete e[t],this.Ou(si,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Ou(t,e),this.save()}Ou(t,e,i){var r;void 0===i&&(i=!0);var s=this.props[t];this.props[t]=e,i&&("distinct_id"!==t&&"$user_state"!==t||s===e||(this.hu=!0),Ms(t)&&!Ns(s,e)&&this.vu.add(t),this.zu(t,s,e),null!=(r=hs(t))&&r.volatile||this.qu(t))}Fu(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(Cs(t)&&this.$u(t,!0),Ms(t)&&this.vu.add(t),this.qu(t))}qu(t){var e,i=null==(e=hs(t))?void 0:e.storageGroup;i&&(this.Cu(i).dirty=!0)}Cu(t){return this.nu[t]||(this.nu[t]={})}},Us={GZipJS:"gzip-js",Base64:"base64"},js={Activation:"events",Cancellation:"cancelEvents"},Ls={Button:"button",Tab:"tab",Selector:"selector"},zs={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},qs={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Ws={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Hs={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Gs={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Vs={Once:"once",Recurring:"recurring",Always:"always"},Js={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Ks={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Ys={Popover:"popover",Inline:"inline"};function Xs(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&P(i.then)&&i.then(void 0,()=>{})}}}}var Qs={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Zs={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},tn={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},en=_e("[RateLimiter]"),rn=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach(t=>{en.info((t||"events")+" is quota limited."),this.serverLimits[t]=/* @__PURE__ */(new Date).getTime()+6e4})}catch(t){return void en.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}get isClientRateLimited(){return 1>this.mc().tokens}clientRateLimitContext(t){var e;void 0===t&&(t=!1);var i=this.mc(),r=1>i.tokens;if(r||t||(i.tokens=Math.max(0,i.tokens-1)),r&&!t){var s=(F(i.dropped)?i.dropped:0)+1;i.dropped=s,!this.lastEventRateLimited&&this.yc(s)&&(i.dropped=0)}return this.lastEventRateLimited=r,null==(e=this.instance.persistence)||e.set_property(Bi,i),{isRateLimited:r,remainingTokens:i.tokens}}mc(){var t,e=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,s=/* @__PURE__ */(new Date).getTime(),n=null==(t=this.instance.persistence)?void 0:t.get_property(Bi),o=n?i({},n):{tokens:e,last:s};return o.tokens+=Math.max(0,s-o.last)/1e3*r,o.last=Math.max(o.last,s),o.tokens>e&&(o.tokens=e),o}bc(t){var e=this.instance.config.property_denylist;return!I(e)||!e.includes(t)}_c(){var t;if(this.bc("$current_url")&&this.bc("$pathname")&&null!=l&&l.pathname)return""+(null!==(t=l.origin)&&void 0!==t?t:"")+l.pathname}yc(t){var e,i,r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,n=this._c(),o=this.bc("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+s+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&/* @__PURE__ */(new Date).getTime()<e}},sn=/* @__PURE__ */_e("[RemoteConfig]"),nn=class{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=f._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}wc(t){var e=ge(this._instance);e?e(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}kc(t){var e=this._instance.__pending_remote_config_callbacks;if(e)e.push(t);else{var i=[t];this._instance.__pending_remote_config_callbacks=i;try{this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),batchKey:"remote_config",fireCallbackOnDrop:!0,callback:t=>{this._instance.__pending_remote_config_callbacks=void 0,i.forEach(e=>e(t))}})}catch(t){throw this._instance.__pending_remote_config_callbacks=void 0,t}}}load(){try{if(this.remoteConfig)return sn.info("Using preloaded remote config",this.remoteConfig),void this.Sc(this.remoteConfig);if(this._instance._shouldDisableFlags())return void sn.warn("Remote config is disabled. Falling back to local config.");if(!this._instance.config.opt_in_site_apps)return void this.kc(t=>{this.Sc(t.json,t)});this.wc(t=>{if(!t)return sn.info("No config found after loading remote JS config. Falling back to JSON."),void this.kc(t=>{this.Sc(t.json,t)});this.Sc(t)})}catch(t){sn.error("Error loading remote config",t),this.Sc()}}Sc(t,e){!t&&e&&(0===e.statusCode?e.error||sn.warn("Failed to fetch remote config from PostHog."):sn.error("Failed to fetch remote config from PostHog."));try{this._instance.Sc(t?{ok:!0,config:t}:{ok:!1})}catch(t){sn.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){sn.error("Error loading feature flags",t)}}},on=["fatal","error","warning","log","info","debug"],an=Uint8Array,hn=Uint16Array,ln=Uint32Array,un=new an([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]),dn=new an([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]),vn=new an([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cn=function(t,e){for(var i=new hn(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new ln(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},_n=cn(un,2),pn=_n[1];_n[0][28]=258,pn[258]=28;for(var fn=cn(dn,0)[1],gn=new hn(32768),mn=0;32768>mn;++mn){var bn=(43690&mn)>>>1|(21845&mn)<<1;gn[mn]=((65280&(bn=(61680&(bn=(52428&bn)>>>2|(13107&bn)<<2))>>>4|(3855&bn)<<4))>>>8|(255&bn)<<8)>>>1}var yn=function(t,e,i){for(var r=t.length,s=0,n=new hn(e);r>s;++s)++n[t[s]-1];var o,a=new hn(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new hn(1<<e);var h=15-e;for(s=0;r>s;++s)if(t[s])for(var l=s<<4|t[s],u=e-t[s],d=a[t[s]-1]++<<u,v=d|(1<<u)-1;v>=d;++d)o[gn[d]>>>h]=l}else for(o=new hn(r),s=0;r>s;++s)o[s]=gn[a[t[s]-1]++]>>>15-t[s];return o},wn=new an(288);for(mn=0;144>mn;++mn)wn[mn]=8;for(mn=144;256>mn;++mn)wn[mn]=9;for(mn=256;280>mn;++mn)wn[mn]=7;for(mn=280;288>mn;++mn)wn[mn]=8;var $n=new an(32);for(mn=0;32>mn;++mn)$n[mn]=5;var Sn=/*#__PURE__*/yn(wn,9,0),xn=/*#__PURE__*/yn($n,5,0),En=function(t){return(t/8|0)+(7&t&&1)},Tn=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof hn?hn:t instanceof ln?ln:an)(i-e);return r.set(t.subarray(e,i)),r},kn=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},In=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Pn=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var s=i.length,n=i.slice();if(!s)return[new an(0),0];if(1==s){var o=new an(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],h=i[1],l=0,u=1,d=2;for(i[0]={s:-1,f:a.f+h.f,l:a,r:h};u!=s-1;)a=i[i[d].f>i[l].f?l++:d++],h=i[l!=u&&i[d].f>i[l].f?l++:d++],i[u++]={s:-1,f:a.f+h.f,l:a,r:h};var v=n[0].s;for(r=1;s>r;++r)n[r].s>v&&(v=n[r].s);var c=new hn(v+1),_=Rn(i[u-1],c,0);if(_>e){r=0;var p=0,f=_-e,g=1<<f;for(n.sort(function(t,e){return c[e.s]-c[t.s]||t.f-e.f});s>r;++r){var m=n[r].s;if(e>=c[m])break;p+=g-(1<<_-c[m]),c[m]=e}for(p>>>=f;p>0;){var b=n[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var y=n[r].s;c[y]==e&&(--c[y],++p)}_=e}return[new an(c),_]},Rn=function(t,e,i){return-1==t.s?Math.max(Rn(t.l,e,i+1),Rn(t.r,e,i+1)):e[t.s]=i},On=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new hn(++e),r=0,s=t[0],n=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==s&&a!=e)++n;else{if(!s&&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(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=t[a]}return[i.subarray(0,r),e]},Cn=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},An=function(t,e,i){var r=i.length,s=En(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var n=0;r>n;++n)t[s+n+4]=i[n];return 8*(s+4+r)},Mn=function(t,e,i,r,s,n,o,a,h,l,u){kn(e,u++,i),++s[256];for(var d=Pn(s,15),v=d[0],c=d[1],_=Pn(n,15),p=_[0],f=_[1],g=On(v),m=g[0],b=g[1],y=On(p),w=y[0],S=y[1],x=new hn(19),E=0;m.length>E;++E)x[31&m[E]]++;for(E=0;w.length>E;++E)x[31&w[E]]++;for(var T=Pn(x,7),k=T[0],I=T[1],P=19;P>4&&!k[vn[P-1]];--P);var R,O,C,A,M=l+5<<3,N=Cn(s,wn)+Cn(n,$n)+o,D=Cn(s,v)+Cn(n,p)+o+14+3*P+Cn(x,k)+(2*x[16]+3*x[17]+7*x[18]);if(N>=M&&D>=M)return An(e,u,t.subarray(h,h+l));if(kn(e,u,1+(N>D)),u+=2,N>D){R=yn(v,c,0),O=v,C=yn(p,f,0),A=p;var F=yn(k,I,0);for(kn(e,u,b-257),kn(e,u+5,S-1),kn(e,u+10,P-4),u+=14,E=0;P>E;++E)kn(e,u+3*E,k[vn[E]]);u+=3*P;for(var B=[m,w],U=0;2>U;++U){var j=B[U];for(E=0;j.length>E;++E)kn(e,u,F[L=31&j[E]]),u+=k[L],L>15&&(kn(e,u,j[E]>>>5&127),u+=j[E]>>>12)}}else R=Sn,O=wn,C=xn,A=$n;for(E=0;a>E;++E)if(r[E]>255){var L;In(e,u,R[257+(L=r[E]>>>18&31)]),u+=O[L+257],L>7&&(kn(e,u,r[E]>>>23&31),u+=un[L]);var z=31&r[E];In(e,u,C[z]),u+=A[z],z>3&&(In(e,u,r[E]>>>5&8191),u+=dn[z])}else In(e,u,R[r[E]]),u+=O[r[E]];return In(e,u,R[256]),u+O[256]},Nn=/*#__PURE__*/new ln([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Dn=/*#__PURE__*/new an(0),Fn=/*#__PURE__*/function(){for(var t=new ln(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Bn=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Un(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Fn[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var s,n,o,a,h,l,u=(a=10+((s=e).filename&&s.filename.length+1||0),h=8,function(t,e,i,r,s,n){var o=t.length,a=new an(r+o+5*(1+Math.floor(o/7e3))+s),h=a.subarray(r,a.length-s),l=0;if(!e||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=An(h,l,t.subarray(u,d)):(h[u]=n,l=An(h,l,t.subarray(u,o)))}else{for(var v=Nn[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new hn(32768),g=new hn(p+1),m=Math.ceil(i/3),b=2*m,y=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<b)&p},w=new ln(25e3),S=new hn(288),x=new hn(32),E=0,T=0,k=(u=0,0),I=0,P=0;o>u;++u){var R=y(u),O=32767&u,C=g[R];if(f[O]=C,g[R]=O,u>=I){var A=o-u;if((E>7e3||k>24576)&&A>423){l=Mn(t,h,0,w,S,x,T,k,P,u-P,l),k=E=T=0,P=u;for(var M=0;286>M;++M)S[M]=0;for(M=0;30>M;++M)x[M]=0}var N=2,D=0,F=_,B=O-C&32767;if(A>2&&R==y(u-B))for(var U=Math.min(c,A)-1,j=Math.min(32767,u),L=Math.min(258,A);j>=B&&--F&&O!=C;){if(t[u+N]==t[u+N-B]){for(var z=0;L>z&&t[u+z]==t[u+z-B];++z);if(z>N){if(N=z,D=B,z>U)break;var q=Math.min(B,z-2),W=0;for(M=0;q>M;++M){var H=u-B+M+32768&32767,G=H-f[H]+32768&32767;G>W&&(W=G,C=H)}}}B+=(O=C)-(C=f[O])+32768&32767}if(D){w[k++]=268435456|pn[N]<<18|fn[D];var V=31&pn[N],J=31&fn[D];T+=un[V]+dn[J],++S[257+V],++x[J],I=u+N,++E}else w[k++]=t[u],++S[t[u]]}}l=Mn(t,h,n,w,S,x,T,k,P,u-P,l),n||(l=An(h,l,Dn))}return Tn(a,0,r+En(l)+s)}(n=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a,h,!l)),d=u.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Bn(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(u,e),Bn(u,d-8,i.d()),Bn(u,d-4,r),u}var jn=!!d||!!u,Ln=/* @__PURE__ */new WeakMap,zn="text/plain",qn=0,Wn=!1,Hn=(t,e)=>{var i=t.split("#"),r=i[1],s=i[0].split("?"),n=s[0],o=s[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return n+(a?"?"+a:"")+(r?"#"+r:"")},Gn=function(t,e,r){var s;void 0===r&&(r=!0);var n=t.split("?"),o=n[0],a=n[1],h=i({},e),l=null!==(s=null==a?void 0:a.split("&").map(t=>{var e,i=t.split("="),s=i[0],n=r&&null!==(e=h[s])&&void 0!==e?e:i[1];return delete h[s],s+"="+n}))&&void 0!==s?s:[],u=function(t,e){var i,r;void 0===e&&(e="&");var s=[];return vr(t,function(t,e){C(t)||C(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),s[s.length]=r+"="+i)}),s.join(e)}(h);return u&&l.push(u),l.length>0?o+"?"+l.join("&"):o},Vn=t=>{if(t.pr)return t.pr;var e=t.data,i=t.compression;if(e){if(i===Us.GZipJS){var r=Un(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new an(t.length+(t.length>>>1)),r=0,s=function(t){i[r++]=t},n=0;e>n;++n){if(r+5>i.length){var o=new an(r+8+(e-n<<1));o.set(i),i=o}var a=t.charCodeAt(n);128>a?s(a):2048>a?(s(192|a>>>6),s(128|63&a)):a>55295&&57344>a?(s(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++n))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return Tn(i,0,r)}(ds(e)),{mtime:0});return{contentType:zn,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Us.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(ds(e)),n="sendBeacon"===t.transport,o=n?s:(t=>"data="+encodeURIComponent("string"==typeof t?t:ds(t)))(s);return{contentType:n?zn:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=ds(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Jn=t=>{var e,r,s=()=>"sendBeacon"===t.transport?{url:Gn(t.url,{compression:Us.Base64}),encodedBody:Vn(i({},t,{compression:Us.Base64,pr:void 0}))}:{url:Hn(t.url,"compression"),encodedBody:Vn(i({},t,{compression:void 0,pr:void 0}))};try{e=Vn(t)}catch(e){if(se(t.compression,vs(t.url,"compression")))return ce.error("Failed to gzip request body, sending uncompressed payload",e),s();throw e}return e&&se(t.compression,vs(t.url,"compression"))&&!((r=e.body)instanceof ArrayBuffer?re(new Uint8Array(r)):ArrayBuffer.isView(r)&&re(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Wn=!0,s()):{url:t.url,encodedBody:e}},Kn=t=>{try{return Jn(t)}catch(e){return ce.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Yn=/*#__PURE__*/function(){var t=s(function*(t){var e=yield function(t,e,i){return ue.apply(this,arguments)}(ds(t.data),Ee.DEBUG,{rethrow:!0});if(!e)return t;var r=yield e.arrayBuffer();return i({},t,{pr:{contentType:zn,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}}(),Xn=t=>Qt("AbortError","PostHog request timed out"+(t?" after "+t+"ms":"")),Qn=/Failed to fetch|NetworkError|Load failed/i,Zn=t=>"TypeError"===(null==t?void 0:t.name)&&Qn.test((null==t?void 0:t.message)||""),to=t=>{try{var e=function(t,e,i){if(void 0===e&&(e=Date.now()),void 0===i&&(i=3e5),"string"==typeof t&&t){var r=t.trim(),s=/^\d+\s*,/.test(r)?r.slice(0,r.indexOf(",")).trim():r;if(/^\d+$/.test(s)){var n=1e3*Math.min(Number(s),i/1e3);return n>0?n:void 0}if(/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(s)){var o=/^\w{3} \w{3} /.test(s)?s+" GMT":s,a=Date.parse(o)-e;if(Number.isFinite(a)&&a>0)return Math.min(a,i)}}}(t());return C(e)?void 0:Math.min(e,3e4)}catch(t){return}},eo=t=>{var e=Kn(t);if(e){var i=new d;Ln.set(i,!0);var r=e.url,s=e.encodedBody;i.open(t.method||"GET",r,!0);var n=null!=s?s:{},o=n.contentType,a=n.body;vr(t.headers,function(t,e){i.setRequestHeader(e,t)}),o&&i.setRequestHeader("Content-Type",o),t.timeout&&(i.timeout=t.timeout);var h=!1;i.ontimeout=()=>{h=!0},i.onloadend=()=>{if(h){var e=Xn(t.timeout);return ce.warn(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}var r={statusCode:i.status,text:i.responseText};if(200===i.status)try{r.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(r,to(()=>i.getResponseHeader("Retry-After")))},null==t.onSend||t.onSend(r),i.send(a)}},io=t=>{var e=Kn(t);if(e){var r=e.url,s=e.encodedBody,n=null!=s?s:{},o=n.contentType,a=n.body,h=n.estimatedSize,l=new Headers;vr(t.headers,function(t,e){l.append(e,t)}),o&&l.append("Content-Type",o);var d=null,c=!1;if(v){var _=new v;d={signal:_.signal,timeout:setTimeout(()=>{c=!0;try{_.abort(Xn(t.timeout))}catch(t){f(t)}},t.timeout)}}var p=!1,f=e=>{p||(p=!0,c&&"AbortError"===(null==e?void 0:e.name)||Zn(e)?ce.warn(e):ce.error(e),null==t.callback||t.callback({statusCode:0,error:e}))},g=0,m=()=>{qn-=g,g=0,d&&clearTimeout(d.timeout)};try{var b,y=i({method:(null==t?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:a,signal:null==(b=d)?void 0:b.signal},t.fetchOptions);null==t.onSend||t.onSend(r);var w=null!=h?h:C(a)?0:void 0;y.keepalive="POST"===y.method&&!t.Ha&&!1!==y.keepalive&&y.body===a&&!C(w)&&w>=0&&52428.8>qn+w,y.keepalive&&(qn+=g=w),u(r,y).then(e=>e.text().then(i=>{if(!p){var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ce.error(t)}p=!0,m(),null==t.callback||t.callback(r,to(()=>e.headers.get("Retry-After")))}})).catch(t=>{m(),f(t)}).finally(m)}catch(t){m(),f(t)}}},ro=t=>{try{var e,r=Jn(t),s=r.url,n=r.encodedBody,o=null!=n?n:{},h=o.body,l=o.estimatedSize;if(!h)return;var d=h instanceof Blob?h:new Blob([h],{type:o.contentType});if(a.sendBeacon(s,d))return;var v=I(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(I(v)&&v.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(v.length/2),_=e=>I(t.data)?e:i({},t.data,{batch:e});return ro(i({},t,{data:_(v.slice(0,c))})),void ro(i({},t,{data:_(v.slice(c))}))}ce.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(u?"fetch":"XHR")),u?io(i({},t,{Ha:!0})):eo(t)}catch(t){ce.warn("Beacon send failed",t)}},so=(t,e,r,s)=>{var n="query"===s?"POST"===e?"sent_at":"_":void 0;return Gn(r===Us.GZipJS?Hn(t,"compression"):t,i({},n?{[n]:Date.now().toString()}:{},r===Us.GZipJS?{}:{compression:r}))},no=/* @__PURE__ */(()=>{var t=[];return u&&t.push({transport:"fetch",method:io}),d&&t.push({transport:"XHR",method:eo}),null!=a&&a.sendBeacon&&t.push({transport:"sendBeacon",method:ro}),t})(),oo=!jn&&-1===(null==_?void 0:_.indexOf("MSIE"))&&-1===(null==_?void 0:_.indexOf("Mozilla"));function ao(t,e,r){var s;r&&(e=i({},e,{callback:t=>r(t)})),t.__loaded?oo?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=i({},t.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(s=t.compression)&&void 0!==s?s:e.compressionFallback:e.compression,(C(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,null==e.onDispatch||e.onDispatch(),((t,e)=>{var r,s,n,o=i({},t,{callback:null!=e?e:e=>null==t.callback?void 0:t.callback(e)});o.timeout=o.timeout||6e4;var a,h,l,u,d,v=null!==(r=o.transport)&&void 0!==r?r:"fetch";"sendBeacon"===v&&C(o.compression)&&o.data&&(o.compression=Us.Base64),"POST"===o.method&&o.data&&("capture-body"===o.timestampMode?o.data={api_key:null!==(h=null==(d=(u=(I(a=o.data)?a:[a]).map(t=>i({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(l=d.properties)?void 0:l.token)&&void 0!==h?h:null==d?void 0:d.token,batch:u,sent_at:/* @__PURE__ */(new Date).toISOString()}:"body"===o.timestampMode&&(o.data=function(t,e){return void 0===e&&(e=/* @__PURE__ */(new Date).toISOString()),I(t)?t.map(t=>i({},t,{sent_at:e})):i({},t,{sent_at:e})}(o.data))),o.url=so(o.url,o.method,o.compression,o.timestampMode);var _=no.filter(t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport)),p=null!==(s=null==(n=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(_,t=>t.transport===v))?void 0:n.method)&&void 0!==s?s:_[0].method;if(!p)throw new Error("No available transport method");var f=t=>{try{p(t)}catch(t){Zn(t)?ce.warn(t):ce.error(t),null==o.callback||o.callback({statusCode:0,error:t})}};"sendBeacon"!==v&&!o.preferSyncCompression&&o.data&&o.compression===Us.GZipJS&&c&&"undefined"!=typeof Promise&&!Wn?Yn(o).then(t=>{f(t)}).catch(e=>{if(ne(e))return Wn=!0,void f(i({},o,{compression:void 0,url:so(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return ne(t)||e===ie})(e)&&(Wn=!0),f(o)}):f(o)})(e,(i,s)=>{t.rateLimiter.checkForLimiting(i),400>i.statusCode||null==t.config.on_request_error||t.config.on_request_error(i),r?r(i,s):null==e.callback||e.callback(i)})):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}var ho=class{constructor(t,e){this.$c=!0,this.Cc=[],this.Tc=K((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,ce.createLogger("flush interval"),3e3),this.Mc=t}enqueue(t){this.Cc.push(t),this.Ic||this.Ec()}unload(){this.Ac();var t=this.Cc.length>0?this.Rc():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Pc(i({},t,{callback:void 0}),"sendBeacon")})}enable(){this.$c=!1,this.Ec()}Ec(){this.$c||(this.Ic=setTimeout(()=>{this.Ac(),this.Oc()},this.Tc))}Oc(){if(this.Cc.length>0){var t=this.Rc();for(var e in t)this.Pc(t[e])}}Pc(t,e){try{this.Mc(t,e)}catch(t){ce.error(t)}}Ac(){clearTimeout(this.Ic),this.Ic=void 0}Rc(){var t={},e={};vr(this.Cc,r=>{var s,n=r,o=((n?n.batchKey:null)||n.url)+(n.batchGroup?":"+n.batchGroup:"");C(t[o])&&(t[o]=i({},n,{data:[],callback:void 0,fireCallbackOnDrop:void 0}),e[o]=[]),null==(s=t[o].data)||s.push(n.data),n.callback&&e[o].push(n.callback)});var r=function(){var i=e[s];i.length&&(t[s].callback=t=>{for(var e of i)e(t)})};for(var s in e)r();return this.Cc=[],t}},lo=class{constructor(t){this._instance=t,this.Fc=!1,this.Lc=3e3,this.Cc=[],this.Cc=[],this.Dc=!0,this.resume()}resume(){if(!C(n)&&"onLine"in n.navigator){if(this.Dc=n.navigator.onLine,this.Nc)return;this.Nc=()=>{this.Dc=!0,this.Oc()},this.jc=()=>{this.Dc=!1},br(n,"online",this.Nc),br(n,"offline",this.jc)}}get length(){return this.Cc.length}retriableRequest(t,r){var s=t.retriesPerformedSoFar,n=function(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}(t,e);B(s)&&(n.url=Gn(n.url,{retry_count:s})),ao(this._instance,r?i({},n,{transport:r}):n,(t,e)=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=s?s:0))return void this.js(i({retriesPerformedSoFar:s},n),e);0===t.statusCode&&ce.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=s?s:0)+" retries.")}null==n.callback||n.callback(t)})}js(t,e){var i=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=i+1;var r=Math.max(function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),s=(Math.random()-.5)*(r-i);return Math.ceil(r+s)}(i),null!=e?e:0),s=Date.now()+r;this.Cc.push({retryAt:s,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ce.warn(n),this.Fc||(this.Fc=!0,this.qc())}qc(){if(this.Bc&&clearTimeout(this.Bc),0===this.Cc.length)return this.Fc=!1,void(this.Bc=void 0);this.Bc=setTimeout(()=>{this.Dc&&this.Cc.length>0&&this.Oc(),this.qc()},this.Lc)}Oc(){var t=Date.now(),e=[],i=this.Cc.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.Cc=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Bc&&(clearTimeout(this.Bc),this.Bc=void 0),this.Fc=!1,C(n)||(this.Nc&&(n.removeEventListener("online",this.Nc),this.Nc=void 0),this.jc&&(n.removeEventListener("offline",this.jc),this.jc=void 0)),this.Cc)){var e=t.requestOptions;try{this._instance._send_request(i({},e,{callback:I(e.data)?void 0:e.callback,transport:"sendBeacon"}))}catch(t){ce.error(t)}}this.Cc=[]}},uo=class{constructor(t){this._instance=t,this.zc=()=>{var t,e,i,r;this.Hc||(this.Hc={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),h=(null==s?void 0:s.scrollHeight)||0;this.Hc.lastScrollY=Math.ceil(n),this.Hc.maxScrollY=Math.max(n,null!==(t=this.Hc.maxScrollY)&&void 0!==t?t:0),this.Hc.maxScrollHeight=Math.max(o,null!==(e=this.Hc.maxScrollHeight)&&void 0!==e?e:0),this.Hc.lastContentY=a,this.Hc.maxContentY=Math.max(a,null!==(i=this.Hc.maxContentY)&&void 0!==i?i:0),this.Hc.maxContentHeight=Math.max(h,null!==(r=this.Hc.maxContentHeight)&&void 0!==r?r:0)}}get Uc(){return this._instance.config.scroll_root_selector}getContext(){return this.Hc}resetContext(){var t=this.Hc;return this.Hc=void 0,setTimeout(this.zc,0),t}startMeasuringScrollPosition(){br(n,"scroll",this.zc,{capture:!0}),br(n,"scrollend",this.zc,{capture:!0}),br(n,"resize",this.zc)}scrollElement(){var t;if(!this.Uc)return null==n||null==(t=n.document)?void 0:t.documentElement;for(var e of I(this.Uc)?this.Uc:[this.Uc]){var i,r=null==n||null==(i=n.document)?void 0:i.querySelector(e);if(r)return r}}Wc(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.Uc){var s=this.scrollElement();return s&&s[r]||0}return n?"y"===t?n.scrollY||n.pageYOffset||(null==(e=n.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:n.scrollX||n.pageXOffset||(null==(i=n.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Wc("y")}scrollX(){return this.Wc("x")}},vo=t=>Ss(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes),co=class{constructor(t,e,i,r){this.ze=t=>{var e=this.Vc();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Gc(this._instance)};this.Qc.register({[Fi]:i})}},this._instance=t,this.Jc=e,this.Qc=i,this.Gc=r||vo,this.Jc.onSessionId(this.ze)}Vc(){return this.Qc.props[Fi]}getSetOnceProps(){var t,e=null==(t=this.Vc())?void 0:t.props;return e?"r"in e?xs(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return vr(pr(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+x(i)]=e}),t}},_o=class{on(t,e){return this.jo[t]||(this.jo[t]=[]),this.jo[t].push(e),()=>{this.jo[t]=this.jo[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.jo[t]||[])i(e);for(var r of this.jo["*"]||[])r(t,e)}constructor(){this.jo={}}},po=_e("[SessionId]"),fo=864e5,go=class{on(t,e){return this.Zc.on(t,e)}constructor(t,e,i){var r;if(this.Kc=null,this.Yc=null,this.Xc=[],this.eh=void 0,this.ih=!1,this.Zc=new _o,this.nh=(t,e)=>!(!B(t)||!B(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Br=t.config,this.Qc=t.persistence,this.Ue=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.sh=void 0,this._sessionActivityTimestamp=null,this.rh=e||kr,this.oh=i||kr;var s=this.Br.persistence_name||this.Br.token;if(this._sessionTimeoutMs=1e3*K(this.Br.session_idle_timeout_seconds||1800,60,36e3,po.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ah(),this.uh="ph_"+s+"_window_id",this.hh="ph_"+s+"_primary_window_exists",this.dh()){var n=Jr.Pt(this.uh),o=Jr.Pt(this.hh);n&&!o?this.Ue=n:Jr.Ft(this.uh),Jr.$t(this.hh,!0)}null!=(r=this.Br.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.Br.bootstrap.sessionID),this.fh()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return C(this.Xc)&&(this.Xc=[]),this.Xc.push(t),this.Xt&&t(this.Xt,this.Ue),()=>{this.Xc=this.Xc.filter(e=>e!==t)}}dh(){return"memory"!==this.Br.persistence&&!this.Qc.gi&&Jr.Ot()}ph(t){t!==this.Ue&&(this.Ue=t,this.dh()&&Jr.$t(this.uh,t))}gh(){return this.Ue?this.Ue:this.dh()?Jr.Pt(this.uh):null}mh(t){var e=this.Kc;return!N(e)&&!N(t)&&5e3>Math.abs(t-e)}yh(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.mh(e)||(this.Kc=e,this.Qc.register({[wi]:[e,t,i]}))}bh(){var t,e=null==(t=this.Br)?void 0:t.persistence_save_debounce_ms;return B(e)&&e>0}_h(){this.bh()?this.Qc.refreshKey(wi):(this.Qc.flush(),this.Qc.load())}wh(){var t;if(!N(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Kc){this._h();var e=this.kh();e[1]===this.Xt&&e[2]===this._sessionStartTimestamp&&(this.Kc=this._sessionActivityTimestamp,this.Qc.register({[wi]:[this._sessionActivityTimestamp,null!==(t=this.Xt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Qc.flush())}}Sh(){var t=this.kh()[0],e=B(t)?t:0,i=B(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}xh(t){return this._h(),this.nh(t,this.Sh())}kh(){var t=this.Qc.props[wi];return I(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Kc=null,this.sh=void 0,clearTimeout(this.$h),this.$h=void 0,this.yh(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=/* @__PURE__ */(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void po.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void po.error("Invalid sessionID in bootstrap",t)}}(t);return!C(i)&&(e?this.sh={sessionId:t,sessionStartTimestamp:i}:this.yh(t,/* @__PURE__ */(new Date).getTime(),i),!0)}destroy(){this.ih=!0,this.wh(),clearTimeout(this.$h),this.$h=void 0,this.eh&&n&&(n.removeEventListener(or,this.eh,{capture:!1}),this.eh=void 0),this.Xc=[]}fh(){this.eh=()=>{this.wh(),this.dh()&&Jr.Ft(this.hh)},br(n,or,this.eh,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this.Br.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||/* @__PURE__ */(new Date).getTime(),s=this.Xt;if(i)this.Yc=r;else if(N(this.Yc)||this.Yc>r||r-this.Yc>=1e3){var n,o;null==(n=(o=this.Qc).syncCookieProperties)||n.call(o),this.Yc=r}var a=this.kh(),h=a[1],l=a[2],u=!C(s)&&h!==s,d=this.Sh(),v=this.gh(),c=this.sh,_=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>fo),p=c?_:B(l)&&Math.abs(r-l)>fo,f=!1,g=u,m=!h||!!c,b=h,y=!m&&!t&&this.nh(r,d);if(y){(y=this.xh(r))||po.info("cross-tab refresh kept the session alive",{sessionId:h});var w=this.kh();h=w[1],l=w[2],y||(m=!h||!!c)}if(m||y||p){g=!1;var S=c&&!_;h=S?c.sessionId:this.rh(),v=this.oh(),po.info("new session ID assigned",{sessionId:h,windowId:v,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:y,sessionPastMaximumLength:p}}),l=S?c.sessionStartTimestamp:r,this.sh=void 0,f=!0}else v||(v=this.oh(),f=!0),(g=g||h!==b)&&(po.info("adopted cross-tab session id",{sessionId:h,windowId:v}),f=!0);var x=B(d)&&t&&!p?d:r,E=B(l)?l:/* @__PURE__ */(new Date).getTime();this.ph(v),this.yh(h,x,E),t||this.ah();var T={noSessionId:m,activityTimeout:y,sessionPastMaximumLength:p,crossTabAdoption:g};return f&&this.Xc.forEach(t=>t(h,v,T)),{sessionId:h,windowId:v,sessionStartTimestamp:E,changeReason:f?T:void 0,lastActivityTimestamp:d}}ah(){this.ih||(clearTimeout(this.$h),this.$h=setTimeout(()=>{if(!this.ih)if(this.xh(/* @__PURE__ */(new Date).getTime())){var t=this.Xt;this.resetSessionId(),this.Zc.emit("forcedIdleReset",{idleSessionId:t})}else this.ah()},1.1*this.sessionTimeoutMs))}},mo=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]);function bo(){return(bo=s(function*(){var t=null==a?void 0:a.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return A(i)&&i.length>0?i:void 0}catch(t){return void ce.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function yo(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function wo(t,e,i){return ds({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var $o,So="custom",xo="i.posthog.com",Eo=/^\/static\//,To=["/s/","/e/","/i/"],ko=class{constructor(t){this.Ch={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+xo,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ch[this.apiHost]||(this.Ch[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":So),this.Ch[this.apiHost]}Th(t){if(Eo.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Mh(t){var e=us(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Ih(t,e,i){if("ui"===t)return i;var r=i,s=this.instance.config.rewriteRequestPath;if(s){var n,o=(null==(n=us(i))?void 0:n.href)||i;r=s(new URL(o)).toString()}if(s&&"api"===t&&To.some(t=>0===e.indexOf(t))){var a=this.Mh(r);if(a){var h,l=this.apiHost,u=this.Eh;(null==(h=u)?void 0:h.apiHost)===l&&u.rewriteRequestPath===s||(this.Eh=u={apiHost:l,rewriteRequestPath:s,urls:/* @__PURE__ */new Set}),u.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Eh,i=this.Mh(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.Ih(t,e,this.uiHost+e);if("flags"===t)return this.Ih(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.Th(e);if(i)return this.Ih(t,e,""+i+e)}if(this.region===So)return this.Ih(t,e,this.apiHost+e);var r=xo+e;switch(t){case"assets":return this.Ih(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Ih(t,e,"https://"+this.region+"."+r)}}},Io=/* @__PURE__ */_e("[Surveys]"),Po={ignoreConditions:!1,ignoreDelay:!1,displayType:Ys.Popover},Ro=_e("[PostHog ExternalIntegrations]"),Oo={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Co=class{constructor(t){this._instance=t}Za(t,e){var i;null==(i=ge(this._instance))||i(this._instance,t,t=>{if(t)return Ro.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,s,n=i[0],o=i[1];!o||null!=(e=f.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Za(Oo[n],()=>{var e;null==(e=f.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(r=f.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[n]&&(null==(s=f.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[n])||s.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}},Ao=()=>{var t;return null!=n&&null!=(t=n.performance)&&t.now?n.performance.now():Date.now()},Mo=[],No=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4],Do=[5,10,25,...No],Fo=class{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var s=null==e?void 0:e.get_property(r);C(s)||(i[r]=s)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}},Bo=class{constructor(t){this.instance=t,this.R=ce,this.kv=new Fo(t),this.onSession=t=>Xs(this.instance.onSessionId(e=>{try{t(e)}catch(t){this.R.error("Browser extension session listener failed",t)}})),this.onEvent=t=>Xs(this.instance._addCaptureHook((e,i)=>{if(i)try{t({event:e,properties:i.properties})}catch(t){this.R.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{var e=e=>{try{t(e)}catch(t){this.R.error("Browser extension remote config listener failed",t)}},i=this.instance.mr.on("extensionsRemoteConfig",e);return this.instance.gr&&e(this.instance.gr),Xs(i)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(Ye);return"string"==typeof t?t:void 0}get library(){return{name:Ee.LIB_NAME,version:Ee.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,s,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0,lastActivityTimestamp:null!==(s=null==n?void 0:n.lastActivityTimestamp)&&void 0!==s?s:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return P(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!(null==(t=this.instance.rateLimiter)||!t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){var e;switch(t){case"featureFlags":case"featureFlagsCommon":e=this.instance.featureFlags;break;case"logs":e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case"autocapture":e=this.instance.autocapture}return e}capture(t,e,r){if(!r)return this.yr(this.instance.capture(t,e));var s=i({timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce},"unload"===r.delivery?{transport:"sendBeacon",send_instantly:!0}:{});return this.yr(this.instance.capture(t,e,s))}yr(t){var e;return!C(t)||!(null!=(e=this.instance.rateLimiter)&&e.lastEventRateLimited)}registerDynamicEventProperties(t){return Xs(this.instance.br(t))}sendRequest(t,e){var i=this;return s(function*(){var r;void 0===e&&(e={});var s=null!==(r=e.target)&&void 0!==r?r:"api",o=e.query?Gn(t,e.query):t,a=i.instance.requestRouter.endpointFor(s,o),h={method:e.method,url:a,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?b.Base64:void 0,timestampMode:e.sentAt};return"api"===s&&"/i/v1/logs"===t&&(h.batchKey="logs"),"sendBeacon"===e.transport?(i.instance._send_request(h),{statusCode:202}):new Promise(t=>{var e,r,o;h.callback=t,"flags"===s&&null!=(e=i.instance.config.metrics)&&e.flags&&(h.onDispatch=()=>{r=Ao()},h.onSend=t=>{o=(t=>{try{return(t=>{var e,i=null==n?void 0:n.PerformanceObserver,r=null==(e=us(t))?void 0:e.href;if(i&&r){var s,o,a,h=Ao(),l={name:r,before:1/0,inFlight:!0},u=1/0,d=!1,v=()=>{d||(d=!0,clearTimeout(a),p.disconnect(),Mo.splice(Mo.indexOf(l),1))},c=!1,_=t=>{for(var e of t){var i=e.startTime;e.name!==r||(c?h>=i:h>i)||i>=l.before||s&&i>=s.startTime||(s=e)}if(s&&o&&u>=s.startTime){var n=o;v(),n(s)}},p=new i(t=>_(t.getEntriesByName(r,"resource")));for(var f of(p.observe({entryTypes:["resource"]}),Mo))f.name===r&&(f.before=Math.min(f.before,h),c=c||f.inFlight);return Mo.push(l),{take(t,e){d||(u=t,l.inFlight=!1,o=e,a=setTimeout(v,5e3),P(p.takeRecords)&&_(p.takeRecords()))},stop:v}}})(t)}catch(t){return}})(t)},h.callback=e=>{var s;if(t(e),!C(r)){var n=r,h=Ao();try{var l=((t,e)=>{var i,r,s=e.statusCode||void 0,n={"server.address":(null!==(i=null==(r=us(t))?void 0:r.hostname)&&void 0!==i?i:t).replace(/^\[(.*)\]$/,"$1")};s&&(n["http.response.status_code"]=s);var o=((t,e)=>t?400>t?void 0:String(t):"AbortError"===(null==e?void 0:e.name)?"timeout":"_OTHER")(s,e.error);o&&(n["error.type"]=o);var a=ls();return a&&(n["client.timezone"]=a),n})(a,e);if(i.wr("posthog.flags.request.duration",h-n,No,l),e.statusCode&&o)return void o.take(h,t=>i.kr(t,n,h,l))}catch(t){ce.error("Failed to record the /flags request timing",t)}null==(s=o)||s.stop()}}),i.instance._send_request(h)})})()}kr(t,e,i,r){if(t.responseEnd>=t.startTime)try{var s=Math.min(t.responseEnd,i);this.wr("posthog.flags.request.pre_send_duration",t.startTime-e,Do,r),this.wr("posthog.flags.request.network_duration",s-t.startTime,No,r),this.wr("posthog.flags.request.main_thread_duration",i-s,Do,r)}catch(t){ce.error("Failed to record the /flags request timing split",t)}}wr(t,e,r,s){var n;null==(n=this.instance.metrics)||n.histogram(t,e,{unit:"ms",attributes:i({},s),bounds:r})}},Uo={},jo=0,Lo=()=>{},zo='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',qo="Surveys module not available",Wo="sanitize_properties is deprecated. Use before_send instead",Ho="Invalid value for property_denylist config: ",Go=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],Vo=["$feature_flag_called","$$heatmap","$snapshot"],Jo=t=>"$"===t.charAt(0)&&!S(Vo,t),Ko=/^[A-Za-z0-9_-]{1,400}$/,Yo=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Xo=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,Qo=["token","distinct_id",Wi],Zo="posthog",ta=[...mo].sort()[mo.length-1],ea=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},ia=t=>{var e;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:mr(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Lo,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:l&&A(null==l?void 0:l.search)&&-1!==l.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==n||null==(e=n.location)?void 0:e.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,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(t){ce.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:nr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Lo},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Xr,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:ea(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(t))},ra=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],sa=t=>{var e={};for(var i of ra){var r=i[0],s=i[1];C(t[r])||(e[s]=t[r])}var n=cr({},e,t),o=t.__preview_external_dependency_versioned_paths;return C(o)||(C(t.strict_script_versioning)&&(n.strict_script_versioning=!!o),A(o)&&C(t.asset_host)&&(n.asset_host=o)),I(t.property_blacklist)&&(C(t.property_denylist)?n.property_denylist=t.property_blacklist:I(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ce.error(Ho+t.property_denylist)),n},na=class{constructor(){this.__forceAllowLocalhost=!1}get Ah(){return this.__forceAllowLocalhost}set Ah(t){ce.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},oa=(t=class t{Rh(t){if(t){var e=this.Ph.indexOf(t);-1!==e&&this.Ph.splice(e,1)}}Oh(t,e){return this.Rh(t),this.Ph.push(e),null==e.initialize||e.initialize(),e}Fh(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Lh(){if(!this.Dh&&this.Nh&&"capture_pageview"in this.Nh&&!i({},t.__defaultExtensionClasses,this.config.__extensionClasses).historyAutocapture){var e=this.config.capture_pageview;("history_change"===e||R(e)&&(e.path||e.search||e.hash&&!this.config.disable_capture_url_hashes))&&(this.Dh=!0,ce.warn("capture_pageview is set to capture history changes, but the history autocapture extension is not loaded, so only the first pageview of each page load is captured. With the slim bundle, pass __extensionClasses: { historyAutocapture: AnalyticsExtensions.historyAutocapture } from 'posthog-js/dist/extension-bundles', or set capture_pageview: true to capture page loads only."))}}jh(){if(!(this.qh||this.config.reuseAnonymousId||this.config.segment||this.Fh())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Bh||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.qh=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}zh(){var t=this.persistence;if(t&&!this.Hh)if(this.Fh())"on_reject"===this.config.cookieless_mode&&"$posthog_cookieless"!==this.get_distinct_id()&&(this.Uh(),this.Wh());else if("$posthog_cookieless"===this.get_distinct_id()){this.Vh()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(kr());this.register({distinct_id:i,$device_id:i}),t.set_property(Di,rr)}this.Uh()}}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var e;this.Gh=!1,this.Qh=!1,this.Jh=!1,this.webPerformance=new na,this.Zh=!1,this.version=Ee.LIB_VERSION,this.__loadExternalDependency=de,this.Kh=/* @__PURE__ */new Set,this.Yh="",this.mr=new _o,this.Ph=[],this.Xh=[],this.ed=!1,this.Bh=!1,this.qh=!1,this.Dh=!1,this.Hh=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ia(),this.SentryIntegration=rs,this.sentryIntegration=t=>function(t,e){var i=is(t,e);return{name:es,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.nd=!1,this.sd=null,this.rd=null,this.od=null,this.scrollManager=new uo(this),this.pageViewManager=new ss(this),this.rateLimiter=new rn(this),this.requestRouter=new ko(this),this.consent=new Kr(this),this.externalIntegrations=new Co(this);var i=null!==(e=t.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(t,e,i)=>{var r=A(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=A(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>ce.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==Zo){var s,n=null!==(s=Uo[r])&&void 0!==s?s:new t;return n._init(e,i,r),Uo[r]=n,Uo[Zo][r]=n,n}return this._init(e,i,r)}_init(t,e,r){var s,o,a;void 0===e&&(e={});var h,l=A(t)?t.trim():"";if(!l)return ce.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 l!==(null==(h=this.config)?void 0:h.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+l+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ia(e.defaults),e.debug=this.ld(e.debug),this.Nh=e,this.ad=[],e.person_profiles?this.rd=e.person_profiles:e.process_person&&(this.rd=e.process_person);var u=ia(e.defaults),d=sa(e),v=cr({},u,d,{name:r,token:l});R(u.rageclick)&&R(d.rageclick)&&(v.rageclick=cr({},u.rageclick,d.rageclick)),R(u.session_recording)&&R(d.session_recording)&&(v.session_recording=cr({},u.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&ce.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Us.GZipJS;var c=this.Vh(),_=!this.Fh();if(this.persistence=new Bs(this.config,c,!0,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Bs(i({},this.config,{persistence:"sessionStorage"}),c,!1,_),this.Yh="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&Jr.Ot()){var p=Jr.Pt(this.Yh);I(p)&&p.forEach(t=>{A(t)&&this.Kh.add(t)})}else Jr.Ft(this.Yh);var f=i({},this.persistence.props),g=i({},this.sessionPersistence.props);this.register({$initialization_time:/* @__PURE__ */(new Date).toISOString()}),this.ud=new ho((t,e)=>this.hd(t,e),this.config.request_queue_config),this.dd=new lo(this),this.__request_queue=[];var m=this.Fh();m||(this.sessionManager=new go(this),this.sessionPropsManager=new co(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.vd()})),this.fd(),this.config.__preview_deferred_init_extensions?(ce.info("Deferring extension initialization to improve startup performance"),this.pd=setTimeout(()=>{this.pd=void 0,this.gd(m)},0)):(ce.info("Initializing extensions synchronously"),this.gd(m)),Ee.DEBUG=Ee.DEBUG||this.config.debug,Ee.DEBUG&&ce.info("Starting in debug mode",{this:this,config:e,thisC:i({},this.config),p:f,s:g}),!this.config.identity_distinct_id||null!=(s=e.bootstrap)&&s.distinctID||(e.bootstrap=i({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var b=null==(o=e.bootstrap)?void 0:o.distinctID;if(this.Bh=!!b&&!M(b),null!=(a=e.bootstrap)&&a.distinctID){var y=e.bootstrap.distinctID,w=this.get_distinct_id(),S=this.persistence.get_property(Di);if(e.bootstrap.isIdentifiedID&&null!=w&&w!==y&&"anonymous"===S)this.identify(y);else if(e.bootstrap.isIdentifiedID&&null!=w&&w!==y&&"identified"===S)ce.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 x=this.config.get_device_id(kr()),E=e.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(Di,e.bootstrap.isIdentifiedID?sr:rr),this.register({distinct_id:y,$device_id:E})}}if(m)this.register_once({distinct_id:qi,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id(kr());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(Di,rr)}return br(n,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),br(n,"pageshow",t=>{if(this.Qh=!1,!this.Jh){var e;if(t.persisted&&this.persistence){var i=this.persistence.get_property(Ke),r=this.persistence.get_property(Di);this.persistence.load(),this.md()||i===this.persistence.get_property("distinct_id")&&r===this.persistence.get_property("$user_state")||this.yd()}null==(e=this.dd)||e.resume()}}),e.segment?ts(this,()=>this.bd()):this.bd(),P(this.config._onCapture)&&this.config._onCapture!==Lo&&(ce.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&ce.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.config.disableDeviceModel||function(){return bo.apply(this,arguments)}().then(t=>{t&&this.register({[Xe]:t})}).catch(Lo),this}_d(t){var e=t;return A(e.name)&&P(e.setup)}wd(t,e){var i=this;this._d(t)?e.push(/*#__PURE__*/s(function*(){try{yield t.setup(i.kd())}catch(e){ce.error('Failed to set up extension "'+t.name+'"',e);try{yield null==t.dispose?void 0:t.dispose()}catch(e){ce.error('Failed to dispose extension "'+t.name+'"',e)}}})):this.Ph.push(t)}fd(){var e,i,r,n,o,a,h=this,l=null!==(e=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)&&void 0!==e?e:null==(r=t.__defaultExtensionClasses)?void 0:r.featureFlags;if(l)if(this.featureFlags&&this.featureFlags instanceof l||(null==(a=this.Sd)||a.call(this),this.Sd=void 0,this.featureFlags=new l(this)),P(this.featureFlags.onReloading)&&P(this.featureFlags.setup)){if(!this.Sd){this.Sd=this.featureFlags.onReloading(()=>{this.mr.emit("featureFlagsReloading",!0)});var u=this.featureFlags;s(function*(){try{yield u.setup(h.kd())}catch(e){ce.error("Failed to set up feature flags",e);var t=h.Sd;h.Sd=void 0;try{null==t||t()}catch(t){ce.error("Failed to unsubscribe feature flag reloading",t)}try{yield u.dispose()}catch(t){ce.error("Failed to dispose feature flags",t)}}})()}}else null==(n=(o=this.featureFlags).initialize)||n.call(o)}gd(e){var r,s,n,o,a,h,l,u,d=performance.now(),v=i({},t.__defaultExtensionClasses,this.config.__extensionClasses),c=[];v.exceptions&&this.Ph.push(this.exceptions=null!==(r=this.exceptions)&&void 0!==r?r:new v.exceptions(this)),v.historyAutocapture&&this.Ph.push(this.historyAutocapture=new v.historyAutocapture(this)),this.Lh(),v.tracingHeaders&&this.Ph.push(this.tracingHeaders=new v.tracingHeaders(this)),v.siteApps&&this.Ph.push(this.siteApps=new v.siteApps(this)),v.sessionRecording&&!e&&this.Ph.push(this.sessionRecording=new v.sessionRecording(this)),v.autocapture&&this.wd(this.autocapture=new v.autocapture(this),c),v.surveys&&this.wd(this.surveys=null!==(s=this.surveys)&&void 0!==s?s:new v.surveys(this),c),v.logs&&this.wd(this.logs=null!==(n=this.logs)&&void 0!==n?n:new v.logs(this),c),v.metrics&&this.Ph.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new v.metrics(this)),v.conversations&&this.Ph.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new v.conversations(this)),v.productTours&&this.Ph.push(this.productTours=new v.productTours(this)),v.heatmaps&&this.Ph.push(this.heatmaps=new v.heatmaps(this)),v.webVitalsAutocapture&&this.Ph.push(this.webVitalsAutocapture=new v.webVitalsAutocapture(this)),v.exceptionObserver&&this.Ph.push(this.exceptionObserver=new v.exceptionObserver(this)),v.deadClicksAutocapture&&this.Ph.push(this.deadClicksAutocapture=new v.deadClicksAutocapture(this,Qr)),v.toolbar&&this.Ph.push(this.toolbar=null!==(h=this.toolbar)&&void 0!==h?h:new v.toolbar(this)),v.experiments&&this.Ph.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new v.experiments(this)),v.webMCP&&this.Ph.push(this.webMCP=null!==(u=this.webMCP)&&void 0!==u?u:new v.webMCP(this));var _=this.Ph.length>0||c.length>0;this.config.disable_scroll_properties||c.unshift(()=>{this.scrollManager.startMeasuringScrollPosition()}),this.Ph.forEach(t=>{t.initialize&&c.push(()=>{null==t.initialize||t.initialize()})}),c.push(()=>{if(this.xd){var t=this.xd;this.xd=void 0,this.Ph.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.$d(c,d,_)}$d(t,e,i){for(var r,s;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void(this.pd=setTimeout(()=>{this.pd=void 0,this.$d(t,e,i)},0));var n=t.shift();if(n)try{n()}catch(t){ce.error("Error initializing extension:",t)}}var o=Math.round(performance.now()-e);i&&o>0?this.register_for_session({[Hi]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Gi]:o}):C(null==(r=this.sessionPersistence)?void 0:r.props.$sdk_debug_extensions_init_method)&&C(null==(s=this.sessionPersistence)?void 0:s.props.$sdk_debug_extensions_init_time_ms)||(this.unregister_for_session(Hi),this.unregister_for_session(Gi)),this.config.__preview_deferred_init_extensions&&ce.info("PostHog extensions initialized ("+o+"ms)")}Sc(t){if(!h||!h.body)return ce.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Sc(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.xd=t),this.gr=t,this.compression=void 0,t.ok){var e,i=t.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=S(i.supportedCompression,Us.GZipJS)?Us.GZipJS:S(i.supportedCompression,Us.Base64)?Us.Base64:void 0),null!=(e=i.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.rd?this.rd:nr}),this.mr.emit("extensionsRemoteConfig",t),this.Ph.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}bd(){try{this.config.loaded(this)}catch(t){ce.critical("`loaded` function failed",t)}if(this.Cd(),this.config.internal_or_test_user_hostname&&null!=l&&l.hostname){var t=l.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Fh())&&this.Td()},1),this.Md=new nn(this),this.Md.load()}Cd(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.ud)||t.enable())}_dom_loaded(){this.is_capturing()&&dr(this.__request_queue,t=>this.hd(t)),this.__request_queue=[],this.Cd()}_handle_unload(){var t,e,i,r,s;this.Qh=!0,null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Id()&&this.capture(hr),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.ud)||r.unload(),null==(s=this.dd)||s.unload()):this.Id()&&this.capture(hr,null,{transport:"sendBeacon"})}_send_request(t){ao(this,t)}hd(t,e){this.dd?this.dd.retriableRequest(t,e):this._send_request(e?i({},t,{transport:e}):t)}_execute_array(t){jo++;try{var e,i=[],r=[],s=[];dr(t,t=>{if(t)if(I(e=t[0]))s.push(t);else if(P(t))try{t.call(this)}catch(e){ce.error("Error executing queued PostHog call",t,e)}else I(t)&&"alias"===e?i.push(t):I(t)&&-1!==e.indexOf("capture")&&P(this[e])?s.push(t):r.push(t)});var n=function(t,e){dr(t,function(t){try{if(I(t[0])){var i=e;vr(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){ce.error("Error executing queued PostHog call",t,e)}})};n(i,this),n(r,this),n(s,this)}finally{jo--}}push(e){if(jo>0&&I(e)&&A(e[0])){var i=t.prototype[e[0]];P(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}get Ed(){return{property:ti,persistenceKey:ei,cookieName:"_fbc",pattern:Yo,register:(t,e)=>{var i;return null==(i=this.persistence)?void 0:i.register({[ei]:{value:t,delivered:e}})},unregister:()=>{var t;return null==(t=this.persistence)?void 0:t.unregister(ei)}}}get Ad(){return{property:ii,persistenceKey:ri,cookieName:"_fbp",pattern:Xo,register:(t,e)=>{var i;return null==(i=this.persistence)?void 0:i.register({[ri]:{value:t,delivered:e}})},unregister:()=>{var t;return null==(t=this.persistence)?void 0:t.unregister(ri)}}}Rd(t){var e,i=null==(e=this.persistence)?void 0:e.get_property(t.persistenceKey);return A(i)&&t.pattern.test(i)?{value:i,delivered:!1}:R(i)&&A(i.value)&&t.pattern.test(i.value)?{value:i.value,delivered:!0===i.delivered}:void 0}Pd(t,e,i){return e===(null==i?void 0:i.value)?{value:e,pending:!i.delivered}:(t.register(e,!1),{value:e,pending:!0})}Od(t){if(this.config.save_campaign_params&&!this.Fh()){var e=$r(t.cookieName);return A(e)&&t.pattern.test(e)?e:void 0}}Fd(t,e,i,r){if(this.persistence){var s=this.Ed,n=this.Rd(s);if(!r){if(i)return A(e)&&Yo.test(e)?this.Pd(s,e,n):void s.unregister();var o=A(t)&&Ko.test(t)?t:void 0,a=this.Od(s);return a&&((t,e,i)=>{var r=t.split(".");if(e)return r[3]===e;if(!i)return!0;var s=i.value.split(".");return r[3]===s[3]||Number(r[2])>Number(s[2])})(a,o,n)?this.Pd(s,a,n):o?(null==n?void 0:n.value.split(".")[3])===o?{value:n.value,pending:!n.delivered}:this.Pd(s,"fb.1."+Date.now()+"."+o,n):n?{value:n.value,pending:!n.delivered}:void 0}s.unregister()}}Ld(t,e,i){if(this.persistence){var r=this.Ad,s=this.Rd(r);if(!i){if(e)return A(t)&&Xo.test(t)?this.Pd(r,t,s):void r.unregister();var n=this.Od(r);return n?this.Pd(r,n,s):s?{value:s.value,pending:!s.delivered}:void 0}r.unregister()}}Dd(t){if(this.persistence){var e=t=>{var e=t.value,i=this.Rd(t.channel);return(null==i?void 0:i.value)===e&&!i.delivered},i=t.filter(e);i.length&&(this.persistence.refreshMetaIdentifiers(),i.filter(e).forEach(t=>t.channel.register(t.value,!0)))}}capture(t,e,r){var s,n,o,a,h,l,u,d;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.ud)if(this.is_capturing())if(!C(t)&&A(t)){if(this.zh(),"$snapshot"!==t||!this.Fh()){var v=!this.config.opt_out_useragent_filter&&this._is_bot();if(v&&!this.config.__preview_capture_bot_pageviews)return this.Gh||(this.Gh=!0,console.warn("[PostHog.js] Events are being dropped because the user agent looks like a bot. Set `opt_out_useragent_filter: true` to capture them, e.g. in end-to-end tests. Note that logs from `captureLog` are not subject to this filter.")),void ce.info('Event "'+t+'" was not captured because the user agent looks like a bot. Set `opt_out_useragent_filter: true` to capture it.');var c=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){var _;null!=e&&e.$current_url&&!A(null==e?void 0:e.$current_url)&&(ce.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=r&&r._originatedFromCaptureException||ce.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 p=/* @__PURE__ */new Date,f=(null==r?void 0:r.timestamp)||p,g=Xt(null==r?void 0:r.uuid,kr),m={uuid:g,event:t,properties:this.calculateEventProperties(t,e||{},f,g)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&v&&(m.event="$bot_pageview",m.properties.$browser_type="bot"),c&&(m.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var b="$feature_flag_called"===t&&!1===m.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=r&&r.$set&&!b&&(m.$set=null==r?void 0:r.$set);var y=R(null==e?void 0:e.$set)?e.$set:void 0,w=I(null==e?void 0:e.$unset)?e.$unset:[],S=(null==r?void 0:r.$unset)||[],x=t=>{var e,i=!(null==r||!r.$set)&&t in r.$set;return{hasProvided:i||!!y&&t in y,provided:i?null==r||null==(e=r.$set)?void 0:e[t]:null==y?void 0:y[t],unset:-1!==w.indexOf(t)||-1!==S.indexOf(t)}};this.persistence.refreshMetaIdentifiersBeforeCapture();var E=x(ti),T=x(ii),k=[{channel:this.Ed,hasProvided:E.hasProvided,update:this.Fd(null==(s=_)?void 0:s.fbclid,E.provided,E.hasProvided,E.unset)},{channel:this.Ad,hasProvided:T.hasProvided,update:this.Ld(T.provided,T.hasProvided,T.unset)}];for(var P of k){var M=P.channel,N=P.update;N&&!0===m.properties.$process_person_profile&&N.pending&&!P.hasProvided&&!b&&(m.$set=i({[M.property]:N.value},m.$set))}var F=null==r?void 0:r.$unset;F&&(m.$unset=F);var B=b?void 0:this.jd(null==r?void 0:r.$set_once,t!==ur,t===lr);if(B&&(m.$set_once=B),null!=r&&r._noTruncate||(h=this.config.properties_string_max_length,l=m,u=t=>A(t)?t.slice(0,h):t,d=/* @__PURE__ */new Set,m=function t(e,i){if(e!==Object(e))return u?u(e):e;if(!d.has(e)){var r;if(d.add(e),I(e))r=[],dr(e,e=>{r.push(t(e))});else{var s={};vr(z(e)?fr(e):e,(e,i)=>{d.has(e)||(s[i]=t(e,i))}),r=s}return r}}(l)),m.timestamp=f,C(null==r?void 0:r.timestamp)||(m.properties.$event_time_override_provided=!0,m.properties.$event_time_override_system_time=p),b&&(m.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return ee.forEach(r),e.forEach(r),i}(m.properties,Qo)),t===Js.DISMISSED||t===Js.SENT){var U=null==e?void 0:e[Ks.SURVEY_ID],j=null==e?void 0:e[Ks.SURVEY_ITERATION];(t=>{try{var e=(t=>((t,e)=>"seenSurvey_"+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e))(0,t))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Io.error("Failed to persist survey seen state",t)}})({id:U,current_iteration:j}),m.$set=i({},m.$set,{[yo({id:U,current_iteration:j},t===Js.SENT?"responded":"dismissed")]:!0})}else t===Js.SHOWN&&(m.$set=i({},m.$set,{[Ks.SURVEY_LAST_SEEN_DATE]:/* @__PURE__ */(new Date).toISOString()}));if(t===Zs.SHOWN){var L=null==e?void 0:e[tn.TOUR_TYPE];L&&(m.$set=i({},m.$set,{[tn.TOUR_LAST_SEEN_DATE+"/"+L]:/* @__PURE__ */(new Date).toISOString()}))}var q=i({},m.properties.$set,m.$set);if(O(q)||this.setPersonPropertiesForFlags(q),!D(this.config.before_send)){var W=this.Ds(m);if(!W)return;(m=W).uuid=Xt(m.uuid,kr)}this.sessionRecording&&!this.ed&&Jo(t)&&(this.ed=!0,setTimeout(()=>this.ed=!1,3e4));var H=[];k.forEach(t=>{var e,i,r,s=t.channel,n=t.update,o=null!==(e=null==(i=m.$set)?void 0:i[s.property])&&void 0!==e?e:R(null==(r=m.properties)?void 0:r.$set)?m.properties.$set[s.property]:void 0;null!=n&&n.pending&&o===n.value&&H.push({channel:s,value:n.value})}),this.mr.emit("eventCaptured",m);var G,V,J=null!==(n=null==r?void 0:r._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),K="recordings"===(null==r?void 0:r._batchKey)||/\/s\/(?:\?|$)/.test(J),Y=i({method:"POST",url:J,data:m,compression:"best-available",preferSyncCompression:null==r?void 0:r.send_instantly,timestampMode:K?"body":"capture-body",batchKey:null==r?void 0:r._batchKey},K&&null!=(o=m.properties)&&o.$session_id?{batchGroup:m.properties.$session_id+(m.properties.$window_id?"-"+m.properties.$window_id:"")}:{},null!=r&&r.transport?{transport:r.transport}:{},H.length?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.Dd(H)}}:{});return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?(!Y.transport&&!Y.callback&&O(null!==(G=this.config.request_headers)&&void 0!==G?G:{})&&this.Qh&&(V="sendBeacon"),this.hd(Y,V)):this.ud.enqueue(Y),null==(a=this.featureFlags)||a.sendFlagCallsPendingCapture(),m}ce.critical("This capture call is ignored due to client rate limiting.")}}else ce.error("No event name provided to posthog.capture");else ce.info('Event "'+t+'" was not captured because capturing is disabled (opted out or consent pending).');else ce.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.qd)?void 0:e.getExtension(t)}kd(){var t;return null!==(t=this.qd)&&void 0!==t?t:this.qd=new Bo(this)}br(t){this.Xh.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Xh.indexOf(t);-1!==i&&this.Xh.splice(i,1)}}}md(t){var e;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange()||(this.yd(t),0))}yd(t){var e,i,r;void 0===t&&(t=!0),this.od=null,"anonymous"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))&&(null==(r=this.sessionPersistence)||r.clear(),this.Kh.clear(),this.Bd()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags()}calculateEventProperties(t,e,r,s,o){if(r=r||/* @__PURE__ */new Date,!this.persistence||!this.sessionPersistence)return e;this.zh(),this.persistence.syncCookieProperties(),this.md();var a=o?void 0:this.persistence.remove_event_timer(t),u=i({},e);if(u.token=this.config.token,u.$config_defaults="latest"===this.config.defaults?ta:this.config.defaults,this.Fh()&&(u[Wi]=!0),"$snapshot"===t){var d=i({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!A(u.distinct_id)&&!F(u.distinct_id)||M(u.distinct_id))&&ce.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var v,c,p=function(t,e,i,r){var s,o,a,h;if(void 0===r&&(r=!1),!_)return{};var u,d=t?[..._s,...e||[]]:[],v=function(t){for(var e=0;Gt.length>e;e++){var i=Gt[e],r=i[1],s=i[0].exec(t),n=s&&(P(r)?r(s,t):r);if(n)return n}return["",""]}(_),c=v[0],p=v[1],f=function(t){for(var e=0;Kt.length>e;e++){var i,r=Kt[e],s=r[1],n=r[2],o=t.match(r[0]);if(o)return[s,(null==(i=n&&t.match(n)||o)?void 0:i[1])||""]}return["",""]}(_),g=f[0],b=f[1],y=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},w={};C(i)||(w.detectGoogleSearchApp=i);var S={},x=null==(s=navigator)||null==(s=s.userAgentData)?void 0:s.platform,E=null==(o=navigator)?void 0:o.maxTouchPoints,T=null==n||null==(a=n.screen)?void 0:a.width,k=null==n||null==(h=n.screen)?void 0:h.height,I=null==n?void 0:n.devicePixelRatio;C(x)||(S.userAgentDataPlatform=x),C(E)||(S.maxTouchPoints=E),C(T)||(S.screenWidth=T),C(k)||(S.screenHeight=k),C(I)||(S.devicePixelRatio=I);var R,O,A,M,N,D,F,B,U=cr(pr({$os:c,$os_version:p,$browser:qt(_,navigator.vendor,y,w),$webview_app:g,$webview_app_version:b,$device:Vt(_),$device_type:(O=_,A=S,B=Vt(O),B===tt||B===Z||"Kobo"===B||"Kindle Fire"===B||B===$t?Q:B===ct||B===pt||B===_t||B===wt?"Console":B===et?"Wearable":B?Y:"Android"===(null==A?void 0:A.userAgentDataPlatform)&&(null!==(M=null==A?void 0:A.maxTouchPoints)&&void 0!==M?M:0)>0?600>Math.min(null!==(N=null==A?void 0:A.screenWidth)&&void 0!==N?N:0,null!==(D=null==A?void 0:A.screenHeight)&&void 0!==D?D:0)/(null!==(F=null==A?void 0:A.devicePixelRatio)&&void 0!==F?F:1)?Y:Q:"Desktop"),$timezone:ls(),$timezone_offset:Es()}),{$current_url:cs(r?Zt(null==l?void 0:l.href):null==l?void 0:l.href,d,fs),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:_.length>1e3?_.substring(0,997)+"...":_,$browser_version:Ht(_,navigator.vendor,y,w),$browser_language:ys(),$browser_language_prefix:(R=ys(),"string"==typeof R?R.split("-")[0]:void 0),$screen_height:null==n?void 0:n.screen.height,$screen_width:null==n?void 0:n.screen.width,$viewport_height:null==n?void 0:n.innerHeight,$viewport_width:null==n?void 0:n.innerWidth,$lib:m.LIB_NAME,$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return m.SDK_DIST_CHANNEL&&(U.$sdk_dist_channel=m.SDK_DIST_CHANNEL),U}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime(),!0),g=f.windowId;u.$session_id=f.sessionId,u.$window_id=g}this.sessionPropsManager&&cr(u,this.sessionPropsManager.getSessionProps());try{var b;if(this.sessionRecording){var y=this.sessionRecording.sdkDebugProperties,w=!this.ed&&Jo(t);for(var x in y)(w||S(Go,x))&&(u[x]=y[x])}v=null==(b=this.dd)?void 0:b.length}catch(t){u.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===So&&(u.$lib_custom_api_host=this.config.api_host),c="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=cr(u,c),"$pageview"===t&&h&&(u.title=h.title),!C(a)){var E=r.getTime()-a;u.$duration=parseFloat((E/1e3).toFixed(3))}_&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var T=this.persistence.properties(),k=this.sessionPersistence.properties(),N=u.$groups,D=T.$groups;R(N)&&!O(N)&&(u.$groups=i({},R(D)?D:{},N)),vr(["$referrer","$referring_domain"],t=>{t in T&&delete k[t]});var B={};if(this.Xh.length>0)for(var U of this.Xh.slice())try{cr(B,U())}catch(t){ce.error("Failed to produce browser extension event properties",t)}u=cr({},p,T,k,i({},B,u)),v?u.$sdk_debug_retry_queue_size=v:delete u.$sdk_debug_retry_queue_size,u.$is_identified=this._isIdentified(),I(this.config.property_denylist)?vr(this.config.property_denylist,function(t){delete u[t]}):ce.error(Ho+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var j=this.config.sanitize_properties;j&&(ce.error(Wo),u=j(u,t));var L=this.zd();return u.$process_person_profile=L,L&&!o&&this.Hd("_calculate_event_properties"),u}jd(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.zd())return t;if(this.Zh&&!i)return t;var s=cr({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),n=this.config.sanitize_properties;return n&&(ce.error(Wo),s=n(s,"$set_once")),e&&(this.Zh=!0),O(s)?void 0:s}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e,i;null==(e=this.persistence)||e.syncCookieProperties(),this.md(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.Kh.add(t)),this.Bd()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.Kh.delete(t),this.Bd()}Ud(t,e){this.register({[t]:e})}vd(){this.Kh.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.Kh.clear(),this.Bd()}Bd(){var t;if(this.Yh)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.gi||!Jr.Ot())Jr.Ft(this.Yh);else{var e=[];this.Kh.forEach(t=>e.push(t)),e.length>0?Jr.$t(this.Yh,e):Jr.Ft(this.Yh)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.mr.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:qo}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:qo})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:qo})}onActiveMatchingSurveysChanged(t){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(t):(t([],{isLoaded:!1,error:qo}),()=>{})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Po),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:qo}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:qo})}Wd(t){return!t||M(t)?(ce.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(ce.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ce.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return ce.uninitializedWarning("posthog.identify");if(F(t)&&(t=t.toString(),ce.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Wd(t)&&this.Hd("posthog.identify")){this.zh();var r=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,n=this.md(!1),o=this.persistence.Qu(),a=!1;try{var h=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:h},""),t!==h&&t!==this.get_property("__alias")&&(this.unregister(Qe),this.register({distinct_id:t}));var l=(this.persistence.get_property("$user_state")||"anonymous")===rr,u=t!==h,d=!u&&l;if(u&&l){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:h};this.persistence.set_property(Di,sr),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ju(),this.capture("$identify",c,{$set:e||{},$set_once:i||{}})&&(this.od=wo(t,e,i)),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:h)}else if(d){this.persistence.set_property(Di,sr);var _=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:_,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.Ju(),this.capture("$set",{$set:_,$set_once:p})&&(this.od=wo(t,e,i))}else(e||i)&&this.setPersonProperties(e,i);u||s||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(De)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Yu(a)}}}setPersonProperties(t,e){if((t||e)&&this.Hd("posthog.setPersonProperties")){var i=wo(this.get_distinct_id(),t,e);this.od!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}})&&(this.od=i)):ce.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(I(t)?t:[t]).filter(t=>A(t)&&t.length>0);0!==i.length&&this.Hd("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.od=null)}group(t,e,r){var s;if(t&&e){null==(s=this.persistence)||s.syncCookieProperties(),this.md();var n=this.getGroups(),o=n[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:i({},n,{[t]:e})}),(o||r)&&this.zd()){var a={$group_type:t,$group_key:e};r&&(a.$group_set=r),this.capture(ur,a)}r&&this.setGroupPropertiesForFlags({[t]:r}),o&&!r&&this.reloadFeatureFlags()}else ce.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.Hd("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=U(t)?t:null==t?void 0:t.resetDeviceID,i=U(t)||null==t?void 0:t.bootstrap;this.Vd(e,!1,i)}Vd(t,e,r){var s,n,o,a,h;if(void 0===e&&(e=!1),ce.info("reset"),!this.__loaded)return ce.uninitializedWarning("posthog.reset");var l=null==r?void 0:r.sessionID;this.config.bootstrap=r||(null==(s=this.Nh)?void 0:s.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags());var u=this.get_property(Ye),d=this.get_property(Xe),v=this.get_property(_i);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var c=this.is_capturing();e||this.consent.reset(),e||!c||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var _=null==(a=this.persistence)||null==a.Qu?void 0:a.Qu(),p=this.Hh;this.Hh=p||e;var f=!1;try{var g,m,b,y,w,S,x,E,T,k,I,P,R;if(null==(g=this.persistence)||g.clear(),null==(m=this.sessionPersistence)||m.clear(),this.Kh.clear(),this.Bd(),C(v)||null==(b=this.persistence)||b.register({[_i]:v}),null==(y=this.surveys)||y.reset(),null==(w=this.featureFlags)||w.reset(),null==(S=this.conversations)||S.reset(),null==(x=this.logs)||x.reset(),null==(E=this.metrics)||E.reset(),null==(T=this.persistence)||T.set_property(Di,rr),null==(k=this.sessionManager)||k.resetSessionId(),this.od=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:qi,$device_id:null},"");else{var O=this.config.get_device_id(kr());this.register_once({distinct_id:O,$device_id:t?O:u},""),t||C(d)||this.register({[Xe]:d})}if(this.register({$last_posthog_reset:/* @__PURE__ */(new Date).toISOString()},1),r)if(r.distinctID&&!this.Fh()&&(null==(R=this.persistence)||R.set_property(Di,r.isIdentifiedID?sr:rr),this.register({distinct_id:r.distinctID})),null==(I=this.featureFlags)||I.initialize(),!(D(l)||null!=(P=this.sessionManager)&&P.setBootstrapSessionId(l,!0))){var A=i({},r);delete A.sessionID,this.config.bootstrap=A}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var M;this.Hh=p,_&&(null==(M=this.persistence)||null==M.Yu||M.Yu(f))}this.gr&&(null==(h=this.conversations)||h.onRemoteConfig(this.gr)),this.reloadFeatureFlags()}shutdown(t){var e=this;return s(function*(){if(e.__loaded){e.Jh=!0,clearTimeout(e.pd),e.pd=void 0;var t=e.Sd;for(var i of(e.Sd=void 0,[()=>{var t;return null==(t=e.sessionRecording)?void 0:t.dispose()},()=>{var t;return null==(t=e.logs)?void 0:t.flushLogs("sendBeacon")},()=>{var t;return null==(t=e.metrics)?void 0:t.flush("sendBeacon")},()=>{var t;return null==(t=e.metrics)?void 0:t.dispose()},()=>{var t;return null==(t=e.logs)?void 0:t.dispose()},()=>{var t;return null==(t=e.surveys)?void 0:t.dispose()},()=>{var t;return null==(t=e.autocapture)?void 0:t.dispose()},()=>null==t?void 0:t(),()=>{var t;return null==(t=e.ud)?void 0:t.unload()},()=>{var t;return null==(t=e.dd)?void 0:t.unload()},()=>{var t;return null==(t=e.featureFlags)?void 0:t.destroy()},()=>{var t;return null==(t=e.persistence)?void 0:t.destroy()},()=>{var t;return null==(t=e.sessionPersistence)?void 0:t.destroy()}]))try{var r=i();r&&P(r.then)&&r.then(void 0,t=>{ce.error("Error during shutdown",t)})}catch(t){ce.error("Error during shutdown",t)}}else ce.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i._onIdentityChanged()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t._onIdentityCleared()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var s,n=null!==(s=t.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(/* @__PURE__ */((new Date).getTime()-i)/1e3)-n,0)}return r}alias(t,e){return t===this.get_property("$people_distinct_id")?(ce.critical("Attempting to create alias for existing People user - aborting."),-2):this.Hd("posthog.alias")?(C(e)&&(e=this.get_distinct_id()),t!==e?(this.Ud(Qe,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ce.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=i({},this.config);if(R(t)){var r,s,n,o,a,h,l,u,d,v,c,_,p,f;cr(this.config,sa(t));var g=this.Vh();if(this.persistence){var m,b,y,w="sessionStorage"===this.config.persistence||"memory"===this.config.persistence;w&&this.sessionPersistence!==this.persistence&&(null==(b=this.sessionPersistence)||b.remove(),null==(y=this.sessionPersistence)||y.destroy()),this.persistence.update_config(this.config,e,g),w?this.sessionPersistence=this.persistence:this.sessionPersistence===this.persistence?this.sessionPersistence=new Bs(i({},this.config,{persistence:"sessionStorage"}),g,!1):null==(m=this.sessionPersistence)||m.update_config(i({},this.config,{persistence:"sessionStorage"}),i({},e,{persistence:"sessionStorage"}),g)}var S=this.ld(this.config.debug);U(S)&&(this.config.debug=S),U(this.config.debug)&&(this.config.debug?(Ee.DEBUG=!0,Mr.Ot()&&Mr.$t("ph_debug",!0),ce.info("set_config",{config:t,oldConfig:e,newConfig:i({},this.config)})):(Ee.DEBUG=!1,Mr.Ot()&&Mr.Ft("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(o=this.metrics)||o.onConfigChange(),null==(a=this.webMCP)||a.startIfEnabled(),null==(h=this.sessionRecording)||h.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(d=this.heatmaps)||d.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(v=this.historyAutocapture)||v.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(_=this.deadClicksAutocapture)||_.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this.Uh(),null==(f=this.externalIntegrations)||f.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&ts(this,Lo,!1)}}_overrideSDKInfo(t,e){Ee.LIB_NAME=t,Ee.LIB_VERSION=e}startSessionRecording(t){var e,i,r,s,n,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.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 t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){try{if(!this.exceptions)return;var r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:/* @__PURE__ */new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(i({},r,e))}catch(t){return}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var e,i;return null!==(e=null==(i=this.logs)?void 0:i.logger)&&void 0!==e?e:t.Jd}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Zo;return e!==Zo&&(e="posthog."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property("$user_state"))}zd(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&O(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}Id(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.zd()||this.Hd("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Hd("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Hd(t){return"never"===this.config.person_profiles?(ce.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.jh(),this.Ud(zi,!0),!0)}Vh(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}Uh(){var t,e,i,r,s,n=this.Vh();return this.is_capturing()||null==(t=this.logs)||t._onOptOut(),(null==(e=this.persistence)?void 0:e.gi)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(r=this.sessionPersistence)?void 0:r.gi)!==n&&(null==(s=this.sessionPersistence)||s.set_disabled(n)),this.Bd(),n}opt_in_capturing(e){var i,r,s,n;if("always"!==this.config.cookieless_mode){if(this.Fh()){var o,a,h,l,u,d;null==(o=this.sessionRecording)||o.dispose({discardBufferedEvents:!0}),this.Vd(!0,!0),null==(a=this.sessionManager)||a.destroy(),null==(h=this.pageViewManager)||h.destroy(),this.sessionManager=new go(this),this.pageViewManager=new ss(this),this.persistence&&(this.sessionPropsManager=new co(this,this.sessionManager,this.persistence));var v,c=null!==(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)&&void 0!==l?l:null==(d=t.__defaultExtensionClasses)?void 0:d.sessionRecording;c&&(this.sessionRecording=this.Oh(this.sessionRecording,new c(this)),this.gr&&(null==(v=this.sessionRecording)||null==v.onRemoteConfig||v.onRemoteConfig(this.gr)))}var _,p,f=1===this.consent.consent;f&&this.zh(),this.consent.optInOut(!0),this.Uh(),this.Cd(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(_=this.surveys)||_.loadIfEnabled(),null==(p=this.conversations)||p.loadIfEnabled()),!f&&(C(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(r=null==e?void 0:e.captureEventName)&&void 0!==r?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),null==(s=this.persistence)||s.syncCookieProperties(),this.md(),null==(n=this.featureFlags)||n.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this.Td()}else ce.warn(zo)}opt_out_capturing(){"always"!==this.config.cookieless_mode?(this.consent.optInOut(!1),this.Uh(),"on_reject"===this.config.cookieless_mode&&this.Wh()):ce.warn(zo)}Wh(){var t,e,i=this.sessionRecording;null==i||i.dispose({discardBufferedEvents:!0}),"$posthog_cookieless"!==this.get_distinct_id()&&this.Vd(!0,!0),this.register({distinct_id:qi,$device_id:null}),this.Rh(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Td(),this.Cd()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return!this.Hh&&("always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.Uh()}_is_bot(){return a?function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&J(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>J(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver}(a,this.config.custom_blocked_useragents):void 0}Td(){h&&("visible"===h.visibilityState?this.nd||(this.nd=!0,this.capture(ar,{title:h.title},{send_instantly:!0}),this.sd&&(h.removeEventListener(Le,this.sd),this.sd=null)):this.sd||(this.sd=this.Td.bind(this),br(h,Le,this.sd)))}debug(t){!1===t?(null==n||n.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==n||n.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}_shouldDisableFlags(){var t=this.Nh||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ce.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):function(t,e,i,r,s){var n=e in t&&!D(t[e]),o=i in t&&!D(t[i]);return n?t[e]:!!o&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,ce)}Ds(t){var e;if(D(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(L),r=I(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r)try{if(s=n(s),D(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return j(t.event)?ce.warn(o+". This can cause unexpected behavior."):ce.info(o),null}s.properties&&!O(s.properties)||ce.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return ce.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(s.properties&&D(s.properties[a]))return ce.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var t;return null==(t=this.pageViewManager.Xa)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}ld(t){var e=U(t)&&!t,i=Mr.Ot()&&"true"===Mr.Lt("ph_debug");return!e&&(!!i||t)}},t.__defaultExtensionClasses={},t.Jd={trace:$o=()=>{},debug:$o,info:$o,warn:$o,error:$o,fatal:$o},t);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=_r(t.prototype[e[i]])}(oa,["identify"]);var aa=function(){Ee.SDK_DIST_CHANNEL="npm";var t=Uo[Zo]=new oa;return function(){function t(){t.done||(t.done=!0,oo=!1,vr(Uo,function(t){t._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?t():br(h,"DOMContentLoaded",t,{capture:!1}):n&&ce.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{Us as Compression,Qs as DEFAULT_PRODUCT_TOUR_APPEARANCE,Ys as DisplaySurveyType,oa as PostHog,Zs as ProductTourEventName,tn as ProductTourEventProperties,Js as SurveyEventName,Ks as SurveyEventProperties,js as SurveyEventType,zs as SurveyPosition,Gs as SurveyQuestionBranchingType,Hs as SurveyQuestionType,Vs as SurveySchedule,qs as SurveyTabPosition,Ws as SurveyType,Ls as SurveyWidgetType,aa as default,aa as posthog,on as severityLevels};
|