circuschief 0.2.1 → 0.4.0
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/package.json +1 -1
- package/packages/server/src/api/git.js +15 -0
- package/packages/server/src/api/index.js +13 -2
- package/packages/server/src/api/projects-commandButtons.js +96 -0
- package/packages/server/src/api/projects-session-helpers.js +51 -33
- package/packages/server/src/api/projects.js +109 -113
- package/packages/server/src/api/sessions-archive.js +2 -1
- package/packages/server/src/api/sessions-lifecycle.js +2 -1
- package/packages/server/src/api/sessions-patch.js +2 -0
- package/packages/server/src/config.js +6 -0
- package/packages/server/src/database.js +1 -0
- package/packages/server/src/db/DatabaseManager.js +12 -1
- package/packages/server/src/db/ProjectRepository.js +22 -5
- package/packages/server/src/db/index.js +4 -0
- package/packages/server/src/db/migrations/index.js +7 -0
- package/packages/server/src/db/migrations/miscMigrations.js +78 -1
- package/packages/server/src/db/migrations/projectsMigrations.js +4 -0
- package/packages/server/src/index.js +10 -4
- package/packages/server/src/services/gitService.js +42 -6
- package/packages/server/src/services/gitSessionSetup.js +4 -3
- package/packages/server/src/services/kanbanTriggers.js +1 -0
- package/packages/server/src/services/schedulerService.js +32 -0
- package/packages/server/src/services/sessionExecution.js +2 -2
- package/packages/server/src/services/templateTriggerService.js +1 -0
- package/packages/shared/src/contracts/projects.js +4 -1
- package/packages/shared/src/types.js +4 -3
- package/packages/web/dist/assets/ActiveSessionsView-BVco8bPU.css +1 -0
- package/packages/web/dist/assets/ActiveSessionsView-D1daFFvI.js +1 -0
- package/packages/web/dist/assets/{AgentLogsView-D4l0N9ZA.js → AgentLogsView-B_NDIx2_.js} +1 -1
- package/packages/web/dist/assets/{ApiClient-Dbs1H78V.js → ApiClient-CcqJ-GAv.js} +1 -1
- package/packages/web/dist/assets/ArchiveConfirmModal-BHqbCCX2.js +1 -0
- package/packages/web/dist/assets/{ArchiveConfirmModal-CQZeuYBz.css → ArchiveConfirmModal-BQ-4gI0R.css} +1 -1
- package/packages/web/dist/assets/CommandButtonDetailView-B9crZey8.js +1 -0
- package/packages/web/dist/assets/EffortLevelSelector-HuOPegKI.js +1 -0
- package/packages/web/dist/assets/{GeneralSettingsView-BqCzCX-z.js → GeneralSettingsView-CzBagrDs.js} +1 -1
- package/packages/web/dist/assets/{PathChooser-CXFxb8Oj.js → InputWithButton-Cplkm8Ze.js} +1 -1
- package/packages/web/dist/assets/InputWithButton-cYdrEmTs.css +1 -0
- package/packages/web/dist/assets/InterpolationHelp-bG_y10VY.js +1 -0
- package/packages/web/dist/assets/MarkdownEditor-CXDVTLvp.js +2 -0
- package/packages/web/dist/assets/{ModelSelector-DSxaZWBL.js → ModelSelector-CgpqdZtV.js} +1 -1
- package/packages/web/dist/assets/{NewSessionView-BsI7JtO9.js → NewSessionView-91V-4qLi.js} +2 -2
- package/packages/web/dist/assets/{NewSessionView-Byoi1XdQ.css → NewSessionView-D_Hi7M9g.css} +1 -1
- package/packages/web/dist/assets/ProjectEditView-C3bOYnD6.js +1 -0
- package/packages/web/dist/assets/ProjectEditView-CpeKj-_w.css +1 -0
- package/packages/web/dist/assets/ProjectListView-BEo1p4dO.js +1 -0
- package/packages/web/dist/assets/ProjectListView-CumumZN-.css +1 -0
- package/packages/web/dist/assets/ProjectNewView-CXGjy3OL.js +1 -0
- package/packages/web/dist/assets/ProjectNewView-CaLXfFzd.css +1 -0
- package/packages/web/dist/assets/{ProvidersView-CgAr0qms.js → ProvidersView-CMAnPTEX.js} +1 -1
- package/packages/web/dist/assets/{ProvidersView-B_QQF3RM.css → ProvidersView-uD8SKWpA.css} +1 -1
- package/packages/web/dist/assets/{QuickResponseSettings-uDDpwaza.js → QuickResponseSettings-Ds4X-J-t.js} +1 -1
- package/packages/web/dist/assets/{QuickResponsesPanel-D0qs0Fm_.js → QuickResponsesPanel-BY2v23c5.js} +1 -1
- package/packages/web/dist/assets/{ResizableTextarea-_kHi1Mg3.js → ResizableTextarea-C2s6_7X9.js} +1 -1
- package/packages/web/dist/assets/{SessionCard-Be1-bK0C.js → SessionCard-C7vFzR16.js} +1 -1
- package/packages/web/dist/assets/{SessionDetailView-mnGRMaLY.css → SessionDetailView-BL83oPiI.css} +1 -1
- package/packages/web/dist/assets/SessionDetailView-D3f0FEV1.js +36 -0
- package/packages/web/dist/assets/{SessionFormOptions-DvhOyP6z.js → SessionFormOptions-3LfqiLiR.js} +1 -1
- package/packages/web/dist/assets/{SessionListView-CuHsWj85.js → SessionListView-NGW-u434.js} +1 -1
- package/packages/web/dist/assets/{SessionLogStream-Da_GniUZ.js → SessionLogStream-NR-AS676.js} +6 -6
- package/packages/web/dist/assets/SettingsView-DKINDb2z.js +1 -0
- package/packages/web/dist/assets/{SlashCommandWizard-B_8ifpxN.js → SlashCommandWizard-PXipO1yA.js} +1 -1
- package/packages/web/dist/assets/{SummarySettingsView-KvgSGHdd.js → SummarySettingsView-D_2bSsYD.js} +1 -1
- package/packages/web/dist/assets/{TemplateDetailView-BhOjYIvS.js → TemplateDetailView-C5rbgXwU.js} +1 -1
- package/packages/web/dist/assets/{commandButtons-B4OYZP0J.js → commandButtons-D_-wR8zJ.js} +1 -1
- package/packages/web/dist/assets/index-BCazaXF8.js +1 -0
- package/packages/web/dist/assets/index-BmQRt229.js +3 -0
- package/packages/web/dist/assets/index-CCQGqJXX.js +1 -0
- package/packages/web/dist/assets/index-CcCiJkwz.js +1 -0
- package/packages/web/dist/assets/index-Cs-001Bx.js +1 -0
- package/packages/web/dist/assets/index-CxiSnR0R.js +1 -0
- package/packages/web/dist/assets/index-D-lQSDZh.js +1 -0
- package/packages/web/dist/assets/{index-CSOPrlmq.js → index-D1Lg5reX.js} +3 -3
- package/packages/web/dist/assets/index-D9VgH58U.js +1 -0
- package/packages/web/dist/assets/index-D9Z6zsGS.js +1 -0
- package/packages/web/dist/assets/index-DP2i58hO.js +1 -0
- package/packages/web/dist/assets/index-DaL3nu0U.js +1 -0
- package/packages/web/dist/assets/index-Dfy1JGZs.js +1 -0
- package/packages/web/dist/assets/index-DgIOe3cM.js +1 -0
- package/packages/web/dist/assets/index-Dp3Eg3c0.js +1 -0
- package/packages/web/dist/assets/{index-BHVnr8MO.js → index-DveLfEiG.js} +2 -2
- package/packages/web/dist/assets/index-DyQ22-ut.js +1 -0
- package/packages/web/dist/assets/{index-BqVgX_Jy.js → index-Krfrs3sc.js} +3 -3
- package/packages/web/dist/assets/index-gylMFbgn.js +7 -0
- package/packages/web/dist/assets/{projects-B2du-GX8.js → projects-CMJJca64.js} +1 -1
- package/packages/web/dist/assets/{providers-B__J6FX0.js → providers-BCtNZWYw.js} +1 -1
- package/packages/web/dist/assets/{sessions-VDrd87yA.js → sessions-CoRS-wuR.js} +1 -1
- package/packages/web/dist/assets/{settings-CZ7Pc-Pt.js → settings-BN_W4nwV.js} +1 -1
- package/packages/web/dist/assets/useSummaryHelpers-GVg7sMWF.js +1 -0
- package/packages/web/dist/index.html +1 -1
- package/packages/web/dist/assets/ActiveSessionsView-3697sD8N.js +0 -1
- package/packages/web/dist/assets/ActiveSessionsView-DfYXc6dz.css +0 -1
- package/packages/web/dist/assets/ArchiveConfirmModal-Bv3vGOMM.js +0 -1
- package/packages/web/dist/assets/CommandButtonDetailView-Bk_SHxpu.js +0 -1
- package/packages/web/dist/assets/EffortLevelSelector-VfBEelvO.js +0 -1
- package/packages/web/dist/assets/InterpolationHelp-Dc1Y0T6v.js +0 -1
- package/packages/web/dist/assets/MarkdownEditor-DwBQkZbs.js +0 -2
- package/packages/web/dist/assets/PathChooser-BoMGzeg2.css +0 -1
- package/packages/web/dist/assets/ProjectEditView-Bes4Mib4.js +0 -1
- package/packages/web/dist/assets/ProjectEditView-DNwBUNRk.css +0 -1
- package/packages/web/dist/assets/ProjectListView-C55H1JHQ.css +0 -1
- package/packages/web/dist/assets/ProjectListView-DzEu-C36.js +0 -1
- package/packages/web/dist/assets/ProjectNewView-CpgE4R-l.css +0 -1
- package/packages/web/dist/assets/ProjectNewView-Cv-iEAgl.js +0 -1
- package/packages/web/dist/assets/SessionDetailView-DUYb7qTA.js +0 -36
- package/packages/web/dist/assets/SettingsView-5RDCXNUa.js +0 -1
- package/packages/web/dist/assets/index-80Qu7W6P.js +0 -1
- package/packages/web/dist/assets/index-B8_Iqwcq.js +0 -1
- package/packages/web/dist/assets/index-B9JErft2.js +0 -1
- package/packages/web/dist/assets/index-BarVnQIj.js +0 -3
- package/packages/web/dist/assets/index-BsvRdU0B.js +0 -1
- package/packages/web/dist/assets/index-Bugg2M-E.js +0 -1
- package/packages/web/dist/assets/index-C2Pjy-M8.js +0 -1
- package/packages/web/dist/assets/index-CS_wb_Vj.js +0 -1
- package/packages/web/dist/assets/index-ClzNIdCp.js +0 -1
- package/packages/web/dist/assets/index-Cn9Ajkye.js +0 -1
- package/packages/web/dist/assets/index-CucpVX4L.js +0 -1
- package/packages/web/dist/assets/index-D9hZYvW3.js +0 -1
- package/packages/web/dist/assets/index-DA0dK_PG.js +0 -7
- package/packages/web/dist/assets/index-DgpSn-jR.js +0 -1
- package/packages/web/dist/assets/index-HZwIyC9t.js +0 -1
- package/packages/web/dist/assets/index-SS3wA2sI.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectListView-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectListView-BEo1p4dO.js","assets/projects-CMJJca64.js","assets/ApiClient-CcqJ-GAv.js","assets/useSummaryHelpers-GVg7sMWF.js","assets/ProjectListView-CumumZN-.css","assets/ProjectNewView-CXGjy3OL.js","assets/InputWithButton-Cplkm8Ze.js","assets/InputWithButton-cYdrEmTs.css","assets/ProjectNewView-CaLXfFzd.css","assets/ProjectEditView-C3bOYnD6.js","assets/QuickResponseSettings-Ds4X-J-t.js","assets/QuickResponseSettings-B8188A1D.css","assets/ModelSelector-CgpqdZtV.js","assets/providers-BCtNZWYw.js","assets/ModelSelector-DPPD-92R.css","assets/ProjectEditView-CpeKj-_w.css","assets/CommandButtonDetailView-B9crZey8.js","assets/commandButtons-D_-wR8zJ.js","assets/CommandButtonDetailView-DBm3rzhw.css","assets/SessionListView-NGW-u434.js","assets/sessions-CoRS-wuR.js","assets/settings-BN_W4nwV.js","assets/SessionLogStream-NR-AS676.js","assets/SessionLogStream-zPUTiGbe.css","assets/SessionCard-C7vFzR16.js","assets/SessionCard-CcqIjL8q.css","assets/ArchiveConfirmModal-BHqbCCX2.js","assets/EffortLevelSelector-HuOPegKI.js","assets/EffortLevelSelector-BQaQmU2d.css","assets/SlashCommandWizard-PXipO1yA.js","assets/SlashCommandWizard-BB30cSvo.css","assets/ArchiveConfirmModal-BQ-4gI0R.css","assets/InterpolationHelp-bG_y10VY.js","assets/InterpolationHelp-iNxTxmhs.css","assets/ResizableTextarea-C2s6_7X9.js","assets/ResizableTextarea-B5nAA0RV.css","assets/SessionFormOptions-3LfqiLiR.js","assets/SessionFormOptions-BuLlDF-7.css","assets/SessionListView-78k6TTz6.css","assets/TemplateDetailView-C5rbgXwU.js","assets/TemplateDetailView-DT2m06W7.css","assets/NewSessionView-91V-4qLi.js","assets/QuickResponsesPanel-BY2v23c5.js","assets/QuickResponsesPanel-DIBQFj0W.css","assets/NewSessionView-D_Hi7M9g.css","assets/ActiveSessionsView-D1daFFvI.js","assets/ActiveSessionsView-BVco8bPU.css","assets/SessionDetailView-D3f0FEV1.js","assets/SessionDetailView-BL83oPiI.css","assets/SettingsView-DKINDb2z.js","assets/SettingsView-DC8-hTQ-.css","assets/ProvidersView-CMAnPTEX.js","assets/ProvidersView-uD8SKWpA.css","assets/SummarySettingsView-D_2bSsYD.js","assets/SummarySettingsView-DcsmSVJI.css","assets/GeneralSettingsView-CzBagrDs.js","assets/GeneralSettingsView-BCf53fpC.css","assets/AgentLogsView-B_NDIx2_.js","assets/AgentLogsView-D90PnQVk.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
|
|
3
3
|
* @vue/shared v3.5.29
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
@@ -76,7 +76,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
76
76
|
* vue-router v4.6.4
|
|
77
77
|
* (c) 2025 Eduardo San Martin Morote
|
|
78
78
|
* @license MIT
|
|
79
|
-
*/let ak=()=>location.protocol+"//"+location.host;function Sp(e,t){const{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let o=s.includes(e.slice(i))?e.slice(i).length:1,a=s.slice(o);return a[0]!=="/"&&(a="/"+a),Uu(a,"")}return Uu(n,e)+r+s}function lk(e,t,n,r){let s=[],i=[],o=null;const a=({state:d})=>{const h=Sp(e,location),p=n.value,g=t.value;let y=0;if(d){if(n.value=h,t.value=d,o&&o===p){o=null;return}y=g?d.position-g.position:0}else r(h);s.forEach(T=>{T(n.value,p,{delta:y,type:Xa.pop,direction:y?y>0?oa.forward:oa.back:oa.unknown})})};function l(){o=n.value}function u(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return i.push(h),h}function c(){if(document.visibilityState==="hidden"){const{history:d}=window;if(!d.state)return;d.replaceState(ye({},d.state,{scroll:zo()}),"")}}function f(){for(const d of i)d();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function Hu(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?zo():null}}function ck(e){const{history:t,location:n}=window,r={value:Sp(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,u,c){const f=e.indexOf("#"),d=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:ak()+e+l;try{t[c?"replaceState":"pushState"](u,"",d),s.value=u}catch(h){console.error(h),n[c?"replace":"assign"](d)}}function o(l,u){i(l,ye({},t.state,Hu(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ye({},s.value,t.state,{forward:l,scroll:zo()});i(c.current,c,!0),i(l,ye({},Hu(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:o}}function uk(e){e=WS(e);const t=ck(e),n=lk(e,t.state,t.location,t.replace);function r(i,o=!0){o||n.pauseListeners(),history.go(i)}const s=ye({location:"",base:e,go:r,createHref:KS.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let ar=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Ye=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Ye||{});const fk={type:ar.Static,value:""},dk=/[a-zA-Z0-9_]/;function hk(e){if(!e)return[[]];if(e==="/")return[[fk]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${u}": ${h}`)}let n=Ye.Static,r=n;const s=[];let i;function o(){i&&s.push(i),i=[]}let a=0,l,u="",c="";function f(){u&&(n===Ye.Static?i.push({type:ar.Static,value:u}):n===Ye.Param||n===Ye.ParamRegExp||n===Ye.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),i.push({type:ar.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function d(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Ye.ParamRegExp){r=n,n=Ye.EscapeNext;continue}switch(n){case Ye.Static:l==="/"?(u&&f(),o()):l===":"?(f(),n=Ye.Param):d();break;case Ye.EscapeNext:d(),n=r;break;case Ye.Param:l==="("?n=Ye.ParamRegExp:dk.test(l)?d():(f(),n=Ye.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Ye.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Ye.ParamRegExpEnd:c+=l;break;case Ye.ParamRegExpEnd:f(),n=Ye.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Ye.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),o(),s}const Gu="[^/]+?",pk={sensitive:!1,strict:!1,start:!0,end:!0};var _t=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(_t||{});const gk=/[.+*?^${}()[\]/\\]/g;function _k(e,t){const n=ye({},pk,t),r=[];let s=n.start?"^":"";const i=[];for(const u of e){const c=u.length?[]:[_t.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const d=u[f];let h=_t.Segment+(n.sensitive?_t.BonusCaseSensitive:0);if(d.type===ar.Static)f||(s+="/"),s+=d.value.replace(gk,"\\$&"),h+=_t.Static;else if(d.type===ar.Param){const{value:p,repeatable:g,optional:y,regexp:T}=d;i.push({name:p,repeatable:g,optional:y});const b=T||Gu;if(b!==Gu){h+=_t.BonusCustomRegExp;try{`${b}`}catch(E){throw new Error(`Invalid custom RegExp for param "${p}" (${b}): `+E.message)}}let S=g?`((?:${b})(?:/(?:${b}))*)`:`(${b})`;f||(S=y&&u.length<2?`(?:/${S})`:"/"+S),y&&(S+="?"),s+=S,h+=_t.Dynamic,y&&(h+=_t.BonusOptional),g&&(h+=_t.BonusRepeatable),b===".*"&&(h+=_t.BonusWildcard)}c.push(h)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=_t.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const o=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(o),f={};if(!c)return null;for(let d=1;d<c.length;d++){const h=c[d]||"",p=i[d-1];f[p.name]=h&&p.repeatable?h.split("/"):h}return f}function l(u){let c="",f=!1;for(const d of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const h of d)if(h.type===ar.Static)c+=h.value;else if(h.type===ar.Param){const{value:p,repeatable:g,optional:y}=h,T=p in u?u[p]:"";if(Ht(T)&&!g)throw new Error(`Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`);const b=Ht(T)?T.join("/"):T;if(!b)if(y)d.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${p}"`);c+=b}}return c||"/"}return{re:o,score:r,keys:i,parse:a,stringify:l}}function vk(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===_t.Static+_t.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===_t.Static+_t.Segment?1:-1:0}function kp(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const i=vk(r[n],s[n]);if(i)return i;n++}if(Math.abs(s.length-r.length)===1){if(Wu(r))return 1;if(Wu(s))return-1}return s.length-r.length}function Wu(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const mk={strict:!1,end:!0,sensitive:!1};function yk(e,t,n){const r=_k(hk(e.path),n),s=ye(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function bk(e,t){const n=[],r=new Map;t=zu(mk,t);function s(f){return r.get(f)}function i(f,d,h){const p=!h,g=Ku(f);g.aliasOf=h&&h.record;const y=zu(t,f),T=[g];if("alias"in f){const E=typeof f.alias=="string"?[f.alias]:f.alias;for(const m of E)T.push(Ku(ye({},g,{components:h?h.record.components:g.components,path:m,aliasOf:h?h.record:g})))}let b,S;for(const E of T){const{path:m}=E;if(d&&m[0]!=="/"){const N=d.record.path,M=N[N.length-1]==="/"?"":"/";E.path=d.record.path+(m&&M+m)}if(b=yk(E,d,y),h?h.alias.push(b):(S=S||b,S!==b&&S.alias.push(b),p&&f.name&&!Ju(b)&&o(f.name)),Tp(b)&&l(b),g.children){const N=g.children;for(let M=0;M<N.length;M++)i(N[M],b,h&&h.children[M])}h=h||b}return S?()=>{o(S)}:Ms}function o(f){if(wp(f)){const d=r.get(f);d&&(r.delete(f),n.splice(n.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=n.indexOf(f);d>-1&&(n.splice(d,1),f.record.name&&r.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return n}function l(f){const d=Sk(f,n);n.splice(d,0,f),f.record.name&&!Ju(f)&&r.set(f.record.name,f)}function u(f,d){let h,p={},g,y;if("name"in f&&f.name){if(h=r.get(f.name),!h)throw Zr(Le.MATCHER_NOT_FOUND,{location:f});y=h.record.name,p=ye(qu(d.params,h.keys.filter(S=>!S.optional).concat(h.parent?h.parent.keys.filter(S=>S.optional):[]).map(S=>S.name)),f.params&&qu(f.params,h.keys.map(S=>S.name))),g=h.stringify(p)}else if(f.path!=null)g=f.path,h=n.find(S=>S.re.test(g)),h&&(p=h.parse(g),y=h.record.name);else{if(h=d.name?r.get(d.name):n.find(S=>S.re.test(d.path)),!h)throw Zr(Le.MATCHER_NOT_FOUND,{location:f,currentLocation:d});y=h.record.name,p=ye({},d.params,f.params),g=h.stringify(p)}const T=[];let b=h;for(;b;)T.unshift(b.record),b=b.parent;return{name:y,path:g,params:p,matched:T,meta:Ek(T)}}e.forEach(f=>i(f));function c(){n.length=0,r.clear()}return{addRoute:i,resolve:u,removeRoute:o,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function qu(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Ku(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:wk(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function wk(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Ju(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ek(e){return e.reduce((t,n)=>ye(t,n.meta),{})}function Sk(e,t){let n=0,r=t.length;for(;n!==r;){const i=n+r>>1;kp(e,t[i])<0?r=i:n=i+1}const s=kk(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function kk(e){let t=e;for(;t=t.parent;)if(Tp(t)&&kp(e,t)===0)return t}function Tp({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Yu(e){const t=Pt(Uo),n=Pt(ic),r=Ce(()=>{const l=Dt(e.to);return t.resolve(l)}),s=Ce(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const d=f.findIndex(Vr.bind(null,c));if(d>-1)return d;const h=Xu(l[u-2]);return u>1&&Xu(c)===h&&f[f.length-1].path!==h?f.findIndex(Vr.bind(null,l[u-2])):d}),i=Ce(()=>s.value>-1&&Ck(n.params,r.value.params)),o=Ce(()=>s.value>-1&&s.value===n.matched.length-1&&bp(n.params,r.value.params));function a(l={}){if(Ak(l)){const u=t[Dt(e.replace)?"replace":"push"](Dt(e.to)).catch(Ms);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:Ce(()=>r.value.href),isActive:i,isExactActive:o,navigate:a}}function Tk(e){return e.length===1?e[0]:e}const Ok=Ul({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Yu,setup(e,{slots:t}){const n=ri(Yu(e)),{options:r}=Pt(Uo),s=Ce(()=>({[Qu(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Qu(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Tk(t.default(n));return e.custom?i:Wl("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),xk=Ok;function Ak(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ck(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!Ht(s)||s.length!==r.length||r.some((i,o)=>i.valueOf()!==s[o].valueOf()))return!1}return!0}function Xu(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Qu=(e,t,n)=>e??t??n,Rk=Ul({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Pt(el),s=Ce(()=>e.route||r.value),i=Pt(Zu,0),o=Ce(()=>{let u=Dt(i);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=Ce(()=>s.value.matched[o.value]);Ri(Zu,Ce(()=>o.value+1)),Ri(ik,a),Ri(el,s);const l=It();return Nr(()=>[l.value,a.value,e.name],([u,c,f],[d,h,p])=>{c&&(c.instances[f]=u,h&&h!==c&&u&&u===d&&(c.leaveGuards.size||(c.leaveGuards=h.leaveGuards),c.updateGuards.size||(c.updateGuards=h.updateGuards))),u&&c&&(!h||!Vr(c,h)||!d)&&(c.enterCallbacks[f]||[]).forEach(g=>g(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,d=f&&f.components[c];if(!d)return ef(n.default,{Component:d,route:u});const h=f.props[c],p=h?h===!0?u.params:typeof h=="function"?h(u):h:null,y=Wl(d,ye({},p,t,{onVnodeUnmounted:T=>{T.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return ef(n.default,{Component:y,route:u})||y}}});function ef(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Ik=Rk;function Pk(e){const t=bk(e.routes,e),n=e.parseQuery||rk,r=e.stringifyQuery||Vu,s=e.history,i=is(),o=is(),a=is(),l=f_(Pn);let u=Pn;kr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=sa.bind(null,A=>""+A),f=sa.bind(null,US),d=sa.bind(null,qs);function h(A,q){let Z,K;return wp(A)?(Z=t.getRecordMatcher(A),K=q):K=A,t.addRoute(K,Z)}function p(A){const q=t.getRecordMatcher(A);q&&t.removeRoute(q)}function g(){return t.getRoutes().map(A=>A.record)}function y(A){return!!t.getRecordMatcher(A)}function T(A,q){if(q=ye({},q||l.value),typeof A=="string"){const w=ia(n,A,q.path),O=t.resolve({path:w.path},q),P=s.createHref(w.fullPath);return ye(w,O,{params:d(O.params),hash:qs(w.hash),redirectedFrom:void 0,href:P})}let Z;if(A.path!=null)Z=ye({},A,{path:ia(n,A.path,q.path).path});else{const w=ye({},A.params);for(const O in w)w[O]==null&&delete w[O];Z=ye({},A,{params:f(w)}),q.params=f(q.params)}const K=t.resolve(Z,q),fe=A.hash||"";K.params=c(d(K.params));const _=VS(r,ye({},A,{hash:FS(fe),path:K.path})),v=s.createHref(_);return ye({fullPath:_,hash:fe,query:r===Vu?sk(A.query):A.query||{}},K,{redirectedFrom:void 0,href:v})}function b(A){return typeof A=="string"?ia(n,A,l.value.path):ye({},A)}function S(A,q){if(u!==A)return Zr(Le.NAVIGATION_CANCELLED,{from:q,to:A})}function E(A){return M(A)}function m(A){return E(ye(b(A),{replace:!0}))}function N(A,q){const Z=A.matched[A.matched.length-1];if(Z&&Z.redirect){const{redirect:K}=Z;let fe=typeof K=="function"?K(A,q):K;return typeof fe=="string"&&(fe=fe.includes("?")||fe.includes("#")?fe=b(fe):{path:fe},fe.params={}),ye({query:A.query,hash:A.hash,params:fe.path!=null?{}:A.params},fe)}}function M(A,q){const Z=u=T(A),K=l.value,fe=A.state,_=A.force,v=A.replace===!0,w=N(Z,K);if(w)return M(ye(b(w),{state:typeof w=="object"?ye({},fe,w.state):fe,force:_,replace:v}),q||Z);const O=Z;O.redirectedFrom=q;let P;return!_&&ZS(r,K,Z)&&(P=Zr(Le.NAVIGATION_DUPLICATED,{to:O,from:K}),tt(K,K,!0,!1)),(P?Promise.resolve(P):F(O,K)).catch(x=>ln(x)?ln(x,Le.NAVIGATION_GUARD_REDIRECT)?x:et(x):ae(x,O,K)).then(x=>{if(x){if(ln(x,Le.NAVIGATION_GUARD_REDIRECT))return M(ye({replace:v},b(x.to),{state:typeof x.to=="object"?ye({},fe,x.to.state):fe,force:_}),q||O)}else x=D(O,K,!0,v,fe);return J(O,K,x),x})}function R(A,q){const Z=S(A,q);return Z?Promise.reject(Z):Promise.resolve()}function I(A){const q=Ve.values().next().value;return q&&typeof q.runWithContext=="function"?q.runWithContext(A):A()}function F(A,q){let Z;const[K,fe,_]=ok(A,q);Z=aa(K.reverse(),"beforeRouteLeave",A,q);for(const w of K)w.leaveGuards.forEach(O=>{Z.push(jn(O,A,q))});const v=R.bind(null,A,q);return Z.push(v),Ue(Z).then(()=>{Z=[];for(const w of i.list())Z.push(jn(w,A,q));return Z.push(v),Ue(Z)}).then(()=>{Z=aa(fe,"beforeRouteUpdate",A,q);for(const w of fe)w.updateGuards.forEach(O=>{Z.push(jn(O,A,q))});return Z.push(v),Ue(Z)}).then(()=>{Z=[];for(const w of _)if(w.beforeEnter)if(Ht(w.beforeEnter))for(const O of w.beforeEnter)Z.push(jn(O,A,q));else Z.push(jn(w.beforeEnter,A,q));return Z.push(v),Ue(Z)}).then(()=>(A.matched.forEach(w=>w.enterCallbacks={}),Z=aa(_,"beforeRouteEnter",A,q,I),Z.push(v),Ue(Z))).then(()=>{Z=[];for(const w of o.list())Z.push(jn(w,A,q));return Z.push(v),Ue(Z)}).catch(w=>ln(w,Le.NAVIGATION_CANCELLED)?w:Promise.reject(w))}function J(A,q,Z){a.list().forEach(K=>I(()=>K(A,q,Z)))}function D(A,q,Z,K,fe){const _=S(A,q);if(_)return _;const v=q===Pn,w=kr?history.state:{};Z&&(K||v?s.replace(A.fullPath,ye({scroll:v&&w&&w.scroll},fe)):s.push(A.fullPath,fe)),l.value=A,tt(A,q,Z,v),et()}let re;function ce(){re||(re=s.listen((A,q,Z)=>{if(!mt.listening)return;const K=T(A),fe=N(K,mt.currentRoute.value);if(fe){M(ye(fe,{replace:!0,force:!0}),K).catch(Ms);return}u=K;const _=l.value;kr&&XS(Bu(_.fullPath,Z.delta),zo()),F(K,_).catch(v=>ln(v,Le.NAVIGATION_ABORTED|Le.NAVIGATION_CANCELLED)?v:ln(v,Le.NAVIGATION_GUARD_REDIRECT)?(M(ye(b(v.to),{force:!0}),K).then(w=>{ln(w,Le.NAVIGATION_ABORTED|Le.NAVIGATION_DUPLICATED)&&!Z.delta&&Z.type===Xa.pop&&s.go(-1,!1)}).catch(Ms),Promise.reject()):(Z.delta&&s.go(-Z.delta,!1),ae(v,K,_))).then(v=>{v=v||D(K,_,!1),v&&(Z.delta&&!ln(v,Le.NAVIGATION_CANCELLED)?s.go(-Z.delta,!1):Z.type===Xa.pop&&ln(v,Le.NAVIGATION_ABORTED|Le.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),J(K,_,v)}).catch(Ms)}))}let we=is(),le=is(),X;function ae(A,q,Z){et(A);const K=le.list();return K.length?K.forEach(fe=>fe(A,q,Z)):console.error(A),Promise.reject(A)}function Be(){return X&&l.value!==Pn?Promise.resolve():new Promise((A,q)=>{we.add([A,q])})}function et(A){return X||(X=!A,ce(),we.list().forEach(([q,Z])=>A?Z(A):q()),we.reset()),A}function tt(A,q,Z,K){const{scrollBehavior:fe}=e;if(!kr||!fe)return Promise.resolve();const _=!Z&&QS(Bu(A.fullPath,0))||(K||!Z)&&history.state&&history.state.scroll||null;return xo().then(()=>fe(A,q,_)).then(v=>v&&YS(v)).catch(v=>ae(v,A,q))}const me=A=>s.go(A);let Je;const Ve=new Set,mt={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:t.clearRoutes,hasRoute:y,getRoutes:g,resolve:T,options:e,push:E,replace:m,go:me,back:()=>me(-1),forward:()=>me(1),beforeEach:i.add,beforeResolve:o.add,afterEach:a.add,onError:le.add,isReady:Be,install(A){A.component("RouterLink",xk),A.component("RouterView",Ik),A.config.globalProperties.$router=mt,Object.defineProperty(A.config.globalProperties,"$route",{enumerable:!0,get:()=>Dt(l)}),kr&&!Je&&l.value===Pn&&(Je=!0,E(s.location).catch(K=>{}));const q={};for(const K in Pn)Object.defineProperty(q,K,{get:()=>l.value[K],enumerable:!0});A.provide(Uo,mt),A.provide(ic,Id(q)),A.provide(el,l);const Z=A.unmount;Ve.add(A),A.unmount=function(){Ve.delete(A),Ve.size<1&&(u=Pn,re&&re(),re=null,l.value=Pn,Je=!1,X=!1),Z()}}};function Ue(A){return A.reduce((q,Z)=>q.then(()=>I(Z)),Promise.resolve())}return mt}function _x(){return Pt(Uo)}function vx(e){return Pt(ic)}const Nk=[{path:"/",name:"ProjectList",component:()=>Ze(()=>import("./ProjectListView-DzEu-C36.js"),__vite__mapDeps([0,1,2,3]))},{path:"/projects/new",name:"ProjectNew",component:()=>Ze(()=>import("./ProjectNewView-Cv-iEAgl.js"),__vite__mapDeps([4,1,2,5,6,7]))},{path:"/projects/:id/edit",name:"ProjectEdit",component:()=>Ze(()=>import("./ProjectEditView-Bes4Mib4.js"),__vite__mapDeps([8,1,2,9,10,5,6,11,12,13,14]))},{path:"/projects/:projectId/command-buttons/new",name:"CommandButtonNew",component:()=>Ze(()=>import("./CommandButtonDetailView-Bk_SHxpu.js"),__vite__mapDeps([15,16,2,17]))},{path:"/projects/:projectId/command-buttons/:buttonId",name:"CommandButtonEdit",component:()=>Ze(()=>import("./CommandButtonDetailView-Bk_SHxpu.js"),__vite__mapDeps([15,16,2,17]))},{path:"/projects/:id/sessions",name:"SessionList",component:()=>Ze(()=>import("./SessionListView-CuHsWj85.js"),__vite__mapDeps([18,1,2,19,20,21,16,22,23,24,25,26,27,11,12,13,28,29,30,31,32,33,34,35,36,37]))},{path:"/projects/:id/archived",name:"ArchivedSessions",component:()=>Ze(()=>import("./SessionListView-CuHsWj85.js"),__vite__mapDeps([18,1,2,19,20,21,16,22,23,24,25,26,27,11,12,13,28,29,30,31,32,33,34,35,36,37]))},{path:"/projects/:id/templates",name:"ProjectTemplates",component:()=>Ze(()=>import("./SessionListView-CuHsWj85.js"),__vite__mapDeps([18,1,2,19,20,21,16,22,23,24,25,26,27,11,12,13,28,29,30,31,32,33,34,35,36,37]))},{path:"/projects/:id/commands",name:"ProjectCommands",component:()=>Ze(()=>import("./SessionListView-CuHsWj85.js"),__vite__mapDeps([18,1,2,19,20,21,16,22,23,24,25,26,27,11,12,13,28,29,30,31,32,33,34,35,36,37]))},{path:"/projects/:id/scheduled",name:"ScheduledSessions",component:()=>Ze(()=>import("./SessionListView-CuHsWj85.js"),__vite__mapDeps([18,1,2,19,20,21,16,22,23,24,25,26,27,11,12,13,28,29,30,31,32,33,34,35,36,37]))},{path:"/projects/:id/kanban",name:"ProjectKanban",component:()=>Ze(()=>import("./SessionListView-CuHsWj85.js"),__vite__mapDeps([18,1,2,19,20,21,16,22,23,24,25,26,27,11,12,13,28,29,30,31,32,33,34,35,36,37]))},{path:"/projects/:projectId/templates/:templateId",name:"TemplateDetail",component:()=>Ze(()=>import("./TemplateDetailView-BhOjYIvS.js"),__vite__mapDeps([38,26,2,19,20,27,11,12,13,31,32,33,34,39]))},{path:"/projects/:id/sessions/new",name:"NewSession",component:()=>Ze(()=>import("./NewSessionView-BsI7JtO9.js"),__vite__mapDeps([40,19,2,20,26,27,9,10,41,42,35,11,12,13,28,29,36,33,34,1,43]))},{path:"/sessions/active",name:"ActiveSessions",component:()=>Ze(()=>import("./ActiveSessionsView-3697sD8N.js"),__vite__mapDeps([44,19,2,20,16,23,21,22,24,45]))},{path:"/sessions/:id/:tab?",name:"SessionDetail",component:()=>Ze(()=>import("./SessionDetailView-DUYb7qTA.js").then(e=>e.S),__vite__mapDeps([46,19,2,20,1,26,27,21,16,22,25,11,12,13,28,29,30,9,10,41,42,33,34,47]))},{path:"/settings",name:"Settings",component:()=>Ze(()=>import("./SettingsView-5RDCXNUa.js"),__vite__mapDeps([48,49])),redirect:"/settings/providers",children:[{path:"providers",name:"Providers",component:()=>Ze(()=>import("./ProvidersView-CgAr0qms.js"),__vite__mapDeps([50,12,2,51]))},{path:"summary",name:"SummarySettings",component:()=>Ze(()=>import("./SummarySettingsView-KvgSGHdd.js"),__vite__mapDeps([52,20,2,33,34,53]))},{path:"general",name:"GeneralSettings",component:()=>Ze(()=>import("./GeneralSettingsView-BqCzCX-z.js"),__vite__mapDeps([54,20,2,55]))},{path:"logs",name:"AgentLogs",component:()=>Ze(()=>import("./AgentLogsView-D4l0N9ZA.js"),__vite__mapDeps([56,2,57]))}]}],$k=Pk({history:uk(),routes:Nk});var k=typeof window<"u"?window:void 0,at=typeof globalThis<"u"?globalThis:k;typeof self>"u"&&(at.self=at),typeof File>"u"&&(at.File=function(){});var Op=Array.prototype,tf=Op.forEach,nf=Op.indexOf,Ct=at==null?void 0:at.navigator,j=at==null?void 0:at.document,st=at==null?void 0:at.location,tl=at==null?void 0:at.fetch,nl=at!=null&&at.XMLHttpRequest&&"withCredentials"in new at.XMLHttpRequest?at.XMLHttpRequest:void 0,rf=at==null?void 0:at.AbortController,St=Ct==null?void 0:Ct.userAgent,Q=k??{},fn={DEBUG:!1,LIB_VERSION:"1.356.1"};function sf(e,t,n,r,s,i,o){try{var a=e[i](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,s)}function dn(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var i=e.apply(t,n);function o(l){sf(i,r,s,o,a,"next",l)}function a(l){sf(i,r,s,o,a,"throw",l)}o(void 0)})}}function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}function xp(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Dk=["$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"],Mk=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],of=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return Mk.concat(t).some(r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1})};function ue(e,t){return e.indexOf(t)!==-1}var jo=function(e){return e.trim()},rl=function(e){return e.replace(/^\$/,"")},Fk=Array.isArray,Ap=Object.prototype,Cp=Ap.hasOwnProperty,Bo=Ap.toString,_e=Fk||function(e){return Bo.call(e)==="[object Array]"},bn=e=>typeof e=="function",Xe=e=>e===Object(e)&&!_e(e),Ar=e=>{if(Xe(e)){for(var t in e)if(Cp.call(e,t))return!1;return!0}return!1},B=e=>e===void 0,Ge=e=>Bo.call(e)=="[object String]",sl=e=>Ge(e)&&e.trim().length===0,Gt=e=>e===null,de=e=>B(e)||Gt(e),Cn=e=>Bo.call(e)=="[object Number]"&&e==e,Tr=e=>Cn(e)&&e>0,Tn=e=>Bo.call(e)==="[object Boolean]",Lk=e=>e instanceof FormData,zk=e=>ue(Dk,e);function il(e){return e===null||typeof e!="object"}function no(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function Rp(e){return!B(Event)&&function(t,n){try{return t instanceof n}catch{return!1}}(e,Event)}var Uk=[!0,"true",1,"1","yes"],la=e=>ue(Uk,e),jk=[!1,"false",0,"0","no"];function rn(e,t,n,r,s){return t>n&&(r.warn("min cannot be greater than max."),t=n),Cn(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),rn(s||n,t,n,r))}class Bk{constructor(t){this.t={},this.i=t.i,this.o=rn(t.bucketSize,0,100,t.h),this.m=rn(t.refillRate,0,this.o,t.h),this.$=rn(t.refillInterval,0,864e5,t.h)}S(t,n){var r=n-t.lastAccess,s=Math.floor(r/this.$);if(s>0){var i=s*this.m;t.tokens=Math.min(t.tokens+i,this.o),t.lastAccess=t.lastAccess+s*this.$}}consumeRateLimit(t){var n,r=Date.now(),s=String(t),i=this.t[s];return i?this.S(i,r):(i={tokens:this.o,lastAccess:r},this.t[s]=i),i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.i)==null||n.call(this,t)),i.tokens===0)}stop(){this.t={}}}var Ft="Mobile",ro="iOS",wn="Android",Ks="Tablet",Ip=wn+" "+Ks,Pp="iPad",Np="Apple",$p=Np+" Watch",Js="Safari",Hr="BlackBerry",Dp="Samsung",Mp=Dp+"Browser",Fp=Dp+" Internet",pr="Chrome",Vk=pr+" OS",Lp=pr+" "+ro,oc="Internet Explorer",zp=oc+" "+Ft,ac="Opera",Zk=ac+" Mini",lc="Edge",Up="Microsoft "+lc,Mr="Firefox",jp=Mr+" "+ro,Ys="Nintendo",Xs="PlayStation",Fr="Xbox",Bp=wn+" "+Ft,Vp=Ft+" "+Js,vs="Windows",ol=vs+" Phone",af="Nokia",al="Ouya",Zp="Generic",Hk=Zp+" "+Ft.toLowerCase(),Hp=Zp+" "+Ks.toLowerCase(),ll="Konqueror",gt="(\\d+(\\.\\d+)?)",ca=new RegExp("Version/"+gt),Gk=new RegExp(Fr,"i"),Wk=new RegExp(Xs+" \\w+","i"),qk=new RegExp(Ys+" \\w+","i"),cc=new RegExp(Hr+"|PlayBook|BB10","i"),Kk={"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"},Si,lf,ua,Jk=(e,t)=>t&&ue(t,Np)||function(n){return ue(n,Js)&&!ue(n,pr)&&!ue(n,wn)}(e),Gp=function(e,t){return t=t||"",ue(e," OPR/")&&ue(e,"Mini")?Zk:ue(e," OPR/")?ac:cc.test(e)?Hr:ue(e,"IE"+Ft)||ue(e,"WPDesktop")?zp:ue(e,Mp)?Fp:ue(e,lc)||ue(e,"Edg/")?Up:ue(e,"FBIOS")?"Facebook "+Ft:ue(e,"UCWEB")||ue(e,"UCBrowser")?"UC Browser":ue(e,"CriOS")?Lp:ue(e,"CrMo")||ue(e,pr)?pr:ue(e,wn)&&ue(e,Js)?Bp:ue(e,"FxiOS")?jp:ue(e.toLowerCase(),ll.toLowerCase())?ll:Jk(e,t)?ue(e,Ft)?Vp:Js:ue(e,Mr)?Mr:ue(e,"MSIE")||ue(e,"Trident/")?oc:ue(e,"Gecko")?Mr:""},Yk={[zp]:[new RegExp("rv:"+gt)],[Up]:[new RegExp(lc+"?\\/"+gt)],[pr]:[new RegExp("("+pr+"|CrMo)\\/"+gt)],[Lp]:[new RegExp("CriOS\\/"+gt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+gt)],[Js]:[ca],[Vp]:[ca],[ac]:[new RegExp("(Opera|OPR)\\/"+gt)],[Mr]:[new RegExp(Mr+"\\/"+gt)],[jp]:[new RegExp("FxiOS\\/"+gt)],[ll]:[new RegExp("Konqueror[:/]?"+gt,"i")],[Hr]:[new RegExp(Hr+" "+gt),ca],[Bp]:[new RegExp("android\\s"+gt,"i")],[Fp]:[new RegExp(Mp+"\\/"+gt)],[oc]:[new RegExp("(rv:|MSIE )"+gt)],Mozilla:[new RegExp("rv:"+gt)]},Xk=function(e,t){var n=Gp(e,t),r=Yk[n];if(B(r))return null;for(var s=0;s<r.length;s++){var i=r[s],o=e.match(i);if(o)return parseFloat(o[o.length-2])}return null},cf=[[new RegExp(Fr+"; "+Fr+" (.*?)[);]","i"),e=>[Fr,e&&e[1]||""]],[new RegExp(Ys,"i"),[Ys,""]],[new RegExp(Xs,"i"),[Xs,""]],[cc,[Hr,""]],[new RegExp(vs,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ol,""];if(new RegExp(Ft).test(t)&&!/IEMobile\b/.test(t))return[vs+" "+Ft,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],s=Kk[r]||"";return/arm/i.test(t)&&(s="RT"),[vs,s]}return[vs,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[ro,t.join(".")]}return[ro,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=B(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+wn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+wn+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[wn,t.join(".")]}return[wn,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Vk,""]],[/Linux|debian/i,["Linux",""]]],uf=function(e){return qk.test(e)?Ys:Wk.test(e)?Xs:Gk.test(e)?Fr:new RegExp(al,"i").test(e)?al:new RegExp("("+ol+"|WPDesktop)","i").test(e)?ol:/iPad/.test(e)?Pp:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?$p:cc.test(e)?Hr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(af,"i").test(e)?af:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Ft).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?wn:Ip:new RegExp("(pda|"+Ft+")","i").test(e)?Hk:new RegExp(Ks,"i").test(e)&&!new RegExp(Ks+" pc","i").test(e)?Hp:""},Qk=e=>e instanceof Error;function eT(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return ua&&n.length===lf||(lf=n.length,ua=n.reduce((r,s)=>{Si||(Si={});var i=Si[s];if(i)r[i[0]]=i[1];else for(var o=e(s),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=t[s];if(u&&c){r[u]=c,Si[s]=[u,c];break}}return r},{})),ua}}class tT{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(t),i=this.buildParsingContext(n),o=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return dn(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&_e(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,s;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),U({},t,{cause:r,stack:s})}applyChunkIds(t,n){return t.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return dn(function*(){var r=t;for(var s of n.modifiers)r=yield s(r);return r})()}convertToExceptionList(t,n){var r,s,i,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=t.synthetic)!==null&&i!==void 0&&i}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return t.cause!=null&&a.push(...this.convertToExceptionList(t.cause,U({},n,{handled:!0}))),a}buildParsingContext(t){var n;return{chunkIdMap:eT(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var s=(i,o)=>{if(o<=4){var a=this.buildCoercingContext(t,n,o);return this.applyCoercers(i,a)}};return U({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Gr="?";function cl(e,t,n,r,s){var i={platform:e,filename:t,function:n==="<anonymous>"?Gr:n,in_app:!0};return B(r)||(i.lineno=r),B(s)||(i.colno=s),i}var Wp=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Gr,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},nT=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,rT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,sT=/\((\S*)(?::(\d+))(?::(\d+))\)/,iT=(e,t)=>{var n=nT.exec(e);if(n){var[,r,s,i]=n;return cl(t,r,Gr,+s,+i)}var o=rT.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=sT.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=Wp(o[1]||Gr,o[2]);return cl(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},oT=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,aT=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,lT=(e,t)=>{var n=oT.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=aT.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Gr;return[i,s]=Wp(i,s),cl(t,s,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},ff=/\(error: (.*)\)/,df=50;function cT(){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(s,i){i===void 0&&(i=0);for(var o=[],a=s.split(`
|
|
79
|
+
*/let ak=()=>location.protocol+"//"+location.host;function Sp(e,t){const{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let o=s.includes(e.slice(i))?e.slice(i).length:1,a=s.slice(o);return a[0]!=="/"&&(a="/"+a),Uu(a,"")}return Uu(n,e)+r+s}function lk(e,t,n,r){let s=[],i=[],o=null;const a=({state:d})=>{const h=Sp(e,location),p=n.value,g=t.value;let y=0;if(d){if(n.value=h,t.value=d,o&&o===p){o=null;return}y=g?d.position-g.position:0}else r(h);s.forEach(T=>{T(n.value,p,{delta:y,type:Xa.pop,direction:y?y>0?oa.forward:oa.back:oa.unknown})})};function l(){o=n.value}function u(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return i.push(h),h}function c(){if(document.visibilityState==="hidden"){const{history:d}=window;if(!d.state)return;d.replaceState(ye({},d.state,{scroll:zo()}),"")}}function f(){for(const d of i)d();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function Hu(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?zo():null}}function ck(e){const{history:t,location:n}=window,r={value:Sp(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,u,c){const f=e.indexOf("#"),d=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:ak()+e+l;try{t[c?"replaceState":"pushState"](u,"",d),s.value=u}catch(h){console.error(h),n[c?"replace":"assign"](d)}}function o(l,u){i(l,ye({},t.state,Hu(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ye({},s.value,t.state,{forward:l,scroll:zo()});i(c.current,c,!0),i(l,ye({},Hu(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:o}}function uk(e){e=WS(e);const t=ck(e),n=lk(e,t.state,t.location,t.replace);function r(i,o=!0){o||n.pauseListeners(),history.go(i)}const s=ye({location:"",base:e,go:r,createHref:KS.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let ar=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Ye=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Ye||{});const fk={type:ar.Static,value:""},dk=/[a-zA-Z0-9_]/;function hk(e){if(!e)return[[]];if(e==="/")return[[fk]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${u}": ${h}`)}let n=Ye.Static,r=n;const s=[];let i;function o(){i&&s.push(i),i=[]}let a=0,l,u="",c="";function f(){u&&(n===Ye.Static?i.push({type:ar.Static,value:u}):n===Ye.Param||n===Ye.ParamRegExp||n===Ye.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),i.push({type:ar.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function d(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Ye.ParamRegExp){r=n,n=Ye.EscapeNext;continue}switch(n){case Ye.Static:l==="/"?(u&&f(),o()):l===":"?(f(),n=Ye.Param):d();break;case Ye.EscapeNext:d(),n=r;break;case Ye.Param:l==="("?n=Ye.ParamRegExp:dk.test(l)?d():(f(),n=Ye.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Ye.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Ye.ParamRegExpEnd:c+=l;break;case Ye.ParamRegExpEnd:f(),n=Ye.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Ye.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),o(),s}const Gu="[^/]+?",pk={sensitive:!1,strict:!1,start:!0,end:!0};var _t=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(_t||{});const gk=/[.+*?^${}()[\]/\\]/g;function _k(e,t){const n=ye({},pk,t),r=[];let s=n.start?"^":"";const i=[];for(const u of e){const c=u.length?[]:[_t.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const d=u[f];let h=_t.Segment+(n.sensitive?_t.BonusCaseSensitive:0);if(d.type===ar.Static)f||(s+="/"),s+=d.value.replace(gk,"\\$&"),h+=_t.Static;else if(d.type===ar.Param){const{value:p,repeatable:g,optional:y,regexp:T}=d;i.push({name:p,repeatable:g,optional:y});const b=T||Gu;if(b!==Gu){h+=_t.BonusCustomRegExp;try{`${b}`}catch(E){throw new Error(`Invalid custom RegExp for param "${p}" (${b}): `+E.message)}}let S=g?`((?:${b})(?:/(?:${b}))*)`:`(${b})`;f||(S=y&&u.length<2?`(?:/${S})`:"/"+S),y&&(S+="?"),s+=S,h+=_t.Dynamic,y&&(h+=_t.BonusOptional),g&&(h+=_t.BonusRepeatable),b===".*"&&(h+=_t.BonusWildcard)}c.push(h)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=_t.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const o=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(o),f={};if(!c)return null;for(let d=1;d<c.length;d++){const h=c[d]||"",p=i[d-1];f[p.name]=h&&p.repeatable?h.split("/"):h}return f}function l(u){let c="",f=!1;for(const d of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const h of d)if(h.type===ar.Static)c+=h.value;else if(h.type===ar.Param){const{value:p,repeatable:g,optional:y}=h,T=p in u?u[p]:"";if(Ht(T)&&!g)throw new Error(`Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`);const b=Ht(T)?T.join("/"):T;if(!b)if(y)d.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${p}"`);c+=b}}return c||"/"}return{re:o,score:r,keys:i,parse:a,stringify:l}}function vk(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===_t.Static+_t.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===_t.Static+_t.Segment?1:-1:0}function kp(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const i=vk(r[n],s[n]);if(i)return i;n++}if(Math.abs(s.length-r.length)===1){if(Wu(r))return 1;if(Wu(s))return-1}return s.length-r.length}function Wu(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const mk={strict:!1,end:!0,sensitive:!1};function yk(e,t,n){const r=_k(hk(e.path),n),s=ye(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function bk(e,t){const n=[],r=new Map;t=zu(mk,t);function s(f){return r.get(f)}function i(f,d,h){const p=!h,g=Ku(f);g.aliasOf=h&&h.record;const y=zu(t,f),T=[g];if("alias"in f){const E=typeof f.alias=="string"?[f.alias]:f.alias;for(const m of E)T.push(Ku(ye({},g,{components:h?h.record.components:g.components,path:m,aliasOf:h?h.record:g})))}let b,S;for(const E of T){const{path:m}=E;if(d&&m[0]!=="/"){const N=d.record.path,M=N[N.length-1]==="/"?"":"/";E.path=d.record.path+(m&&M+m)}if(b=yk(E,d,y),h?h.alias.push(b):(S=S||b,S!==b&&S.alias.push(b),p&&f.name&&!Ju(b)&&o(f.name)),Tp(b)&&l(b),g.children){const N=g.children;for(let M=0;M<N.length;M++)i(N[M],b,h&&h.children[M])}h=h||b}return S?()=>{o(S)}:Ms}function o(f){if(wp(f)){const d=r.get(f);d&&(r.delete(f),n.splice(n.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=n.indexOf(f);d>-1&&(n.splice(d,1),f.record.name&&r.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return n}function l(f){const d=Sk(f,n);n.splice(d,0,f),f.record.name&&!Ju(f)&&r.set(f.record.name,f)}function u(f,d){let h,p={},g,y;if("name"in f&&f.name){if(h=r.get(f.name),!h)throw Zr(Le.MATCHER_NOT_FOUND,{location:f});y=h.record.name,p=ye(qu(d.params,h.keys.filter(S=>!S.optional).concat(h.parent?h.parent.keys.filter(S=>S.optional):[]).map(S=>S.name)),f.params&&qu(f.params,h.keys.map(S=>S.name))),g=h.stringify(p)}else if(f.path!=null)g=f.path,h=n.find(S=>S.re.test(g)),h&&(p=h.parse(g),y=h.record.name);else{if(h=d.name?r.get(d.name):n.find(S=>S.re.test(d.path)),!h)throw Zr(Le.MATCHER_NOT_FOUND,{location:f,currentLocation:d});y=h.record.name,p=ye({},d.params,f.params),g=h.stringify(p)}const T=[];let b=h;for(;b;)T.unshift(b.record),b=b.parent;return{name:y,path:g,params:p,matched:T,meta:Ek(T)}}e.forEach(f=>i(f));function c(){n.length=0,r.clear()}return{addRoute:i,resolve:u,removeRoute:o,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function qu(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Ku(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:wk(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function wk(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Ju(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ek(e){return e.reduce((t,n)=>ye(t,n.meta),{})}function Sk(e,t){let n=0,r=t.length;for(;n!==r;){const i=n+r>>1;kp(e,t[i])<0?r=i:n=i+1}const s=kk(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function kk(e){let t=e;for(;t=t.parent;)if(Tp(t)&&kp(e,t)===0)return t}function Tp({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Yu(e){const t=Pt(Uo),n=Pt(ic),r=Ce(()=>{const l=Dt(e.to);return t.resolve(l)}),s=Ce(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const d=f.findIndex(Vr.bind(null,c));if(d>-1)return d;const h=Xu(l[u-2]);return u>1&&Xu(c)===h&&f[f.length-1].path!==h?f.findIndex(Vr.bind(null,l[u-2])):d}),i=Ce(()=>s.value>-1&&Ck(n.params,r.value.params)),o=Ce(()=>s.value>-1&&s.value===n.matched.length-1&&bp(n.params,r.value.params));function a(l={}){if(Ak(l)){const u=t[Dt(e.replace)?"replace":"push"](Dt(e.to)).catch(Ms);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:Ce(()=>r.value.href),isActive:i,isExactActive:o,navigate:a}}function Tk(e){return e.length===1?e[0]:e}const Ok=Ul({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Yu,setup(e,{slots:t}){const n=ri(Yu(e)),{options:r}=Pt(Uo),s=Ce(()=>({[Qu(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Qu(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Tk(t.default(n));return e.custom?i:Wl("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),xk=Ok;function Ak(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ck(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!Ht(s)||s.length!==r.length||r.some((i,o)=>i.valueOf()!==s[o].valueOf()))return!1}return!0}function Xu(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Qu=(e,t,n)=>e??t??n,Rk=Ul({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Pt(el),s=Ce(()=>e.route||r.value),i=Pt(Zu,0),o=Ce(()=>{let u=Dt(i);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=Ce(()=>s.value.matched[o.value]);Ri(Zu,Ce(()=>o.value+1)),Ri(ik,a),Ri(el,s);const l=It();return Nr(()=>[l.value,a.value,e.name],([u,c,f],[d,h,p])=>{c&&(c.instances[f]=u,h&&h!==c&&u&&u===d&&(c.leaveGuards.size||(c.leaveGuards=h.leaveGuards),c.updateGuards.size||(c.updateGuards=h.updateGuards))),u&&c&&(!h||!Vr(c,h)||!d)&&(c.enterCallbacks[f]||[]).forEach(g=>g(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,d=f&&f.components[c];if(!d)return ef(n.default,{Component:d,route:u});const h=f.props[c],p=h?h===!0?u.params:typeof h=="function"?h(u):h:null,y=Wl(d,ye({},p,t,{onVnodeUnmounted:T=>{T.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return ef(n.default,{Component:y,route:u})||y}}});function ef(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Ik=Rk;function Pk(e){const t=bk(e.routes,e),n=e.parseQuery||rk,r=e.stringifyQuery||Vu,s=e.history,i=is(),o=is(),a=is(),l=f_(Pn);let u=Pn;kr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=sa.bind(null,A=>""+A),f=sa.bind(null,US),d=sa.bind(null,qs);function h(A,q){let Z,K;return wp(A)?(Z=t.getRecordMatcher(A),K=q):K=A,t.addRoute(K,Z)}function p(A){const q=t.getRecordMatcher(A);q&&t.removeRoute(q)}function g(){return t.getRoutes().map(A=>A.record)}function y(A){return!!t.getRecordMatcher(A)}function T(A,q){if(q=ye({},q||l.value),typeof A=="string"){const w=ia(n,A,q.path),O=t.resolve({path:w.path},q),P=s.createHref(w.fullPath);return ye(w,O,{params:d(O.params),hash:qs(w.hash),redirectedFrom:void 0,href:P})}let Z;if(A.path!=null)Z=ye({},A,{path:ia(n,A.path,q.path).path});else{const w=ye({},A.params);for(const O in w)w[O]==null&&delete w[O];Z=ye({},A,{params:f(w)}),q.params=f(q.params)}const K=t.resolve(Z,q),fe=A.hash||"";K.params=c(d(K.params));const _=VS(r,ye({},A,{hash:FS(fe),path:K.path})),v=s.createHref(_);return ye({fullPath:_,hash:fe,query:r===Vu?sk(A.query):A.query||{}},K,{redirectedFrom:void 0,href:v})}function b(A){return typeof A=="string"?ia(n,A,l.value.path):ye({},A)}function S(A,q){if(u!==A)return Zr(Le.NAVIGATION_CANCELLED,{from:q,to:A})}function E(A){return M(A)}function m(A){return E(ye(b(A),{replace:!0}))}function N(A,q){const Z=A.matched[A.matched.length-1];if(Z&&Z.redirect){const{redirect:K}=Z;let fe=typeof K=="function"?K(A,q):K;return typeof fe=="string"&&(fe=fe.includes("?")||fe.includes("#")?fe=b(fe):{path:fe},fe.params={}),ye({query:A.query,hash:A.hash,params:fe.path!=null?{}:A.params},fe)}}function M(A,q){const Z=u=T(A),K=l.value,fe=A.state,_=A.force,v=A.replace===!0,w=N(Z,K);if(w)return M(ye(b(w),{state:typeof w=="object"?ye({},fe,w.state):fe,force:_,replace:v}),q||Z);const O=Z;O.redirectedFrom=q;let P;return!_&&ZS(r,K,Z)&&(P=Zr(Le.NAVIGATION_DUPLICATED,{to:O,from:K}),tt(K,K,!0,!1)),(P?Promise.resolve(P):F(O,K)).catch(x=>ln(x)?ln(x,Le.NAVIGATION_GUARD_REDIRECT)?x:et(x):ae(x,O,K)).then(x=>{if(x){if(ln(x,Le.NAVIGATION_GUARD_REDIRECT))return M(ye({replace:v},b(x.to),{state:typeof x.to=="object"?ye({},fe,x.to.state):fe,force:_}),q||O)}else x=D(O,K,!0,v,fe);return J(O,K,x),x})}function R(A,q){const Z=S(A,q);return Z?Promise.reject(Z):Promise.resolve()}function I(A){const q=Ve.values().next().value;return q&&typeof q.runWithContext=="function"?q.runWithContext(A):A()}function F(A,q){let Z;const[K,fe,_]=ok(A,q);Z=aa(K.reverse(),"beforeRouteLeave",A,q);for(const w of K)w.leaveGuards.forEach(O=>{Z.push(jn(O,A,q))});const v=R.bind(null,A,q);return Z.push(v),Ue(Z).then(()=>{Z=[];for(const w of i.list())Z.push(jn(w,A,q));return Z.push(v),Ue(Z)}).then(()=>{Z=aa(fe,"beforeRouteUpdate",A,q);for(const w of fe)w.updateGuards.forEach(O=>{Z.push(jn(O,A,q))});return Z.push(v),Ue(Z)}).then(()=>{Z=[];for(const w of _)if(w.beforeEnter)if(Ht(w.beforeEnter))for(const O of w.beforeEnter)Z.push(jn(O,A,q));else Z.push(jn(w.beforeEnter,A,q));return Z.push(v),Ue(Z)}).then(()=>(A.matched.forEach(w=>w.enterCallbacks={}),Z=aa(_,"beforeRouteEnter",A,q,I),Z.push(v),Ue(Z))).then(()=>{Z=[];for(const w of o.list())Z.push(jn(w,A,q));return Z.push(v),Ue(Z)}).catch(w=>ln(w,Le.NAVIGATION_CANCELLED)?w:Promise.reject(w))}function J(A,q,Z){a.list().forEach(K=>I(()=>K(A,q,Z)))}function D(A,q,Z,K,fe){const _=S(A,q);if(_)return _;const v=q===Pn,w=kr?history.state:{};Z&&(K||v?s.replace(A.fullPath,ye({scroll:v&&w&&w.scroll},fe)):s.push(A.fullPath,fe)),l.value=A,tt(A,q,Z,v),et()}let re;function ce(){re||(re=s.listen((A,q,Z)=>{if(!mt.listening)return;const K=T(A),fe=N(K,mt.currentRoute.value);if(fe){M(ye(fe,{replace:!0,force:!0}),K).catch(Ms);return}u=K;const _=l.value;kr&&XS(Bu(_.fullPath,Z.delta),zo()),F(K,_).catch(v=>ln(v,Le.NAVIGATION_ABORTED|Le.NAVIGATION_CANCELLED)?v:ln(v,Le.NAVIGATION_GUARD_REDIRECT)?(M(ye(b(v.to),{force:!0}),K).then(w=>{ln(w,Le.NAVIGATION_ABORTED|Le.NAVIGATION_DUPLICATED)&&!Z.delta&&Z.type===Xa.pop&&s.go(-1,!1)}).catch(Ms),Promise.reject()):(Z.delta&&s.go(-Z.delta,!1),ae(v,K,_))).then(v=>{v=v||D(K,_,!1),v&&(Z.delta&&!ln(v,Le.NAVIGATION_CANCELLED)?s.go(-Z.delta,!1):Z.type===Xa.pop&&ln(v,Le.NAVIGATION_ABORTED|Le.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),J(K,_,v)}).catch(Ms)}))}let we=is(),le=is(),X;function ae(A,q,Z){et(A);const K=le.list();return K.length?K.forEach(fe=>fe(A,q,Z)):console.error(A),Promise.reject(A)}function Be(){return X&&l.value!==Pn?Promise.resolve():new Promise((A,q)=>{we.add([A,q])})}function et(A){return X||(X=!A,ce(),we.list().forEach(([q,Z])=>A?Z(A):q()),we.reset()),A}function tt(A,q,Z,K){const{scrollBehavior:fe}=e;if(!kr||!fe)return Promise.resolve();const _=!Z&&QS(Bu(A.fullPath,0))||(K||!Z)&&history.state&&history.state.scroll||null;return xo().then(()=>fe(A,q,_)).then(v=>v&&YS(v)).catch(v=>ae(v,A,q))}const me=A=>s.go(A);let Je;const Ve=new Set,mt={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:t.clearRoutes,hasRoute:y,getRoutes:g,resolve:T,options:e,push:E,replace:m,go:me,back:()=>me(-1),forward:()=>me(1),beforeEach:i.add,beforeResolve:o.add,afterEach:a.add,onError:le.add,isReady:Be,install(A){A.component("RouterLink",xk),A.component("RouterView",Ik),A.config.globalProperties.$router=mt,Object.defineProperty(A.config.globalProperties,"$route",{enumerable:!0,get:()=>Dt(l)}),kr&&!Je&&l.value===Pn&&(Je=!0,E(s.location).catch(K=>{}));const q={};for(const K in Pn)Object.defineProperty(q,K,{get:()=>l.value[K],enumerable:!0});A.provide(Uo,mt),A.provide(ic,Id(q)),A.provide(el,l);const Z=A.unmount;Ve.add(A),A.unmount=function(){Ve.delete(A),Ve.size<1&&(u=Pn,re&&re(),re=null,l.value=Pn,Je=!1,X=!1),Z()}}};function Ue(A){return A.reduce((q,Z)=>q.then(()=>I(Z)),Promise.resolve())}return mt}function _x(){return Pt(Uo)}function vx(e){return Pt(ic)}const Nk=[{path:"/",name:"ProjectList",component:()=>Ze(()=>import("./ProjectListView-BEo1p4dO.js"),__vite__mapDeps([0,1,2,3,4]))},{path:"/projects/new",name:"ProjectNew",component:()=>Ze(()=>import("./ProjectNewView-CXGjy3OL.js"),__vite__mapDeps([5,1,2,6,7,8]))},{path:"/projects/:id/edit",name:"ProjectEdit",component:()=>Ze(()=>import("./ProjectEditView-C3bOYnD6.js"),__vite__mapDeps([9,1,2,10,11,6,7,12,13,14,15]))},{path:"/projects/:projectId/command-buttons/new",name:"CommandButtonNew",component:()=>Ze(()=>import("./CommandButtonDetailView-B9crZey8.js"),__vite__mapDeps([16,17,2,18]))},{path:"/projects/:projectId/command-buttons/:buttonId",name:"CommandButtonEdit",component:()=>Ze(()=>import("./CommandButtonDetailView-B9crZey8.js"),__vite__mapDeps([16,17,2,18]))},{path:"/projects/:id/sessions",name:"SessionList",component:()=>Ze(()=>import("./SessionListView-NGW-u434.js"),__vite__mapDeps([19,1,2,20,21,22,17,23,24,25,26,27,28,12,13,14,29,30,31,32,33,34,35,36,37,38]))},{path:"/projects/:id/archived",name:"ArchivedSessions",component:()=>Ze(()=>import("./SessionListView-NGW-u434.js"),__vite__mapDeps([19,1,2,20,21,22,17,23,24,25,26,27,28,12,13,14,29,30,31,32,33,34,35,36,37,38]))},{path:"/projects/:id/templates",name:"ProjectTemplates",component:()=>Ze(()=>import("./SessionListView-NGW-u434.js"),__vite__mapDeps([19,1,2,20,21,22,17,23,24,25,26,27,28,12,13,14,29,30,31,32,33,34,35,36,37,38]))},{path:"/projects/:id/commands",name:"ProjectCommands",component:()=>Ze(()=>import("./SessionListView-NGW-u434.js"),__vite__mapDeps([19,1,2,20,21,22,17,23,24,25,26,27,28,12,13,14,29,30,31,32,33,34,35,36,37,38]))},{path:"/projects/:id/scheduled",name:"ScheduledSessions",component:()=>Ze(()=>import("./SessionListView-NGW-u434.js"),__vite__mapDeps([19,1,2,20,21,22,17,23,24,25,26,27,28,12,13,14,29,30,31,32,33,34,35,36,37,38]))},{path:"/projects/:id/kanban",name:"ProjectKanban",component:()=>Ze(()=>import("./SessionListView-NGW-u434.js"),__vite__mapDeps([19,1,2,20,21,22,17,23,24,25,26,27,28,12,13,14,29,30,31,32,33,34,35,36,37,38]))},{path:"/projects/:projectId/templates/:templateId",name:"TemplateDetail",component:()=>Ze(()=>import("./TemplateDetailView-C5rbgXwU.js"),__vite__mapDeps([39,27,2,20,21,28,12,13,14,32,33,34,35,40]))},{path:"/projects/:id/sessions/new",name:"NewSession",component:()=>Ze(()=>import("./NewSessionView-91V-4qLi.js"),__vite__mapDeps([41,20,2,21,27,28,10,11,42,43,36,12,13,14,29,30,37,34,35,1,44]))},{path:"/sessions/active",name:"ActiveSessions",component:()=>Ze(()=>import("./ActiveSessionsView-D1daFFvI.js"),__vite__mapDeps([45,20,2,21,17,24,22,23,25,46]))},{path:"/sessions/:id/:tab?",name:"SessionDetail",component:()=>Ze(()=>import("./SessionDetailView-D3f0FEV1.js").then(e=>e.S),__vite__mapDeps([47,20,2,21,1,27,28,22,17,23,26,12,13,14,29,30,31,3,10,11,42,43,34,35,48]))},{path:"/settings",name:"Settings",component:()=>Ze(()=>import("./SettingsView-DKINDb2z.js"),__vite__mapDeps([49,50])),redirect:"/settings/providers",children:[{path:"providers",name:"Providers",component:()=>Ze(()=>import("./ProvidersView-CMAnPTEX.js"),__vite__mapDeps([51,13,2,52]))},{path:"summary",name:"SummarySettings",component:()=>Ze(()=>import("./SummarySettingsView-D_2bSsYD.js"),__vite__mapDeps([53,21,2,34,35,54]))},{path:"general",name:"GeneralSettings",component:()=>Ze(()=>import("./GeneralSettingsView-CzBagrDs.js"),__vite__mapDeps([55,21,2,56]))},{path:"logs",name:"AgentLogs",component:()=>Ze(()=>import("./AgentLogsView-B_NDIx2_.js"),__vite__mapDeps([57,2,58]))}]}],$k=Pk({history:uk(),routes:Nk});var k=typeof window<"u"?window:void 0,at=typeof globalThis<"u"?globalThis:k;typeof self>"u"&&(at.self=at),typeof File>"u"&&(at.File=function(){});var Op=Array.prototype,tf=Op.forEach,nf=Op.indexOf,Ct=at==null?void 0:at.navigator,j=at==null?void 0:at.document,st=at==null?void 0:at.location,tl=at==null?void 0:at.fetch,nl=at!=null&&at.XMLHttpRequest&&"withCredentials"in new at.XMLHttpRequest?at.XMLHttpRequest:void 0,rf=at==null?void 0:at.AbortController,St=Ct==null?void 0:Ct.userAgent,Q=k??{},fn={DEBUG:!1,LIB_VERSION:"1.356.1"};function sf(e,t,n,r,s,i,o){try{var a=e[i](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,s)}function dn(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var i=e.apply(t,n);function o(l){sf(i,r,s,o,a,"next",l)}function a(l){sf(i,r,s,o,a,"throw",l)}o(void 0)})}}function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}function xp(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Dk=["$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"],Mk=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],of=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return Mk.concat(t).some(r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1})};function ue(e,t){return e.indexOf(t)!==-1}var jo=function(e){return e.trim()},rl=function(e){return e.replace(/^\$/,"")},Fk=Array.isArray,Ap=Object.prototype,Cp=Ap.hasOwnProperty,Bo=Ap.toString,_e=Fk||function(e){return Bo.call(e)==="[object Array]"},bn=e=>typeof e=="function",Xe=e=>e===Object(e)&&!_e(e),Ar=e=>{if(Xe(e)){for(var t in e)if(Cp.call(e,t))return!1;return!0}return!1},B=e=>e===void 0,Ge=e=>Bo.call(e)=="[object String]",sl=e=>Ge(e)&&e.trim().length===0,Gt=e=>e===null,de=e=>B(e)||Gt(e),Cn=e=>Bo.call(e)=="[object Number]"&&e==e,Tr=e=>Cn(e)&&e>0,Tn=e=>Bo.call(e)==="[object Boolean]",Lk=e=>e instanceof FormData,zk=e=>ue(Dk,e);function il(e){return e===null||typeof e!="object"}function no(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function Rp(e){return!B(Event)&&function(t,n){try{return t instanceof n}catch{return!1}}(e,Event)}var Uk=[!0,"true",1,"1","yes"],la=e=>ue(Uk,e),jk=[!1,"false",0,"0","no"];function rn(e,t,n,r,s){return t>n&&(r.warn("min cannot be greater than max."),t=n),Cn(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),rn(s||n,t,n,r))}class Bk{constructor(t){this.t={},this.i=t.i,this.o=rn(t.bucketSize,0,100,t.h),this.m=rn(t.refillRate,0,this.o,t.h),this.$=rn(t.refillInterval,0,864e5,t.h)}S(t,n){var r=n-t.lastAccess,s=Math.floor(r/this.$);if(s>0){var i=s*this.m;t.tokens=Math.min(t.tokens+i,this.o),t.lastAccess=t.lastAccess+s*this.$}}consumeRateLimit(t){var n,r=Date.now(),s=String(t),i=this.t[s];return i?this.S(i,r):(i={tokens:this.o,lastAccess:r},this.t[s]=i),i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.i)==null||n.call(this,t)),i.tokens===0)}stop(){this.t={}}}var Ft="Mobile",ro="iOS",wn="Android",Ks="Tablet",Ip=wn+" "+Ks,Pp="iPad",Np="Apple",$p=Np+" Watch",Js="Safari",Hr="BlackBerry",Dp="Samsung",Mp=Dp+"Browser",Fp=Dp+" Internet",pr="Chrome",Vk=pr+" OS",Lp=pr+" "+ro,oc="Internet Explorer",zp=oc+" "+Ft,ac="Opera",Zk=ac+" Mini",lc="Edge",Up="Microsoft "+lc,Mr="Firefox",jp=Mr+" "+ro,Ys="Nintendo",Xs="PlayStation",Fr="Xbox",Bp=wn+" "+Ft,Vp=Ft+" "+Js,vs="Windows",ol=vs+" Phone",af="Nokia",al="Ouya",Zp="Generic",Hk=Zp+" "+Ft.toLowerCase(),Hp=Zp+" "+Ks.toLowerCase(),ll="Konqueror",gt="(\\d+(\\.\\d+)?)",ca=new RegExp("Version/"+gt),Gk=new RegExp(Fr,"i"),Wk=new RegExp(Xs+" \\w+","i"),qk=new RegExp(Ys+" \\w+","i"),cc=new RegExp(Hr+"|PlayBook|BB10","i"),Kk={"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"},Si,lf,ua,Jk=(e,t)=>t&&ue(t,Np)||function(n){return ue(n,Js)&&!ue(n,pr)&&!ue(n,wn)}(e),Gp=function(e,t){return t=t||"",ue(e," OPR/")&&ue(e,"Mini")?Zk:ue(e," OPR/")?ac:cc.test(e)?Hr:ue(e,"IE"+Ft)||ue(e,"WPDesktop")?zp:ue(e,Mp)?Fp:ue(e,lc)||ue(e,"Edg/")?Up:ue(e,"FBIOS")?"Facebook "+Ft:ue(e,"UCWEB")||ue(e,"UCBrowser")?"UC Browser":ue(e,"CriOS")?Lp:ue(e,"CrMo")||ue(e,pr)?pr:ue(e,wn)&&ue(e,Js)?Bp:ue(e,"FxiOS")?jp:ue(e.toLowerCase(),ll.toLowerCase())?ll:Jk(e,t)?ue(e,Ft)?Vp:Js:ue(e,Mr)?Mr:ue(e,"MSIE")||ue(e,"Trident/")?oc:ue(e,"Gecko")?Mr:""},Yk={[zp]:[new RegExp("rv:"+gt)],[Up]:[new RegExp(lc+"?\\/"+gt)],[pr]:[new RegExp("("+pr+"|CrMo)\\/"+gt)],[Lp]:[new RegExp("CriOS\\/"+gt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+gt)],[Js]:[ca],[Vp]:[ca],[ac]:[new RegExp("(Opera|OPR)\\/"+gt)],[Mr]:[new RegExp(Mr+"\\/"+gt)],[jp]:[new RegExp("FxiOS\\/"+gt)],[ll]:[new RegExp("Konqueror[:/]?"+gt,"i")],[Hr]:[new RegExp(Hr+" "+gt),ca],[Bp]:[new RegExp("android\\s"+gt,"i")],[Fp]:[new RegExp(Mp+"\\/"+gt)],[oc]:[new RegExp("(rv:|MSIE )"+gt)],Mozilla:[new RegExp("rv:"+gt)]},Xk=function(e,t){var n=Gp(e,t),r=Yk[n];if(B(r))return null;for(var s=0;s<r.length;s++){var i=r[s],o=e.match(i);if(o)return parseFloat(o[o.length-2])}return null},cf=[[new RegExp(Fr+"; "+Fr+" (.*?)[);]","i"),e=>[Fr,e&&e[1]||""]],[new RegExp(Ys,"i"),[Ys,""]],[new RegExp(Xs,"i"),[Xs,""]],[cc,[Hr,""]],[new RegExp(vs,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ol,""];if(new RegExp(Ft).test(t)&&!/IEMobile\b/.test(t))return[vs+" "+Ft,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],s=Kk[r]||"";return/arm/i.test(t)&&(s="RT"),[vs,s]}return[vs,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[ro,t.join(".")]}return[ro,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=B(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+wn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+wn+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[wn,t.join(".")]}return[wn,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Vk,""]],[/Linux|debian/i,["Linux",""]]],uf=function(e){return qk.test(e)?Ys:Wk.test(e)?Xs:Gk.test(e)?Fr:new RegExp(al,"i").test(e)?al:new RegExp("("+ol+"|WPDesktop)","i").test(e)?ol:/iPad/.test(e)?Pp:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?$p:cc.test(e)?Hr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(af,"i").test(e)?af:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Ft).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?wn:Ip:new RegExp("(pda|"+Ft+")","i").test(e)?Hk:new RegExp(Ks,"i").test(e)&&!new RegExp(Ks+" pc","i").test(e)?Hp:""},Qk=e=>e instanceof Error;function eT(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return ua&&n.length===lf||(lf=n.length,ua=n.reduce((r,s)=>{Si||(Si={});var i=Si[s];if(i)r[i[0]]=i[1];else for(var o=e(s),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=t[s];if(u&&c){r[u]=c,Si[s]=[u,c];break}}return r},{})),ua}}class tT{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(t),i=this.buildParsingContext(n),o=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return dn(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&_e(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,s;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),U({},t,{cause:r,stack:s})}applyChunkIds(t,n){return t.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return dn(function*(){var r=t;for(var s of n.modifiers)r=yield s(r);return r})()}convertToExceptionList(t,n){var r,s,i,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=t.synthetic)!==null&&i!==void 0&&i}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return t.cause!=null&&a.push(...this.convertToExceptionList(t.cause,U({},n,{handled:!0}))),a}buildParsingContext(t){var n;return{chunkIdMap:eT(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var s=(i,o)=>{if(o<=4){var a=this.buildCoercingContext(t,n,o);return this.applyCoercers(i,a)}};return U({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Gr="?";function cl(e,t,n,r,s){var i={platform:e,filename:t,function:n==="<anonymous>"?Gr:n,in_app:!0};return B(r)||(i.lineno=r),B(s)||(i.colno=s),i}var Wp=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Gr,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},nT=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,rT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,sT=/\((\S*)(?::(\d+))(?::(\d+))\)/,iT=(e,t)=>{var n=nT.exec(e);if(n){var[,r,s,i]=n;return cl(t,r,Gr,+s,+i)}var o=rT.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=sT.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=Wp(o[1]||Gr,o[2]);return cl(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},oT=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,aT=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,lT=(e,t)=>{var n=oT.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=aT.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Gr;return[i,s]=Wp(i,s),cl(t,s,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},ff=/\(error: (.*)\)/,df=50;function cT(){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(s,i){i===void 0&&(i=0);for(var o=[],a=s.split(`
|
|
80
80
|
`),l=i;l<a.length;l++){var u=a[l];if(!(u.length>1024)){var c=ff.test(u)?u.replace(ff,"$1"):u;if(!c.match(/\S*Error: /)){for(var f of n){var d=f(c,e);if(d){o.push(d);break}}if(o.length>=df)break}}}return function(h){if(!h.length)return[];var p=Array.from(h);return p.reverse(),p.slice(0,df).map(g=>{return U({},g,{filename:g.filename||(y=p,y[y.length-1]||{}).filename,function:g.function||Gr});var y})}(o)}}("web:javascript",iT,lT)}class uT{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=Ge(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return no(t,"DOMException")}isDOMError(t){return no(t,"DOMError")}}class fT{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class dT{constructor(){}match(t){return no(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r,s=n.apply(t.error);return s||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var hT=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class pT{match(t){return typeof t=="string"}coerce(t,n){var r,[s,i]=this.getInfos(t);return{type:s??"Error",value:i??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,s=t.match(hT);return s&&(n=s[1],r=s[2]),[n,r]}}var gT=["fatal","error","warning","log","info","debug"];function qp(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(!(s.length>t))return r===n.length||s.length<=t?s:s.slice(0,t)+"..."}return""}class _T{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,s=this.getErrorPropertyFromObject(t);return s?n.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return Rp(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+qp(t)}isSeverityLevel(t){return Ge(t)&&!sl(t)&&gT.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(Qk(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class vT{match(t){return Rp(t)}coerce(t,n){var r,s=t.constructor.name;return{type:s,value:s+" captured as exception with keys: "+qp(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class mT{match(t){return il(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class yT{match(t){return no(t,"PromiseRejectionEvent")}coerce(t,n){var r,s=this.getUnhandledRejectionReason(t);return il(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(t){if(il(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var Kp=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k:function(s){if(k&&(fn.DEBUG||Q.POSTHOG_DEBUG||n)&&!B(k.console)&&k.console){for(var i=("__rrweb_original__"in k.console[s])?k.console[s].__rrweb_original__:k.console[s],o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];i(e,...a)}},info:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("log",...i)},warn:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("warn",...i)},error:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("error",...i)},critical:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];console.error(e,...i)},uninitializedWarning:s=>{r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>Kp(e+" "+s,i)};return r},V=Kp("[PostHog.js]"),Fe=V.createLogger,bT=Fe("[ExternalScriptsLoader]"),hf=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return bT.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=j==null?void 0:j.querySelectorAll("script");if(r){for(var s,i=function(){if(r[o].src===t){var l=r[o];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",u=>{l.__posthog_loading_callback_fired=!0,n(void 0,u)}),l.onerror=u=>n(u),{v:void 0})}},o=0;o<r.length;o++)if(s=i())return s.v}var a=()=>{if(!j)return n("document not found");var l=j.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=t,l.onload=f=>{l.__posthog_loading_callback_fired=!0,n(void 0,f)},l.onerror=f=>n(f),e.config.prepare_external_dependency_script&&(l=e.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")j.head.appendChild(l);else{var u,c=j.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):j.body.appendChild(l)}};j!=null&&j.body?a():j==null||j.addEventListener("DOMContentLoaded",a)};Q.__PosthogExtensions__=Q.__PosthogExtensions__||{},Q.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/"+t+".js?v="+e.version;if(t==="remote-config"&&(r="/array/"+e.config.token+"/config.js"),t==="toolbar"){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var i=e.requestRouter.endpointFor("assets",r);hf(e,i,n)},Q.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);hf(e,r,n)};var so={};function Hn(e,t,n){if(_e(e)){if(tf&&e.forEach===tf)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(r in e&&t.call(n,e[r],r)===so)return}}}function Ae(e,t,n){if(!de(e)){if(_e(e))return Hn(e,t,n);if(Lk(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===so)return}else for(var s in e)if(Cp.call(e,s)&&t.call(n,e[s],s)===so)return}}var je=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Hn(n,function(s){for(var i in s)s[i]!==void 0&&(e[i]=s[i])}),e},Wr=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Hn(n,function(s){Hn(s,function(i){e.push(i)})}),e};function Fi(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var pf=function(e){try{return e()}catch{return}},wT=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(s){V.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),V.critical(s)}}},uc=function(e){var t={};return Ae(e,function(n,r){(Ge(n)&&n.length>0||Cn(n))&&(t[r]=n)}),t};function ET(e,t){return n=e,r=i=>Ge(i)&&!Gt(t)?i.slice(0,t):i,s=new Set,function i(o,a){return o!==Object(o)?r?r(o,a):o:s.has(o)?void 0:(s.add(o),_e(o)?(l=[],Hn(o,u=>{l.push(i(u))})):(l={},Ae(o,(u,c)=>{s.has(u)||(l[c]=i(u,c))})),l);var l}(n);var n,r,s}var ST=["herokuapp.com","vercel.app","netlify.app"];function kT(e){var t=e==null?void 0:e.hostname;if(!Ge(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of ST)if(n===r)return!1;return!0}function Jp(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function He(e,t,n,r){var{capture:s=!1,passive:i=!0}=r??{};e==null||e.addEventListener(t,n,{capture:s,passive:i})}function Yp(e){return e.name==="ph_toolbar_internal"}var Xp="$people_distinct_id",ms="__alias",ys="__timers",gf="$autocapture_disabled_server_side",ul="$heatmaps_enabled_server_side",_f="$exception_capture_enabled_server_side",fl="$error_tracking_suppression_rules",vf="$error_tracking_capture_extension_exceptions",mf="$web_vitals_enabled_server_side",Qp="$dead_clicks_enabled_server_side",yf="$product_tours_enabled_server_side",bf="$web_vitals_allowed_metrics",ki="$session_recording_remote_config",io="$sesid",eg="$session_is_sampled",Cr="$enabled_feature_flags",bs="$early_access_features",dl="$feature_flag_details",ws="$stored_person_properties",or="$stored_group_properties",hl="$surveys",oo="$flag_call_reported",pl="$feature_flag_errors",ao="$feature_flag_evaluated_at",en="$user_state",gl="$client_session_props",_l="$capture_rate_limit",vl="$initial_campaign_params",ml="$initial_referrer_info",lo="$initial_person_info",co="$epp",tg="__POSTHOG_TOOLBAR__",os="$posthog_cookieless",TT=[Xp,ms,"__cmpns",ys,"$session_recording_enabled_server_side",ul,io,Cr,fl,en,bs,dl,or,ws,hl,oo,pl,ao,gl,_l,vl,ml,co,lo];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Cn(e)&&isFinite(e)&&Math.floor(e)===e});var wf="0123456789abcdef";class uo{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,s){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||t<0||n<0||r<0||s<0||t>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/Math.pow(2,8),i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new uo(i)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+wf.charAt(this.bytes[n]>>>4)+wf.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new uo(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class OT{constructor(){this.P=0,this.T=0,this.C=new xT}generate(){var t=this.generateOrAbort();if(B(t)){this.P=0;var n=this.generateOrAbort();if(B(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.P)this.P=t,this.I();else{if(!(t+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.I())}return uo.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.C.nextUint32())}I(){this.T=1024*this.C.nextUint32()+(1023&this.C.nextUint32())}}var Ef,ng=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};k&&!B(k.crypto)&&crypto.getRandomValues&&(ng=e=>crypto.getRandomValues(e));class xT{constructor(){this.R=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.R.length&&(ng(this.R),this.F=0),this.R[this.F++]}}var Vn=()=>AT().toString(),AT=()=>(Ef||(Ef=new OT)).generate(),as="",CT=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function RT(e,t){if(t){var n=function(s,i){if(i===void 0&&(i=j),as)return as;if(!i||["localhost","127.0.0.1"].includes(s))return"";for(var o=s.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Vn();!as&&a--;){var u=o.slice(a).join("."),c=l+"=1;domain=."+u+";path=/";i.cookie=c+";max-age=3",i.cookie.includes(l)&&(i.cookie=c+";max-age=0",as=u)}return as}(e);if(!n){var r=(s=>{var i=s.match(CT);return i?i[0]:""})(e);r!==n&&V.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var nn={O:()=>!!j,M:function(e){V.error("cookieStore error: "+e)},A:function(e){if(j){try{for(var t=e+"=",n=j.cookie.split(";").filter(i=>i.length),r=0;r<n.length;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}},D:function(e){var t;try{t=JSON.parse(nn.A(e))||{}}catch{}return t},j:function(e,t,n,r,s){if(j)try{var i="",o="",a=RT(j.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),i="; expires="+l.toUTCString()}s&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&V.warn("cookieStore warning: large cookie, len="+u.length),j.cookie=u,u}catch{return}},L:function(e,t){if(j!=null&&j.cookie)try{nn.j(e,"",-1,t)}catch{return}}},fa=null,$e={O:function(){if(!Gt(fa))return fa;var e=!0;if(B(k))e=!1;else try{var t="__mplssupport__";$e.j(t,"xyz"),$e.A(t)!=='"xyz"'&&(e=!1),$e.L(t)}catch{e=!1}return e||V.error("localStorage unsupported; falling back to cookie store"),fa=e,e},M:function(e){V.error("localStorage error: "+e)},A:function(e){try{return k==null?void 0:k.localStorage.getItem(e)}catch(t){$e.M(t)}return null},D:function(e){try{return JSON.parse($e.A(e))||{}}catch{}return null},j:function(e,t){try{k==null||k.localStorage.setItem(e,JSON.stringify(t))}catch(n){$e.M(n)}},L:function(e){try{k==null||k.localStorage.removeItem(e)}catch(t){$e.M(t)}}},IT=["$device_id","distinct_id",io,eg,co,lo,en],Ti={},PT={O:function(){return!0},M:function(e){V.error("memoryStorage error: "+e)},A:function(e){return Ti[e]||null},D:function(e){return Ti[e]||null},j:function(e,t){Ti[e]=t},L:function(e){delete Ti[e]}},rr=null,rt={O:function(){if(!Gt(rr))return rr;if(rr=!0,B(k))rr=!1;else try{var e="__support__";rt.j(e,"xyz"),rt.A(e)!=='"xyz"'&&(rr=!1),rt.L(e)}catch{rr=!1}return rr},M:function(e){V.error("sessionStorage error: ",e)},A:function(e){try{return k==null?void 0:k.sessionStorage.getItem(e)}catch(t){rt.M(t)}return null},D:function(e){try{return JSON.parse(rt.A(e))||null}catch{}return null},j:function(e,t){try{k==null||k.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){rt.M(n)}},L:function(e){try{k==null||k.sessionStorage.removeItem(e)}catch(t){rt.M(t)}}},hn=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class NT{constructor(t){this._instance=t}get N(){return this._instance.config}get consent(){return this.U()?hn.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===hn.DENIED||this.consent===hn.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===hn.DENIED}optInOut(t){this.B.j(this.q,t?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.L(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get H(){var t=this.B.A(this.q);return la(t)?hn.GRANTED:ue(jk,t)?hn.DENIED:hn.PENDING}get B(){if(!this.W){var t=this.N.opt_out_capturing_persistence_type;this.W=t==="localStorage"?$e:nn;var n=t==="localStorage"?nn:$e;n.A(this.q)&&(this.W.A(this.q)||this.optInOut(la(n.A(this.q))),n.L(this.q,this.N.cross_subdomain_cookie))}return this.W}U(){return!!this.N.respect_dnt&&!!Jp([Ct==null?void 0:Ct.doNotTrack,Ct==null?void 0:Ct.msDoNotTrack,Q.doNotTrack],t=>la(t))}}var Oi=Fe("[Dead Clicks]"),$T=()=>!0,DT=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(Qp)),r=e.instance.config.capture_dead_clicks;return Tn(r)?r:!!Xe(r)||n};class Sf{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[Qp]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.V(()=>{this.J()}):this.stop()}V(t){var n,r;(n=Q.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?Oi.error("failed to load script",s):t()})}J(){var t;if(j){if(!this.G&&(t=Q.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Xe(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.G=Q.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.G.start(j),Oi.info("starting...")}}else Oi.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,Oi.info("stopping..."))}}var da=Fe("[SegmentIntegration]");function MT(e,t){var n=e.config.segment;if(!n)return t();(function(r,s){var i=r.config.segment;if(!i)return s();var o=l=>{var u=()=>l.anonymousId()||Vn();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(en,"identified")),s()},a=i.user();"then"in a&&bn(a.then)?a.then(o):o(a)})(e,()=>{n.register((r=>{Promise&&Promise.resolve||da.warn("This browser does not have Promise support, and can not use the segment integration");var s=(i,o)=>{if(!o)return i;i.event.userId||i.event.anonymousId===r.get_distinct_id()||(da.info("No userId set, resetting PostHog"),r.reset()),i.event.userId&&i.event.userId!==r.get_distinct_id()&&(da.info("UserId set, identifying with PostHog"),r.identify(i.event.userId));var a=r.calculateEventProperties(o,i.event.properties);return i.event.properties=Object.assign({},a,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:i=>s(i,i.event.event),page:i=>s(i,"$pageview"),identify:i=>s(i,"$identify"),screen:i=>s(i,"$screen")}})(e)).then(()=>{t()})})}var rg="posthog-js";function sg(e,t){var{organization:n,projectId:r,prefix:s,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return a=>{var l,u,c,f,d;if(!(i==="*"||i.includes(a.level))||!e.__loaded)return a;a.tags||(a.tags={});var h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());a.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=((l=a.exception)==null?void 0:l.values)||[],g=p.map(T=>U({},T,{stacktrace:T.stacktrace?U({},T.stacktrace,{type:"raw",frames:(T.stacktrace.frames||[]).map(b=>U({},b,{platform:"web:javascript"}))}):void 0})),y={$exception_message:((u=p[0])==null?void 0:u.value)||a.message,$exception_type:(c=p[0])==null?void 0:c.type,$exception_level:a.level,$exception_list:g,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((f=p[0])==null?void 0:f.value)||a.message,$sentry_exception_type:(d=p[0])==null?void 0:d.type,$sentry_tags:a.tags};return n&&r&&(y.$sentry_url=(s||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),o&&e.exceptions.sendExceptionEvent(y),a}}class FT{constructor(t,n,r,s,i,o){this.name=rg,this.setupOnce=function(a){a(sg(t,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}}var fo=e=>{var t=j==null?void 0:j.createElement("a");return B(t)?null:(t.href=e,t)},LT=function(e,t){var n,r;t===void 0&&(t="&");var s=[];return Ae(e,function(i,o){B(i)||B(o)||o==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(i)?i.name:i.toString()),r=encodeURIComponent(o),s[s.length]=r+"="+n)}),s.join(t)},ho=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var i=r[s].split("=");if(i[0]===t){n=i;break}}if(!_e(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{V.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Qs=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",i=r[1],o=s.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],f=0;f<u.length;f++){var d=u[f].split("=");_e(d)&&(t.includes(d[0])?c.push(d[0]+"="+n):c.push(u[f]))}var h=l;return a!=null&&(h+="?"+c.join("&")),i!=null&&(h+="#"+i),h},po=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},zT=k!=null&&k.location?po(k.location.hash,"__posthog")||po(location.hash,"state"):null,kf="_postHogToolbarParams",Tf=Fe("[Toolbar]"),Fn=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Fn||{});class UT{constructor(t){this.instance=t}K(t){Q.ph_toolbar_state=t}Y(){var t;return(t=Q.ph_toolbar_state)!==null&&t!==void 0?t:Fn.UNINITIALIZED}maybeLoadToolbar(t,n,r){if(t===void 0&&(t=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),Yp(this.instance.config)||!k||!j)return!1;t=t??k.location,r=r??k.history;try{if(!n){try{k.localStorage.setItem("test","test"),k.localStorage.removeItem("test")}catch{return!1}n=k==null?void 0:k.localStorage}var s,i=zT||po(t.hash,"__posthog")||po(t.hash,"state"),o=i?pf(()=>JSON.parse(atob(decodeURIComponent(i))))||pf(()=>JSON.parse(decodeURIComponent(i))):null;return o&&o.action==="ph_authorize"?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((s=JSON.parse(n.getItem(kf)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}X(t){var n=Q.ph_load_toolbar||Q.ph_load_editor;!de(n)&&bn(n)?n(t,this.instance):Tf.warn("No toolbar load function found")}loadToolbar(t){var n=!(j==null||!j.getElementById(tg));if(!k||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=U({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(k.localStorage.setItem(kf,JSON.stringify(U({},s,{source:void 0}))),this.Y()===Fn.LOADED)this.X(s);else if(this.Y()===Fn.UNINITIALIZED){var i;this.K(Fn.LOADING),(i=Q.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",o=>{if(o)return Tf.error("[Toolbar] Failed to load",o),void this.K(Fn.UNINITIALIZED);this.K(Fn.LOADED),this.X(s)}),He(k,"turbolinks:load",()=>{this.K(Fn.UNINITIALIZED),this.loadToolbar(s)})}return!0}Z(t){return this.loadToolbar(t)}maybeLoadEditor(t,n,r){return t===void 0&&(t=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(t,n,r)}}class Of{constructor(t){this.tt=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength)&&(V.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.it=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.et()}et(){var t;this.rt=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.tt)}destroy(){var t;(t=this.rt)==null||t.call(this),this.rt=void 0}doPageView(t,n){var r,s=this.st(t,n);return this.it={pathname:(r=k==null?void 0:k.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var n;return this.st(t,(n=this.it)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.it)==null?void 0:t.pageViewId}}st(t,n){var r=this.it;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:f}=i;if(!(B(o)||B(a)||B(l)||B(u)||B(c)||B(f))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),f=Math.ceil(f);var d=o<=1?1:rn(a/o,0,1,V),h=o<=1?1:rn(l/o,0,1,V),p=u<=1?1:rn(c/u,0,1,V),g=u<=1?1:rn(f/u,0,1,V);s=je(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:g})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),s}}var yn=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Lt=Uint8Array,Tt=Uint16Array,qr=Uint32Array,fc=new Lt([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]),dc=new Lt([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]),xf=new Lt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ig=function(e,t){for(var n=new Tt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var s=new qr(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)s[i]=i-n[r]<<5|r;return[n,s]},og=ig(fc,2),jT=og[0],yl=og[1];jT[28]=258,yl[258]=28;for(var Af=ig(dc,0)[1],ag=new Tt(32768),Ie=0;Ie<32768;++Ie){var sr=(43690&Ie)>>>1|(21845&Ie)<<1;sr=(61680&(sr=(52428&sr)>>>2|(13107&sr)<<2))>>>4|(3855&sr)<<4,ag[Ie]=((65280&sr)>>>8|(255&sr)<<8)>>>1}var Fs=function(e,t,n){for(var r=e.length,s=0,i=new Tt(t);s<r;++s)++i[e[s]-1];var o,a=new Tt(t);for(s=0;s<t;++s)a[s]=a[s-1]+i[s-1]<<1;for(o=new Tt(r),s=0;s<r;++s)o[s]=ag[a[e[s]-1]++]>>>15-e[s];return o},gr=new Lt(288);for(Ie=0;Ie<144;++Ie)gr[Ie]=8;for(Ie=144;Ie<256;++Ie)gr[Ie]=9;for(Ie=256;Ie<280;++Ie)gr[Ie]=7;for(Ie=280;Ie<288;++Ie)gr[Ie]=8;var go=new Lt(32);for(Ie=0;Ie<32;++Ie)go[Ie]=5;var BT=Fs(gr,9),VT=Fs(go,5),lg=function(e){return(e/8>>0)+(7&e&&1)},cg=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Tt?Tt:e instanceof qr?qr:Lt)(n-t);return r.set(e.subarray(t,n)),r},cn=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},ls=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},ha=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var s=n.length,i=n.slice();if(!s)return[new Lt(0),0];if(s==1){var o=new Lt(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(m,N){return m.f-N.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=s-1;)a=n[n[u].f<n[f].f?u++:f++],l=n[u!=c&&n[u].f<n[f].f?u++:f++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=i[0].s;for(r=1;r<s;++r)i[r].s>d&&(d=i[r].s);var h=new Tt(d+1),p=bl(n[c-1],h,0);if(p>t){r=0;var g=0,y=p-t,T=1<<y;for(i.sort(function(m,N){return h[N.s]-h[m.s]||m.f-N.f});r<s;++r){var b=i[r].s;if(!(h[b]>t))break;g+=T-(1<<p-h[b]),h[b]=t}for(g>>>=y;g>0;){var S=i[r].s;h[S]<t?g-=1<<t-h[S]++-1:++r}for(;r>=0&&g;--r){var E=i[r].s;h[E]==t&&(--h[E],++g)}p=t}return[new Lt(h),p]},bl=function(e,t,n){return e.s==-1?Math.max(bl(e.l,t,n+1),bl(e.r,t,n+1)):t[e.s]=n},Cf=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Tt(++t),r=0,s=e[0],i=1,o=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==s&&a!=t)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=e[a]}return[n.subarray(0,r),t]},cs=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},wl=function(e,t,n){var r=n.length,s=lg(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var i=0;i<r;++i)e[s+i+4]=n[i];return 8*(s+4+r)},Rf=function(e,t,n,r,s,i,o,a,l,u,c){cn(t,c++,n),++s[256];for(var f=ha(s,15),d=f[0],h=f[1],p=ha(i,15),g=p[0],y=p[1],T=Cf(d),b=T[0],S=T[1],E=Cf(g),m=E[0],N=E[1],M=new Tt(19),R=0;R<b.length;++R)M[31&b[R]]++;for(R=0;R<m.length;++R)M[31&m[R]]++;for(var I=ha(M,7),F=I[0],J=I[1],D=19;D>4&&!F[xf[D-1]];--D);var re,ce,we,le,X=u+5<<3,ae=cs(s,gr)+cs(i,go)+o,Be=cs(s,d)+cs(i,g)+o+14+3*D+cs(M,F)+(2*M[16]+3*M[17]+7*M[18]);if(X<=ae&&X<=Be)return wl(t,c,e.subarray(l,l+u));if(cn(t,c,1+(Be<ae)),c+=2,Be<ae){re=Fs(d,h),ce=d,we=Fs(g,y),le=g;var et=Fs(F,J);for(cn(t,c,S-257),cn(t,c+5,N-1),cn(t,c+10,D-4),c+=14,R=0;R<D;++R)cn(t,c+3*R,F[xf[R]]);c+=3*D;for(var tt=[b,m],me=0;me<2;++me){var Je=tt[me];for(R=0;R<Je.length;++R){var Ve=31&Je[R];cn(t,c,et[Ve]),c+=F[Ve],Ve>15&&(cn(t,c,Je[R]>>>5&127),c+=Je[R]>>>12)}}}else re=BT,ce=gr,we=VT,le=go;for(R=0;R<a;++R)if(r[R]>255){Ve=r[R]>>>18&31,ls(t,c,re[Ve+257]),c+=ce[Ve+257],Ve>7&&(cn(t,c,r[R]>>>23&31),c+=fc[Ve]);var mt=31&r[R];ls(t,c,we[mt]),c+=le[mt],mt>3&&(ls(t,c,r[R]>>>5&8191),c+=dc[mt])}else ls(t,c,re[r[R]]),c+=ce[r[R]];return ls(t,c,re[256]),c+ce[256]},ZT=new qr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),HT=function(){for(var e=new qr(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),GT=function(e,t,n,r,s){return function(i,o,a,l,u,c){var f=i.length,d=new Lt(l+f+5*(1+Math.floor(f/7e3))+u),h=d.subarray(l,d.length-u),p=0;if(!o||f<8)for(var g=0;g<=f;g+=65535){var y=g+65535;y<f?p=wl(h,p,i.subarray(g,y)):(h[g]=c,p=wl(h,p,i.subarray(g,f)))}else{for(var T=ZT[o-1],b=T>>>13,S=8191&T,E=(1<<a)-1,m=new Tt(32768),N=new Tt(E+1),M=Math.ceil(a/3),R=2*M,I=function(x){return(i[x]^i[x+1]<<M^i[x+2]<<R)&E},F=new qr(25e3),J=new Tt(288),D=new Tt(32),re=0,ce=0,we=(g=0,0),le=0,X=0;g<f;++g){var ae=I(g),Be=32767&g,et=N[ae];if(m[Be]=et,N[ae]=Be,le<=g){var tt=f-g;if((re>7e3||we>24576)&&tt>423){p=Rf(i,h,0,F,J,D,ce,we,X,g-X,p),we=re=ce=0,X=g;for(var me=0;me<286;++me)J[me]=0;for(me=0;me<30;++me)D[me]=0}var Je=2,Ve=0,mt=S,Ue=Be-et&32767;if(tt>2&&ae==I(g-Ue))for(var A=Math.min(b,tt)-1,q=Math.min(32767,g),Z=Math.min(258,tt);Ue<=q&&--mt&&Be!=et;){if(i[g+Je]==i[g+Je-Ue]){for(var K=0;K<Z&&i[g+K]==i[g+K-Ue];++K);if(K>Je){if(Je=K,Ve=Ue,K>A)break;var fe=Math.min(Ue,K-2),_=0;for(me=0;me<fe;++me){var v=g-Ue+me+32768&32767,w=v-m[v]+32768&32767;w>_&&(_=w,et=v)}}}Ue+=(Be=et)-(et=m[Be])+32768&32767}if(Ve){F[we++]=268435456|yl[Je]<<18|Af[Ve];var O=31&yl[Je],P=31&Af[Ve];ce+=fc[O]+dc[P],++J[257+O],++D[P],le=g+Je,++re}else F[we++]=i[g],++J[i[g]]}}p=Rf(i,h,c,F,J,D,ce,we,X,g-X,p)}return cg(d,0,l+lg(p)+u)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},pa=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function WT(e,t){t===void 0&&(t={});var n=function(){var a=4294967295;return{p:function(l){for(var u=a,c=0;c<l.length;++c)u=HT[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),r=e.length;n.p(e);var s,i=GT(e,t,10+((s=t).filename&&s.filename.length+1||0),8),o=i.length;return function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&pa(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var c=0;c<=u.length;++c)a[c+10]=u.charCodeAt(c)}}(i,t),pa(i,o-8,n.d()),pa(i,o-4,r),i}var qT=function(e){var t,n,r,s,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
|
|
81
81
|
`).replace(/\r/g,`
|
|
82
|
-
`)).length,s=0;s<r;s++){var o=e.charCodeAt(s),a=null;o<128?n++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Gt(a)||(n>t&&(i+=e.substring(t,n)),i+=a,t=n=s+1)}return n>t&&(i+=e.substring(t,e.length)),i},KT=!!nl||!!tl,If="text/plain",_o=function(e,t,n){var r;n===void 0&&(n=!0);var[s,i]=e.split("?"),o=U({},t),a=(r=i==null?void 0:i.split("&").map(u=>{var c,[f,d]=u.split("="),h=n&&(c=o[f])!==null&&c!==void 0?c:d;return delete o[f],f+"="+h}))!==null&&r!==void 0?r:[],l=LT(o);return l&&a.push(l),s+"?"+a.join("&")},Es=(e,t)=>JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t),ga=e=>{var{data:t,compression:n}=e;if(t){if(n===yn.GZipJS){var r=WT(function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new Lt(l.length+(l.length>>>1)),d=0,h=function(T){f[d++]=T},p=0;p<c;++p){if(d+5>f.length){var g=new Lt(d+8+(c-p<<1));g.set(f),f=g}var y=l.charCodeAt(p);y<128||u?h(y):y<2048?(h(192|y>>>6),h(128|63&y)):y>55295&&y<57344?(h(240|(y=65536+(1047552&y)|1023&l.charCodeAt(++p))>>>18),h(128|y>>>12&63),h(128|y>>>6&63),h(128|63&y)):(h(224|y>>>12),h(128|y>>>6&63),h(128|63&y))}return cg(f,0,d)}(Es(t)),{mtime:0}),s=new Blob([r],{type:If});return{contentType:If,body:s,estimatedSize:s.size}}if(n===yn.Base64){var i=function(l){var u,c,f,d,h,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,y=0,T="",b=[];if(!l)return l;l=qT(l);do u=(h=l.charCodeAt(g++)<<16|l.charCodeAt(g++)<<8|l.charCodeAt(g++))>>18&63,c=h>>12&63,f=h>>6&63,d=63&h,b[y++]=p.charAt(u)+p.charAt(c)+p.charAt(f)+p.charAt(d);while(g<l.length);switch(T=b.join(""),l.length%3){case 1:T=T.slice(0,-2)+"==";break;case 2:T=T.slice(0,-1)+"="}return T}(Es(t)),o=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Es(l)))(i);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Es(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Li=[];tl&&Li.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:s,estimatedSize:i}=(t=ga(e))!==null&&t!==void 0?t:{},o=new Headers;Ae(e.headers,function(c,f){o.append(f,c)}),r&&o.append("Content-Type",r);var a=e.url,l=null;if(rf){var u=new rf;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),e.timeout)}}tl(a,U({method:(e==null?void 0:e.method)||"GET",headers:o,keepalive:e.method==="POST"&&(i||0)<52428.8,body:s,signal:(n=l)==null?void 0:n.signal},e.fetchOptions)).then(c=>c.text().then(f=>{var d={statusCode:c.status,text:f};if(c.status===200)try{d.json=JSON.parse(f)}catch(h){V.error(h)}e.callback==null||e.callback(d)})).catch(c=>{V.error(c),e.callback==null||e.callback({statusCode:0,error:c})}).finally(()=>l?clearTimeout(l.timeout):null)}}),nl&&Li.push({transport:"XHR",method:e=>{var t,n=new nl;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=(t=ga(e))!==null&&t!==void 0?t:{};Ae(e.headers,function(i,o){n.setRequestHeader(o,i)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var i={statusCode:n.status,text:n.responseText};if(n.status===200)try{i.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(i)}},n.send(s)}}),Ct!=null&&Ct.sendBeacon&&Li.push({transport:"sendBeacon",method:e=>{var t=_o(e.url,{beacon:"1"});try{var n,{contentType:r,body:s}=(n=ga(e))!==null&&n!==void 0?n:{},i=typeof s=="string"?new Blob([s],{type:r}):s;Ct.sendBeacon(t,i)}catch{}}});var vo=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function Pf(e,t,n){return Es({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var ug={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>vo(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!vo(n,r))),icontains:(e,t)=>t.map(xi).some(n=>e.map(xi).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(xi).every(n=>e.map(xi).every(r=>!n.includes(r))),gt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(s=>r>parseFloat(s))}),lt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(s=>r<parseFloat(s))})},xi=e=>e.toLowerCase();function fg(e,t){return!e||Object.entries(e).every(n=>{var[r,s]=n,i=t==null?void 0:t[r];if(B(i)||Gt(i))return!1;var o=[String(i)],a=ug[s.operator];return!!a&&a(s.values,o)})}var _a=Fe("[Error tracking]");class JT{constructor(t){var n,r;this.nt=[],this.ot=new tT([new uT,new yT,new dT,new fT,new vT,new _T,new pT,new mT],cT()),this._instance=t,this.nt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(fl))!==null&&n!==void 0?n:[]}onRemoteConfig(t){var n,r,s;if("errorTracking"in t){var i=(n=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],o=(s=t.errorTracking)==null?void 0:s.captureExtensionExceptions;this.nt=i,this._instance.persistence&&this._instance.persistence.register({[fl]:this.nt,[vf]:o})}}get ut(){var t,n=!!this._instance.get_property(vf),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??n)!==null&&t!==void 0&&t}buildProperties(t,n){return this.ot.buildFromUnknown(t,{syntheticException:n==null?void 0:n.syntheticException,mechanism:{handled:n==null?void 0:n.handled}})}sendExceptionEvent(t){var n=t.$exception_list;if(this.ht(n)){if(this.dt(n))return void _a.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(n))return void _a.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(n))return void _a.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(t){if(t.length===0)return!1;var n=t.reduce((r,s)=>{var{type:i,value:o}=s;return Ge(i)&&i.length>0&&r.$exception_types.push(i),Ge(o)&&o.length>0&&r.$exception_values.push(o),r},{$exception_types:[],$exception_values:[]});return this.nt.some(r=>{var s=r.values.map(i=>{var o,a=ug[i.operator],l=_e(i.value)?i.value:[i.value],u=(o=n[i.key])!==null&&o!==void 0?o:[];return l.length>0&&a(l,u)});return r.type==="OR"?s.some(Boolean):s.every(Boolean)})}vt(t){return t.flatMap(n=>{var r,s;return(r=(s=n.stacktrace)==null?void 0:s.frames)!==null&&r!==void 0?r:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}ct(t){if(t.length>0){var n,r,s,i,o=(n=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=o[o.length-1];return(s=a==null||(i=a.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}ht(t){return!de(t)&&_e(t)}}var Ai="https?://(.*)",Kr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],YT=Wr(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Kr),ei="<masked>",XT=["li_fat_id"];function dg(e,t,n){if(!j)return{};var r,s=t?Wr([],Kr,n||[]):[],i=hg(Qs(j.URL,s,ei),e),o=(r={},Ae(XT,function(a){var l=nn.A(a);r[a]=l||null}),r);return je(o,i)}function hg(e,t){var n=YT.concat(t||[]),r={};return Ae(n,function(s){var i=ho(e,s);r[s]=i||null}),r}function pg(e){var t=function(i){return i?i.search(Ai+"google.([^/?]*)")===0?"google":i.search(Ai+"bing.com")===0?"bing":i.search(Ai+"yahoo.com")===0?"yahoo":i.search(Ai+"duckduckgo.com")===0?"duckduckgo":null:null}(e),n=t!="yahoo"?"q":"p",r={};if(!Gt(t)){r.$search_engine=t;var s=j?ho(j.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function Nf(){return navigator.language||navigator.userLanguage}function gg(){return(j==null?void 0:j.referrer)||"$direct"}function _g(e,t){var n=e?Wr([],Kr,t||[]):[],r=st==null?void 0:st.href.substring(0,1e3);return{r:gg().substring(0,1e3),u:r?Qs(r,n,ei):void 0}}function vg(e){var t,{r:n,u:r}=e,s={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=fo(n))==null?void 0:t.host};if(r){s.$current_url=r;var i=fo(r);s.$host=i==null?void 0:i.host,s.$pathname=i==null?void 0:i.pathname;var o=hg(r);je(s,o)}if(n){var a=pg(n);je(s,a)}return s}function mg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function QT(){try{return new Date().getTimezoneOffset()}catch{return}}function eO(e,t){var n,r;if(!St)return{};var s,i,o=e?Wr([],Kr,t||[]):[],[a,l]=function(T){for(var b=0;b<cf.length;b++){var[S,E]=cf[b],m=S.exec(T),N=m&&(bn(E)?E(m,T):E);if(N)return N}return["",""]}(St),u=(s=uf(St))===Pp||s===Ip||s==="Kobo"||s==="Kindle Fire"||s===Hp?Ks:s===Ys||s===Fr||s===Xs||s===al?"Console":s===$p?"Wearable":s?Ft:"Desktop";if(u==="Desktop"&&((n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform)==="Android"&&((r=navigator)==null?void 0:r.maxTouchPoints)>0){var c,f,d,h,p,g=(c=k==null||(f=k.screen)==null?void 0:f.width)!==null&&c!==void 0?c:0,y=(d=k==null||(h=k.screen)==null?void 0:h.height)!==null&&d!==void 0?d:0;u=Math.min(g,y)/((p=k==null?void 0:k.devicePixelRatio)!==null&&p!==void 0?p:1)>=600?"Tablet":"Mobile"}return je(uc({$os:a,$os_version:l,$browser:Gp(St,navigator.vendor),$device:uf(St),$device_type:u,$timezone:mg(),$timezone_offset:QT()}),{$current_url:Qs(st==null?void 0:st.href,o,ei),$host:st==null?void 0:st.host,$pathname:st==null?void 0:st.pathname,$raw_user_agent:St.length>1e3?St.substring(0,997)+"...":St,$browser_version:Xk(St,navigator.vendor),$browser_language:Nf(),$browser_language_prefix:(i=Nf(),typeof i=="string"?i.split("-")[0]:void 0),$screen_height:k==null?void 0:k.screen.height,$screen_width:k==null?void 0:k.screen.width,$viewport_height:k==null?void 0:k.innerHeight,$viewport_width:k==null?void 0:k.innerWidth,$lib:"web",$lib_version:fn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var wt=Fe("[FeatureFlags]"),us=Fe("[FeatureFlags]",{debugEnabled:!0}),tO="errors_while_computing_flags",nO="flag_missing",rO="quota_limited",sO="timeout",iO="connection_error",oO="unknown_error",aO=e=>"api_error_"+e,va="$active_feature_flags",yr="$override_feature_flags",$f="$feature_flag_payloads",fs="$override_feature_flag_payloads",Df="$feature_flag_request_id",Mf=e=>{var t={};for(var[n,r]of Fi(e||{}))r&&(t[n]=r);return t},lO=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(n=>t[n].enabled).filter(n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload}).map(n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]}))):wt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},cO=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class uO{constructor(t){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this.St=!1,this._instance=t,this.featureFlagEventHandlers=[]}kt(){var t,n;return(t=(n=this._instance.persistence)==null?void 0:n.Pt(this._instance.config.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Tt(){return!!this.kt()&&(this.St||this.yt||(this.St=!0,wt.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ct(){var t,n=(t=this._instance.config.evaluation_contexts)!==null&&t!==void 0?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(wt.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),n!=null&&n.length?n.filter(r=>{var s=r&&typeof r=="string"&&r.trim().length>0;return s||wt.error("Invalid evaluation context found:",r,"Expected non-empty string"),s}):[]}It(){return this.Ct().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(dl),n=this._instance.get_property(yr),r=this._instance.get_property(fs);if(!r&&!n)return t||{};var s=je({},t||{}),i=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of i){var a,l,u=s[o],c=n==null?void 0:n[o],f=B(c)?(a=u==null?void 0:u.enabled)!==null&&a!==void 0&&a:!!c,d=B(c)?u.variant:typeof c=="string"?c:void 0,h=r==null?void 0:r[o],p=U({},u,{enabled:f,variant:f?d??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(p.original_enabled=u==null?void 0:u.enabled),d!==(u==null?void 0:u.variant)&&(p.original_variant=u==null?void 0:u.variant),h&&(p.metadata=U({},u==null?void 0:u.metadata,{payload:h,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),s[o]=p}return this._t||(wt.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:s}),this._t=!0),s}getFlagVariants(){var t=this._instance.get_property(Cr),n=this._instance.get_property(yr);if(!n)return t||{};for(var r=je({},t),s=Object.keys(n),i=0;i<s.length;i++)r[s[i]]=n[s[i]];return this._t||(wt.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this._t=!0),r}getFlagPayloads(){var t=this._instance.get_property($f),n=this._instance.get_property(fs);if(!n)return t||{};for(var r=je({},t||{}),s=Object.keys(n),i=0;i<s.length;i++)r[s[i]]=n[s[i]];return this._t||(wt.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this._t=!0),r}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Rt||(this._instance.Ft.emit("featureFlagsReloading",!0),this.Rt=setTimeout(()=>{this.Ot()},5))}Mt(){clearTimeout(this.Rt),this.Rt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Rt||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.wt=t}Ot(t){var n;if(this.Mt(),!this._instance.At())if(this.yt)this.xt=!0;else{var r=this._instance.config.token,s=this._instance.get_property("$device_id"),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:U({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(ws)||{}),group_properties:this._instance.get_property(or),timezone:mg()};Gt(s)||B(s)||(i.$device_id=s),(t!=null&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.It()&&(i.evaluation_contexts=this.Ct());var o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+o);this.yt=!0,this._instance._send_request({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:yn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,f,d=!0;if(l.statusCode===200&&(this.xt||(this.$anon_distinct_id=void 0),d=!1),this.yt=!1,!i.disable_flags||this.xt){this.$t=!d;var h=[];l.error?l.error instanceof Error?h.push(l.error.name==="AbortError"?sO:iO):h.push(oO):l.statusCode!==200&&h.push(aO(l.statusCode)),(u=l.json)!=null&&u.errorsWhileComputingFlags&&h.push(tO);var p=!((c=l.json)==null||(c=c.quotaLimited)==null||!c.includes(cO.FeatureFlags));if(p&&h.push(rO),(f=this._instance.persistence)==null||f.register({[pl]:h}),p)wt.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var g;i.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},d),this.xt&&(this.xt=!1,this.Ot())}}}})}}getFeatureFlag(t,n){var r;if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var s=this.getFeatureFlagResult(t,n);return(r=s==null?void 0:s.variant)!==null&&r!==void 0?r:s==null?void 0:s.enabled}}else wt.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var n=this.getFeatureFlagResult(t,{send_event:!1});return n==null?void 0:n.payload}getFeatureFlagResult(t,n){if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var r=this.getFlagVariants(),s=t in r,i=r[t],o=this.getFlagPayloads()[t],a=String(i),l=this._instance.get_property(Df)||void 0,u=this._instance.get_property(ao)||void 0,c=this._instance.get_property(oo)||{};if((n.send_event||!("send_event"in n))&&(!(t in c)||!c[t].includes(a))){var f,d,h,p,g,y,T,b,S,E;_e(c[t])?c[t].push(a):c[t]=[a],(f=this._instance.persistence)==null||f.register({[oo]:c});var m=this.getFeatureFlagDetails(t),N=[...(d=this._instance.get_property(pl))!==null&&d!==void 0?d:[]];B(i)&&N.push(nO);var M={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:o||null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((h=this._instance.config.bootstrap)==null||(h=h.featureFlags)==null?void 0:h[t])||null,$feature_flag_bootstrapped_payload:((p=this._instance.config.bootstrap)==null||(p=p.featureFlagPayloads)==null?void 0:p[t])||null,$used_bootstrap_value:!this.$t};B(m==null||(g=m.metadata)==null?void 0:g.version)||(M.$feature_flag_version=m.metadata.version);var R,I=(y=m==null||(T=m.reason)==null?void 0:T.description)!==null&&y!==void 0?y:m==null||(b=m.reason)==null?void 0:b.code;I&&(M.$feature_flag_reason=I),m!=null&&(S=m.metadata)!=null&&S.id&&(M.$feature_flag_id=m.metadata.id),B(m==null?void 0:m.original_variant)&&B(m==null?void 0:m.original_enabled)||(M.$feature_flag_original_response=B(m.original_variant)?m.original_enabled:m.original_variant),m!=null&&(E=m.metadata)!=null&&E.original_payload&&(M.$feature_flag_original_payload=m==null||(R=m.metadata)==null?void 0:R.original_payload),N.length&&(M.$feature_flag_error=N.join(",")),this._instance.capture("$feature_flag_called",M)}if(s){var F=o;if(!B(o))try{F=JSON.parse(o)}catch{}return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:F}}}}else wt.warn('getFeatureFlagResult for key "'+t+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(t,n){var r=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:r};this.It()&&(s.evaluation_contexts=this.Ct()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this._instance.config.disable_compression?void 0:yn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var o,a=(o=i.json)==null?void 0:o.featureFlagPayloads;n((a==null?void 0:a[t])||void 0)}})}isFeatureEnabled(t,n){if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,n);return B(r)?void 0:!!r}wt.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==t)}receivedFeatureFlags(t,n){if(this._instance.persistence){this.bt=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(o,a,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var f=lO(o),d=f.flags,h=f.featureFlags,p=f.featureFlagPayloads;if(h){var g=o.requestId,y=o.evaluatedAt;if(_e(h)){wt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var T={};if(h)for(var b=0;b<h.length;b++)T[h[b]]=!0;a&&a.register({[va]:h,[Cr]:T})}else{var S=h,E=p,m=d;if(o.errorsWhileComputingFlags)if(d){var N=new Set(Object.keys(d).filter(M=>{var R;return!((R=d[M])!=null&&R.failed)}));S=U({},l,Object.fromEntries(Object.entries(S).filter(M=>{var[R]=M;return N.has(R)}))),E=U({},u,Object.fromEntries(Object.entries(E||{}).filter(M=>{var[R]=M;return N.has(R)}))),m=U({},c,Object.fromEntries(Object.entries(m||{}).filter(M=>{var[R]=M;return N.has(R)})))}else S=U({},l,S),E=U({},u,E),m=U({},c,m);a&&a.register(U({[va]:Object.keys(Mf(S)),[Cr]:S||{},[$f]:E||{},[dl]:m||{}},g?{[Df]:g}:{},y?{[ao]:y}:{}))}}})(t,this._instance.persistence,r,s,i),n||(this.St=!1),this.Dt(n)}}override(t,n){n===void 0&&(n=!1),wt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return wt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(yr),this._instance.persistence.unregister(fs),this.Dt(),us.info("All overrides cleared");if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this._t=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(yr),us.info("Flag overrides cleared");else if(r.flags){if(_e(r.flags)){for(var s={},i=0;i<r.flags.length;i++)s[r.flags[i]]=!0;this._instance.persistence.register({[yr]:s})}else this._instance.persistence.register({[yr]:r.flags});us.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(fs),us.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[fs]:r.payloads}),us.info("Payload overrides set",{payloads:r.payloads}))),void this.Dt()}this.Dt()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.bt){var{flags:n,flagVariants:r}=this.jt();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n,r){var s,i=(this._instance.get_property(bs)||[]).find(u=>u.flagKey===t),o={["$feature_enrollment/"+t]:n},a={$feature_flag:t,$feature_enrollment:n,$set:o};i&&(a.$early_access_feature_name=i.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=U({},this.getFlagVariants(),{[t]:n});(s=this._instance.persistence)==null||s.register({[va]:Object.keys(Mf(l)),[Cr]:l}),this.Dt()}getEarlyAccessFeatures(t,n,r){n===void 0&&(n=!1);var s=this._instance.get_property(bs),i=r?"&"+r.map(o=>"stage="+o).join("&"):"";if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+i),method:"GET",callback:o=>{var a,l;if(o.json){var u=o.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(bs),(l=this._instance.persistence)==null||l.register({[bs]:u}),t(u)}}})}jt(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,s)=>(r[s]=n[s],r),{})}}Dt(t){var{flags:n,flagVariants:r}=this.jt();this.featureFlagEventHandlers.forEach(s=>s(n,r,{errorsLoading:t}))}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(ws)||{};this._instance.register({[ws]:U({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ws)}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(or)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(s=>{r[s]=U({},r[s],t[s]),delete t[s]}),this._instance.register({[or]:U({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this._instance.get_property(or)||{};this._instance.register({[or]:U({},n,{[t]:{}})})}else this._instance.unregister(or)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Mt(),this._t=!1}}var fO=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class ma{constructor(t,n){this.N=t,this.props={},this.Lt=!1,this.Nt=(r=>{var s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(t),this.B=this.Ut(t),this.load(),t.debug&&V.info("Persistence loaded",t.persistence,U({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.zt}Ut(t){fO.indexOf(t.persistence.toLowerCase())===-1&&(V.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=function(s){s===void 0&&(s=[]);var i=[...IT,...s];return U({},$e,{D:function(o){try{var a={};try{a=nn.D(o)||{}}catch{}var l=je(a,JSON.parse($e.A(o)||"{}"));return $e.j(o,l),l}catch{}return null},j:function(o,a,l,u,c,f){try{$e.j(o,a,void 0,void 0,f);var d={};i.forEach(h=>{a[h]&&(d[h]=a[h])}),Object.keys(d).length&&nn.j(o,d,l,u,c,f)}catch(h){$e.M(h)}},L:function(o,a){try{k==null||k.localStorage.removeItem(o),nn.L(o,a)}catch(l){$e.M(l)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&$e.O()?$e:r==="localstorage+cookie"&&n.O()?n:r==="sessionstorage"&&rt.O()?rt:r==="memory"?PT:r==="cookie"?nn:n.O()?n:nn}Pt(t){var n=t??this.N.feature_flag_cache_ttl_ms;if(!n||n<=0)return!1;var r=this.props[ao];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return Ae(this.props,(n,r)=>{if(r===Cr&&Xe(n)){if(!this.Pt())for(var s=Object.keys(n),i=0;i<s.length;i++)t["$feature/"+s[i]]=n[s[i]]}else a=r,l=!1,(Gt(o=TT)?l:nf&&o.indexOf===nf?o.indexOf(a)!=-1:(Ae(o,function(u){if(l||(l=u===a))return so}),l))||(t[r]=n);var o,a,l}),t}load(){if(!this.zt){var t=this.B.D(this.Nt);t&&(this.props=je({},t))}}save(){this.zt||this.B.j(this.Nt,this.props,this.Ht,this.Bt,this.qt,this.N.debug)}remove(){this.B.L(this.Nt,!1),this.B.L(this.Nt,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Xe(t)){B(n)&&(n="None"),this.Ht=B(r)?this.Wt:r;var s=!1;if(Ae(t,(i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=i,s=!0)}),s)return this.save(),!0}return!1}register(t,n){if(Xe(t)){this.Ht=B(n)?this.Wt:n;var r=!1;if(Ae(t,(s,i)=>{t.hasOwnProperty(i)&&this.props[i]!==s&&(this.props[i]=s,r=!0)}),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.Lt){var t=dg(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);Ar(uc(t))||this.register(t),this.Lt=!0}}update_search_keyword(){var t;this.register((t=j==null?void 0:j.referrer)?pg(t):{})}update_referrer_info(){var t;this.register_once({$referrer:gg(),$referring_domain:j!=null&&j.referrer&&((t=fo(j.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[vl]||this.props[ml]||this.register_once({[lo]:_g(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Ae([ml,vl],o=>{var a=this.props[o];a&&Ae(a,function(l,u){t["$initial_"+rl(u)]=l})});var n,r,s=this.props[lo];if(s){var i=(n=vg(s),r={},Ae(n,function(o,a){r["$initial_"+rl(a)]=o}),r);je(t,i)}return t}safe_merge(t){return Ae(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n,r){if(this.Wt=this.Ht=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((o,a)=>{if(o.length!==a.length)return!1;var l=[...o].sort(),u=[...a].sort();return l.every((c,f)=>c===u[f])})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var s=this.Ut(t),i=this.props;this.clear(),this.B=s,this.props=i,this.save()}}set_disabled(t){this.zt=t,this.zt?this.remove():this.save()}set_cross_subdomain(t){t!==this.Bt&&(this.Bt=t,this.remove(),this.save())}set_secure(t){t!==this.qt&&(this.qt=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[ys]||{};r[t]=n,this.props[ys]=r,this.save()}remove_event_timer(t){var n=(this.props[ys]||{})[t];return B(n)||(delete this.props[ys][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var ds=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({});(function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e})({});(function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e})({});(function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e})({});var ya=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({});(function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e})({});(function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e})({});(function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e})({});var Ss=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({}),ba=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e}({}),El=function(e){return e.Popover="popover",e.Inline="inline",e}({}),ke=Fe("[Surveys]"),yg="seenSurvey_",dO=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},Ff=e=>((t,n)=>{var r=""+t+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+t+n.id+"_"+n.current_iteration),r})(yg,e),hO=[ya.Popover,ya.Widget,ya.API],pO={ignoreConditions:!1,ignoreDelay:!1,displayType:El.Popover};class hc{constructor(){this.Gt={},this.Gt={}}on(t,n){return this.Gt[t]||(this.Gt[t]=[]),this.Gt[t].push(n),()=>{this.Gt[t]=this.Gt[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.Gt[t]||[])r(n);for(var s of this.Gt["*"]||[])s(t,n)}}function br(e,t,n){if(de(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class gO{constructor(t){this.Vt=new hc,this.Jt=(n,r)=>this.Kt(n,r)&&this.Yt(n,r)&&this.Xt(n,r)&&this.Qt(n,r),this.Kt=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t,this.Zt=new Set,this.ti=new Set}init(){var t;if(!B((t=this._instance)==null?void 0:t._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook((r,s)=>{this.on(r,s)})}}register(t){var n,r;if(!B((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach(o=>{var a,l;(a=this.ti)==null||a.add(o),(l=o.steps)==null||l.forEach(u=>{var c;(c=this.Zt)==null||c.add((u==null?void 0:u.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;t.forEach(o=>{var a;(a=o.steps)==null||a.forEach(l=>{l!=null&&l.selector&&i.add(l==null?void 0:l.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(t,n){var r;n!=null&&t.length!=0&&(this.Zt.has(t)||this.Zt.has(n==null?void 0:n.event))&&this.ti&&((r=this.ti)==null?void 0:r.size)>0&&this.ti.forEach(s=>{this.ii(n,s)&&this.Vt.emit("actionCaptured",s.name)})}ei(t){this.onAction("actionCaptured",n=>t(n))}ii(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Jt(t,r))return!0;return!1}onAction(t,n){return this.Vt.on(t,n)}Yt(t,n){if(n!=null&&n.url){var r,s=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!br(s,n.url,n.url_matching||"contains"))return!1}return!0}Xt(t,n){return!!this.ri(t,n)&&!!this.si(t,n)&&!!this.ni(t,n)}ri(t,n){var r;if(n==null||!n.href)return!0;var s=this.oi(t);if(s.length>0)return s.some(a=>br(a.href,n.href,n.href_matching||"exact"));var i,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&br((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}si(t,n){var r;if(n==null||!n.text)return!0;var s=this.oi(t);if(s.length>0)return s.some(u=>br(u.text,n.text,n.text_matching||"exact")||br(u.$el_text,n.text,n.text_matching||"exact"));var i,o,a,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(i=function(u){for(var c,f=[],d=/(?::|")text="(.*?)"/g;!de(c=d.exec(u));)f.includes(c[1])||f.push(c[1]);return f}(l),o=n.text,a=n.text_matching||"exact",i.some(u=>br(u,o,a)))}ni(t,n){var r,s;if(n==null||!n.selector)return!0;var i=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(t==null||(s=t.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}oi(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t==null?void 0:t.properties.$elements}Qt(t,n){return n==null||!n.properties||n.properties.length===0||fg(n.properties.reduce((r,s)=>{var i=_e(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r},{}),t==null?void 0:t.properties)}}class _O{constructor(t){this._instance=t,this.ai=new Map,this.li=new Map,this.ui=new Map}hi(t,n){return!!t&&fg(t.propertyFilters,n==null?void 0:n.properties)}di(t,n){var r=new Map;return t.forEach(s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(s.id),r.set(o.name,a)}})}),r}vi(t,n,r){var s=(r===ds.Activation?this.ai:this.li).get(t),i=[];return this.ci(o=>{i=o.filter(a=>s==null?void 0:s.includes(a.id))}),i.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(u=>u.name===t);return this.hi(l,n)})}register(t){var n;B((n=this._instance)==null?void 0:n._addCaptureHook)||(this.fi(t),this.pi(t))}pi(t){var n=t.filter(r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0});n.length!==0&&(this.gi==null&&(this.gi=new gO(this._instance),this.gi.init(),this.gi.ei(r=>{this.onAction(r)})),n.forEach(r=>{var s,i,o,a,l;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.gi)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.ui.get(u.name);c&&c.push(r.id),this.ui.set(u.name,c||[r.id])}}))}))}fi(t){var n,r=t.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.events)&&((a=i.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0}),s=t.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((a=i.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0});(r.length!==0||s.length!==0)&&((n=this._instance)==null||n._addCaptureHook((i,o)=>{this.onEvent(i,o)}),this.ai=this.di(t,ds.Activation),this.li=this.di(t,ds.Cancellation))}onEvent(t,n){var r,s=this.mi(),i=this.bi(),o=this.yi(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[i])||[];if(o===t&&n&&a.length>0){var l,u;s.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:a});var c=(n==null||(l=n.properties)==null?void 0:l.$survey_id)||(n==null||(u=n.properties)==null?void 0:u.$product_tour_id);if(c){var f=a.indexOf(c);f>=0&&(a.splice(f,1),this.wi(a))}}else{if(this.li.has(t)){var d=this.vi(t,n,ds.Cancellation);d.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:d.map(p=>p.id)}),d.forEach(p=>{var g=a.indexOf(p.id);g>=0&&a.splice(g,1),this.xi(p.id)}),this.wi(a))}if(this.ai.has(t)){s.info("event name matched",{event:t,eventPayload:n,items:this.ai.get(t)});var h=this.vi(t,n,ds.Activation);this.wi(a.concat(h.map(p=>p.id)||[]))}}}onAction(t){var n,r=this.bi(),s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ui.has(t)&&this.wi(s.concat(this.ui.get(t)||[]))}wi(t){var n,r=this.mi(),s=this.bi(),i=[...new Set(t)].filter(o=>!this.$i(o));r.info("updating activated items",{activatedItems:i}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[s]:i})}getActivatedIds(){var t,n=this.bi(),r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r||[]}getEventToItemsMap(){return this.ai}Ei(){return this.gi}}class vO extends _O{constructor(t){super(t)}bi(){return"$surveys_activated"}yi(){return Ss.SHOWN}ci(t){var n;(n=this._instance)==null||n.getSurveys(t)}xi(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}mi(){return ke}$i(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class mO{constructor(t){this.Si=void 0,this._surveyManager=null,this.ki=!1,this.Pi=[],this.Ti=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var n=t.surveys;if(de(n))return ke.warn("Flags not loaded yet. Not loading surveys.");var r=_e(n);this.Si=r?n.length>0:n,ke.info("flags response received, isSurveysEnabled: "+this.Si),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(yg)||r!=null&&r.startsWith("inProgressSurvey_"))&&t.push(r)}t.forEach(s=>localStorage.removeItem(s))}loadIfEnabled(){if(!this._surveyManager)if(this.ki)ke.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ke.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ke.info("Not loading surveys in cookieless mode without consent.");else{var t=Q==null?void 0:Q.__PosthogExtensions__;if(t){if(!B(this.Si)||this._instance.config.advanced_enable_surveys){var n=this.Si||this._instance.config.advanced_enable_surveys;this.ki=!0;try{var r=t.generateSurveys;if(r)return void this.Ci(r,n);var s=t.loadExternalDependency;if(!s)return void this.Ii("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!t.generateSurveys?this.Ii("Could not load surveys script",i):this.Ci(t.generateSurveys,n)})}catch(i){throw this.Ii("Error initializing surveys",i),i}finally{this.ki=!1}}}else ke.error("PostHog Extensions not found.")}}Ci(t,n){this._surveyManager=t(this._instance,n),this._surveyEventReceiver=new vO(this._instance),ke.info("Surveys loaded successfully"),this.Ri({isLoaded:!0})}Ii(t,n){ke.error(t,n),this.Ri({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Pi.push(t),this._surveyManager&&this.Ri({isLoaded:!0}),()=>{this.Pi=this.Pi.filter(n=>n!==t)}}getSurveys(t,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return ke.info("Disabled. Not loading surveys."),t([]);var r,s=this._instance.get_property(hl);if(s&&!n)return t(s,{isLoaded:!0});typeof Promise<"u"&&this.Ti?this.Ti.then(i=>{var{surveys:o,context:a}=i;return t(o,a)}):(typeof Promise<"u"&&(this.Ti=new Promise(i=>{r=i})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var o;this.Ti=null;var a=i.statusCode;if(a!==200||!i.json){var l="Surveys API could not be loaded, status: "+a;ke.error(l);var u={isLoaded:!1,error:l};return t([],u),void(r==null||r({surveys:[],context:u}))}var c,f=i.json.surveys||[],d=f.filter(p=>function(g){return!(!g.start_date||g.end_date)}(p)&&(function(g){var y;return!((y=g.conditions)==null||(y=y.events)==null||(y=y.values)==null||!y.length)}(p)||function(g){var y;return!((y=g.conditions)==null||(y=y.actions)==null||(y=y.values)==null||!y.length)}(p)));d.length>0&&((c=this._surveyEventReceiver)==null||c.register(d)),(o=this._instance.persistence)==null||o.register({[hl]:f});var h={isLoaded:!0};t(f,h),r==null||r({surveys:f,context:h})}}))}Ri(t){for(var n of this.Pi)try{if(!t.isLoaded)return n([],t);this.getSurveys(n)}catch(r){ke.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,n){if(n===void 0&&(n=!1),!de(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,n);ke.warn("init was not called")}Fi(t){var n=null;return this.getSurveys(r=>{var s;n=(s=r.find(i=>i.id===t))!==null&&s!==void 0?s:null}),n}Oi(t){if(de(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof t=="string"?this.Fi(t):t;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(de(this._surveyManager))return ke.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.Oi(t);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(t,n){return de(this._surveyManager)?(ke.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(r=>{this.getSurveys(s=>{var i,o=(i=s.find(l=>l.id===t))!==null&&i!==void 0?i:null;if(o){var a=this.Oi(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(t,n,r){var s;if(de(this._surveyManager))ke.warn("init was not called");else{var i=typeof t=="string"?this.Fi(t):t;if(i!=null&&i.id)if(hO.includes(i.type)){var o=j==null?void 0:j.querySelector(n);if(o)return(s=i.appearance)!=null&&s.surveyPopupDelaySeconds?(ke.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,l;ke.info("Rendering survey "+i.id+" with delay of "+((a=i.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(i,o,r),ke.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o,r);ke.warn("Survey element not found")}else ke.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ke.warn("Survey not found")}}displaySurvey(t,n){var r;if(de(this._surveyManager))ke.warn("init was not called");else{var s=this.Fi(t);if(s){var i=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=U({},s,{appearance:U({},s.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==El.Popover&&n.initialResponses&&ke.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.canRenderSurvey(s);if(!o.visible)return void ke.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==El.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else ke.warn("Survey not found")}}cancelPendingSurvey(t){de(this._surveyManager)?ke.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload()}}var $t=Fe("[Conversations]");class yO{constructor(t){this.Mi=void 0,this._conversationsManager=null,this.Ai=!1,this.Di=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var n=t.conversations;de(n)||(Tn(n)?this.Mi=n:(this.Mi=n.enabled,this.Di=n),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Mi=void 0,this.Di=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ai||this._instance.config.disable_conversations||Yp(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=Q==null?void 0:Q.__PosthogExtensions__;if(t&&!B(this.Mi)&&this.Mi)if(this.Di&&this.Di.token){this.Ai=!0;try{var n=t.initConversations;if(n)return this.ji(n),void(this.Ai=!1);var r=t.loadExternalDependency;if(!r)return void this.Li("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",s=>{s||!t.initConversations?this.Li("Could not load conversations script",s):this.ji(t.initConversations),this.Ai=!1})}catch(s){this.Li("Error initializing conversations",s),this.Ai=!1}}else $t.error("Conversations enabled but missing token in remote config.")}}ji(t){if(this.Di)try{this._conversationsManager=t(this.Di,this._instance),$t.info("Conversations loaded successfully")}catch(n){this.Li("Error completing conversations initialization",n)}else $t.error("Cannot complete initialization: remote config is null")}Li(t,n){$t.error(t,n),this._conversationsManager=null,this.Ai=!1}show(){this._conversationsManager?this._conversationsManager.show():$t.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Mi===!0&&!Gt(this._conversationsManager)}isVisible(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&t!==void 0&&t}sendMessage(t,n,r){var s=this;return dn(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(t,n,r):($t.warn("Conversations not available yet."),null)})()}getMessages(t,n){var r=this;return dn(function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,n):($t.warn("Conversations not available yet."),null)})()}markAsRead(t){var n=this;return dn(function*(){return n._conversationsManager?n._conversationsManager.markAsRead(t):($t.warn("Conversations not available yet."),null)})()}getTickets(t){var n=this;return dn(function*(){return n._conversationsManager?n._conversationsManager.getTickets(t):($t.warn("Conversations not available yet."),null)})()}requestRestoreLink(t){var n=this;return dn(function*(){return n._conversationsManager?n._conversationsManager.requestRestoreLink(t):($t.warn("Conversations not available yet."),null)})()}restoreFromToken(t){var n=this;return dn(function*(){return n._conversationsManager?n._conversationsManager.restoreFromToken(t):($t.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var t=this;return dn(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():($t.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&t!==void 0?t:null}}var bO=function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e.BANNER_ACTION_CLICKED="product tour banner action clicked",e}({}),Lf=function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",e.TOUR_TYPE="$product_tour_type",e}({});class wO{constructor(t){var n;this.Ni=!1,this.Ui=!1,this._instance=t,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.Ni=!0)}onRemoteConfig(t){var n,r=(n=t.logs)==null?void 0:n.captureConsoleLogs;!de(r)&&r&&(this.Ni=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ni&&!this.Ui){var t=Fe("[logs]"),n=Q==null?void 0:Q.__PosthogExtensions__;if(n){var r=n.loadExternalDependency;r?r(this._instance,"logs",s=>{var i;s||(i=n.logs)==null||!i.initializeLogs?t.error("Could not load logs script",s):(n.logs.initializeLogs(this._instance),this.Ui=!0)}):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var zf=Fe("[RateLimiter]");class EO{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(s=>{zf.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void zf.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,s;t===void 0&&(t=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:o}=this,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(_l))!==null&&n!==void 0?n:{tokens:i,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>i&&(l.tokens=i);var u=l.tokens<1;return u||t||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(s=this.instance.persistence)==null||s.set_property(_l,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var hs=Fe("[RemoteConfig]");class bg{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=Q._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}zi(t){var n,r;(n=Q.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Hi(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return hs.info("Using preloaded remote config",this.remoteConfig),this.Bi(this.remoteConfig),void this.qi();if(this._instance.At())return void hs.warn("Remote config is disabled. Falling back to local config.");this.zi(t=>{if(!t)return hs.info("No config found after loading remote JS config. Falling back to JSON."),void this.Hi(n=>{this.Bi(n),this.qi()});this.Bi(t),this.qi()})}catch(t){hs.error("Error loading remote config",t)}}stop(){this.Wi&&(clearInterval(this.Wi),this.Wi=void 0)}refresh(){this._instance.At()||(j==null?void 0:j.visibilityState)==="hidden"||this._instance.featureFlags.reloadFeatureFlags()}qi(){var t;if(!this.Wi){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.Wi=setInterval(()=>{this.refresh()},n))}}Bi(t){t||hs.error("Failed to fetch remote config from PostHog."),this._instance.Bi(t??{}),(t==null?void 0:t.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}var Sl=3e3;class SO{constructor(t,n){this.Gi=!0,this.Vi=[],this.Ji=rn((n==null?void 0:n.flush_interval_ms)||Sl,250,5e3,V.createLogger("flush interval"),Sl),this.Ki=t}enqueue(t){this.Vi.push(t),this.Yi||this.Xi()}unload(){this.Qi();var t=this.Vi.length>0?this.Zi():{},n=Object.values(t);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Ki(U({},r,{transport:"sendBeacon"}))})}enable(){this.Gi=!1,this.Xi()}Xi(){var t=this;this.Gi||(this.Yi=setTimeout(()=>{if(this.Qi(),this.Vi.length>0){var n=this.Zi(),r=function(){var i=n[s],o=new Date().getTime();i.data&&_e(i.data)&&Ae(i.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),t.Ki(i)};for(var s in n)r()}},this.Ji))}Qi(){clearTimeout(this.Yi),this.Yi=void 0}Zi(){var t={};return Ae(this.Vi,n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;B(t[i])&&(t[i]=U({},s,{data:[]})),(r=t[i].data)==null||r.push(s.data)}),this.Vi=[],t}}var kO=["retriesPerformedSoFar"];class TO{constructor(t){this.te=!1,this.ie=3e3,this.Vi=[],this._instance=t,this.Vi=[],this.ee=!0,!B(k)&&"onLine"in k.navigator&&(this.ee=k.navigator.onLine,this.re=()=>{this.ee=!0,this.se()},this.ne=()=>{this.ee=!1},He(k,"online",this.re),He(k,"offline",this.ne))}get length(){return this.Vi.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=xp(t,kO);Tr(n)&&(r.url=_o(r.url,{retry_count:n})),this._instance._send_request(U({},r,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(n??0)<10?this.oe(U({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(s)}}))}oe(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(n),s=Date.now()+r;this.Vi.push({retryAt:s,requestOptions:t});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),V.warn(i),this.te||(this.te=!0,this.ae())}ae(){if(this.le&&clearTimeout(this.le),this.Vi.length===0)return this.te=!1,void(this.le=void 0);this.le=setTimeout(()=>{this.ee&&this.Vi.length>0&&this.se(),this.ae()},this.ie)}se(){var t=Date.now(),n=[],r=this.Vi.filter(i=>i.retryAt<t||(n.push(i),!1));if(this.Vi=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:t}of(this.le&&(clearTimeout(this.le),this.le=void 0),this.te=!1,B(k)||(this.re&&(k.removeEventListener("online",this.re),this.re=void 0),this.ne&&(k.removeEventListener("offline",this.ne),this.ne=void 0)),this.Vi))try{this._instance._send_request(U({},t,{transport:"sendBeacon"}))}catch(n){V.error(n)}this.Vi=[]}}class OO{constructor(t){this.ue=()=>{var n,r,s,i;this.he||(this.he={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.he.lastScrollY=Math.ceil(a),this.he.maxScrollY=Math.max(a,(n=this.he.maxScrollY)!==null&&n!==void 0?n:0),this.he.maxScrollHeight=Math.max(l,(r=this.he.maxScrollHeight)!==null&&r!==void 0?r:0),this.he.lastContentY=u,this.he.maxContentY=Math.max(u,(s=this.he.maxContentY)!==null&&s!==void 0?s:0),this.he.maxContentHeight=Math.max(c,(i=this.he.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=t}getContext(){return this.he}resetContext(){var t=this.he;return setTimeout(this.ue,0),t}startMeasuringScrollPosition(){He(k,"scroll",this.ue,{capture:!0}),He(k,"scrollend",this.ue,{capture:!0}),He(k,"resize",this.ue)}scrollElement(){if(!this._instance.config.scroll_root_selector)return k==null?void 0:k.document.documentElement;var t=_e(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=k==null?void 0:k.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return k&&(k.scrollY||k.pageYOffset||k.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return k&&(k.scrollX||k.pageXOffset||k.document.documentElement.scrollLeft)||0}}var xO=e=>_g(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties);class Uf{constructor(t,n,r,s){this.de=i=>{var o=this.ve();if(!o||o.sessionId!==i){var a={sessionId:i,props:this.ce(this._instance)};this.fe.register({[gl]:a})}},this._instance=t,this.pe=n,this.fe=r,this.ce=s||xO,this.pe.onSessionId(this.de)}ve(){return this.fe.props[gl]}getSetOnceProps(){var t,n=(t=this.ve())==null?void 0:t.props;return n?"r"in n?vg(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Ae(uc(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+rl(r)]=n}),t}}var wa=Fe("[SessionId]");class jf{on(t,n){return this._e.on(t,n)}constructor(t,n,r){var s;if(this.ge=[],this.me=void 0,this._e=new hc,this.be=(c,f)=>!(!Tr(c)||!Tr(f))&&Math.abs(c-f)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=t.config,this.fe=t.persistence,this.ye=void 0,this.we=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.xe=n||Vn,this.$e=r||Vn;var i=this.N.persistence_name||this.N.token,o=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*rn(o,60,36e3,wa.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ee(),this.Se="ph_"+i+"_window_id",this.ke="ph_"+i+"_primary_window_exists",this.Pe()){var a=rt.D(this.Se),l=rt.D(this.ke);a&&!l?this.ye=a:rt.L(this.Se),rt.j(this.ke,!0)}if((s=this.N.bootstrap)!=null&&s.sessionID)try{var u=(c=>{var f=c.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.N.bootstrap.sessionID);this.Te(this.N.bootstrap.sessionID,new Date().getTime(),u)}catch(c){wa.error("Invalid sessionID in bootstrap",c)}this.Ce()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return B(this.ge)&&(this.ge=[]),this.ge.push(t),this.we&&t(this.we,this.ye),()=>{this.ge=this.ge.filter(n=>n!==t)}}Pe(){return this.N.persistence!=="memory"&&!this.fe.zt&&rt.O()}Ie(t){t!==this.ye&&(this.ye=t,this.Pe()&&rt.j(this.Se,t))}Re(){return this.ye?this.ye:this.Pe()?rt.D(this.Se):null}Te(t,n,r){t===this.we&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.we=t,this.fe.register({[io]:[n,t,r]}))}Fe(){var t=this.fe.props[io];return _e(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Te(null,null,null)}destroy(){clearTimeout(this.Oe),this.Oe=void 0,this.me&&k&&(k.removeEventListener("beforeunload",this.me,{capture:!1}),this.me=void 0),this.ge=[]}Ce(){this.me=()=>{this.Pe()&&rt.L(this.ke)},He(k,"beforeunload",this.me,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[s,i,o]=this.Fe(),a=this.Re(),l=Tr(o)&&Math.abs(r-o)>864e5,u=!1,c=!i,f=!c&&!t&&this.be(r,s);c||f||l?(i=this.xe(),a=this.$e(),wa.info("new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}}),o=r,u=!0):a||(a=this.$e(),u=!0);var d=Tr(s)&&t&&!l?s:r,h=Tr(o)?o:new Date().getTime();return this.Ie(a),this.Te(i,d,h),t||this.Ee(),u&&this.ge.forEach(p=>p(i,a,u?{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}:void 0)),{sessionId:i,windowId:a,sessionStartTimestamp:h,changeReason:u?{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}Ee(){clearTimeout(this.Oe),this.Oe=setTimeout(()=>{var[t]=this.Fe();if(this.be(new Date().getTime(),t)){var n=this.we;this.resetSessionId(),this._e.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var wg=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&of(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>of(s==null?void 0:s.brand,t)))return!0}catch{}return!!e.webdriver},ks=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),Bf="i.posthog.com";class AO{constructor(t){this.Me={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"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,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+Bf,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Me[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=ks.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=ks.EU:this.Me[this.apiHost]=ks.CUSTOM),this.Me[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===ks.CUSTOM)return this.apiHost+n;var r=Bf+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var CO={icontains:(e,t)=>!!k&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!k&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!k&&vo(t.href,e),not_regex:(e,t)=>!!k&&!vo(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class ct{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(s=>{ct.Ae("retrieved web experiments from the server"),n.De=new Map,s.forEach(i=>{if(i.feature_flag_key){var o;n.De&&(ct.Ae("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.De)==null||o.set(i.feature_flag_key,i));var a=n._instance.getFeatureFlag(i.feature_flag_key);Ge(a)&&i.variants[a]&&n.je(i.name,a,i.variants[a].transforms)}else if(i.variants)for(var l in i.variants){var u=i.variants[l];ct.Le(u)&&n.je(i.name,l,u.transforms)}})},r)},this._instance=t,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(t){if(this._is_bot())ct.Ae("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(de(this.De))return this.De=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ct.Ae("applying feature flags",t),t.forEach(n=>{var r;if(this.De&&(r=this.De)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),o=(s=this.De)==null?void 0:s.get(n);i&&o!=null&&o.variants[i]&&this.je(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){var t=ct.getWindowLocation();if(t!=null&&t.search){var n=ho(t==null?void 0:t.search,"__experiment_id"),r=ho(t==null?void 0:t.search,"__experiment_variant");n&&r&&(ct.Ae("previewing web experiments "+n+" && "+r),this.getWebExperiments(s=>{this.Ne(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return t([]);var o=i.json.experiments||[];return t(o)}})}Ne(t,n,r){var s=r.filter(i=>i.id===t);s&&s.length>0&&(ct.Ae("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.je(s[0].name,n,s[0].variants[n].transforms))}static Le(t){return!de(t.conditions)&&ct.Ue(t)&&ct.ze(t)}static Ue(t){var n;if(de(t.conditions)||de((n=t.conditions)==null?void 0:n.url))return!0;var r,s,i,o=ct.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||CO[(s=(i=t.conditions)==null?void 0:i.urlMatchType)!==null&&s!==void 0?s:"icontains"](t.conditions.url,o))}static getWindowLocation(){return k==null?void 0:k.location}static ze(t){var n;if(de(t.conditions)||de((n=t.conditions)==null?void 0:n.utm))return!0;var r=dg();if(r.utm_source){var s,i,o,a,l,u,c,f,d=(s=t.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=t.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,h=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,p=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=t.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,g=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_term||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return d&&p&&g&&h}return!1}static Ae(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];V.info("[WebExperiments] "+t,r)}je(t,n,r){this._is_bot()?ct.Ae("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(s=>{if(s.selector){var i;ct.Ae("applying transform of variant "+n+" for experiment "+t+" ",s);var o=(i=document)==null?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):ct.Ae("Control variants leave the page unmodified.")}_is_bot(){return Ct&&this._instance?wg(Ct,this._instance.config.custom_blocked_useragents):void 0}}var RO=Fe("[PostHog ExternalIntegrations]"),IO={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class PO{constructor(t){this._instance=t}V(t,n){var r;(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,s=>{if(s)return RO.error("failed to load script",s);n()})}startIfEnabledOrStop(){var t=this,n=function(o){var a,l,u;!s||(a=Q.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||t.V(IO[o],()=>{var c;(c=Q.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.start(t._instance)}),!s&&(l=Q.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((u=Q.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.stop())};for(var[r,s]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(r)}}}var Ls={},Ea=0,kl=()=>{},Or="posthog",Eg=!KT&&(St==null?void 0:St.indexOf("MSIE"))===-1&&(St==null?void 0:St.indexOf("Mozilla"))===-1,Vf=e=>{var t;return U({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:kT(j==null?void 0:j.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:kl,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:st&&Ge(st==null?void 0:st.search)&&st.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(k==null||(t=k.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;V.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Sl},error_tracking:{},_onCapture:kl,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Zf=e=>{var t={};B(e.process_person)||(t.person_profiles=e.process_person),B(e.xhr_headers)||(t.request_headers=e.xhr_headers),B(e.cookie_name)||(t.persistence_name=e.cookie_name),B(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),B(e.store_google)||(t.save_campaign_params=e.store_google),B(e.verbose)||(t.debug=e.verbose);var n=je({},t,e);return _e(e.property_blacklist)&&(B(e.property_denylist)?n.property_denylist=e.property_blacklist:_e(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:V.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class NO{constructor(){this.__forceAllowLocalhost=!1}get He(){return this.__forceAllowLocalhost}set He(t){V.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class En{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){this.webPerformance=new NO,this.Be=!1,this.version=fn.LIB_VERSION,this.Ft=new hc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Vf(),this.SentryIntegration=FT,this.sentryIntegration=t=>function(n,r){var s=sg(n,r);return{name:rg,processEvent:i=>s(i)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.qe=!1,this.We=null,this.Ge=null,this.Ve=null,this.featureFlags=new uO(this),this.toolbar=new UT(this),this.scrollManager=new OO(this),this.pageViewManager=new Of(this),this.surveys=new mO(this),this.conversations=new yO(this),this.logs=new wO(this),this.experiments=new ct(this),this.exceptions=new JT(this),this.rateLimiter=new EO(this),this.requestRouter=new AO(this),this.consent=new NT(this),this.externalIntegrations=new PO(this),this.people={set:(t,n,r)=>{var s=Ge(t)?{[t]:n}:t;this.setPersonProperties(s),r==null||r({})},set_once:(t,n,r)=>{var s=Ge(t)?{[t]:n}:t;this.setPersonProperties(void 0,s),r==null||r({})}},this.on("eventCaptured",t=>V.info('send "'+(t==null?void 0:t.event)+'"',t))}init(t,n,r){if(r&&r!==Or){var s,i=(s=Ls[r])!==null&&s!==void 0?s:new En;return i._init(t,n,r),Ls[r]=i,Ls[Or][r]=i,i}return this._init(t,n,r)}_init(t,n,r){var s;if(n===void 0&&(n={}),B(t)||sl(t))return V.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Je(n.debug),this.Ke=n,this.Ye=[],n.person_profiles?this.Ge=n.person_profiles:n.process_person&&(this.Ge=n.process_person),this.set_config(je({},Vf(n.defaults),Zf(n),{name:r,token:t})),this.config.on_xhr_error&&V.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:yn.GZipJS;var i=this.Xe();this.persistence=new ma(this.config,i),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ma(U({},this.config,{persistence:"sessionStorage"}),i);var o=U({},this.persistence.props),a=U({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Qe=new SO(b=>this.Ze(b),this.config.request_queue_config),this.tr=new TO(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new jf(this),this.sessionPropsManager=new Uf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(V.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.ir(l)},0)):(V.info("Initializing extensions synchronously"),this.ir(l)),fn.DEBUG=fn.DEBUG||this.config.debug,fn.DEBUG&&V.info("Starting in debug mode",{this:this,config:n,thisC:U({},this.config),p:o,s:a}),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var u,c,f=this.config.get_device_id(Vn()),d=(u=n.bootstrap)!=null&&u.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(en,(c=n.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:d})}if(this.er()){var h,p,g=Object.keys(((h=n.bootstrap)==null?void 0:h.featureFlags)||{}).filter(b=>{var S;return!((S=n.bootstrap)==null||(S=S.featureFlags)==null||!S[b])}).reduce((b,S)=>{var E;return b[S]=((E=n.bootstrap)==null||(E=E.featureFlags)==null?void 0:E[S])||!1,b},{}),y=Object.keys(((p=n.bootstrap)==null?void 0:p.featureFlagPayloads)||{}).filter(b=>g[b]).reduce((b,S)=>{var E,m;return(E=n.bootstrap)!=null&&(E=E.featureFlagPayloads)!=null&&E[S]&&(b[S]=(m=n.bootstrap)==null||(m=m.featureFlagPayloads)==null?void 0:m[S]),b},{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:y})}if(l)this.register_once({distinct_id:os,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id(Vn());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(en,"anonymous")}return He(k,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?MT(this,()=>this.rr()):this.rr(),bn(this.config._onCapture)&&this.config._onCapture!==kl&&(V.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",b=>this.config._onCapture(b.event,b))),this.config.ip&&V.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}ir(t){var n=performance.now(),r=U({},En.__defaultExtensionClasses,this.config.__extensionClasses);r.historyAutocapture&&(this.historyAutocapture=new r.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var s=[];r.tracingHeaders&&s.push(()=>{new r.tracingHeaders(this).startIfEnabledOrStop()}),r.siteApps&&s.push(()=>{var i;this.siteApps=new r.siteApps(this),(i=this.siteApps)==null||i.init()}),!t&&r.sessionRecording&&s.push(()=>{this.sessionRecording=new r.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&s.push(()=>{this.autocapture=new r.autocapture(this),this.autocapture.startIfEnabled()}),s.push(()=>{this.surveys.loadIfEnabled()}),s.push(()=>{this.logs.loadIfEnabled()}),s.push(()=>{this.conversations.loadIfEnabled()}),r.productTours&&s.push(()=>{this.productTours=new r.productTours(this),this.productTours.loadIfEnabled()}),r.heatmaps&&s.push(()=>{this.heatmaps=new r.heatmaps(this),this.heatmaps.startIfEnabled()}),r.webVitalsAutocapture&&s.push(()=>{this.webVitalsAutocapture=new r.webVitalsAutocapture(this)}),r.exceptionObserver&&s.push(()=>{this.exceptionObserver=new r.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()}),r.deadClicksAutocapture&&s.push(()=>{this.deadClicksAutocapture=new r.deadClicksAutocapture(this,DT),this.deadClicksAutocapture.startIfEnabledOrStop()}),s.push(()=>{if(this.sr){var i=this.sr;this.sr=void 0,this.Bi(i)}}),this.nr(s,n)}nr(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout(()=>{this.nr(t,n)},0);var r=t.shift();if(r)try{r()}catch(i){V.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&V.info("PostHog extensions initialized ("+s+"ms)")}Bi(t){var n,r,s,i,o,a,l,u,c;if(!j||!j.body)return V.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Bi(t)},500);this.config.__preview_deferred_init_extensions&&(this.sr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=ue(t.supportedCompression,yn.GZipJS)?yn.GZipJS:ue(t.supportedCompression,yn.Base64)?yn.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ge?this.Ge:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(t),(s=this.sessionRecording)==null||s.onRemoteConfig(t),(i=this.autocapture)==null||i.onRemoteConfig(t),(o=this.heatmaps)==null||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),(a=this.productTours)==null||a.onRemoteConfig(t),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(t),(u=this.exceptionObserver)==null||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(t)}rr(){try{this.config.loaded(this)}catch(r){V.critical("`loaded` function failed",r)}if(this.ar(),this.config.internal_or_test_user_hostname&&st!=null&&st.hostname){var t=st.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.lr()},1),this.ur=new bg(this),this.ur.load()}ar(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Qe)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Hn(this.__request_queue,t=>this.Ze(t)),this.__request_queue=[],this.ar()}_handle_unload(){var t,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.hr()&&this.capture("$pageleave"),(t=this.Qe)==null||t.unload(),(n=this.tr)==null||n.unload()):this.hr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Eg?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=_o(t.url,{ip:this.config.ip?1:0}),t.headers=U({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,o=U({},n);o.timeout=o.timeout||6e4,o.url=_o(o.url,{_:new Date().getTime().toString(),ver:fn.LIB_VERSION,compression:o.compression});var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=Li.filter(c=>!o.disableTransport||!c.transport||!o.disableTransport.includes(c.transport)),u=(s=(i=Jp(l,c=>c.transport===a))==null?void 0:i.method)!==null&&s!==void 0?s:l[0].method;if(!u)throw new Error("No available transport method");u(o)})(U({},t,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(s=this.config).on_request_error)==null||r.call(s,n)),t.callback==null||t.callback(n)}}))))}Ze(t){this.tr?this.tr.retriableRequest(t):this._send_request(t)}_execute_array(t){Ea++;try{var n,r=[],s=[],i=[];Hn(t,a=>{a&&(n=a[0],_e(n)?i.push(a):bn(a)?a.call(this):_e(a)&&n==="alias"?r.push(a):_e(a)&&n.indexOf("capture")!==-1&&bn(this[n])?i.push(a):s.push(a))});var o=function(a,l){Hn(a,function(u){if(_e(u[0])){var c=l;Ae(u,function(f){c=c[f[0]].apply(c,f.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};o(r,this),o(s,this),o(i,this)}finally{Ea--}}er(){var t,n;return((t=this.config.bootstrap)==null?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(t){if(Ea>0&&_e(t)&&Ge(t[0])){var n=En.prototype[t[0]];bn(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Qe){if(this.is_capturing())if(!B(t)&&Ge(t)){var i=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(i&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!Ge(n==null?void 0:n.$current_url)&&(V.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.ft||V.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 a=new Date,l=(r==null?void 0:r.timestamp)||a,u=Vn(),c={uuid:u,event:t,properties:this.calculateEventProperties(t,n||{},l,u)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&i&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(c.$set=r==null?void 0:r.$set);var f,d=t!=="$groupidentify",h=this.dr(r==null?void 0:r.$set_once,d);if(h&&(c.$set_once=h),(c=ET(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,B(r==null?void 0:r.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),t===Ss.DISMISSED||t===Ss.SENT){var p=n==null?void 0:n[ba.SURVEY_ID],g=n==null?void 0:n[ba.SURVEY_ITERATION];f={id:p,current_iteration:g},localStorage.getItem(Ff(f))||localStorage.setItem(Ff(f),"true"),c.$set=U({},c.$set,{[dO({id:p,current_iteration:g},t===Ss.SENT?"responded":"dismissed")]:!0})}else t===Ss.SHOWN&&(c.$set=U({},c.$set,{[ba.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===bO.SHOWN){var y=n==null?void 0:n[Lf.TOUR_TYPE];y&&(c.$set=U({},c.$set,{[Lf.TOUR_LAST_SEEN_DATE+"/"+y]:new Date().toISOString()}))}var T=U({},c.properties.$set,c.$set);if(Ar(T)||this.setPersonPropertiesForFlags(T),!de(this.config.before_send)){var b=this.vr(c);if(!b)return;c=b}this.Ft.emit("eventCaptured",c);var S={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ze(S):this.Qe.enqueue(S),c}V.critical("This capture call is ignored due to client rate limiting.")}}else V.error("No event name provided to posthog.capture")}else V.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}calculateEventProperties(t,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=i?void 0:this.persistence.remove_event_timer(t),a=U({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),t==="$snapshot"){var l=U({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Ge(a.distinct_id)&&!Cn(a.distinct_id)||sl(a.distinct_id))&&V.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=eO(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime());a.$session_id=f,a.$window_id=d}this.sessionPropsManager&&je(a,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&je(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(h=this.tr)==null?void 0:h.length}catch(T){a.$sdk_debug_error_capturing_properties=String(T)}if(this.requestRouter.region===ks.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||i?t!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=je(a,u),t==="$pageview"&&j&&(a.title=j.title),!B(o)){var p=r.getTime()-o;a.$duration=parseFloat((p/1e3).toFixed(3))}St&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=je({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),_e(this.config.property_denylist)?Ae(this.config.property_denylist,function(T){delete a[T]}):V.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(V.error("sanitize_properties is deprecated. Use before_send instead"),a=g(a,t));var y=this.cr();return a.$process_person_profile=y,y&&!i&&this.pr("_calculate_event_properties"),a}dr(t,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.cr()||this.Be)return t;var s=this.persistence.get_initial_props(),i=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=je({},s,i||{},t||{}),a=this.config.sanitize_properties;return a&&(V.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),n&&(this.Be=!0),Ar(o)?void 0:o}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var s;(s=this.persistence)==null||s.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}_r(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){return this.featureFlags.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){return this.featureFlags.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,n,r){var s=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},i=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},o=U({},s,t),a=U({},i,n),l={};for(var[u,c]of Object.entries(o)){var f=typeof c=="string";l[u]={key:u,enabled:!!f||!!c,variant:f?c:void 0,reason:void 0,metadata:B(a==null?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(t,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Ft.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}displaySurvey(t,n){n===void 0&&(n=pO),this.surveys.displaySurvey(t,n)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(t,n)}identify(t,n,r){if(!this.__loaded||!this.persistence)return V.uninitializedWarning("posthog.identify");if(Cn(t)&&(t=t.toString(),V.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))V.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.');else if(t!==os){if(this.pr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var i=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}t!==s&&t!==this.get_property(ms)&&(this.unregister(ms),this.register({distinct_id:t}));var o=(this.persistence.get_property(en)||"anonymous")==="anonymous";t!==s&&o?(this.persistence.set_property(en,"identified"),this.setPersonPropertiesForFlags(U({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Ve=Pf(t,n,r),this.featureFlags.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),t!==s&&(this.reloadFeatureFlags(),this.unregister(oo))}}else V.critical('The string "'+os+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else V.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.pr("posthog.setPersonProperties")){var r=Pf(this.get_distinct_id(),t,n);this.Ve!==r?(this.setPersonPropertiesForFlags(U({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Ve=r):V.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var s=this.getGroups();s[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:U({},s,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),s[t]===n||r||this.reloadFeatureFlags()}else V.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0),this.pr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,s,i,o;if(V.info("reset"),!this.__loaded)return V.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),(s=this.ur)==null||s.stop(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(en,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ve=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:os,$device_id:null},"");else{var l=this.config.get_device_id(Vn());this.register_once({distinct_id:l,$device_id:t?l:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var i,o=(i=t.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return s}alias(t,n){return t===this.get_property(Xp)?(V.critical("Attempting to create alias for existing People user - aborting."),-2):this.pr("posthog.alias")?(B(n)&&(n=this.get_distinct_id()),t!==n?(this._r(ms,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(V.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=U({},this.config);if(Xe(t)){var r,s,i,o,a,l,u,c;je(this.config,Zf(t));var f=this.Xe();(r=this.persistence)==null||r.update_config(this.config,n,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ma(U({},this.config,{persistence:"sessionStorage"}),f);var d=this.Je(this.config.debug);Tn(d)&&(this.config.debug=d),Tn(this.config.debug)&&(this.config.debug?(fn.DEBUG=!0,$e.O()&&$e.j("ph_debug","true"),V.info("set_config",{config:t,oldConfig:n,newConfig:U({},this.config)})):(fn.DEBUG=!1,$e.O()&&$e.L("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.gr(),(c=this.externalIntegrations)==null||c.startIfEnabledOrStop()}}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var s,i,o,a,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(U({},s,n))}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Or;return n!==Or&&(n=Or+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(en))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(en))==="identified"}cr(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ar(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[ms])&&((n=this.persistence)==null||(n=n.props)==null||!n[co]))}hr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.cr()||this.pr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.pr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}pr(t){return this.config.person_profiles==="never"?(V.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._r(co,!0),!0)}Xe(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!n}gr(){var t,n,r,s,i=this.Xe();return((t=this.persistence)==null?void 0:t.zt)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.zt)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(t){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,s,i,o,a;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new jf(this),this.pageViewManager=new Of(this),this.persistence&&(this.sessionPropsManager=new Uf(this,this.sessionManager,this.persistence));var l=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(a=En.__defaultExtensionClasses)==null?void 0:a.sessionRecording;l&&(this.sessionRecording=new l(this),this.sessionRecording.startIfEnabledOrStop())}var u;this.consent.optInOut(!0),this.gr(),this.ar(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(B(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((u=t==null?void 0:t.captureEventName)!==null&&u!==void 0?u:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.lr()}else V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.gr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:os,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.lr())):V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===hn.GRANTED?"granted":t===hn.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.gr()}_is_bot(){return Ct?wg(Ct,this.config.custom_blocked_useragents):void 0}lr(){j&&(j.visibilityState==="visible"?this.qe||(this.qe=!0,this.capture("$pageview",{title:j.title},{send_instantly:!0}),this.We&&(j.removeEventListener("visibilitychange",this.We),this.We=null)):this.We||(this.We=this.lr.bind(this),He(j,"visibilitychange",this.We)))}debug(t){t===!1?(k==null||k.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(k==null||k.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}))}At(){var t,n,r,s,i,o,a,l=this.Ke||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(V.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):(r="advanced_disable_decide",s=!1,i=V,o=(n="advanced_disable_flags")in(t=l)&&!de(t[n]),a=r in t&&!de(t[r]),o?t[n]:a?(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):s)}vr(t){if(de(this.config.before_send))return t;var n=_e(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var s of n){if(r=s(r),de(r)){var i="Event '"+t.event+"' was rejected in beforeSend function";return zk(t.event)?V.warn(i+". This can cause unexpected behavior."):V.info(i),null}r.properties&&!Ar(r.properties)||V.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.it)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Je(t){var n=Tn(t)&&!t,r=$e.O()&&$e.A("ph_debug")==="true";return!n&&(!!r||t)}}En.__defaultExtensionClasses={},function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=wT(e.prototype[t[n]])}(En,["identify"]);function Hf(e){return e instanceof Element&&(e.id===tg||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function Vo(e){return!!e&&e.nodeType===1}function Gn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Sg(e){return!!e&&e.nodeType===3}function kg(e){return!!e&&e.nodeType===11}function pc(e){return e?jo(e).split(/\s+/):[]}function Gf(e){var t=k==null?void 0:k.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function mo(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return pc(t)}function Tg(e){return de(e)?null:jo(e).split(/(\s+)/).filter(t=>ti(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ui(e){var t="";return Tl(e)&&!Cg(e)&&e.childNodes&&e.childNodes.length&&Ae(e.childNodes,function(n){var r;Sg(n)&&n.textContent&&(t+=(r=Tg(n.textContent))!==null&&r!==void 0?r:"")}),jo(t)}function Wf(e){return B(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var gc=["a","button","form","input","select","textarea","label"];function Og(e,t){if(B(t))return!0;var n,r=function(i){if(t.some(o=>i.matches(o)))return{v:!0}};for(var s of e)if(n=r(s))return n.v;return!1}function xg(e){var t=e.parentNode;return!(!t||!Vo(t))&&t}var $O=["next","previous","prev",">","<"],qf=10,Kf=[".ph-no-rageclick",".ph-no-capture"];function DO(e,t){if(!k||_c(e))return!1;var n,r,s;if(Tn(t)?(n=!!t&&Kf,r=void 0):(n=(s=t==null?void 0:t.css_selector_ignorelist)!==null&&s!==void 0?s:Kf,r=t==null?void 0:t.content_ignorelist),n===!1)return!1;var{targetElementList:i}=Ag(e,!1);return!function(o,a){if(o===!1||B(o))return!1;var l;if(o===!0)l=$O;else{if(!_e(o))return!1;if(o.length>qf)return V.error("[PostHog] content_ignorelist array cannot exceed "+qf+" items. Use css_selector_ignorelist for more complex matching."),!1;l=o.map(u=>u.toLowerCase())}return a.some(u=>{var{safeText:c,ariaLabel:f}=u;return l.some(d=>c.includes(d)||f.includes(d))})}(r,i.map(o=>{var a;return{safeText:ui(o).toLowerCase(),ariaLabel:((a=o.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}}))&&!Og(i,n)}var _c=e=>!e||Gn(e,"html")||!Vo(e),Ag=(e,t)=>{if(!k||_c(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],s=e;s.parentNode&&!Gn(s,"body");)if(kg(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=xg(s);if(!i)break;if(t||gc.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var o=k.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function MO(e,t,n,r,s){var i,o,a,l;if(n===void 0&&(n=void 0),!k||_c(e)||(i=n)!=null&&i.url_allowlist&&!Gf(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&Gf(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some(p=>t.type===p))return!1}var{parentIsUsefulElement:c,targetElementList:f}=Ag(e,r);if(!function(p,g){var y=g==null?void 0:g.element_allowlist;if(B(y))return!0;var T,b=function(E){if(y.some(m=>E.tagName.toLowerCase()===m))return{v:!0}};for(var S of p)if(T=b(S))return T.v;return!1}(f,n)||!Og(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var d=k.getComputedStyle(e);if(d&&d.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return c?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(gc.indexOf(h)>-1||e.getAttribute("contenteditable")==="true")}}function Tl(e){for(var t=e;t.parentNode&&!Gn(t,"body");t=t.parentNode){var n=mo(t);if(ue(n,"ph-sensitive")||ue(n,"ph-no-capture"))return!1}if(ue(mo(e),"ph-include"))return!0;var r=e.type||"";if(Ge(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(Ge(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Cg(e){return!!(Gn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Gn(e,"select")||Gn(e,"textarea")||e.getAttribute("contenteditable")==="true")}var Rg="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",FO=new RegExp("^(?:"+Rg+")$"),LO=new RegExp(Rg),Ig="\\d{3}-?\\d{2}-?\\d{4}",zO=new RegExp("^("+Ig+")$"),UO=new RegExp("("+Ig+")");function ti(e,t){return t===void 0&&(t=!0),!(de(e)||Ge(e)&&(e=jo(e),(t?FO:LO).test((e||"").replace(/[- ]/g,""))||(t?zO:UO).test(e)))}function Pg(e){var t=ui(e);return ti(t=(t+" "+Ng(e)).trim())?t:""}function Ng(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Ae(e.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=ui(n);t=(t+" "+s).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+Ng(n)).trim())}catch(i){V.error("[AutoCapture]",i)}}),t}function jO(e){return function(t){var n=t.map(r=>{var s,i,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))o+="."+a.replace(/"/g,"");var l=U({},r.text?{text:r.text}:{},{"nth-child":(s=r.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(i=r.nth_of_type)!==null&&i!==void 0?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return Fi(l).sort((c,f)=>{var[d]=c,[h]=f;return d.localeCompare(h)}).forEach(c=>{var[f,d]=c;return u[Jf(f.toString())]=Jf(d.toString())}),o+=":",o+=Fi(u).map(c=>{var[f,d]=c;return f+'="'+d+'"'}).join("")});return n.join(";")}(function(t){return t.map(n=>{var r,s,i={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(s=n.attr__href)==null?void 0:s.slice(0,2048),attr_class:BO(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Fi(n).filter(o=>{var[a]=o;return a.indexOf("attr__")===0}).forEach(o=>{var[a,l]=o;return i.attributes[a]=l}),i})}(e))}function Jf(e){return e.replace(/"|\\"/g,'\\"')}function BO(e){var t=e.attr__class;return t?_e(t)?t:pc(t):void 0}class Yf{constructor(t){this.disabled=t===!1;var n=Xe(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(t-s.x)+Math.abs(n-s.y)<this.thresholdPx&&r-s.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var Sa="$copy_autocapture",Xf=Fe("[AutoCapture]");function ka(e,t){return t.length>e?t.slice(0,e)+"...":t}function VO(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Vo(t));return t}function ZO(e,t,n,r){var s=e.tagName.toLowerCase(),i={tag_name:s};gc.indexOf(s)>-1&&!n&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?i.$el_text=ka(1024,Pg(e)):i.$el_text=ka(1024,ui(e)));var o=mo(e);o.length>0&&(i.classes=o.filter(function(c){return c!==""})),Ae(e.attributes,function(c){var f;if((!Cg(e)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!t&&ti(c.value)&&(f=c.name,!Ge(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var d=c.value;c.name==="class"&&(d=pc(d).join(" ")),i["attr__"+c.name]=ka(1024,d)}});for(var a=1,l=1,u=e;u=VO(u);)a++,u.tagName===e.tagName&&l++;return i.nth_child=a,i.nth_of_type=l,i}function HO(e,t){for(var n,r,{e:s,maskAllElementAttributes:i,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],c=e;c.parentNode&&!Gn(c,"body");)kg(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var f,d=[],h={},p=!1,g=!1;if(Ae(u,E=>{var m=Tl(E);E.tagName.toLowerCase()==="a"&&(p=E.getAttribute("href"),p=m&&p&&ti(p)&&p),ue(mo(E),"ph-no-capture")&&(g=!0),d.push(ZO(E,i,o,a));var N=function(M){if(!Tl(M))return{};var R={};return Ae(M.attributes,function(I){if(I.name&&I.name.indexOf("data-ph-capture-attribute")===0){var F=I.name.replace("data-ph-capture-attribute-",""),J=I.value;F&&J&&ti(J)&&(R[F]=J)}}),R}(E);je(h,N)}),g)return{props:{},explicitNoCapture:g};if(o||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?d[0].$el_text=Pg(e):d[0].$el_text=ui(e)),p){var y,T;d[0].attr__href=p;var b=(y=fo(p))==null?void 0:y.host,S=k==null||(T=k.location)==null?void 0:T.host;b&&S&&b!==S&&(f=p)}return{props:je({$event_type:s.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:jO(d)},(n=d[0])!=null&&n.$el_text?{$el_text:(r=d[0])==null?void 0:r.$el_text}:{},f&&s.type==="click"?{$external_click_url:f}:{},h)}}var ps=Fe("[ExceptionAutocapture]");function Qf(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],s=n(r);return bn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}var GO=Fe("[TracingHeaders]"),Nn=Fe("[Web Vitals]"),ed=9e5;Fe("[SessionRecording]");var Ol="[SessionRecording]",wr=Fe(Ol),WO=Fe("[Heatmaps]");function td(e){return Xe(e)&&"clientX"in e&&"clientY"in e&&Cn(e.clientX)&&Cn(e.clientY)}var nd=Fe("[Product Tours]"),Ta="ph_product_tours",qO=["$set_once","$set"],$n=Fe("[SiteApps]"),KO={sessionRecording:class{get started(){var e;return!((e=this.mr)==null||!e.isStarted)}get status(){return this.mr?this.mr.status:this.br?this.yr?"lazy_loading":"disabled":"pending_config"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.br=!1,this.wr=!1,this.$r=void 0,this._instance=e,!this._instance.sessionManager)throw wr.error("started without valid sessionManager"),new Error(Ol+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Ol+' cannot be used with cookieless_mode="always"')}get yr(){var e,t=!((e=this._instance.get_property(ki))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return k&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(this.br&&(!this.yr||(t=this.mr)==null||!t.isStarted)){var n=!B(Object.assign)&&!B(Array.from);this.yr&&n?(this.Er(e),wr.info("starting")):this.stopRecording()}}Er(e){var t,n,r;this.yr&&(Q!=null&&(t=Q.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=Q.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Sr(e):(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.kr,s=>{if(s)return wr.error("could not load recorder",s);this.Sr(e)}))}stopRecording(){var e,t;(e=this.$r)==null||e.call(this),this.$r=void 0,(t=this.mr)==null||t.stop()}Pr(){var e;(e=this._instance.persistence)==null||e.unregister(eg)}Tr(e){if(this._instance.persistence){var t,n,r=this._instance.persistence,s=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,o=i==null?void 0:i.sampleRate,a=de(o)?null:parseFloat(o);de(a)&&this.Pr();var l=i==null?void 0:i.minimumDurationMilliseconds;r.register({[ki]:U({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:U({capturePerformance:e.capturePerformance},i==null?void 0:i.networkPayloadCapture),canvasRecording:{enabled:i==null?void 0:i.recordCanvas,fps:i==null?void 0:i.canvasFps,quality:i==null?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:B(l)?null:l,endpoint:i==null?void 0:i.endpoint,triggerMatchType:i==null?void 0:i.triggerMatchType,masking:i==null?void 0:i.masking,urlTriggers:i==null?void 0:i.urlTriggers})})};s(),(t=this.$r)==null||t.call(this),this.$r=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.wr=!1,this.Tr(e),this.br=!0,this.startIfEnabledOrStop()):this.br=!0:wr.info("skipping remote config with no sessionRecording",e)}log(e,t){var n;t===void 0&&(t="log"),(n=this.mr)!=null&&n.log?this.mr.log(e,t):wr.warn("log called before recorder was ready")}get kr(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(ki);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Cr(){var e,t=this._instance.get_property(ki);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return Date.now()-n<=3e5}Sr(e){var t,n;if((t=Q.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.mr||(this.mr=(n=Q.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Cr()?this.mr.start(e):this.wr||(this.wr=!0,wr.info("persisted remote config is stale, requesting fresh config before starting"),new bg(this._instance).load())}onRRwebEmit(e){var t;(t=this.mr)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.mr||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.mr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.mr||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.mr)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.mr||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.mr)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.mr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.mr)==null||!n.tryAddCustomEvent(e,t))}}},JO={autocapture:class{constructor(e){this.Ir=!1,this.Rr=null,this.Fr=!1,this.instance=e,this.rageclicks=new Yf(e.config.rageclick),this.Or=null}get N(){var e,t,n=Xe(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map(r=>new RegExp(r)),n}Mr(){if(this.isBrowserSupported()){if(k&&j){var e=n=>{n=n||(k==null?void 0:k.event);try{this.Ar(n)}catch(r){Xf.error("Failed to capture event",r)}};if(He(j,"submit",e,{capture:!0}),He(j,"change",e,{capture:!0}),He(j,"click",e,{capture:!0}),this.N.capture_copied_text){var t=n=>{n=n||(k==null?void 0:k.event),this.Ar(n,Sa)};He(j,"copy",t,{capture:!0}),He(j,"cut",t,{capture:!0})}}}else Xf.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ir&&(this.Mr(),this.Ir=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Fr=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[gf]:!!e.autocapture_opt_out}),this.Rr=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Or=e}getElementSelectors(e){var t,n=[];return(t=this.Or)==null||t.forEach(r=>{var s=j==null?void 0:j.querySelectorAll(r);s==null||s.forEach(i=>{e===i&&n.push(r)})}),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[gf],r=this.Rr;if(Gt(r)&&!Tn(n)&&!this.instance.At())return!1;var s=(t=this.Rr)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!s}Ar(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=Wf(e);Sg(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&DO(r,this.instance.config.rageclick)&&this.Ar(e,"$rageclick");var s=t===Sa;if(r&&MO(r,e,this.N,s,s?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=HO(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Fr});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(i.$element_selectors=a),t===Sa){var l,u=Tg(k==null||(l=k.getSelection())==null?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;i.$selected_content=u,i.$copy_type=c}return this.instance.capture(t,i),!0}}}isBrowserSupported(){return bn(j==null?void 0:j.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Dr=(k==null||(t=k.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(V.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.jr&&this.jr(),this.jr=void 0,V.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(k&&k.history){var n=this;(e=k.history.pushState)!=null&&e.__posthog_wrapped__||Qf(k.history,"pushState",r=>function(s,i,o){r.call(this,s,i,o),n.Lr("pushState")}),(t=k.history.replaceState)!=null&&t.__posthog_wrapped__||Qf(k.history,"replaceState",r=>function(s,i,o){r.call(this,s,i,o),n.Lr("replaceState")}),this.Nr()}}Lr(e){try{var t,n=k==null||(t=k.location)==null?void 0:t.pathname;if(!n)return;n!==this.Dr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.Dr=n}catch(r){V.error("Error capturing "+e+" pageview",r)}}Nr(){if(!this.jr){var e=()=>{this.Lr("popstate")};He(k,"popstate",e),this.jr=()=>{k&&k.removeEventListener("popstate",e)}}}},heatmaps:class{constructor(e){var t;this.Ur=!1,this.Ir=!1,this.zr=null,this.instance=e,this.Ur=!((t=this.instance.persistence)==null||!t.props[ul]),this.rageclicks=new Yf(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Xe(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return de(this.instance.config.capture_heatmaps)?de(this.instance.config.enable_heatmaps)?this.Ur:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Ir)return;WO.info("starting..."),this.Hr(),this.Br()}else{var e;clearInterval((e=this.zr)!==null&&e!==void 0?e:void 0),this.qr(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ul]:t}),this.Ur=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Wr(e){this.Gr(e.originalEvent,"deadclick")}Br(){this.zr&&clearInterval(this.zr),this.zr=function(e){return(e==null?void 0:e.visibilityState)==="visible"}(j)?setInterval(this.se.bind(this),this.flushIntervalMilliseconds):null}Hr(){k&&j&&(this.Vr=this.se.bind(this),He(k,"beforeunload",this.Vr),this.Jr=e=>this.Gr(e||(k==null?void 0:k.event)),He(j,"click",this.Jr,{capture:!0}),this.Kr=e=>this.Yr(e||(k==null?void 0:k.event)),He(j,"mousemove",this.Kr,{capture:!0}),this.Xr=new Sf(this.instance,$T,this.Wr.bind(this)),this.Xr.startIfEnabledOrStop(),this.Qr=this.Br.bind(this),He(j,"visibilitychange",this.Qr),this.Ir=!0)}qr(){var e;k&&j&&(this.Vr&&k.removeEventListener("beforeunload",this.Vr),this.Jr&&j.removeEventListener("click",this.Jr,{capture:!0}),this.Kr&&j.removeEventListener("mousemove",this.Kr,{capture:!0}),this.Qr&&j.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.Zr),(e=this.Xr)==null||e.stop(),this.Ir=!1)}ts(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=function(o,a,l){for(var u=o;u&&Vo(u)&&!Gn(u,"body");){if(u===l)return!1;if(ue(a,k==null?void 0:k.getComputedStyle(u).position))return!0;u=xg(u)}return!1}(Wf(e),["fixed","sticky"],s);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:t}}Gr(e,t){var n;if(t===void 0&&(t="click"),!Hf(e.target)&&td(e)){var r=this.ts(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.es(U({},r,{type:"rageclick"})),this.es(r)}}Yr(e){!Hf(e.target)&&td(e)&&(clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.es(this.ts(e,"mousemove"))},500))}es(e){if(k){var t=k.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,s=n?Wr([],Kr,r||[]):[],i=Qs(t,s,ei);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(e)}}se(){this.R&&!Ar(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Sf,webVitalsAutocapture:class{constructor(e){var t;this.Ur=!1,this.Ir=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rs=()=>{clearTimeout(this.ss),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((n,r)=>U({},n,{["$web_vitals_"+r.name+"_event"]:U({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ns=n=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(B(s))Nn.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.os();B(i)||(de(n==null?void 0:n.name)||de(n==null?void 0:n.value)?Nn.error("Invalid metric received",n):this.ls&&n.value>=this.ls?Nn.error("Ignoring metric with value >= "+this.ls,n):(this.R.url!==i&&(this.rs(),this.ss=setTimeout(this.rs,this.flushToCaptureTimeoutMs)),B(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=B(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.R.metrics.push(U({},n,{$current_url:i,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.rs()))}},this.us=()=>{if(!this.Ir){var n,r,s,i,o=Q.__PosthogExtensions__;B(o)||B(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:s,onINP:i}=o.postHogWebVitalsCallbacks),n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ns.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ns.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.ns.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ns.bind(this)),this.Ir=!0):Nn.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Ur=!((t=this._instance.persistence)==null||!t.props[mf]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Xe(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return de(n)?((t=this._instance.persistence)==null?void 0:t.props[bf])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Xe(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Xe(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get ls(){var e=Xe(this._instance.config.capture_performance)&&Cn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:ed;return 0<e&&e<=6e4?ed:e}get isEnabled(){var e=st==null?void 0:st.protocol;if(e!=="http:"&&e!=="https:")return Nn.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Xe(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Tn(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Tn(t)?t:this.Ur}startIfEnabled(){this.isEnabled&&!this.Ir&&(Nn.info("enabled, starting..."),this.V(this.us))}onRemoteConfig(e){if("capturePerformance"in e){var t=Xe(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Xe(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[mf]:t}),this._instance.persistence.register({[bf]:n})),this.Ur=t,this.startIfEnabled()}}V(e){var t,n;if((t=Q.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,s=>{s?Nn.error("failed to load script",s):e()})}}os(){var e=k?k.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=t?Wr([],Kr,n||[]):[];return Qs(e,r,ei)}Nn.error("Could not determine current URL")}}},YO={exceptionObserver:class{constructor(e){var t,n,r;this.us=()=>{var s;if(k&&this.isEnabled&&(s=Q.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var i=Q.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=Q.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=Q.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.hs&&this.N.capture_unhandled_errors&&(this.hs=i(this.captureException.bind(this))),!this.ds&&this.N.capture_unhandled_rejections&&(this.ds=o(this.captureException.bind(this))),!this.vs&&this.N.capture_console_errors&&(this.vs=a(this.captureException.bind(this)))}catch(l){ps.error("failed to start",l),this.cs()}}},this._instance=e,this.fs=!((t=this._instance.persistence)==null||!t.props[_f]),this.ps=new Bk({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:ps}),this.N=this._s(),this.startIfEnabledOrStop()}_s(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Xe(e)?t=U({},t,e):(B(e)?this.fs:e)&&(t=U({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ps.info("enabled"),this.cs(),this.V(this.us)):this.cs()}V(e){var t,n;(t=Q.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return ps.error("failed to load script",r);e()})}cs(){var e,t,n;(e=this.hs)==null||e.call(this),this.hs=void 0,(t=this.ds)==null||t.call(this),this.ds=void 0,(n=this.vs)==null||n.call(this),this.vs=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.fs=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[_f]:this.fs}),this.N=this._s(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this._s()}captureException(e){var t,n,r=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.ps.consumeRateLimit(r)?ps.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}},XO={productTours:class{constructor(e){this.gs=null,this.bs=null,this._instance=e}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[yf]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.gs||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(yf)||this.V(()=>this.ys())}V(e){var t,n;(t=Q.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?nd.error("Could not load product tours script",r):e()})}ys(){var e;!this.gs&&(e=Q.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.gs=Q.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!_e(this.bs)||t){var n=this._instance.persistence;if(n){var r=n.props[Ta];if(_e(r)&&!t)return this.bs=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var i=s.statusCode;if(i!==200||!s.json){var o="Product Tours API could not be loaded, status: "+i;return nd.error(o),void e([],{isLoaded:!1,error:o})}var a=_e(s.json.product_tours)?s.json.product_tours:[];this.bs=a,n&&n.register({[Ta]:a}),e(a,{isLoaded:!0})}})}else e(this.bs,{isLoaded:!0})}getActiveProductTours(e){de(this.gs)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.gs.getActiveProductTours(e)}showProductTour(e){var t;(t=this.gs)==null||t.showTourById(e)}previewTour(e){this.gs?this.gs.previewTour(e):this.V(()=>{var t;this.ys(),(t=this.gs)==null||t.previewTour(e)})}dismissProductTour(){var e;(e=this.gs)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.gs)==null||e.nextStep()}previousStep(){var e;(e=this.gs)==null||e.previousStep()}clearCache(){var e;this.bs=null,(e=this._instance.persistence)==null||e.unregister(Ta)}resetTour(e){var t;(t=this.gs)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.gs)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.gs)==null||t.cancelPendingTour(e)}}},QO={siteApps:class{constructor(e){this._instance=e,this.ws=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}xs(e,t){if(t){var n=this.globalsForEvent(t);this.ws.push(n),this.ws.length>1e3&&(this.ws=this.ws.slice(10))}}get siteAppLoaders(){var e;return(e=Q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.xs.bind(this));this.$s=()=>{e(),this.ws=[],this.$s=void 0}}}globalsForEvent(e){var t,n,r,s,i,o,a;if(!e)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var[f,d]of Object.entries(c))l[f]={id:u[f],type:f,properties:d};var{$set_once:h,$set:p}=e;return{event:U({},xp(e,qO),{properties:U({},e.properties,p?{$set:U({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},p)}:{},h?{$set_once:U({},(r=(s=e.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},h)}:{}),elements_chain:(i=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(a=e.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.ws.length&&($n.info("Processing "+this.ws.length+" events for site app with id "+e.id),this.ws.forEach(a=>t.processEvent==null?void 0:t.processEvent(a)),t.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.$s)==null||o.call(this))},r=!1,s=o=>{t.errored=!o,t.loaded=!0,$n.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:o=>{s(o)}});i&&(t.processEvent=i),r=!0}catch(o){$n.error("Error while initializing PostHog app with config id "+e.id,o),s(!1)}if(r&&t.loaded)try{n()}catch(o){$n.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Es(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Ss(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){$n.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,s=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Es(),void this._instance.on("eventCaptured",l=>this.Ss(l))):void $n.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.$s)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(l){var u;Q["__$$ph_site_app_"+l]=s._instance,(u=Q.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,a,c=>{if(c)return $n.error("Error while initializing PostHog app with config id "+l,c)})};for(var{id:o,url:a}of e.siteApps)i(o)}else $n.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},ex=U({},KO,JO,YO,XO,QO,{tracingHeaders:class{constructor(e){this.ks=void 0,this.Ps=void 0,this.us=()=>{var t,n;B(this.ks)&&((t=Q.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),B(this.Ps)&&((n=Q.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}V(e){var t,n;(t=Q.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return GO.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.V(this.us):((e=this.ks)==null||e.call(this),(t=this.Ps)==null||t.call(this),this.ks=void 0,this.Ps=void 0)}}});En.__defaultExtensionClasses=U({},ex);var rd,tx=(rd=Ls[Or]=new En,function(){function e(){e.done||(e.done=!0,Eg=!1,Ae(Ls,function(t){t._dom_loaded()}))}j!=null&&j.addEventListener?j.readyState==="complete"?e():He(j,"DOMContentLoaded",e,{capture:!1}):k&&V.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),rd);function sd(e={}){const{disableAnalytics:t=!1}=e,n="phc_oXbpiTqzSdiNdHvnZLw66vz3oho8m84Wbjk3r2w5Hguo",r="https://us.i.posthog.com";if(t){console.log("PostHog: Analytics disabled by user setting");return}tx.init(n,{api_host:r,defaults:"2026-01-30",disable_session_recording:!0,capture_pageleave:!0,autocapture:!0,respect_dnt:!0,persistence:"localStorage"})}async function nx(){try{const t=await fetch("/api/settings/general"),{disableAnalytics:n}=await t.json();sd({disableAnalytics:n})}catch{console.log("PostHog: Failed to fetch general settings, using defaults"),sd()}const e=Em(kS);e.use(Tm()),e.use($k),e.mount("#app")}nx();export{rx as $,Yn as A,px as B,hx as C,dx as D,ur as E,dt as F,Io as G,dm as H,xo as I,ym as J,De as K,Im as L,gx as M,Qd as N,ox as O,Ze as P,pS as Q,Sn as R,ux as S,Uv as T,fx as U,x_ as V,Y as W,Ri as X,I_ as Y,lx as Z,li as _,Pe as a,Pt as a0,cx as a1,Tv as a2,ax as a3,Ul as a4,qn as a5,f_ as a6,ix as a7,Wl as a8,Hs as a9,Em as aa,G as b,Qe as c,Re as d,kv as e,Pc as f,_x as g,vm as h,uE as i,sx as j,Bn as k,It as l,Nr as m,hm as n,Xr as o,fm as p,Vc as q,V_ as r,vx as s,Et as t,Dt as u,cu as v,Bs as w,Ce as x,ri as y,ci as z};
|
|
82
|
+
`)).length,s=0;s<r;s++){var o=e.charCodeAt(s),a=null;o<128?n++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Gt(a)||(n>t&&(i+=e.substring(t,n)),i+=a,t=n=s+1)}return n>t&&(i+=e.substring(t,e.length)),i},KT=!!nl||!!tl,If="text/plain",_o=function(e,t,n){var r;n===void 0&&(n=!0);var[s,i]=e.split("?"),o=U({},t),a=(r=i==null?void 0:i.split("&").map(u=>{var c,[f,d]=u.split("="),h=n&&(c=o[f])!==null&&c!==void 0?c:d;return delete o[f],f+"="+h}))!==null&&r!==void 0?r:[],l=LT(o);return l&&a.push(l),s+"?"+a.join("&")},Es=(e,t)=>JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t),ga=e=>{var{data:t,compression:n}=e;if(t){if(n===yn.GZipJS){var r=WT(function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new Lt(l.length+(l.length>>>1)),d=0,h=function(T){f[d++]=T},p=0;p<c;++p){if(d+5>f.length){var g=new Lt(d+8+(c-p<<1));g.set(f),f=g}var y=l.charCodeAt(p);y<128||u?h(y):y<2048?(h(192|y>>>6),h(128|63&y)):y>55295&&y<57344?(h(240|(y=65536+(1047552&y)|1023&l.charCodeAt(++p))>>>18),h(128|y>>>12&63),h(128|y>>>6&63),h(128|63&y)):(h(224|y>>>12),h(128|y>>>6&63),h(128|63&y))}return cg(f,0,d)}(Es(t)),{mtime:0}),s=new Blob([r],{type:If});return{contentType:If,body:s,estimatedSize:s.size}}if(n===yn.Base64){var i=function(l){var u,c,f,d,h,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,y=0,T="",b=[];if(!l)return l;l=qT(l);do u=(h=l.charCodeAt(g++)<<16|l.charCodeAt(g++)<<8|l.charCodeAt(g++))>>18&63,c=h>>12&63,f=h>>6&63,d=63&h,b[y++]=p.charAt(u)+p.charAt(c)+p.charAt(f)+p.charAt(d);while(g<l.length);switch(T=b.join(""),l.length%3){case 1:T=T.slice(0,-2)+"==";break;case 2:T=T.slice(0,-1)+"="}return T}(Es(t)),o=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Es(l)))(i);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Es(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Li=[];tl&&Li.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:s,estimatedSize:i}=(t=ga(e))!==null&&t!==void 0?t:{},o=new Headers;Ae(e.headers,function(c,f){o.append(f,c)}),r&&o.append("Content-Type",r);var a=e.url,l=null;if(rf){var u=new rf;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),e.timeout)}}tl(a,U({method:(e==null?void 0:e.method)||"GET",headers:o,keepalive:e.method==="POST"&&(i||0)<52428.8,body:s,signal:(n=l)==null?void 0:n.signal},e.fetchOptions)).then(c=>c.text().then(f=>{var d={statusCode:c.status,text:f};if(c.status===200)try{d.json=JSON.parse(f)}catch(h){V.error(h)}e.callback==null||e.callback(d)})).catch(c=>{V.error(c),e.callback==null||e.callback({statusCode:0,error:c})}).finally(()=>l?clearTimeout(l.timeout):null)}}),nl&&Li.push({transport:"XHR",method:e=>{var t,n=new nl;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=(t=ga(e))!==null&&t!==void 0?t:{};Ae(e.headers,function(i,o){n.setRequestHeader(o,i)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var i={statusCode:n.status,text:n.responseText};if(n.status===200)try{i.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(i)}},n.send(s)}}),Ct!=null&&Ct.sendBeacon&&Li.push({transport:"sendBeacon",method:e=>{var t=_o(e.url,{beacon:"1"});try{var n,{contentType:r,body:s}=(n=ga(e))!==null&&n!==void 0?n:{},i=typeof s=="string"?new Blob([s],{type:r}):s;Ct.sendBeacon(t,i)}catch{}}});var vo=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function Pf(e,t,n){return Es({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var ug={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>vo(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!vo(n,r))),icontains:(e,t)=>t.map(xi).some(n=>e.map(xi).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(xi).every(n=>e.map(xi).every(r=>!n.includes(r))),gt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(s=>r>parseFloat(s))}),lt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(s=>r<parseFloat(s))})},xi=e=>e.toLowerCase();function fg(e,t){return!e||Object.entries(e).every(n=>{var[r,s]=n,i=t==null?void 0:t[r];if(B(i)||Gt(i))return!1;var o=[String(i)],a=ug[s.operator];return!!a&&a(s.values,o)})}var _a=Fe("[Error tracking]");class JT{constructor(t){var n,r;this.nt=[],this.ot=new tT([new uT,new yT,new dT,new fT,new vT,new _T,new pT,new mT],cT()),this._instance=t,this.nt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(fl))!==null&&n!==void 0?n:[]}onRemoteConfig(t){var n,r,s;if("errorTracking"in t){var i=(n=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],o=(s=t.errorTracking)==null?void 0:s.captureExtensionExceptions;this.nt=i,this._instance.persistence&&this._instance.persistence.register({[fl]:this.nt,[vf]:o})}}get ut(){var t,n=!!this._instance.get_property(vf),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??n)!==null&&t!==void 0&&t}buildProperties(t,n){return this.ot.buildFromUnknown(t,{syntheticException:n==null?void 0:n.syntheticException,mechanism:{handled:n==null?void 0:n.handled}})}sendExceptionEvent(t){var n=t.$exception_list;if(this.ht(n)){if(this.dt(n))return void _a.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(n))return void _a.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(n))return void _a.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(t){if(t.length===0)return!1;var n=t.reduce((r,s)=>{var{type:i,value:o}=s;return Ge(i)&&i.length>0&&r.$exception_types.push(i),Ge(o)&&o.length>0&&r.$exception_values.push(o),r},{$exception_types:[],$exception_values:[]});return this.nt.some(r=>{var s=r.values.map(i=>{var o,a=ug[i.operator],l=_e(i.value)?i.value:[i.value],u=(o=n[i.key])!==null&&o!==void 0?o:[];return l.length>0&&a(l,u)});return r.type==="OR"?s.some(Boolean):s.every(Boolean)})}vt(t){return t.flatMap(n=>{var r,s;return(r=(s=n.stacktrace)==null?void 0:s.frames)!==null&&r!==void 0?r:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}ct(t){if(t.length>0){var n,r,s,i,o=(n=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=o[o.length-1];return(s=a==null||(i=a.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}ht(t){return!de(t)&&_e(t)}}var Ai="https?://(.*)",Kr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],YT=Wr(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Kr),ei="<masked>",XT=["li_fat_id"];function dg(e,t,n){if(!j)return{};var r,s=t?Wr([],Kr,n||[]):[],i=hg(Qs(j.URL,s,ei),e),o=(r={},Ae(XT,function(a){var l=nn.A(a);r[a]=l||null}),r);return je(o,i)}function hg(e,t){var n=YT.concat(t||[]),r={};return Ae(n,function(s){var i=ho(e,s);r[s]=i||null}),r}function pg(e){var t=function(i){return i?i.search(Ai+"google.([^/?]*)")===0?"google":i.search(Ai+"bing.com")===0?"bing":i.search(Ai+"yahoo.com")===0?"yahoo":i.search(Ai+"duckduckgo.com")===0?"duckduckgo":null:null}(e),n=t!="yahoo"?"q":"p",r={};if(!Gt(t)){r.$search_engine=t;var s=j?ho(j.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function Nf(){return navigator.language||navigator.userLanguage}function gg(){return(j==null?void 0:j.referrer)||"$direct"}function _g(e,t){var n=e?Wr([],Kr,t||[]):[],r=st==null?void 0:st.href.substring(0,1e3);return{r:gg().substring(0,1e3),u:r?Qs(r,n,ei):void 0}}function vg(e){var t,{r:n,u:r}=e,s={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=fo(n))==null?void 0:t.host};if(r){s.$current_url=r;var i=fo(r);s.$host=i==null?void 0:i.host,s.$pathname=i==null?void 0:i.pathname;var o=hg(r);je(s,o)}if(n){var a=pg(n);je(s,a)}return s}function mg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function QT(){try{return new Date().getTimezoneOffset()}catch{return}}function eO(e,t){var n,r;if(!St)return{};var s,i,o=e?Wr([],Kr,t||[]):[],[a,l]=function(T){for(var b=0;b<cf.length;b++){var[S,E]=cf[b],m=S.exec(T),N=m&&(bn(E)?E(m,T):E);if(N)return N}return["",""]}(St),u=(s=uf(St))===Pp||s===Ip||s==="Kobo"||s==="Kindle Fire"||s===Hp?Ks:s===Ys||s===Fr||s===Xs||s===al?"Console":s===$p?"Wearable":s?Ft:"Desktop";if(u==="Desktop"&&((n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform)==="Android"&&((r=navigator)==null?void 0:r.maxTouchPoints)>0){var c,f,d,h,p,g=(c=k==null||(f=k.screen)==null?void 0:f.width)!==null&&c!==void 0?c:0,y=(d=k==null||(h=k.screen)==null?void 0:h.height)!==null&&d!==void 0?d:0;u=Math.min(g,y)/((p=k==null?void 0:k.devicePixelRatio)!==null&&p!==void 0?p:1)>=600?"Tablet":"Mobile"}return je(uc({$os:a,$os_version:l,$browser:Gp(St,navigator.vendor),$device:uf(St),$device_type:u,$timezone:mg(),$timezone_offset:QT()}),{$current_url:Qs(st==null?void 0:st.href,o,ei),$host:st==null?void 0:st.host,$pathname:st==null?void 0:st.pathname,$raw_user_agent:St.length>1e3?St.substring(0,997)+"...":St,$browser_version:Xk(St,navigator.vendor),$browser_language:Nf(),$browser_language_prefix:(i=Nf(),typeof i=="string"?i.split("-")[0]:void 0),$screen_height:k==null?void 0:k.screen.height,$screen_width:k==null?void 0:k.screen.width,$viewport_height:k==null?void 0:k.innerHeight,$viewport_width:k==null?void 0:k.innerWidth,$lib:"web",$lib_version:fn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var wt=Fe("[FeatureFlags]"),us=Fe("[FeatureFlags]",{debugEnabled:!0}),tO="errors_while_computing_flags",nO="flag_missing",rO="quota_limited",sO="timeout",iO="connection_error",oO="unknown_error",aO=e=>"api_error_"+e,va="$active_feature_flags",yr="$override_feature_flags",$f="$feature_flag_payloads",fs="$override_feature_flag_payloads",Df="$feature_flag_request_id",Mf=e=>{var t={};for(var[n,r]of Fi(e||{}))r&&(t[n]=r);return t},lO=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(n=>t[n].enabled).filter(n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload}).map(n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]}))):wt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},cO=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class uO{constructor(t){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this.St=!1,this._instance=t,this.featureFlagEventHandlers=[]}kt(){var t,n;return(t=(n=this._instance.persistence)==null?void 0:n.Pt(this._instance.config.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Tt(){return!!this.kt()&&(this.St||this.yt||(this.St=!0,wt.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ct(){var t,n=(t=this._instance.config.evaluation_contexts)!==null&&t!==void 0?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(wt.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),n!=null&&n.length?n.filter(r=>{var s=r&&typeof r=="string"&&r.trim().length>0;return s||wt.error("Invalid evaluation context found:",r,"Expected non-empty string"),s}):[]}It(){return this.Ct().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(dl),n=this._instance.get_property(yr),r=this._instance.get_property(fs);if(!r&&!n)return t||{};var s=je({},t||{}),i=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of i){var a,l,u=s[o],c=n==null?void 0:n[o],f=B(c)?(a=u==null?void 0:u.enabled)!==null&&a!==void 0&&a:!!c,d=B(c)?u.variant:typeof c=="string"?c:void 0,h=r==null?void 0:r[o],p=U({},u,{enabled:f,variant:f?d??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(p.original_enabled=u==null?void 0:u.enabled),d!==(u==null?void 0:u.variant)&&(p.original_variant=u==null?void 0:u.variant),h&&(p.metadata=U({},u==null?void 0:u.metadata,{payload:h,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),s[o]=p}return this._t||(wt.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:s}),this._t=!0),s}getFlagVariants(){var t=this._instance.get_property(Cr),n=this._instance.get_property(yr);if(!n)return t||{};for(var r=je({},t),s=Object.keys(n),i=0;i<s.length;i++)r[s[i]]=n[s[i]];return this._t||(wt.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this._t=!0),r}getFlagPayloads(){var t=this._instance.get_property($f),n=this._instance.get_property(fs);if(!n)return t||{};for(var r=je({},t||{}),s=Object.keys(n),i=0;i<s.length;i++)r[s[i]]=n[s[i]];return this._t||(wt.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this._t=!0),r}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Rt||(this._instance.Ft.emit("featureFlagsReloading",!0),this.Rt=setTimeout(()=>{this.Ot()},5))}Mt(){clearTimeout(this.Rt),this.Rt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Rt||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.wt=t}Ot(t){var n;if(this.Mt(),!this._instance.At())if(this.yt)this.xt=!0;else{var r=this._instance.config.token,s=this._instance.get_property("$device_id"),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:U({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(ws)||{}),group_properties:this._instance.get_property(or),timezone:mg()};Gt(s)||B(s)||(i.$device_id=s),(t!=null&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.It()&&(i.evaluation_contexts=this.Ct());var o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+o);this.yt=!0,this._instance._send_request({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:yn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,f,d=!0;if(l.statusCode===200&&(this.xt||(this.$anon_distinct_id=void 0),d=!1),this.yt=!1,!i.disable_flags||this.xt){this.$t=!d;var h=[];l.error?l.error instanceof Error?h.push(l.error.name==="AbortError"?sO:iO):h.push(oO):l.statusCode!==200&&h.push(aO(l.statusCode)),(u=l.json)!=null&&u.errorsWhileComputingFlags&&h.push(tO);var p=!((c=l.json)==null||(c=c.quotaLimited)==null||!c.includes(cO.FeatureFlags));if(p&&h.push(rO),(f=this._instance.persistence)==null||f.register({[pl]:h}),p)wt.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var g;i.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},d),this.xt&&(this.xt=!1,this.Ot())}}}})}}getFeatureFlag(t,n){var r;if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var s=this.getFeatureFlagResult(t,n);return(r=s==null?void 0:s.variant)!==null&&r!==void 0?r:s==null?void 0:s.enabled}}else wt.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var n=this.getFeatureFlagResult(t,{send_event:!1});return n==null?void 0:n.payload}getFeatureFlagResult(t,n){if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var r=this.getFlagVariants(),s=t in r,i=r[t],o=this.getFlagPayloads()[t],a=String(i),l=this._instance.get_property(Df)||void 0,u=this._instance.get_property(ao)||void 0,c=this._instance.get_property(oo)||{};if((n.send_event||!("send_event"in n))&&(!(t in c)||!c[t].includes(a))){var f,d,h,p,g,y,T,b,S,E;_e(c[t])?c[t].push(a):c[t]=[a],(f=this._instance.persistence)==null||f.register({[oo]:c});var m=this.getFeatureFlagDetails(t),N=[...(d=this._instance.get_property(pl))!==null&&d!==void 0?d:[]];B(i)&&N.push(nO);var M={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:o||null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((h=this._instance.config.bootstrap)==null||(h=h.featureFlags)==null?void 0:h[t])||null,$feature_flag_bootstrapped_payload:((p=this._instance.config.bootstrap)==null||(p=p.featureFlagPayloads)==null?void 0:p[t])||null,$used_bootstrap_value:!this.$t};B(m==null||(g=m.metadata)==null?void 0:g.version)||(M.$feature_flag_version=m.metadata.version);var R,I=(y=m==null||(T=m.reason)==null?void 0:T.description)!==null&&y!==void 0?y:m==null||(b=m.reason)==null?void 0:b.code;I&&(M.$feature_flag_reason=I),m!=null&&(S=m.metadata)!=null&&S.id&&(M.$feature_flag_id=m.metadata.id),B(m==null?void 0:m.original_variant)&&B(m==null?void 0:m.original_enabled)||(M.$feature_flag_original_response=B(m.original_variant)?m.original_enabled:m.original_variant),m!=null&&(E=m.metadata)!=null&&E.original_payload&&(M.$feature_flag_original_payload=m==null||(R=m.metadata)==null?void 0:R.original_payload),N.length&&(M.$feature_flag_error=N.join(",")),this._instance.capture("$feature_flag_called",M)}if(s){var F=o;if(!B(o))try{F=JSON.parse(o)}catch{}return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:F}}}}else wt.warn('getFeatureFlagResult for key "'+t+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(t,n){var r=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:r};this.It()&&(s.evaluation_contexts=this.Ct()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this._instance.config.disable_compression?void 0:yn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var o,a=(o=i.json)==null?void 0:o.featureFlagPayloads;n((a==null?void 0:a[t])||void 0)}})}isFeatureEnabled(t,n){if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,n);return B(r)?void 0:!!r}wt.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==t)}receivedFeatureFlags(t,n){if(this._instance.persistence){this.bt=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(o,a,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var f=lO(o),d=f.flags,h=f.featureFlags,p=f.featureFlagPayloads;if(h){var g=o.requestId,y=o.evaluatedAt;if(_e(h)){wt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var T={};if(h)for(var b=0;b<h.length;b++)T[h[b]]=!0;a&&a.register({[va]:h,[Cr]:T})}else{var S=h,E=p,m=d;if(o.errorsWhileComputingFlags)if(d){var N=new Set(Object.keys(d).filter(M=>{var R;return!((R=d[M])!=null&&R.failed)}));S=U({},l,Object.fromEntries(Object.entries(S).filter(M=>{var[R]=M;return N.has(R)}))),E=U({},u,Object.fromEntries(Object.entries(E||{}).filter(M=>{var[R]=M;return N.has(R)}))),m=U({},c,Object.fromEntries(Object.entries(m||{}).filter(M=>{var[R]=M;return N.has(R)})))}else S=U({},l,S),E=U({},u,E),m=U({},c,m);a&&a.register(U({[va]:Object.keys(Mf(S)),[Cr]:S||{},[$f]:E||{},[dl]:m||{}},g?{[Df]:g}:{},y?{[ao]:y}:{}))}}})(t,this._instance.persistence,r,s,i),n||(this.St=!1),this.Dt(n)}}override(t,n){n===void 0&&(n=!1),wt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return wt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(yr),this._instance.persistence.unregister(fs),this.Dt(),us.info("All overrides cleared");if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this._t=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(yr),us.info("Flag overrides cleared");else if(r.flags){if(_e(r.flags)){for(var s={},i=0;i<r.flags.length;i++)s[r.flags[i]]=!0;this._instance.persistence.register({[yr]:s})}else this._instance.persistence.register({[yr]:r.flags});us.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(fs),us.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[fs]:r.payloads}),us.info("Payload overrides set",{payloads:r.payloads}))),void this.Dt()}this.Dt()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.bt){var{flags:n,flagVariants:r}=this.jt();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n,r){var s,i=(this._instance.get_property(bs)||[]).find(u=>u.flagKey===t),o={["$feature_enrollment/"+t]:n},a={$feature_flag:t,$feature_enrollment:n,$set:o};i&&(a.$early_access_feature_name=i.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=U({},this.getFlagVariants(),{[t]:n});(s=this._instance.persistence)==null||s.register({[va]:Object.keys(Mf(l)),[Cr]:l}),this.Dt()}getEarlyAccessFeatures(t,n,r){n===void 0&&(n=!1);var s=this._instance.get_property(bs),i=r?"&"+r.map(o=>"stage="+o).join("&"):"";if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+i),method:"GET",callback:o=>{var a,l;if(o.json){var u=o.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(bs),(l=this._instance.persistence)==null||l.register({[bs]:u}),t(u)}}})}jt(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,s)=>(r[s]=n[s],r),{})}}Dt(t){var{flags:n,flagVariants:r}=this.jt();this.featureFlagEventHandlers.forEach(s=>s(n,r,{errorsLoading:t}))}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(ws)||{};this._instance.register({[ws]:U({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ws)}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(or)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(s=>{r[s]=U({},r[s],t[s]),delete t[s]}),this._instance.register({[or]:U({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this._instance.get_property(or)||{};this._instance.register({[or]:U({},n,{[t]:{}})})}else this._instance.unregister(or)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Mt(),this._t=!1}}var fO=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class ma{constructor(t,n){this.N=t,this.props={},this.Lt=!1,this.Nt=(r=>{var s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(t),this.B=this.Ut(t),this.load(),t.debug&&V.info("Persistence loaded",t.persistence,U({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.zt}Ut(t){fO.indexOf(t.persistence.toLowerCase())===-1&&(V.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=function(s){s===void 0&&(s=[]);var i=[...IT,...s];return U({},$e,{D:function(o){try{var a={};try{a=nn.D(o)||{}}catch{}var l=je(a,JSON.parse($e.A(o)||"{}"));return $e.j(o,l),l}catch{}return null},j:function(o,a,l,u,c,f){try{$e.j(o,a,void 0,void 0,f);var d={};i.forEach(h=>{a[h]&&(d[h]=a[h])}),Object.keys(d).length&&nn.j(o,d,l,u,c,f)}catch(h){$e.M(h)}},L:function(o,a){try{k==null||k.localStorage.removeItem(o),nn.L(o,a)}catch(l){$e.M(l)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&$e.O()?$e:r==="localstorage+cookie"&&n.O()?n:r==="sessionstorage"&&rt.O()?rt:r==="memory"?PT:r==="cookie"?nn:n.O()?n:nn}Pt(t){var n=t??this.N.feature_flag_cache_ttl_ms;if(!n||n<=0)return!1;var r=this.props[ao];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return Ae(this.props,(n,r)=>{if(r===Cr&&Xe(n)){if(!this.Pt())for(var s=Object.keys(n),i=0;i<s.length;i++)t["$feature/"+s[i]]=n[s[i]]}else a=r,l=!1,(Gt(o=TT)?l:nf&&o.indexOf===nf?o.indexOf(a)!=-1:(Ae(o,function(u){if(l||(l=u===a))return so}),l))||(t[r]=n);var o,a,l}),t}load(){if(!this.zt){var t=this.B.D(this.Nt);t&&(this.props=je({},t))}}save(){this.zt||this.B.j(this.Nt,this.props,this.Ht,this.Bt,this.qt,this.N.debug)}remove(){this.B.L(this.Nt,!1),this.B.L(this.Nt,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Xe(t)){B(n)&&(n="None"),this.Ht=B(r)?this.Wt:r;var s=!1;if(Ae(t,(i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=i,s=!0)}),s)return this.save(),!0}return!1}register(t,n){if(Xe(t)){this.Ht=B(n)?this.Wt:n;var r=!1;if(Ae(t,(s,i)=>{t.hasOwnProperty(i)&&this.props[i]!==s&&(this.props[i]=s,r=!0)}),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.Lt){var t=dg(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);Ar(uc(t))||this.register(t),this.Lt=!0}}update_search_keyword(){var t;this.register((t=j==null?void 0:j.referrer)?pg(t):{})}update_referrer_info(){var t;this.register_once({$referrer:gg(),$referring_domain:j!=null&&j.referrer&&((t=fo(j.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[vl]||this.props[ml]||this.register_once({[lo]:_g(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Ae([ml,vl],o=>{var a=this.props[o];a&&Ae(a,function(l,u){t["$initial_"+rl(u)]=l})});var n,r,s=this.props[lo];if(s){var i=(n=vg(s),r={},Ae(n,function(o,a){r["$initial_"+rl(a)]=o}),r);je(t,i)}return t}safe_merge(t){return Ae(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n,r){if(this.Wt=this.Ht=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((o,a)=>{if(o.length!==a.length)return!1;var l=[...o].sort(),u=[...a].sort();return l.every((c,f)=>c===u[f])})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var s=this.Ut(t),i=this.props;this.clear(),this.B=s,this.props=i,this.save()}}set_disabled(t){this.zt=t,this.zt?this.remove():this.save()}set_cross_subdomain(t){t!==this.Bt&&(this.Bt=t,this.remove(),this.save())}set_secure(t){t!==this.qt&&(this.qt=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[ys]||{};r[t]=n,this.props[ys]=r,this.save()}remove_event_timer(t){var n=(this.props[ys]||{})[t];return B(n)||(delete this.props[ys][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var ds=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({});(function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e})({});(function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e})({});(function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e})({});var ya=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({});(function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e})({});(function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e})({});(function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e})({});var Ss=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({}),ba=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e}({}),El=function(e){return e.Popover="popover",e.Inline="inline",e}({}),ke=Fe("[Surveys]"),yg="seenSurvey_",dO=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},Ff=e=>((t,n)=>{var r=""+t+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+t+n.id+"_"+n.current_iteration),r})(yg,e),hO=[ya.Popover,ya.Widget,ya.API],pO={ignoreConditions:!1,ignoreDelay:!1,displayType:El.Popover};class hc{constructor(){this.Gt={},this.Gt={}}on(t,n){return this.Gt[t]||(this.Gt[t]=[]),this.Gt[t].push(n),()=>{this.Gt[t]=this.Gt[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.Gt[t]||[])r(n);for(var s of this.Gt["*"]||[])s(t,n)}}function br(e,t,n){if(de(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class gO{constructor(t){this.Vt=new hc,this.Jt=(n,r)=>this.Kt(n,r)&&this.Yt(n,r)&&this.Xt(n,r)&&this.Qt(n,r),this.Kt=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t,this.Zt=new Set,this.ti=new Set}init(){var t;if(!B((t=this._instance)==null?void 0:t._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook((r,s)=>{this.on(r,s)})}}register(t){var n,r;if(!B((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach(o=>{var a,l;(a=this.ti)==null||a.add(o),(l=o.steps)==null||l.forEach(u=>{var c;(c=this.Zt)==null||c.add((u==null?void 0:u.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;t.forEach(o=>{var a;(a=o.steps)==null||a.forEach(l=>{l!=null&&l.selector&&i.add(l==null?void 0:l.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(t,n){var r;n!=null&&t.length!=0&&(this.Zt.has(t)||this.Zt.has(n==null?void 0:n.event))&&this.ti&&((r=this.ti)==null?void 0:r.size)>0&&this.ti.forEach(s=>{this.ii(n,s)&&this.Vt.emit("actionCaptured",s.name)})}ei(t){this.onAction("actionCaptured",n=>t(n))}ii(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Jt(t,r))return!0;return!1}onAction(t,n){return this.Vt.on(t,n)}Yt(t,n){if(n!=null&&n.url){var r,s=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!br(s,n.url,n.url_matching||"contains"))return!1}return!0}Xt(t,n){return!!this.ri(t,n)&&!!this.si(t,n)&&!!this.ni(t,n)}ri(t,n){var r;if(n==null||!n.href)return!0;var s=this.oi(t);if(s.length>0)return s.some(a=>br(a.href,n.href,n.href_matching||"exact"));var i,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&br((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}si(t,n){var r;if(n==null||!n.text)return!0;var s=this.oi(t);if(s.length>0)return s.some(u=>br(u.text,n.text,n.text_matching||"exact")||br(u.$el_text,n.text,n.text_matching||"exact"));var i,o,a,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(i=function(u){for(var c,f=[],d=/(?::|")text="(.*?)"/g;!de(c=d.exec(u));)f.includes(c[1])||f.push(c[1]);return f}(l),o=n.text,a=n.text_matching||"exact",i.some(u=>br(u,o,a)))}ni(t,n){var r,s;if(n==null||!n.selector)return!0;var i=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(t==null||(s=t.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}oi(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t==null?void 0:t.properties.$elements}Qt(t,n){return n==null||!n.properties||n.properties.length===0||fg(n.properties.reduce((r,s)=>{var i=_e(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r},{}),t==null?void 0:t.properties)}}class _O{constructor(t){this._instance=t,this.ai=new Map,this.li=new Map,this.ui=new Map}hi(t,n){return!!t&&fg(t.propertyFilters,n==null?void 0:n.properties)}di(t,n){var r=new Map;return t.forEach(s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(s.id),r.set(o.name,a)}})}),r}vi(t,n,r){var s=(r===ds.Activation?this.ai:this.li).get(t),i=[];return this.ci(o=>{i=o.filter(a=>s==null?void 0:s.includes(a.id))}),i.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(u=>u.name===t);return this.hi(l,n)})}register(t){var n;B((n=this._instance)==null?void 0:n._addCaptureHook)||(this.fi(t),this.pi(t))}pi(t){var n=t.filter(r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0});n.length!==0&&(this.gi==null&&(this.gi=new gO(this._instance),this.gi.init(),this.gi.ei(r=>{this.onAction(r)})),n.forEach(r=>{var s,i,o,a,l;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.gi)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.ui.get(u.name);c&&c.push(r.id),this.ui.set(u.name,c||[r.id])}}))}))}fi(t){var n,r=t.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.events)&&((a=i.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0}),s=t.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((a=i.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0});(r.length!==0||s.length!==0)&&((n=this._instance)==null||n._addCaptureHook((i,o)=>{this.onEvent(i,o)}),this.ai=this.di(t,ds.Activation),this.li=this.di(t,ds.Cancellation))}onEvent(t,n){var r,s=this.mi(),i=this.bi(),o=this.yi(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[i])||[];if(o===t&&n&&a.length>0){var l,u;s.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:a});var c=(n==null||(l=n.properties)==null?void 0:l.$survey_id)||(n==null||(u=n.properties)==null?void 0:u.$product_tour_id);if(c){var f=a.indexOf(c);f>=0&&(a.splice(f,1),this.wi(a))}}else{if(this.li.has(t)){var d=this.vi(t,n,ds.Cancellation);d.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:d.map(p=>p.id)}),d.forEach(p=>{var g=a.indexOf(p.id);g>=0&&a.splice(g,1),this.xi(p.id)}),this.wi(a))}if(this.ai.has(t)){s.info("event name matched",{event:t,eventPayload:n,items:this.ai.get(t)});var h=this.vi(t,n,ds.Activation);this.wi(a.concat(h.map(p=>p.id)||[]))}}}onAction(t){var n,r=this.bi(),s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ui.has(t)&&this.wi(s.concat(this.ui.get(t)||[]))}wi(t){var n,r=this.mi(),s=this.bi(),i=[...new Set(t)].filter(o=>!this.$i(o));r.info("updating activated items",{activatedItems:i}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[s]:i})}getActivatedIds(){var t,n=this.bi(),r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r||[]}getEventToItemsMap(){return this.ai}Ei(){return this.gi}}class vO extends _O{constructor(t){super(t)}bi(){return"$surveys_activated"}yi(){return Ss.SHOWN}ci(t){var n;(n=this._instance)==null||n.getSurveys(t)}xi(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}mi(){return ke}$i(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class mO{constructor(t){this.Si=void 0,this._surveyManager=null,this.ki=!1,this.Pi=[],this.Ti=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var n=t.surveys;if(de(n))return ke.warn("Flags not loaded yet. Not loading surveys.");var r=_e(n);this.Si=r?n.length>0:n,ke.info("flags response received, isSurveysEnabled: "+this.Si),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(yg)||r!=null&&r.startsWith("inProgressSurvey_"))&&t.push(r)}t.forEach(s=>localStorage.removeItem(s))}loadIfEnabled(){if(!this._surveyManager)if(this.ki)ke.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ke.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ke.info("Not loading surveys in cookieless mode without consent.");else{var t=Q==null?void 0:Q.__PosthogExtensions__;if(t){if(!B(this.Si)||this._instance.config.advanced_enable_surveys){var n=this.Si||this._instance.config.advanced_enable_surveys;this.ki=!0;try{var r=t.generateSurveys;if(r)return void this.Ci(r,n);var s=t.loadExternalDependency;if(!s)return void this.Ii("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!t.generateSurveys?this.Ii("Could not load surveys script",i):this.Ci(t.generateSurveys,n)})}catch(i){throw this.Ii("Error initializing surveys",i),i}finally{this.ki=!1}}}else ke.error("PostHog Extensions not found.")}}Ci(t,n){this._surveyManager=t(this._instance,n),this._surveyEventReceiver=new vO(this._instance),ke.info("Surveys loaded successfully"),this.Ri({isLoaded:!0})}Ii(t,n){ke.error(t,n),this.Ri({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Pi.push(t),this._surveyManager&&this.Ri({isLoaded:!0}),()=>{this.Pi=this.Pi.filter(n=>n!==t)}}getSurveys(t,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return ke.info("Disabled. Not loading surveys."),t([]);var r,s=this._instance.get_property(hl);if(s&&!n)return t(s,{isLoaded:!0});typeof Promise<"u"&&this.Ti?this.Ti.then(i=>{var{surveys:o,context:a}=i;return t(o,a)}):(typeof Promise<"u"&&(this.Ti=new Promise(i=>{r=i})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var o;this.Ti=null;var a=i.statusCode;if(a!==200||!i.json){var l="Surveys API could not be loaded, status: "+a;ke.error(l);var u={isLoaded:!1,error:l};return t([],u),void(r==null||r({surveys:[],context:u}))}var c,f=i.json.surveys||[],d=f.filter(p=>function(g){return!(!g.start_date||g.end_date)}(p)&&(function(g){var y;return!((y=g.conditions)==null||(y=y.events)==null||(y=y.values)==null||!y.length)}(p)||function(g){var y;return!((y=g.conditions)==null||(y=y.actions)==null||(y=y.values)==null||!y.length)}(p)));d.length>0&&((c=this._surveyEventReceiver)==null||c.register(d)),(o=this._instance.persistence)==null||o.register({[hl]:f});var h={isLoaded:!0};t(f,h),r==null||r({surveys:f,context:h})}}))}Ri(t){for(var n of this.Pi)try{if(!t.isLoaded)return n([],t);this.getSurveys(n)}catch(r){ke.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,n){if(n===void 0&&(n=!1),!de(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,n);ke.warn("init was not called")}Fi(t){var n=null;return this.getSurveys(r=>{var s;n=(s=r.find(i=>i.id===t))!==null&&s!==void 0?s:null}),n}Oi(t){if(de(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof t=="string"?this.Fi(t):t;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(de(this._surveyManager))return ke.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.Oi(t);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(t,n){return de(this._surveyManager)?(ke.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(r=>{this.getSurveys(s=>{var i,o=(i=s.find(l=>l.id===t))!==null&&i!==void 0?i:null;if(o){var a=this.Oi(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(t,n,r){var s;if(de(this._surveyManager))ke.warn("init was not called");else{var i=typeof t=="string"?this.Fi(t):t;if(i!=null&&i.id)if(hO.includes(i.type)){var o=j==null?void 0:j.querySelector(n);if(o)return(s=i.appearance)!=null&&s.surveyPopupDelaySeconds?(ke.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,l;ke.info("Rendering survey "+i.id+" with delay of "+((a=i.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(i,o,r),ke.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o,r);ke.warn("Survey element not found")}else ke.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ke.warn("Survey not found")}}displaySurvey(t,n){var r;if(de(this._surveyManager))ke.warn("init was not called");else{var s=this.Fi(t);if(s){var i=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=U({},s,{appearance:U({},s.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==El.Popover&&n.initialResponses&&ke.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.canRenderSurvey(s);if(!o.visible)return void ke.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==El.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else ke.warn("Survey not found")}}cancelPendingSurvey(t){de(this._surveyManager)?ke.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload()}}var $t=Fe("[Conversations]");class yO{constructor(t){this.Mi=void 0,this._conversationsManager=null,this.Ai=!1,this.Di=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var n=t.conversations;de(n)||(Tn(n)?this.Mi=n:(this.Mi=n.enabled,this.Di=n),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Mi=void 0,this.Di=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ai||this._instance.config.disable_conversations||Yp(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=Q==null?void 0:Q.__PosthogExtensions__;if(t&&!B(this.Mi)&&this.Mi)if(this.Di&&this.Di.token){this.Ai=!0;try{var n=t.initConversations;if(n)return this.ji(n),void(this.Ai=!1);var r=t.loadExternalDependency;if(!r)return void this.Li("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",s=>{s||!t.initConversations?this.Li("Could not load conversations script",s):this.ji(t.initConversations),this.Ai=!1})}catch(s){this.Li("Error initializing conversations",s),this.Ai=!1}}else $t.error("Conversations enabled but missing token in remote config.")}}ji(t){if(this.Di)try{this._conversationsManager=t(this.Di,this._instance),$t.info("Conversations loaded successfully")}catch(n){this.Li("Error completing conversations initialization",n)}else $t.error("Cannot complete initialization: remote config is null")}Li(t,n){$t.error(t,n),this._conversationsManager=null,this.Ai=!1}show(){this._conversationsManager?this._conversationsManager.show():$t.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Mi===!0&&!Gt(this._conversationsManager)}isVisible(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&t!==void 0&&t}sendMessage(t,n,r){var s=this;return dn(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(t,n,r):($t.warn("Conversations not available yet."),null)})()}getMessages(t,n){var r=this;return dn(function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,n):($t.warn("Conversations not available yet."),null)})()}markAsRead(t){var n=this;return dn(function*(){return n._conversationsManager?n._conversationsManager.markAsRead(t):($t.warn("Conversations not available yet."),null)})()}getTickets(t){var n=this;return dn(function*(){return n._conversationsManager?n._conversationsManager.getTickets(t):($t.warn("Conversations not available yet."),null)})()}requestRestoreLink(t){var n=this;return dn(function*(){return n._conversationsManager?n._conversationsManager.requestRestoreLink(t):($t.warn("Conversations not available yet."),null)})()}restoreFromToken(t){var n=this;return dn(function*(){return n._conversationsManager?n._conversationsManager.restoreFromToken(t):($t.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var t=this;return dn(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():($t.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&t!==void 0?t:null}}var bO=function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e.BANNER_ACTION_CLICKED="product tour banner action clicked",e}({}),Lf=function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",e.TOUR_TYPE="$product_tour_type",e}({});class wO{constructor(t){var n;this.Ni=!1,this.Ui=!1,this._instance=t,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.Ni=!0)}onRemoteConfig(t){var n,r=(n=t.logs)==null?void 0:n.captureConsoleLogs;!de(r)&&r&&(this.Ni=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ni&&!this.Ui){var t=Fe("[logs]"),n=Q==null?void 0:Q.__PosthogExtensions__;if(n){var r=n.loadExternalDependency;r?r(this._instance,"logs",s=>{var i;s||(i=n.logs)==null||!i.initializeLogs?t.error("Could not load logs script",s):(n.logs.initializeLogs(this._instance),this.Ui=!0)}):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var zf=Fe("[RateLimiter]");class EO{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(s=>{zf.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void zf.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,s;t===void 0&&(t=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:o}=this,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(_l))!==null&&n!==void 0?n:{tokens:i,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>i&&(l.tokens=i);var u=l.tokens<1;return u||t||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(s=this.instance.persistence)==null||s.set_property(_l,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var hs=Fe("[RemoteConfig]");class bg{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=Q._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}zi(t){var n,r;(n=Q.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Hi(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return hs.info("Using preloaded remote config",this.remoteConfig),this.Bi(this.remoteConfig),void this.qi();if(this._instance.At())return void hs.warn("Remote config is disabled. Falling back to local config.");this.zi(t=>{if(!t)return hs.info("No config found after loading remote JS config. Falling back to JSON."),void this.Hi(n=>{this.Bi(n),this.qi()});this.Bi(t),this.qi()})}catch(t){hs.error("Error loading remote config",t)}}stop(){this.Wi&&(clearInterval(this.Wi),this.Wi=void 0)}refresh(){this._instance.At()||(j==null?void 0:j.visibilityState)==="hidden"||this._instance.featureFlags.reloadFeatureFlags()}qi(){var t;if(!this.Wi){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.Wi=setInterval(()=>{this.refresh()},n))}}Bi(t){t||hs.error("Failed to fetch remote config from PostHog."),this._instance.Bi(t??{}),(t==null?void 0:t.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}var Sl=3e3;class SO{constructor(t,n){this.Gi=!0,this.Vi=[],this.Ji=rn((n==null?void 0:n.flush_interval_ms)||Sl,250,5e3,V.createLogger("flush interval"),Sl),this.Ki=t}enqueue(t){this.Vi.push(t),this.Yi||this.Xi()}unload(){this.Qi();var t=this.Vi.length>0?this.Zi():{},n=Object.values(t);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Ki(U({},r,{transport:"sendBeacon"}))})}enable(){this.Gi=!1,this.Xi()}Xi(){var t=this;this.Gi||(this.Yi=setTimeout(()=>{if(this.Qi(),this.Vi.length>0){var n=this.Zi(),r=function(){var i=n[s],o=new Date().getTime();i.data&&_e(i.data)&&Ae(i.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),t.Ki(i)};for(var s in n)r()}},this.Ji))}Qi(){clearTimeout(this.Yi),this.Yi=void 0}Zi(){var t={};return Ae(this.Vi,n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;B(t[i])&&(t[i]=U({},s,{data:[]})),(r=t[i].data)==null||r.push(s.data)}),this.Vi=[],t}}var kO=["retriesPerformedSoFar"];class TO{constructor(t){this.te=!1,this.ie=3e3,this.Vi=[],this._instance=t,this.Vi=[],this.ee=!0,!B(k)&&"onLine"in k.navigator&&(this.ee=k.navigator.onLine,this.re=()=>{this.ee=!0,this.se()},this.ne=()=>{this.ee=!1},He(k,"online",this.re),He(k,"offline",this.ne))}get length(){return this.Vi.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=xp(t,kO);Tr(n)&&(r.url=_o(r.url,{retry_count:n})),this._instance._send_request(U({},r,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(n??0)<10?this.oe(U({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(s)}}))}oe(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(n),s=Date.now()+r;this.Vi.push({retryAt:s,requestOptions:t});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),V.warn(i),this.te||(this.te=!0,this.ae())}ae(){if(this.le&&clearTimeout(this.le),this.Vi.length===0)return this.te=!1,void(this.le=void 0);this.le=setTimeout(()=>{this.ee&&this.Vi.length>0&&this.se(),this.ae()},this.ie)}se(){var t=Date.now(),n=[],r=this.Vi.filter(i=>i.retryAt<t||(n.push(i),!1));if(this.Vi=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:t}of(this.le&&(clearTimeout(this.le),this.le=void 0),this.te=!1,B(k)||(this.re&&(k.removeEventListener("online",this.re),this.re=void 0),this.ne&&(k.removeEventListener("offline",this.ne),this.ne=void 0)),this.Vi))try{this._instance._send_request(U({},t,{transport:"sendBeacon"}))}catch(n){V.error(n)}this.Vi=[]}}class OO{constructor(t){this.ue=()=>{var n,r,s,i;this.he||(this.he={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.he.lastScrollY=Math.ceil(a),this.he.maxScrollY=Math.max(a,(n=this.he.maxScrollY)!==null&&n!==void 0?n:0),this.he.maxScrollHeight=Math.max(l,(r=this.he.maxScrollHeight)!==null&&r!==void 0?r:0),this.he.lastContentY=u,this.he.maxContentY=Math.max(u,(s=this.he.maxContentY)!==null&&s!==void 0?s:0),this.he.maxContentHeight=Math.max(c,(i=this.he.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=t}getContext(){return this.he}resetContext(){var t=this.he;return setTimeout(this.ue,0),t}startMeasuringScrollPosition(){He(k,"scroll",this.ue,{capture:!0}),He(k,"scrollend",this.ue,{capture:!0}),He(k,"resize",this.ue)}scrollElement(){if(!this._instance.config.scroll_root_selector)return k==null?void 0:k.document.documentElement;var t=_e(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=k==null?void 0:k.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return k&&(k.scrollY||k.pageYOffset||k.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return k&&(k.scrollX||k.pageXOffset||k.document.documentElement.scrollLeft)||0}}var xO=e=>_g(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties);class Uf{constructor(t,n,r,s){this.de=i=>{var o=this.ve();if(!o||o.sessionId!==i){var a={sessionId:i,props:this.ce(this._instance)};this.fe.register({[gl]:a})}},this._instance=t,this.pe=n,this.fe=r,this.ce=s||xO,this.pe.onSessionId(this.de)}ve(){return this.fe.props[gl]}getSetOnceProps(){var t,n=(t=this.ve())==null?void 0:t.props;return n?"r"in n?vg(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Ae(uc(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+rl(r)]=n}),t}}var wa=Fe("[SessionId]");class jf{on(t,n){return this._e.on(t,n)}constructor(t,n,r){var s;if(this.ge=[],this.me=void 0,this._e=new hc,this.be=(c,f)=>!(!Tr(c)||!Tr(f))&&Math.abs(c-f)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=t.config,this.fe=t.persistence,this.ye=void 0,this.we=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.xe=n||Vn,this.$e=r||Vn;var i=this.N.persistence_name||this.N.token,o=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*rn(o,60,36e3,wa.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ee(),this.Se="ph_"+i+"_window_id",this.ke="ph_"+i+"_primary_window_exists",this.Pe()){var a=rt.D(this.Se),l=rt.D(this.ke);a&&!l?this.ye=a:rt.L(this.Se),rt.j(this.ke,!0)}if((s=this.N.bootstrap)!=null&&s.sessionID)try{var u=(c=>{var f=c.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.N.bootstrap.sessionID);this.Te(this.N.bootstrap.sessionID,new Date().getTime(),u)}catch(c){wa.error("Invalid sessionID in bootstrap",c)}this.Ce()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return B(this.ge)&&(this.ge=[]),this.ge.push(t),this.we&&t(this.we,this.ye),()=>{this.ge=this.ge.filter(n=>n!==t)}}Pe(){return this.N.persistence!=="memory"&&!this.fe.zt&&rt.O()}Ie(t){t!==this.ye&&(this.ye=t,this.Pe()&&rt.j(this.Se,t))}Re(){return this.ye?this.ye:this.Pe()?rt.D(this.Se):null}Te(t,n,r){t===this.we&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.we=t,this.fe.register({[io]:[n,t,r]}))}Fe(){var t=this.fe.props[io];return _e(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Te(null,null,null)}destroy(){clearTimeout(this.Oe),this.Oe=void 0,this.me&&k&&(k.removeEventListener("beforeunload",this.me,{capture:!1}),this.me=void 0),this.ge=[]}Ce(){this.me=()=>{this.Pe()&&rt.L(this.ke)},He(k,"beforeunload",this.me,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[s,i,o]=this.Fe(),a=this.Re(),l=Tr(o)&&Math.abs(r-o)>864e5,u=!1,c=!i,f=!c&&!t&&this.be(r,s);c||f||l?(i=this.xe(),a=this.$e(),wa.info("new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}}),o=r,u=!0):a||(a=this.$e(),u=!0);var d=Tr(s)&&t&&!l?s:r,h=Tr(o)?o:new Date().getTime();return this.Ie(a),this.Te(i,d,h),t||this.Ee(),u&&this.ge.forEach(p=>p(i,a,u?{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}:void 0)),{sessionId:i,windowId:a,sessionStartTimestamp:h,changeReason:u?{noSessionId:c,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}Ee(){clearTimeout(this.Oe),this.Oe=setTimeout(()=>{var[t]=this.Fe();if(this.be(new Date().getTime(),t)){var n=this.we;this.resetSessionId(),this._e.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var wg=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&of(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>of(s==null?void 0:s.brand,t)))return!0}catch{}return!!e.webdriver},ks=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),Bf="i.posthog.com";class AO{constructor(t){this.Me={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"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,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+Bf,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Me[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=ks.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=ks.EU:this.Me[this.apiHost]=ks.CUSTOM),this.Me[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===ks.CUSTOM)return this.apiHost+n;var r=Bf+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var CO={icontains:(e,t)=>!!k&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!k&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!k&&vo(t.href,e),not_regex:(e,t)=>!!k&&!vo(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class ct{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(s=>{ct.Ae("retrieved web experiments from the server"),n.De=new Map,s.forEach(i=>{if(i.feature_flag_key){var o;n.De&&(ct.Ae("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.De)==null||o.set(i.feature_flag_key,i));var a=n._instance.getFeatureFlag(i.feature_flag_key);Ge(a)&&i.variants[a]&&n.je(i.name,a,i.variants[a].transforms)}else if(i.variants)for(var l in i.variants){var u=i.variants[l];ct.Le(u)&&n.je(i.name,l,u.transforms)}})},r)},this._instance=t,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(t){if(this._is_bot())ct.Ae("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(de(this.De))return this.De=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ct.Ae("applying feature flags",t),t.forEach(n=>{var r;if(this.De&&(r=this.De)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),o=(s=this.De)==null?void 0:s.get(n);i&&o!=null&&o.variants[i]&&this.je(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){var t=ct.getWindowLocation();if(t!=null&&t.search){var n=ho(t==null?void 0:t.search,"__experiment_id"),r=ho(t==null?void 0:t.search,"__experiment_variant");n&&r&&(ct.Ae("previewing web experiments "+n+" && "+r),this.getWebExperiments(s=>{this.Ne(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return t([]);var o=i.json.experiments||[];return t(o)}})}Ne(t,n,r){var s=r.filter(i=>i.id===t);s&&s.length>0&&(ct.Ae("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.je(s[0].name,n,s[0].variants[n].transforms))}static Le(t){return!de(t.conditions)&&ct.Ue(t)&&ct.ze(t)}static Ue(t){var n;if(de(t.conditions)||de((n=t.conditions)==null?void 0:n.url))return!0;var r,s,i,o=ct.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||CO[(s=(i=t.conditions)==null?void 0:i.urlMatchType)!==null&&s!==void 0?s:"icontains"](t.conditions.url,o))}static getWindowLocation(){return k==null?void 0:k.location}static ze(t){var n;if(de(t.conditions)||de((n=t.conditions)==null?void 0:n.utm))return!0;var r=dg();if(r.utm_source){var s,i,o,a,l,u,c,f,d=(s=t.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=t.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,h=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,p=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=t.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,g=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_term||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return d&&p&&g&&h}return!1}static Ae(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];V.info("[WebExperiments] "+t,r)}je(t,n,r){this._is_bot()?ct.Ae("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(s=>{if(s.selector){var i;ct.Ae("applying transform of variant "+n+" for experiment "+t+" ",s);var o=(i=document)==null?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):ct.Ae("Control variants leave the page unmodified.")}_is_bot(){return Ct&&this._instance?wg(Ct,this._instance.config.custom_blocked_useragents):void 0}}var RO=Fe("[PostHog ExternalIntegrations]"),IO={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class PO{constructor(t){this._instance=t}V(t,n){var r;(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,s=>{if(s)return RO.error("failed to load script",s);n()})}startIfEnabledOrStop(){var t=this,n=function(o){var a,l,u;!s||(a=Q.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||t.V(IO[o],()=>{var c;(c=Q.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.start(t._instance)}),!s&&(l=Q.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((u=Q.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.stop())};for(var[r,s]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(r)}}}var Ls={},Ea=0,kl=()=>{},Or="posthog",Eg=!KT&&(St==null?void 0:St.indexOf("MSIE"))===-1&&(St==null?void 0:St.indexOf("Mozilla"))===-1,Vf=e=>{var t;return U({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:kT(j==null?void 0:j.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:kl,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:st&&Ge(st==null?void 0:st.search)&&st.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(k==null||(t=k.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;V.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Sl},error_tracking:{},_onCapture:kl,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Zf=e=>{var t={};B(e.process_person)||(t.person_profiles=e.process_person),B(e.xhr_headers)||(t.request_headers=e.xhr_headers),B(e.cookie_name)||(t.persistence_name=e.cookie_name),B(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),B(e.store_google)||(t.save_campaign_params=e.store_google),B(e.verbose)||(t.debug=e.verbose);var n=je({},t,e);return _e(e.property_blacklist)&&(B(e.property_denylist)?n.property_denylist=e.property_blacklist:_e(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:V.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class NO{constructor(){this.__forceAllowLocalhost=!1}get He(){return this.__forceAllowLocalhost}set He(t){V.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class En{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){this.webPerformance=new NO,this.Be=!1,this.version=fn.LIB_VERSION,this.Ft=new hc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Vf(),this.SentryIntegration=FT,this.sentryIntegration=t=>function(n,r){var s=sg(n,r);return{name:rg,processEvent:i=>s(i)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.qe=!1,this.We=null,this.Ge=null,this.Ve=null,this.featureFlags=new uO(this),this.toolbar=new UT(this),this.scrollManager=new OO(this),this.pageViewManager=new Of(this),this.surveys=new mO(this),this.conversations=new yO(this),this.logs=new wO(this),this.experiments=new ct(this),this.exceptions=new JT(this),this.rateLimiter=new EO(this),this.requestRouter=new AO(this),this.consent=new NT(this),this.externalIntegrations=new PO(this),this.people={set:(t,n,r)=>{var s=Ge(t)?{[t]:n}:t;this.setPersonProperties(s),r==null||r({})},set_once:(t,n,r)=>{var s=Ge(t)?{[t]:n}:t;this.setPersonProperties(void 0,s),r==null||r({})}},this.on("eventCaptured",t=>V.info('send "'+(t==null?void 0:t.event)+'"',t))}init(t,n,r){if(r&&r!==Or){var s,i=(s=Ls[r])!==null&&s!==void 0?s:new En;return i._init(t,n,r),Ls[r]=i,Ls[Or][r]=i,i}return this._init(t,n,r)}_init(t,n,r){var s;if(n===void 0&&(n={}),B(t)||sl(t))return V.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Je(n.debug),this.Ke=n,this.Ye=[],n.person_profiles?this.Ge=n.person_profiles:n.process_person&&(this.Ge=n.process_person),this.set_config(je({},Vf(n.defaults),Zf(n),{name:r,token:t})),this.config.on_xhr_error&&V.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:yn.GZipJS;var i=this.Xe();this.persistence=new ma(this.config,i),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ma(U({},this.config,{persistence:"sessionStorage"}),i);var o=U({},this.persistence.props),a=U({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Qe=new SO(b=>this.Ze(b),this.config.request_queue_config),this.tr=new TO(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new jf(this),this.sessionPropsManager=new Uf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(V.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.ir(l)},0)):(V.info("Initializing extensions synchronously"),this.ir(l)),fn.DEBUG=fn.DEBUG||this.config.debug,fn.DEBUG&&V.info("Starting in debug mode",{this:this,config:n,thisC:U({},this.config),p:o,s:a}),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var u,c,f=this.config.get_device_id(Vn()),d=(u=n.bootstrap)!=null&&u.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(en,(c=n.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:d})}if(this.er()){var h,p,g=Object.keys(((h=n.bootstrap)==null?void 0:h.featureFlags)||{}).filter(b=>{var S;return!((S=n.bootstrap)==null||(S=S.featureFlags)==null||!S[b])}).reduce((b,S)=>{var E;return b[S]=((E=n.bootstrap)==null||(E=E.featureFlags)==null?void 0:E[S])||!1,b},{}),y=Object.keys(((p=n.bootstrap)==null?void 0:p.featureFlagPayloads)||{}).filter(b=>g[b]).reduce((b,S)=>{var E,m;return(E=n.bootstrap)!=null&&(E=E.featureFlagPayloads)!=null&&E[S]&&(b[S]=(m=n.bootstrap)==null||(m=m.featureFlagPayloads)==null?void 0:m[S]),b},{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:y})}if(l)this.register_once({distinct_id:os,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id(Vn());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(en,"anonymous")}return He(k,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?MT(this,()=>this.rr()):this.rr(),bn(this.config._onCapture)&&this.config._onCapture!==kl&&(V.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",b=>this.config._onCapture(b.event,b))),this.config.ip&&V.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}ir(t){var n=performance.now(),r=U({},En.__defaultExtensionClasses,this.config.__extensionClasses);r.historyAutocapture&&(this.historyAutocapture=new r.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var s=[];r.tracingHeaders&&s.push(()=>{new r.tracingHeaders(this).startIfEnabledOrStop()}),r.siteApps&&s.push(()=>{var i;this.siteApps=new r.siteApps(this),(i=this.siteApps)==null||i.init()}),!t&&r.sessionRecording&&s.push(()=>{this.sessionRecording=new r.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&s.push(()=>{this.autocapture=new r.autocapture(this),this.autocapture.startIfEnabled()}),s.push(()=>{this.surveys.loadIfEnabled()}),s.push(()=>{this.logs.loadIfEnabled()}),s.push(()=>{this.conversations.loadIfEnabled()}),r.productTours&&s.push(()=>{this.productTours=new r.productTours(this),this.productTours.loadIfEnabled()}),r.heatmaps&&s.push(()=>{this.heatmaps=new r.heatmaps(this),this.heatmaps.startIfEnabled()}),r.webVitalsAutocapture&&s.push(()=>{this.webVitalsAutocapture=new r.webVitalsAutocapture(this)}),r.exceptionObserver&&s.push(()=>{this.exceptionObserver=new r.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()}),r.deadClicksAutocapture&&s.push(()=>{this.deadClicksAutocapture=new r.deadClicksAutocapture(this,DT),this.deadClicksAutocapture.startIfEnabledOrStop()}),s.push(()=>{if(this.sr){var i=this.sr;this.sr=void 0,this.Bi(i)}}),this.nr(s,n)}nr(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout(()=>{this.nr(t,n)},0);var r=t.shift();if(r)try{r()}catch(i){V.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&V.info("PostHog extensions initialized ("+s+"ms)")}Bi(t){var n,r,s,i,o,a,l,u,c;if(!j||!j.body)return V.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Bi(t)},500);this.config.__preview_deferred_init_extensions&&(this.sr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=ue(t.supportedCompression,yn.GZipJS)?yn.GZipJS:ue(t.supportedCompression,yn.Base64)?yn.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ge?this.Ge:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(t),(s=this.sessionRecording)==null||s.onRemoteConfig(t),(i=this.autocapture)==null||i.onRemoteConfig(t),(o=this.heatmaps)==null||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),(a=this.productTours)==null||a.onRemoteConfig(t),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(t),(u=this.exceptionObserver)==null||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(t)}rr(){try{this.config.loaded(this)}catch(r){V.critical("`loaded` function failed",r)}if(this.ar(),this.config.internal_or_test_user_hostname&&st!=null&&st.hostname){var t=st.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.lr()},1),this.ur=new bg(this),this.ur.load()}ar(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Qe)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Hn(this.__request_queue,t=>this.Ze(t)),this.__request_queue=[],this.ar()}_handle_unload(){var t,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.hr()&&this.capture("$pageleave"),(t=this.Qe)==null||t.unload(),(n=this.tr)==null||n.unload()):this.hr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Eg?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=_o(t.url,{ip:this.config.ip?1:0}),t.headers=U({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,o=U({},n);o.timeout=o.timeout||6e4,o.url=_o(o.url,{_:new Date().getTime().toString(),ver:fn.LIB_VERSION,compression:o.compression});var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=Li.filter(c=>!o.disableTransport||!c.transport||!o.disableTransport.includes(c.transport)),u=(s=(i=Jp(l,c=>c.transport===a))==null?void 0:i.method)!==null&&s!==void 0?s:l[0].method;if(!u)throw new Error("No available transport method");u(o)})(U({},t,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(s=this.config).on_request_error)==null||r.call(s,n)),t.callback==null||t.callback(n)}}))))}Ze(t){this.tr?this.tr.retriableRequest(t):this._send_request(t)}_execute_array(t){Ea++;try{var n,r=[],s=[],i=[];Hn(t,a=>{a&&(n=a[0],_e(n)?i.push(a):bn(a)?a.call(this):_e(a)&&n==="alias"?r.push(a):_e(a)&&n.indexOf("capture")!==-1&&bn(this[n])?i.push(a):s.push(a))});var o=function(a,l){Hn(a,function(u){if(_e(u[0])){var c=l;Ae(u,function(f){c=c[f[0]].apply(c,f.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};o(r,this),o(s,this),o(i,this)}finally{Ea--}}er(){var t,n;return((t=this.config.bootstrap)==null?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(t){if(Ea>0&&_e(t)&&Ge(t[0])){var n=En.prototype[t[0]];bn(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Qe){if(this.is_capturing())if(!B(t)&&Ge(t)){var i=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(i&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!Ge(n==null?void 0:n.$current_url)&&(V.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.ft||V.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 a=new Date,l=(r==null?void 0:r.timestamp)||a,u=Vn(),c={uuid:u,event:t,properties:this.calculateEventProperties(t,n||{},l,u)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&i&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(c.$set=r==null?void 0:r.$set);var f,d=t!=="$groupidentify",h=this.dr(r==null?void 0:r.$set_once,d);if(h&&(c.$set_once=h),(c=ET(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,B(r==null?void 0:r.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),t===Ss.DISMISSED||t===Ss.SENT){var p=n==null?void 0:n[ba.SURVEY_ID],g=n==null?void 0:n[ba.SURVEY_ITERATION];f={id:p,current_iteration:g},localStorage.getItem(Ff(f))||localStorage.setItem(Ff(f),"true"),c.$set=U({},c.$set,{[dO({id:p,current_iteration:g},t===Ss.SENT?"responded":"dismissed")]:!0})}else t===Ss.SHOWN&&(c.$set=U({},c.$set,{[ba.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===bO.SHOWN){var y=n==null?void 0:n[Lf.TOUR_TYPE];y&&(c.$set=U({},c.$set,{[Lf.TOUR_LAST_SEEN_DATE+"/"+y]:new Date().toISOString()}))}var T=U({},c.properties.$set,c.$set);if(Ar(T)||this.setPersonPropertiesForFlags(T),!de(this.config.before_send)){var b=this.vr(c);if(!b)return;c=b}this.Ft.emit("eventCaptured",c);var S={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ze(S):this.Qe.enqueue(S),c}V.critical("This capture call is ignored due to client rate limiting.")}}else V.error("No event name provided to posthog.capture")}else V.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}calculateEventProperties(t,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=i?void 0:this.persistence.remove_event_timer(t),a=U({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),t==="$snapshot"){var l=U({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Ge(a.distinct_id)&&!Cn(a.distinct_id)||sl(a.distinct_id))&&V.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=eO(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime());a.$session_id=f,a.$window_id=d}this.sessionPropsManager&&je(a,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&je(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(h=this.tr)==null?void 0:h.length}catch(T){a.$sdk_debug_error_capturing_properties=String(T)}if(this.requestRouter.region===ks.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||i?t!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=je(a,u),t==="$pageview"&&j&&(a.title=j.title),!B(o)){var p=r.getTime()-o;a.$duration=parseFloat((p/1e3).toFixed(3))}St&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=je({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),_e(this.config.property_denylist)?Ae(this.config.property_denylist,function(T){delete a[T]}):V.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(V.error("sanitize_properties is deprecated. Use before_send instead"),a=g(a,t));var y=this.cr();return a.$process_person_profile=y,y&&!i&&this.pr("_calculate_event_properties"),a}dr(t,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.cr()||this.Be)return t;var s=this.persistence.get_initial_props(),i=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=je({},s,i||{},t||{}),a=this.config.sanitize_properties;return a&&(V.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),n&&(this.Be=!0),Ar(o)?void 0:o}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var s;(s=this.persistence)==null||s.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}_r(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){return this.featureFlags.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){return this.featureFlags.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,n,r){var s=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},i=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},o=U({},s,t),a=U({},i,n),l={};for(var[u,c]of Object.entries(o)){var f=typeof c=="string";l[u]={key:u,enabled:!!f||!!c,variant:f?c:void 0,reason:void 0,metadata:B(a==null?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(t,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Ft.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}displaySurvey(t,n){n===void 0&&(n=pO),this.surveys.displaySurvey(t,n)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(t,n)}identify(t,n,r){if(!this.__loaded||!this.persistence)return V.uninitializedWarning("posthog.identify");if(Cn(t)&&(t=t.toString(),V.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))V.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.');else if(t!==os){if(this.pr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var i=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}t!==s&&t!==this.get_property(ms)&&(this.unregister(ms),this.register({distinct_id:t}));var o=(this.persistence.get_property(en)||"anonymous")==="anonymous";t!==s&&o?(this.persistence.set_property(en,"identified"),this.setPersonPropertiesForFlags(U({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Ve=Pf(t,n,r),this.featureFlags.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),t!==s&&(this.reloadFeatureFlags(),this.unregister(oo))}}else V.critical('The string "'+os+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else V.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.pr("posthog.setPersonProperties")){var r=Pf(this.get_distinct_id(),t,n);this.Ve!==r?(this.setPersonPropertiesForFlags(U({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Ve=r):V.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var s=this.getGroups();s[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:U({},s,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),s[t]===n||r||this.reloadFeatureFlags()}else V.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0),this.pr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,s,i,o;if(V.info("reset"),!this.__loaded)return V.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),(s=this.ur)==null||s.stop(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(en,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ve=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:os,$device_id:null},"");else{var l=this.config.get_device_id(Vn());this.register_once({distinct_id:l,$device_id:t?l:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var i,o=(i=t.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return s}alias(t,n){return t===this.get_property(Xp)?(V.critical("Attempting to create alias for existing People user - aborting."),-2):this.pr("posthog.alias")?(B(n)&&(n=this.get_distinct_id()),t!==n?(this._r(ms,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(V.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=U({},this.config);if(Xe(t)){var r,s,i,o,a,l,u,c;je(this.config,Zf(t));var f=this.Xe();(r=this.persistence)==null||r.update_config(this.config,n,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ma(U({},this.config,{persistence:"sessionStorage"}),f);var d=this.Je(this.config.debug);Tn(d)&&(this.config.debug=d),Tn(this.config.debug)&&(this.config.debug?(fn.DEBUG=!0,$e.O()&&$e.j("ph_debug","true"),V.info("set_config",{config:t,oldConfig:n,newConfig:U({},this.config)})):(fn.DEBUG=!1,$e.O()&&$e.L("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.gr(),(c=this.externalIntegrations)==null||c.startIfEnabledOrStop()}}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var s,i,o,a,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(U({},s,n))}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Or;return n!==Or&&(n=Or+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(en))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(en))==="identified"}cr(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ar(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[ms])&&((n=this.persistence)==null||(n=n.props)==null||!n[co]))}hr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.cr()||this.pr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.pr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}pr(t){return this.config.person_profiles==="never"?(V.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._r(co,!0),!0)}Xe(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!n}gr(){var t,n,r,s,i=this.Xe();return((t=this.persistence)==null?void 0:t.zt)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.zt)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(t){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,s,i,o,a;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new jf(this),this.pageViewManager=new Of(this),this.persistence&&(this.sessionPropsManager=new Uf(this,this.sessionManager,this.persistence));var l=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(a=En.__defaultExtensionClasses)==null?void 0:a.sessionRecording;l&&(this.sessionRecording=new l(this),this.sessionRecording.startIfEnabledOrStop())}var u;this.consent.optInOut(!0),this.gr(),this.ar(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(B(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((u=t==null?void 0:t.captureEventName)!==null&&u!==void 0?u:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.lr()}else V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.gr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:os,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.lr())):V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===hn.GRANTED?"granted":t===hn.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.gr()}_is_bot(){return Ct?wg(Ct,this.config.custom_blocked_useragents):void 0}lr(){j&&(j.visibilityState==="visible"?this.qe||(this.qe=!0,this.capture("$pageview",{title:j.title},{send_instantly:!0}),this.We&&(j.removeEventListener("visibilitychange",this.We),this.We=null)):this.We||(this.We=this.lr.bind(this),He(j,"visibilitychange",this.We)))}debug(t){t===!1?(k==null||k.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(k==null||k.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}))}At(){var t,n,r,s,i,o,a,l=this.Ke||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(V.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):(r="advanced_disable_decide",s=!1,i=V,o=(n="advanced_disable_flags")in(t=l)&&!de(t[n]),a=r in t&&!de(t[r]),o?t[n]:a?(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):s)}vr(t){if(de(this.config.before_send))return t;var n=_e(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var s of n){if(r=s(r),de(r)){var i="Event '"+t.event+"' was rejected in beforeSend function";return zk(t.event)?V.warn(i+". This can cause unexpected behavior."):V.info(i),null}r.properties&&!Ar(r.properties)||V.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.it)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Je(t){var n=Tn(t)&&!t,r=$e.O()&&$e.A("ph_debug")==="true";return!n&&(!!r||t)}}En.__defaultExtensionClasses={},function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=wT(e.prototype[t[n]])}(En,["identify"]);function Hf(e){return e instanceof Element&&(e.id===tg||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function Vo(e){return!!e&&e.nodeType===1}function Gn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Sg(e){return!!e&&e.nodeType===3}function kg(e){return!!e&&e.nodeType===11}function pc(e){return e?jo(e).split(/\s+/):[]}function Gf(e){var t=k==null?void 0:k.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function mo(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return pc(t)}function Tg(e){return de(e)?null:jo(e).split(/(\s+)/).filter(t=>ti(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ui(e){var t="";return Tl(e)&&!Cg(e)&&e.childNodes&&e.childNodes.length&&Ae(e.childNodes,function(n){var r;Sg(n)&&n.textContent&&(t+=(r=Tg(n.textContent))!==null&&r!==void 0?r:"")}),jo(t)}function Wf(e){return B(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var gc=["a","button","form","input","select","textarea","label"];function Og(e,t){if(B(t))return!0;var n,r=function(i){if(t.some(o=>i.matches(o)))return{v:!0}};for(var s of e)if(n=r(s))return n.v;return!1}function xg(e){var t=e.parentNode;return!(!t||!Vo(t))&&t}var $O=["next","previous","prev",">","<"],qf=10,Kf=[".ph-no-rageclick",".ph-no-capture"];function DO(e,t){if(!k||_c(e))return!1;var n,r,s;if(Tn(t)?(n=!!t&&Kf,r=void 0):(n=(s=t==null?void 0:t.css_selector_ignorelist)!==null&&s!==void 0?s:Kf,r=t==null?void 0:t.content_ignorelist),n===!1)return!1;var{targetElementList:i}=Ag(e,!1);return!function(o,a){if(o===!1||B(o))return!1;var l;if(o===!0)l=$O;else{if(!_e(o))return!1;if(o.length>qf)return V.error("[PostHog] content_ignorelist array cannot exceed "+qf+" items. Use css_selector_ignorelist for more complex matching."),!1;l=o.map(u=>u.toLowerCase())}return a.some(u=>{var{safeText:c,ariaLabel:f}=u;return l.some(d=>c.includes(d)||f.includes(d))})}(r,i.map(o=>{var a;return{safeText:ui(o).toLowerCase(),ariaLabel:((a=o.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}}))&&!Og(i,n)}var _c=e=>!e||Gn(e,"html")||!Vo(e),Ag=(e,t)=>{if(!k||_c(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],s=e;s.parentNode&&!Gn(s,"body");)if(kg(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=xg(s);if(!i)break;if(t||gc.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var o=k.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function MO(e,t,n,r,s){var i,o,a,l;if(n===void 0&&(n=void 0),!k||_c(e)||(i=n)!=null&&i.url_allowlist&&!Gf(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&Gf(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some(p=>t.type===p))return!1}var{parentIsUsefulElement:c,targetElementList:f}=Ag(e,r);if(!function(p,g){var y=g==null?void 0:g.element_allowlist;if(B(y))return!0;var T,b=function(E){if(y.some(m=>E.tagName.toLowerCase()===m))return{v:!0}};for(var S of p)if(T=b(S))return T.v;return!1}(f,n)||!Og(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var d=k.getComputedStyle(e);if(d&&d.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return c?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(gc.indexOf(h)>-1||e.getAttribute("contenteditable")==="true")}}function Tl(e){for(var t=e;t.parentNode&&!Gn(t,"body");t=t.parentNode){var n=mo(t);if(ue(n,"ph-sensitive")||ue(n,"ph-no-capture"))return!1}if(ue(mo(e),"ph-include"))return!0;var r=e.type||"";if(Ge(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(Ge(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Cg(e){return!!(Gn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Gn(e,"select")||Gn(e,"textarea")||e.getAttribute("contenteditable")==="true")}var Rg="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",FO=new RegExp("^(?:"+Rg+")$"),LO=new RegExp(Rg),Ig="\\d{3}-?\\d{2}-?\\d{4}",zO=new RegExp("^("+Ig+")$"),UO=new RegExp("("+Ig+")");function ti(e,t){return t===void 0&&(t=!0),!(de(e)||Ge(e)&&(e=jo(e),(t?FO:LO).test((e||"").replace(/[- ]/g,""))||(t?zO:UO).test(e)))}function Pg(e){var t=ui(e);return ti(t=(t+" "+Ng(e)).trim())?t:""}function Ng(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Ae(e.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=ui(n);t=(t+" "+s).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+Ng(n)).trim())}catch(i){V.error("[AutoCapture]",i)}}),t}function jO(e){return function(t){var n=t.map(r=>{var s,i,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))o+="."+a.replace(/"/g,"");var l=U({},r.text?{text:r.text}:{},{"nth-child":(s=r.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(i=r.nth_of_type)!==null&&i!==void 0?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return Fi(l).sort((c,f)=>{var[d]=c,[h]=f;return d.localeCompare(h)}).forEach(c=>{var[f,d]=c;return u[Jf(f.toString())]=Jf(d.toString())}),o+=":",o+=Fi(u).map(c=>{var[f,d]=c;return f+'="'+d+'"'}).join("")});return n.join(";")}(function(t){return t.map(n=>{var r,s,i={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(s=n.attr__href)==null?void 0:s.slice(0,2048),attr_class:BO(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Fi(n).filter(o=>{var[a]=o;return a.indexOf("attr__")===0}).forEach(o=>{var[a,l]=o;return i.attributes[a]=l}),i})}(e))}function Jf(e){return e.replace(/"|\\"/g,'\\"')}function BO(e){var t=e.attr__class;return t?_e(t)?t:pc(t):void 0}class Yf{constructor(t){this.disabled=t===!1;var n=Xe(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(t-s.x)+Math.abs(n-s.y)<this.thresholdPx&&r-s.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var Sa="$copy_autocapture",Xf=Fe("[AutoCapture]");function ka(e,t){return t.length>e?t.slice(0,e)+"...":t}function VO(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Vo(t));return t}function ZO(e,t,n,r){var s=e.tagName.toLowerCase(),i={tag_name:s};gc.indexOf(s)>-1&&!n&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?i.$el_text=ka(1024,Pg(e)):i.$el_text=ka(1024,ui(e)));var o=mo(e);o.length>0&&(i.classes=o.filter(function(c){return c!==""})),Ae(e.attributes,function(c){var f;if((!Cg(e)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!t&&ti(c.value)&&(f=c.name,!Ge(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var d=c.value;c.name==="class"&&(d=pc(d).join(" ")),i["attr__"+c.name]=ka(1024,d)}});for(var a=1,l=1,u=e;u=VO(u);)a++,u.tagName===e.tagName&&l++;return i.nth_child=a,i.nth_of_type=l,i}function HO(e,t){for(var n,r,{e:s,maskAllElementAttributes:i,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],c=e;c.parentNode&&!Gn(c,"body");)kg(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var f,d=[],h={},p=!1,g=!1;if(Ae(u,E=>{var m=Tl(E);E.tagName.toLowerCase()==="a"&&(p=E.getAttribute("href"),p=m&&p&&ti(p)&&p),ue(mo(E),"ph-no-capture")&&(g=!0),d.push(ZO(E,i,o,a));var N=function(M){if(!Tl(M))return{};var R={};return Ae(M.attributes,function(I){if(I.name&&I.name.indexOf("data-ph-capture-attribute")===0){var F=I.name.replace("data-ph-capture-attribute-",""),J=I.value;F&&J&&ti(J)&&(R[F]=J)}}),R}(E);je(h,N)}),g)return{props:{},explicitNoCapture:g};if(o||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?d[0].$el_text=Pg(e):d[0].$el_text=ui(e)),p){var y,T;d[0].attr__href=p;var b=(y=fo(p))==null?void 0:y.host,S=k==null||(T=k.location)==null?void 0:T.host;b&&S&&b!==S&&(f=p)}return{props:je({$event_type:s.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:jO(d)},(n=d[0])!=null&&n.$el_text?{$el_text:(r=d[0])==null?void 0:r.$el_text}:{},f&&s.type==="click"?{$external_click_url:f}:{},h)}}var ps=Fe("[ExceptionAutocapture]");function Qf(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],s=n(r);return bn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}var GO=Fe("[TracingHeaders]"),Nn=Fe("[Web Vitals]"),ed=9e5;Fe("[SessionRecording]");var Ol="[SessionRecording]",wr=Fe(Ol),WO=Fe("[Heatmaps]");function td(e){return Xe(e)&&"clientX"in e&&"clientY"in e&&Cn(e.clientX)&&Cn(e.clientY)}var nd=Fe("[Product Tours]"),Ta="ph_product_tours",qO=["$set_once","$set"],$n=Fe("[SiteApps]"),KO={sessionRecording:class{get started(){var e;return!((e=this.mr)==null||!e.isStarted)}get status(){return this.mr?this.mr.status:this.br?this.yr?"lazy_loading":"disabled":"pending_config"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.br=!1,this.wr=!1,this.$r=void 0,this._instance=e,!this._instance.sessionManager)throw wr.error("started without valid sessionManager"),new Error(Ol+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Ol+' cannot be used with cookieless_mode="always"')}get yr(){var e,t=!((e=this._instance.get_property(ki))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return k&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(this.br&&(!this.yr||(t=this.mr)==null||!t.isStarted)){var n=!B(Object.assign)&&!B(Array.from);this.yr&&n?(this.Er(e),wr.info("starting")):this.stopRecording()}}Er(e){var t,n,r;this.yr&&(Q!=null&&(t=Q.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=Q.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Sr(e):(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.kr,s=>{if(s)return wr.error("could not load recorder",s);this.Sr(e)}))}stopRecording(){var e,t;(e=this.$r)==null||e.call(this),this.$r=void 0,(t=this.mr)==null||t.stop()}Pr(){var e;(e=this._instance.persistence)==null||e.unregister(eg)}Tr(e){if(this._instance.persistence){var t,n,r=this._instance.persistence,s=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,o=i==null?void 0:i.sampleRate,a=de(o)?null:parseFloat(o);de(a)&&this.Pr();var l=i==null?void 0:i.minimumDurationMilliseconds;r.register({[ki]:U({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:U({capturePerformance:e.capturePerformance},i==null?void 0:i.networkPayloadCapture),canvasRecording:{enabled:i==null?void 0:i.recordCanvas,fps:i==null?void 0:i.canvasFps,quality:i==null?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:B(l)?null:l,endpoint:i==null?void 0:i.endpoint,triggerMatchType:i==null?void 0:i.triggerMatchType,masking:i==null?void 0:i.masking,urlTriggers:i==null?void 0:i.urlTriggers})})};s(),(t=this.$r)==null||t.call(this),this.$r=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.wr=!1,this.Tr(e),this.br=!0,this.startIfEnabledOrStop()):this.br=!0:wr.info("skipping remote config with no sessionRecording",e)}log(e,t){var n;t===void 0&&(t="log"),(n=this.mr)!=null&&n.log?this.mr.log(e,t):wr.warn("log called before recorder was ready")}get kr(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(ki);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Cr(){var e,t=this._instance.get_property(ki);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return Date.now()-n<=3e5}Sr(e){var t,n;if((t=Q.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.mr||(this.mr=(n=Q.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Cr()?this.mr.start(e):this.wr||(this.wr=!0,wr.info("persisted remote config is stale, requesting fresh config before starting"),new bg(this._instance).load())}onRRwebEmit(e){var t;(t=this.mr)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.mr||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.mr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.mr||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.mr)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.mr||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.mr)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.mr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.mr)==null||!n.tryAddCustomEvent(e,t))}}},JO={autocapture:class{constructor(e){this.Ir=!1,this.Rr=null,this.Fr=!1,this.instance=e,this.rageclicks=new Yf(e.config.rageclick),this.Or=null}get N(){var e,t,n=Xe(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map(r=>new RegExp(r)),n}Mr(){if(this.isBrowserSupported()){if(k&&j){var e=n=>{n=n||(k==null?void 0:k.event);try{this.Ar(n)}catch(r){Xf.error("Failed to capture event",r)}};if(He(j,"submit",e,{capture:!0}),He(j,"change",e,{capture:!0}),He(j,"click",e,{capture:!0}),this.N.capture_copied_text){var t=n=>{n=n||(k==null?void 0:k.event),this.Ar(n,Sa)};He(j,"copy",t,{capture:!0}),He(j,"cut",t,{capture:!0})}}}else Xf.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ir&&(this.Mr(),this.Ir=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Fr=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[gf]:!!e.autocapture_opt_out}),this.Rr=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Or=e}getElementSelectors(e){var t,n=[];return(t=this.Or)==null||t.forEach(r=>{var s=j==null?void 0:j.querySelectorAll(r);s==null||s.forEach(i=>{e===i&&n.push(r)})}),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[gf],r=this.Rr;if(Gt(r)&&!Tn(n)&&!this.instance.At())return!1;var s=(t=this.Rr)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!s}Ar(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=Wf(e);Sg(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&DO(r,this.instance.config.rageclick)&&this.Ar(e,"$rageclick");var s=t===Sa;if(r&&MO(r,e,this.N,s,s?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=HO(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Fr});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(i.$element_selectors=a),t===Sa){var l,u=Tg(k==null||(l=k.getSelection())==null?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;i.$selected_content=u,i.$copy_type=c}return this.instance.capture(t,i),!0}}}isBrowserSupported(){return bn(j==null?void 0:j.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Dr=(k==null||(t=k.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(V.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.jr&&this.jr(),this.jr=void 0,V.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(k&&k.history){var n=this;(e=k.history.pushState)!=null&&e.__posthog_wrapped__||Qf(k.history,"pushState",r=>function(s,i,o){r.call(this,s,i,o),n.Lr("pushState")}),(t=k.history.replaceState)!=null&&t.__posthog_wrapped__||Qf(k.history,"replaceState",r=>function(s,i,o){r.call(this,s,i,o),n.Lr("replaceState")}),this.Nr()}}Lr(e){try{var t,n=k==null||(t=k.location)==null?void 0:t.pathname;if(!n)return;n!==this.Dr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.Dr=n}catch(r){V.error("Error capturing "+e+" pageview",r)}}Nr(){if(!this.jr){var e=()=>{this.Lr("popstate")};He(k,"popstate",e),this.jr=()=>{k&&k.removeEventListener("popstate",e)}}}},heatmaps:class{constructor(e){var t;this.Ur=!1,this.Ir=!1,this.zr=null,this.instance=e,this.Ur=!((t=this.instance.persistence)==null||!t.props[ul]),this.rageclicks=new Yf(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Xe(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return de(this.instance.config.capture_heatmaps)?de(this.instance.config.enable_heatmaps)?this.Ur:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Ir)return;WO.info("starting..."),this.Hr(),this.Br()}else{var e;clearInterval((e=this.zr)!==null&&e!==void 0?e:void 0),this.qr(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ul]:t}),this.Ur=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Wr(e){this.Gr(e.originalEvent,"deadclick")}Br(){this.zr&&clearInterval(this.zr),this.zr=function(e){return(e==null?void 0:e.visibilityState)==="visible"}(j)?setInterval(this.se.bind(this),this.flushIntervalMilliseconds):null}Hr(){k&&j&&(this.Vr=this.se.bind(this),He(k,"beforeunload",this.Vr),this.Jr=e=>this.Gr(e||(k==null?void 0:k.event)),He(j,"click",this.Jr,{capture:!0}),this.Kr=e=>this.Yr(e||(k==null?void 0:k.event)),He(j,"mousemove",this.Kr,{capture:!0}),this.Xr=new Sf(this.instance,$T,this.Wr.bind(this)),this.Xr.startIfEnabledOrStop(),this.Qr=this.Br.bind(this),He(j,"visibilitychange",this.Qr),this.Ir=!0)}qr(){var e;k&&j&&(this.Vr&&k.removeEventListener("beforeunload",this.Vr),this.Jr&&j.removeEventListener("click",this.Jr,{capture:!0}),this.Kr&&j.removeEventListener("mousemove",this.Kr,{capture:!0}),this.Qr&&j.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.Zr),(e=this.Xr)==null||e.stop(),this.Ir=!1)}ts(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=function(o,a,l){for(var u=o;u&&Vo(u)&&!Gn(u,"body");){if(u===l)return!1;if(ue(a,k==null?void 0:k.getComputedStyle(u).position))return!0;u=xg(u)}return!1}(Wf(e),["fixed","sticky"],s);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:t}}Gr(e,t){var n;if(t===void 0&&(t="click"),!Hf(e.target)&&td(e)){var r=this.ts(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.es(U({},r,{type:"rageclick"})),this.es(r)}}Yr(e){!Hf(e.target)&&td(e)&&(clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.es(this.ts(e,"mousemove"))},500))}es(e){if(k){var t=k.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,s=n?Wr([],Kr,r||[]):[],i=Qs(t,s,ei);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(e)}}se(){this.R&&!Ar(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Sf,webVitalsAutocapture:class{constructor(e){var t;this.Ur=!1,this.Ir=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rs=()=>{clearTimeout(this.ss),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((n,r)=>U({},n,{["$web_vitals_"+r.name+"_event"]:U({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ns=n=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(B(s))Nn.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.os();B(i)||(de(n==null?void 0:n.name)||de(n==null?void 0:n.value)?Nn.error("Invalid metric received",n):this.ls&&n.value>=this.ls?Nn.error("Ignoring metric with value >= "+this.ls,n):(this.R.url!==i&&(this.rs(),this.ss=setTimeout(this.rs,this.flushToCaptureTimeoutMs)),B(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=B(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.R.metrics.push(U({},n,{$current_url:i,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.rs()))}},this.us=()=>{if(!this.Ir){var n,r,s,i,o=Q.__PosthogExtensions__;B(o)||B(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:s,onINP:i}=o.postHogWebVitalsCallbacks),n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ns.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ns.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.ns.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ns.bind(this)),this.Ir=!0):Nn.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Ur=!((t=this._instance.persistence)==null||!t.props[mf]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Xe(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return de(n)?((t=this._instance.persistence)==null?void 0:t.props[bf])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Xe(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Xe(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get ls(){var e=Xe(this._instance.config.capture_performance)&&Cn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:ed;return 0<e&&e<=6e4?ed:e}get isEnabled(){var e=st==null?void 0:st.protocol;if(e!=="http:"&&e!=="https:")return Nn.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Xe(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Tn(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Tn(t)?t:this.Ur}startIfEnabled(){this.isEnabled&&!this.Ir&&(Nn.info("enabled, starting..."),this.V(this.us))}onRemoteConfig(e){if("capturePerformance"in e){var t=Xe(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Xe(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[mf]:t}),this._instance.persistence.register({[bf]:n})),this.Ur=t,this.startIfEnabled()}}V(e){var t,n;if((t=Q.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,s=>{s?Nn.error("failed to load script",s):e()})}}os(){var e=k?k.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=t?Wr([],Kr,n||[]):[];return Qs(e,r,ei)}Nn.error("Could not determine current URL")}}},YO={exceptionObserver:class{constructor(e){var t,n,r;this.us=()=>{var s;if(k&&this.isEnabled&&(s=Q.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var i=Q.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=Q.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=Q.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.hs&&this.N.capture_unhandled_errors&&(this.hs=i(this.captureException.bind(this))),!this.ds&&this.N.capture_unhandled_rejections&&(this.ds=o(this.captureException.bind(this))),!this.vs&&this.N.capture_console_errors&&(this.vs=a(this.captureException.bind(this)))}catch(l){ps.error("failed to start",l),this.cs()}}},this._instance=e,this.fs=!((t=this._instance.persistence)==null||!t.props[_f]),this.ps=new Bk({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:ps}),this.N=this._s(),this.startIfEnabledOrStop()}_s(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Xe(e)?t=U({},t,e):(B(e)?this.fs:e)&&(t=U({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ps.info("enabled"),this.cs(),this.V(this.us)):this.cs()}V(e){var t,n;(t=Q.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return ps.error("failed to load script",r);e()})}cs(){var e,t,n;(e=this.hs)==null||e.call(this),this.hs=void 0,(t=this.ds)==null||t.call(this),this.ds=void 0,(n=this.vs)==null||n.call(this),this.vs=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.fs=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[_f]:this.fs}),this.N=this._s(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this._s()}captureException(e){var t,n,r=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.ps.consumeRateLimit(r)?ps.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}},XO={productTours:class{constructor(e){this.gs=null,this.bs=null,this._instance=e}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[yf]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.gs||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(yf)||this.V(()=>this.ys())}V(e){var t,n;(t=Q.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?nd.error("Could not load product tours script",r):e()})}ys(){var e;!this.gs&&(e=Q.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.gs=Q.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!_e(this.bs)||t){var n=this._instance.persistence;if(n){var r=n.props[Ta];if(_e(r)&&!t)return this.bs=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var i=s.statusCode;if(i!==200||!s.json){var o="Product Tours API could not be loaded, status: "+i;return nd.error(o),void e([],{isLoaded:!1,error:o})}var a=_e(s.json.product_tours)?s.json.product_tours:[];this.bs=a,n&&n.register({[Ta]:a}),e(a,{isLoaded:!0})}})}else e(this.bs,{isLoaded:!0})}getActiveProductTours(e){de(this.gs)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.gs.getActiveProductTours(e)}showProductTour(e){var t;(t=this.gs)==null||t.showTourById(e)}previewTour(e){this.gs?this.gs.previewTour(e):this.V(()=>{var t;this.ys(),(t=this.gs)==null||t.previewTour(e)})}dismissProductTour(){var e;(e=this.gs)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.gs)==null||e.nextStep()}previousStep(){var e;(e=this.gs)==null||e.previousStep()}clearCache(){var e;this.bs=null,(e=this._instance.persistence)==null||e.unregister(Ta)}resetTour(e){var t;(t=this.gs)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.gs)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.gs)==null||t.cancelPendingTour(e)}}},QO={siteApps:class{constructor(e){this._instance=e,this.ws=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}xs(e,t){if(t){var n=this.globalsForEvent(t);this.ws.push(n),this.ws.length>1e3&&(this.ws=this.ws.slice(10))}}get siteAppLoaders(){var e;return(e=Q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.xs.bind(this));this.$s=()=>{e(),this.ws=[],this.$s=void 0}}}globalsForEvent(e){var t,n,r,s,i,o,a;if(!e)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var[f,d]of Object.entries(c))l[f]={id:u[f],type:f,properties:d};var{$set_once:h,$set:p}=e;return{event:U({},xp(e,qO),{properties:U({},e.properties,p?{$set:U({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},p)}:{},h?{$set_once:U({},(r=(s=e.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},h)}:{}),elements_chain:(i=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(a=e.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.ws.length&&($n.info("Processing "+this.ws.length+" events for site app with id "+e.id),this.ws.forEach(a=>t.processEvent==null?void 0:t.processEvent(a)),t.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.$s)==null||o.call(this))},r=!1,s=o=>{t.errored=!o,t.loaded=!0,$n.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:o=>{s(o)}});i&&(t.processEvent=i),r=!0}catch(o){$n.error("Error while initializing PostHog app with config id "+e.id,o),s(!1)}if(r&&t.loaded)try{n()}catch(o){$n.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Es(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Ss(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){$n.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,s=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Es(),void this._instance.on("eventCaptured",l=>this.Ss(l))):void $n.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.$s)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(l){var u;Q["__$$ph_site_app_"+l]=s._instance,(u=Q.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,a,c=>{if(c)return $n.error("Error while initializing PostHog app with config id "+l,c)})};for(var{id:o,url:a}of e.siteApps)i(o)}else $n.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},ex=U({},KO,JO,YO,XO,QO,{tracingHeaders:class{constructor(e){this.ks=void 0,this.Ps=void 0,this.us=()=>{var t,n;B(this.ks)&&((t=Q.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),B(this.Ps)&&((n=Q.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}V(e){var t,n;(t=Q.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return GO.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.V(this.us):((e=this.ks)==null||e.call(this),(t=this.Ps)==null||t.call(this),this.ks=void 0,this.Ps=void 0)}}});En.__defaultExtensionClasses=U({},ex);var rd,tx=(rd=Ls[Or]=new En,function(){function e(){e.done||(e.done=!0,Eg=!1,Ae(Ls,function(t){t._dom_loaded()}))}j!=null&&j.addEventListener?j.readyState==="complete"?e():He(j,"DOMContentLoaded",e,{capture:!1}):k&&V.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),rd);function sd(e={}){const{disableAnalytics:t=!1}=e,n="phc_oXbpiTqzSdiNdHvnZLw66vz3oho8m84Wbjk3r2w5Hguo",r="https://us.i.posthog.com";if(t){console.log("PostHog: Analytics disabled by user setting");return}tx.init(n,{api_host:r,defaults:"2026-01-30",disable_session_recording:!0,capture_pageleave:!0,autocapture:!0,respect_dnt:!0,persistence:"localStorage"})}async function nx(){try{const t=await fetch("/api/settings/general"),{disableAnalytics:n}=await t.json();sd({disableAnalytics:n})}catch{console.log("PostHog: Failed to fetch general settings, using defaults"),sd()}const e=Em(kS);e.use(Tm()),e.use($k),e.mount("#app")}nx();export{rx as $,Yn as A,px as B,hx as C,dx as D,ur as E,dt as F,Io as G,dm as H,xo as I,ym as J,De as K,Im as L,gx as M,Qd as N,ox as O,Ze as P,pS as Q,Sn as R,ux as S,Uv as T,fx as U,x_ as V,Y as W,Ri as X,I_ as Y,lx as Z,li as _,Pe as a,Pt as a0,cx as a1,Tv as a2,ax as a3,Ul as a4,qn as a5,f_ as a6,ix as a7,Wl as a8,Hs as a9,Em as aa,G as b,Qe as c,Re as d,Vc as e,kv as f,Pc as g,_x as h,Bn as i,vm as j,uE as k,Nr as l,sx as m,It as n,Xr as o,hm as p,fm as q,V_ as r,vx as s,Et as t,Dt as u,cu as v,Bs as w,Ce as x,ri as y,ci as z};
|