@jlongo78/agent-spaces 0.5.3 → 0.5.4
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/.next/standalone/.claude/settings.local.json +16 -0
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +19 -19
- package/.next/standalone/.next/server/app/(desktop)/admin/analytics/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/admin/users/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/analytics/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/network/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/pane/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/terminal/remote/[nodeId]/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(desktop)/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/analytics.html +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.rsc +5 -5
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin/analytics.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/analytics.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/admin/analytics.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/analytics.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/admin/analytics.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/users.html +1 -1
- package/.next/standalone/.next/server/app/admin/users.rsc +5 -5
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin/users.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap/admin.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/users.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/users.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/admin/users.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/users.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/admin/users.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/analytics.html +1 -1
- package/.next/standalone/.next/server/app/analytics.rsc +5 -5
- package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap/analytics.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/analytics.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/analytics.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/analytics.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/analytics.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/analytics.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/analytics/overview/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/bulk/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/chat/route.js +1 -1
- package/.next/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/folders/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/handshake/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/handshake/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/projects/route.js +2 -1
- package/.next/standalone/.next/server/app/api/network/projects/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/search/route.js +2 -1
- package/.next/standalone/.next/server/app/api/network/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js +2 -1
- package/.next/standalone/.next/server/app/api/network/sessions/[id]/messages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js +2 -1
- package/.next/standalone/.next/server/app/api/network/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/sessions/route.js +2 -1
- package/.next/standalone/.next/server/app/api/network/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js +2 -1
- package/.next/standalone/.next/server/app/api/network/workspaces/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/workspaces/route.js +2 -1
- package/.next/standalone/.next/server/app/api/network/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/panes/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/panes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/messages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sync/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tier/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tier/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/[key]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/context/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/[msgId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/messages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/[id]/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/route.js +1 -1
- package/.next/standalone/.next/server/app/api/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login.html +1 -1
- package/.next/standalone/.next/server/app/login.rsc +4 -4
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/projects.html +1 -1
- package/.next/standalone/.next/server/app/m/projects.rsc +5 -5
- package/.next/standalone/.next/server/app/m/projects.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/m/projects.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/projects.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m/projects.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/projects.segments/m/projects/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/projects.segments/m/projects.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/projects.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/sessions.html +1 -1
- package/.next/standalone/.next/server/app/m/sessions.rsc +5 -5
- package/.next/standalone/.next/server/app/m/sessions.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/m/sessions.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/sessions.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m/sessions.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/sessions.segments/m/sessions.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/sessions.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/settings.html +1 -1
- package/.next/standalone/.next/server/app/m/settings.rsc +5 -5
- package/.next/standalone/.next/server/app/m/settings.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/m/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/settings.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m/settings.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/settings.segments/m/settings/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/settings.segments/m/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/settings.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/terminal/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/m/terminal.html +1 -1
- package/.next/standalone/.next/server/app/m/terminal.rsc +5 -5
- package/.next/standalone/.next/server/app/m/terminal.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/m/terminal.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/terminal.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m/terminal.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m/terminal.segments/m/terminal.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m/terminal.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m.html +1 -1
- package/.next/standalone/.next/server/app/m.rsc +5 -5
- package/.next/standalone/.next/server/app/m.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/m.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/m.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/m.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m.segments/m/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/m.segments/m.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/network.html +1 -1
- package/.next/standalone/.next/server/app/network.rsc +5 -5
- package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap/network.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/network.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/network.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/network.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/network.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/network.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/projects.html +1 -1
- package/.next/standalone/.next/server/app/projects.rsc +5 -5
- package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap/projects.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/projects.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/projects.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/projects.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/sessions.html +1 -1
- package/.next/standalone/.next/server/app/sessions.rsc +5 -5
- package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap/sessions.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/sessions.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/sessions.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/sessions.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/sessions.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/sessions.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +5 -5
- package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/terminal.html +1 -1
- package/.next/standalone/.next/server/app/terminal.rsc +5 -5
- package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap/terminal.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/terminal.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/terminal.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/terminal.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/terminal.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/terminal.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.html +1 -1
- package/.next/standalone/.next/server/app/workspaces.rsc +5 -5
- package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap/workspaces.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspaces.segments/!KGRlc2t0b3Ap.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspaces.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/workspaces.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspaces.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/workspaces.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d038fdf._.js +106 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0e4c2d35._.js → [root-of-the-server]__12673e47._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__130dee4b._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__142c2f41._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2861e096._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2d3d8d52._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__45205e47._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__46b7da42._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__8765f2fc._.js → [root-of-the-server]__4cf845f6._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__57b966d5._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5a0020ba._.js +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5bd0f118._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5bf8f2c0._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__69eb20b1._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__74c48d65._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7d6610c4._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__84f3af14._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a38f7af1._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a6eb742d._.js +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b4c83e91._.js +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b7c8a7dd._.js +98 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__cae0486f._.js → [root-of-the-server]__c1d7faa6._.js} +4 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c546cf71._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__a2ee9884._.js → [root-of-the-server]__c977bf2f._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d2f9be33._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d5615808._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d877df12._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e9d6e526._.js +98 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f66ceeb8._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f893957c._.js +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fcd26315._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fd505913._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__feff7b91._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__66aca5d4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1f12caba._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_43e7e611._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(desktop)_network_page_tsx_27f035db._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_telemetry_ts_d7f80cd0._.js +1 -1
- package/.next/standalone/.next/server/edge/chunks/_d73df637._.js +1 -1
- package/.next/standalone/.next/server/middleware-manifest.json +5 -5
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{10c6424526b53431.js → 483bf086feba6531.js} +1 -1
- package/.next/standalone/.next/static/chunks/{f8d7a4a58f712ecd.js → 56ddb2d75f5beb1a.js} +1 -1
- package/.next/standalone/.next/static/chunks/7c4cfb3160fa8dd4.js +5 -0
- package/.next/standalone/.next/static/chunks/{3434c5b2c9958276.js → ae3a695e671c8d31.js} +1 -1
- package/.next/standalone/.next/static/chunks/e972ec0d23b19896.js +5 -0
- package/.next/standalone/.next/static/chunks/ff5fac1bd7b518dd.css +3 -0
- package/.next/standalone/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64.node +0 -0
- package/.next/standalone/node_modules/@img/{sharp-linux-x64 → sharp-win32-x64}/package.json +39 -46
- package/.next/standalone/package.json +89 -89
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/tsconfig.json +34 -34
- package/LICENSE +661 -661
- package/README.md +131 -131
- package/bin/fix-standalone-externals.js +79 -79
- package/bin/lib/auto-setup.js +110 -101
- package/bin/mdns-service.js +171 -171
- package/bin/postinstall.js +35 -35
- package/bin/setup-admin.js +195 -189
- package/bin/spaces-dev.js +208 -208
- package/bin/spaces-install.js +572 -483
- package/bin/spaces-service.js +881 -0
- package/bin/spaces-setup.js +253 -247
- package/bin/spaces.js +500 -466
- package/bin/terminal-server.js +1252 -1117
- package/package.json +89 -89
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__18a58c5f._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__41e589ee._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__464db440._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4ad64489._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__64f5810e._.js +0 -98
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__95b7f18e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a6ce192e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e2b78951._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f84e3cf3._.js +0 -98
- package/.next/standalone/.next/static/chunks/302ce212c690bec4.js +0 -5
- package/.next/standalone/.next/static/chunks/67c7bf5024309fca.css +0 -3
- package/.next/standalone/.next/static/chunks/cb442c50eecb758d.js +0 -5
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -221
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
- package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -42
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -221
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
- package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
- package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
- package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
- package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
- /package/.next/standalone/.next/static/{nbYSIjUtkSwSvTgyR5p00 → 5J530rtIR_FsG4E9MLLpB}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{nbYSIjUtkSwSvTgyR5p00 → 5J530rtIR_FsG4E9MLLpB}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{nbYSIjUtkSwSvTgyR5p00 → 5J530rtIR_FsG4E9MLLpB}/_ssgManifest.js +0 -0
- /package/.next/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-win32-x64}/versions.json +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9593,e=>{"use strict";var t=e.i(47167),i="u">typeof window?window:void 0,r="u">typeof globalThis?globalThis:i;"u"<typeof self&&(r.self=r),"u"<typeof File&&(r.File=function(){});var s=Array.prototype,n=s.forEach,o=s.indexOf,a=null==r?void 0:r.navigator,l=null==r?void 0:r.document,c=null==r?void 0:r.location,u=null==r?void 0:r.fetch,h=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,d=null==r?void 0:r.AbortController,p=null==a?void 0:a.userAgent,_=null!=i?i:{},g={DEBUG:!1,LIB_VERSION:"1.352.0"};function v(e,t,i,r,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(r,s)}function f(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function o(e){v(n,r,s,o,a,"next",e)}function a(e){v(n,r,s,o,a,"throw",e)}o(void 0)})}}function m(){return(m=Object.assign.bind()).apply(null,arguments)}function y(e,t){if(null==e)return{};var i={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var b=["$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"],E=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],w=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return E.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function x(e,t){return -1!==e.indexOf(t)}var k=function(e){return e.trim()},S=function(e){return e.replace(/^\$/,"")},P=Array.isArray,R=Object.prototype,T=R.hasOwnProperty,$=R.toString,I=P||function(e){return"[object Array]"===$.call(e)},O=e=>"function"==typeof e,F=e=>e===Object(e)&&!I(e),C=e=>{if(F(e)){for(var t in e)if(T.call(e,t))return!1;return!0}return!1},M=e=>void 0===e,A=e=>"[object String]"==$.call(e),L=e=>A(e)&&0===e.trim().length,N=e=>null===e,D=e=>M(e)||N(e),U=e=>"[object Number]"==$.call(e)&&e==e,j=e=>U(e)&&e>0,H=e=>"[object Boolean]"===$.call(e),q=e=>x(b,e);function B(e){return null===e||"object"!=typeof e}function V(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function G(e){return!M(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var W=[!0,"true",1,"1","yes"],z=[!1,"false",0,"0","no"];function Y(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),U(e)?e>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):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: "+i+", fallback: "+s),Y(s||i,t,i,r))}class X{constructor(e){this.t={},this.i=e.i,this.o=Y(e.bucketSize,0,100,e.h),this.m=Y(e.refillRate,0,this.o,e.h),this.$=Y(e.refillInterval,0,864e5,e.h)}S(e,t){var i=Math.floor((t-e.lastAccess)/this.$);if(i>0){var r=i*this.m;e.tokens=Math.min(e.tokens+r,this.o),e.lastAccess=e.lastAccess+i*this.$}}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.t[r];return s?this.S(s,i):(s={tokens:this.o,lastAccess:i},this.t[r]=s),0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.i)||t.call(this,e)),0===s.tokens)}stop(){this.t={}}}var K,J,Z,Q="Mobile",ee="Android",et="Tablet",ei=ee+" "+et,er="iPad",es="Apple",en=es+" Watch",eo="Safari",ea="BlackBerry",el="Samsung",ec=el+"Browser",eu=el+" Internet",eh="Chrome",ed=eh+" OS",ep=eh+" iOS",e_="Internet Explorer",eg=e_+" "+Q,ev="Opera",ef=ev+" Mini",em="Edge",ey="Microsoft "+em,eb="Firefox",eE=eb+" iOS",ew="Nintendo",ex="PlayStation",ek="Xbox",eS=ee+" "+Q,eP=Q+" "+eo,eR="Windows",eT=eR+" Phone",e$="Nokia",eI="Ouya",eO="Generic",eF=eO+" "+Q.toLowerCase(),eC=eO+" "+et.toLowerCase(),eM="Konqueror",eA="(\\d+(\\.\\d+)?)",eL=RegExp("Version/"+eA),eN=RegExp(ek,"i"),eD=RegExp(ex+" \\w+","i"),eU=RegExp(ew+" \\w+","i"),ej=RegExp(ea+"|PlayBook|BB10","i"),eH={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},eq=function(e,t){var i;return t=t||"",x(e," OPR/")&&x(e,"Mini")?ef:x(e," OPR/")?ev:ej.test(e)?ea:x(e,"IE"+Q)||x(e,"WPDesktop")?eg:x(e,ec)?eu:x(e,em)||x(e,"Edg/")?ey:x(e,"FBIOS")?"Facebook "+Q:x(e,"UCWEB")||x(e,"UCBrowser")?"UC Browser":x(e,"CriOS")?ep:x(e,"CrMo")||x(e,eh)?eh:x(e,ee)&&x(e,eo)?eS:x(e,"FxiOS")?eE:x(e.toLowerCase(),eM.toLowerCase())?eM:(i=t)&&x(i,es)||x(e,eo)&&!x(e,eh)&&!x(e,ee)?x(e,Q)?eP:eo:x(e,eb)?eb:x(e,"MSIE")||x(e,"Trident/")?e_:x(e,"Gecko")?eb:""},eB={[eg]:[RegExp("rv:"+eA)],[ey]:[RegExp(em+"?\\/"+eA)],[eh]:[RegExp("("+eh+"|CrMo)\\/"+eA)],[ep]:[RegExp("CriOS\\/"+eA)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+eA)],[eo]:[eL],[eP]:[eL],[ev]:[RegExp("(Opera|OPR)\\/"+eA)],[eb]:[RegExp(eb+"\\/"+eA)],[eE]:[RegExp("FxiOS\\/"+eA)],[eM]:[RegExp("Konqueror[:/]?"+eA,"i")],[ea]:[RegExp(ea+" "+eA),eL],[eS]:[RegExp("android\\s"+eA,"i")],[eu]:[RegExp(ec+"\\/"+eA)],[e_]:[RegExp("(rv:|MSIE )"+eA)],Mozilla:[RegExp("rv:"+eA)]},eV=function(e,t){var i=eB[eq(e,t)];if(M(i))return null;for(var r=0;r<i.length;r++){var s=i[r],n=e.match(s);if(n)return parseFloat(n[n.length-2])}return null},eG=[[RegExp(ek+"; "+ek+" (.*?)[);]","i"),e=>[ek,e&&e[1]||""]],[RegExp(ew,"i"),[ew,""]],[RegExp(ex,"i"),[ex,""]],[ej,[ea,""]],[RegExp(eR,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eT,""];if(new RegExp(Q).test(t)&&!/IEMobile\b/.test(t))return[eR+" "+Q,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=eH[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[eR,r]}return[eR,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=M(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ee+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ee+")","i"),e=>e&&e[2]?[ee,[e[2],e[3],e[4]||"0"].join(".")]:[ee,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ed,""]],[/Linux|debian/i,["Linux",""]]],eW=function(e){return eU.test(e)?ew:eD.test(e)?ex:eN.test(e)?ek:RegExp(eI,"i").test(e)?eI:RegExp("("+eT+"|WPDesktop)","i").test(e)?eT:/iPad/.test(e)?er:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?en:ej.test(e)?ea:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(e$,"i").test(e)?e$:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Q).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)?ee:ei:RegExp("(pda|"+Q+")","i").test(e)?eF:RegExp(et,"i").test(e)&&!RegExp(et+" pc","i").test(e)?eC:""},ez=e=>e instanceof Error;class eY{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(t),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return f(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&I(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),m({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return f(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(r=t.handled)||r,synthetic:null!=(s=e.synthetic)&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,m({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return Z&&i.length===J||(J=i.length,Z=i.reduce((i,r)=>{K||(K={});var s=K[r];if(s)i[s[0]]=s[1];else for(var n=e(r),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,c=t[r];if(l&&c){i[l]=c,K[r]=[l,c];break}}return i},{})),Z}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(r<=4){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return m({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}function eX(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return M(r)||(n.lineno=r),M(s)||(n.colno=s),n}var eK=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},eJ=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,eZ=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,eQ=/\((\S*)(?::(\d+))(?::(\d+))\)/,e0=(e,t)=>{var i=eJ.exec(e);if(i){var[,r,s,n]=i;return eX(t,r,"?",+s,+n)}var o=eZ.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=eQ.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,c]=eK(o[1]||"?",o[2]);return eX(t,c,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},e1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,e2=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,e3=(e,t)=>{var i=e1.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=e2.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var s=i[3],n=i[1]||"?";return[n,s]=eK(n,s),eX(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},e5=/\(error: (.*)\)/;class e8{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=A(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return V(e,"DOMException")}isDOMError(e){return V(e,"DOMError")}}class e6{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class e4{match(e){return V(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var e7=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class e9{match(e){return"string"==typeof e}coerce(e,t){var i,[r,s]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(e7);return r&&(t=r[1],i=r[2]),[t,i]}}var te=["fatal","error","warning","log","info","debug"];function tt(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");if(!(s.length>t))return r===i.length||s.length<=t?s:s.slice(0,t)+"..."}return""}class ti{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return G(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tt(e)}isSeverityLevel(e){return A(e)&&!L(e)&&te.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(ez(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tr{match(e){return G(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tt(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class ts{match(e){return B(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tn{match(e){return V(e,"PromiseRejectionEvent")}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return B(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){if(B(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var to=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,s={k:function(t){if(i&&(g.DEBUG||_.POSTHOG_DEBUG||r)&&!M(i.console)&&i.console){for(var s=("__rrweb_original__"in i.console[t])?i.console[t].__rrweb_original__:i.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];s(e,...o)}},info:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];s.k("log",...t)},warn:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];s.k("warn",...t)},error:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];s.k("error",...t)},critical:function(){for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning:e=>{s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>to(e+" "+t,i)};return s},ta=to("[PostHog.js]"),tl=ta.createLogger,tc=tl("[ExternalScriptsLoader]"),tu=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tc.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==l?void 0:l.querySelectorAll("script");if(r){for(var s,n=0;n<r.length;n++)if(s=function(){if(r[n].src===t){var e=r[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return s.v}var o=()=>{if(!l)return i("document not found");var r=l.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)l.head.appendChild(r);else{var s,n=l.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):l.body.appendChild(r)}};null!=l&&l.body?o():null==l||l.addEventListener("DOMContentLoaded",o)};_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var r="/static/"+t+".js?v="+e.version;"remote-config"===t&&(r="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5));var s=e.requestRouter.endpointFor("assets",r);tu(e,s,i)},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);tu(e,r,i)};var th={};function td(e,t,i){if(I(e)){if(n&&e.forEach===n)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(r in e&&t.call(i,e[r],r)===th)return}}}function tp(e,t,i){if(!D(e)){if(I(e))return td(e,t,i);if(e instanceof FormData){for(var r of e.entries())if(t.call(i,r[1],r[0])===th)return}else for(var s in e)if(T.call(e,s)&&t.call(i,e[s],s)===th)return}}var t_=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return td(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},tg=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return td(i,function(t){td(t,function(t){e.push(t)})}),e};function tv(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var tf=function(e){try{return e()}catch(e){return}},tm=function(e){return function(){try{for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){ta.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ta.critical(e)}}},ty=function(e){var t={};return tp(e,function(e,i){(A(e)&&e.length>0||U(e))&&(t[i]=e)}),t},tb=["herokuapp.com","vercel.app","netlify.app"];function tE(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function tw(e,t,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}var tx="$people_distinct_id",tk="__alias",tS="__timers",tP="$autocapture_disabled_server_side",tR="$heatmaps_enabled_server_side",tT="$exception_capture_enabled_server_side",t$="$error_tracking_suppression_rules",tI="$error_tracking_capture_extension_exceptions",tO="$web_vitals_enabled_server_side",tF="$dead_clicks_enabled_server_side",tC="$product_tours_enabled_server_side",tM="$web_vitals_allowed_metrics",tA="$session_recording_remote_config",tL="$sesid",tN="$session_is_sampled",tD="$enabled_feature_flags",tU="$early_access_features",tj="$feature_flag_details",tH="$stored_person_properties",tq="$stored_group_properties",tB="$surveys",tV="$flag_call_reported",tG="$feature_flag_errors",tW="$user_state",tz="$client_session_props",tY="$capture_rate_limit",tX="$initial_campaign_params",tK="$initial_referrer_info",tJ="$initial_person_info",tZ="$epp",tQ="__POSTHOG_TOOLBAR__",t0="$posthog_cookieless",t1=[tx,tk,"__cmpns",tS,"$session_recording_enabled_server_side",tR,tL,tD,t$,tW,tU,tj,tq,tH,tB,tV,tG,tz,tY,tX,tK,tZ,tJ];function t2(e){return e instanceof Element&&(e.id===tQ||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function t3(e){return!!e&&1===e.nodeType}function t5(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function t8(e){return!!e&&3===e.nodeType}function t6(e){return!!e&&11===e.nodeType}function t4(e){return e?k(e).split(/\s+/):[]}function t7(e){var t=null==i?void 0:i.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function t9(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 t4(t)}function ie(e){return D(e)?null:k(e).split(/(\s+)/).filter(e=>ib(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function it(e){var t="";return ih(e)&&!id(e)&&e.childNodes&&e.childNodes.length&&tp(e.childNodes,function(e){var i;t8(e)&&e.textContent&&(t+=null!=(i=ie(e.textContent))?i:"")}),k(t)}function ii(e){var t;return M(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var ir=["a","button","form","input","select","textarea","label"];function is(e,t){if(M(t))return!0;var i,r=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function io(e){var t=e.parentNode;return!(!t||!t3(t))&&t}var ia=["next","previous","prev",">","<"],il=[".ph-no-rageclick",".ph-no-capture"],ic=e=>!e||t5(e,"html")||!t3(e),iu=(e,t)=>{if(!i||ic(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,s=[e],n=e;n.parentNode&&!t5(n,"body");)if(t6(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var o=io(n);if(!o)break;if(t||ir.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var a=i.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}s.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:s}};function ih(e){for(var t=e;t.parentNode&&!t5(t,"body");t=t.parentNode){var i=t9(t);if(x(i,"ph-sensitive")||x(i,"ph-no-capture"))return!1}if(x(t9(e),"ph-include"))return!0;var r=e.type||"";if(A(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(A(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 id(e){return!!(t5(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||t5(e,"select")||t5(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ip="(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})",i_=RegExp("^(?:"+ip+")$"),ig=new RegExp(ip),iv="\\d{3}-?\\d{2}-?\\d{4}",im=RegExp("^("+iv+")$"),iy=RegExp("("+iv+")");function ib(e,t){return void 0===t&&(t=!0),!(D(e)||A(e)&&(e=k(e),(t?i_:ig).test((e||"").replace(/[- ]/g,""))||(t?im:iy).test(e)))&&!0}function iE(e){var t=it(e);return ib(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&tp(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=it(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){ta.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function iw(e){return e.replace(/"|\\"/g,'\\"')}class ix{constructor(e){this.disabled=!1===e;var t=F(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var ik=e=>{var t=null==l?void 0:l.createElement("a");return M(t)?null:(t.href=e,t)},iS=function(e,t){void 0===t&&(t="&");var i,r,s=[];return tp(e,function(e,t){M(e)||M(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),r=encodeURIComponent(t),s[s.length]=r+"="+i)}),s.join(t)},iP=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var n=r[s].split("=");if(n[0]===t){i=n;break}}if(!I(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){ta.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},iR=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",n=r[1],o=s.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");I(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},iT=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},i$="$copy_autocapture",iI=tl("[AutoCapture]");function iO(e,t){return t.length>e?t.slice(0,e)+"...":t}class iF{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new ix(e.config.rageclick),this.C=null}get R(){var e,t,i=F(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}F(){if(this.isBrowserSupported()){if(i&&l){var e=e=>{e=e||(null==i?void 0:i.event);try{this.O(e)}catch(e){iI.error("Failed to capture event",e)}};if(tw(l,"submit",e,{capture:!0}),tw(l,"change",e,{capture:!0}),tw(l,"click",e,{capture:!0}),this.R.capture_copied_text){var t=e=>{e=e||(null==i?void 0:i.event),this.O(e,i$)};tw(l,"copy",t,{capture:!0}),tw(l,"cut",t,{capture:!0})}}}else iI.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tP]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var t,i=[];return null==(t=this.C)||t.forEach(t=>{var r=null==l?void 0:l.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[tP];if(N(this.T)&&!H(i)&&!this.instance.M())return!1;var r=null!=(t=this.T)?t:!!i;return!!this.instance.config.autocapture&&!r}O(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,s=ii(e);t8(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&function(e,t){if(!i||ic(e)||(H(t)?(r=!!t&&il,s=void 0):(r=null!=(n=null==t?void 0:t.css_selector_ignorelist)?n:il,s=null==t?void 0:t.content_ignorelist),!1===r))return!1;var r,s,n,{targetElementList:o}=iu(e,!1);return!function(e,t){var i;if(!1===e||M(e))return!1;if(!0===e)i=ia;else{if(!I(e))return!1;if(e.length>10)return ta.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:r}=e;return i.some(e=>t.includes(e)||r.includes(e))})}(s,o.map(e=>{var t;return{safeText:it(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!is(o,r)}(s,this.instance.config.rageclick)&&this.O(e,"$rageclick");var n=t===i$;if(s&&function(e,t,r,s,n){if(void 0===r&&(r=void 0),!i||ic(e)||null!=(o=r)&&o.url_allowlist&&!t7(r.url_allowlist)||null!=(a=r)&&a.url_ignorelist&&t7(r.url_ignorelist))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var o,a,l,c,u=r.dom_event_allowlist;if(u&&!u.some(e=>t.type===e))return!1}var{parentIsUsefulElement:h,targetElementList:d}=iu(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(M(i))return!0;var r,s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(r=s(n))return r.v;return!1}(d,r)||!is(d,null==(c=r)?void 0:c.css_selector_allowlist))return!1;var p=i.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var _=e.tagName.toLowerCase();switch(_){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(ir.indexOf(_)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.R,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){for(var r,s,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!t5(h,"body");)t6(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],_={},g=!1,v=!1;if(tp(u,e=>{var t=ih(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&ib(g)&&g),x(t9(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,r){var s=e.tagName.toLowerCase(),n={tag_name:s};ir.indexOf(s)>-1&&!i&&("a"===s.toLowerCase()||"button"===s.toLowerCase()?n.$el_text=iO(1024,iE(e)):n.$el_text=iO(1024,it(e)));var o=t9(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),tp(e.attributes,function(i){var s;if((!id(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&ib(i.value)&&(!A(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=t4(o).join(" ")),n["attr__"+i.name]=iO(1024,o)}});for(var a=1,l=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!t3(t))return t}(c);)a++,c.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l)),t_(_,function(e){if(!ih(e))return{};var t={};return tp(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&ib(r)&&(t[i]=r)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=iE(e):p[0].$el_text=it(e)),g){p[0].attr__href=g;var f,y,b=null==(f=ik(g))?void 0:f.host,E=null==i||null==(y=i.location)?void 0:y.host;b&&E&&b!==E&&(d=g)}return{props:t_({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,r,s={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?I(t)?t:t4(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return tv(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s}).map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=m({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return tv(n).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return o[iw(t.toString())]=iw(i.toString())}),r+=":",r+=tv(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(r=p[0])&&r.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},_)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===i$){var c,u=ie(null==i||null==(c=i.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return O(null==l?void 0:l.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return U(e)&&isFinite(e)&&Math.floor(e)===e});var iC="0123456789abcdef";class iM{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/0x10000000000,s[1]=e/0x100000000,s[2]=e/0x1000000,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new iM(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+iC.charAt(this.bytes[t]>>>4)+iC.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new iM(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class iA{constructor(){this.A=0,this.j=0,this.D=new iD}generate(){var e=this.generateOrAbort();if(M(e)){this.A=0;var t=this.generateOrAbort();if(M(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.j++,this.j>0x3ffffffffff&&(this.A++,this.L())}return iM.fromFieldsV7(this.A,Math.trunc(this.j/0x40000000),0x3fffffff&this.j,this.D.nextUint32())}L(){this.j=1024*this.D.nextUint32()+(1023&this.D.nextUint32())}}var iL,iN=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};i&&!M(i.crypto)&&crypto.getRandomValues&&(iN=e=>crypto.getRandomValues(e));class iD{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(iN(this.N),this.U=0),this.N[this.U++]}}var iU=()=>ij().toString(),ij=()=>(iL||(iL=new iA)).generate(),iH="",iq=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,iB={H:()=>!!l,B:function(e){ta.error("cookieStore error: "+e)},q:function(e){if(l){try{for(var t=e+"=",i=l.cookie.split(";").filter(e=>e.length),r=0;r<i.length;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},W:function(e){var t;try{t=JSON.parse(iB.q(e))||{}}catch(e){}return t},G:function(e,t,i,r,s){if(l)try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=l),iH)return iH;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+iU();!iH&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",iH=n)}return iH}(e);if(!i){var r,s=(r=e.match(iq))?r[0]:"";s!==i&&ta.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(l.location.hostname,r);if(i){var c=new Date;c.setTime(c.getTime()+24*i*36e5),n="; expires="+c.toUTCString()}s&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ta.warn("cookieStore warning: large cookie, len="+u.length),l.cookie=u,u}catch(e){return}},V:function(e,t){if(null!=l&&l.cookie)try{iB.G(e,"",-1,t)}catch(e){return}}},iV=null,iG={H:function(){if(!N(iV))return iV;var e=!0;if(M(i))e=!1;else try{var t="__mplssupport__";iG.G(t,"xyz"),'"xyz"'!==iG.q(t)&&(e=!1),iG.V(t)}catch(t){e=!1}return e||ta.error("localStorage unsupported; falling back to cookie store"),iV=e,e},B:function(e){ta.error("localStorage error: "+e)},q:function(e){try{return null==i?void 0:i.localStorage.getItem(e)}catch(e){iG.B(e)}return null},W:function(e){try{return JSON.parse(iG.q(e))||{}}catch(e){}return null},G:function(e,t){try{null==i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){iG.B(e)}},V:function(e){try{null==i||i.localStorage.removeItem(e)}catch(e){iG.B(e)}}},iW=["$device_id","distinct_id",tL,tN,tZ,tJ],iz={},iY={H:function(){return!0},B:function(e){ta.error("memoryStorage error: "+e)},q:function(e){return iz[e]||null},W:function(e){return iz[e]||null},G:function(e,t){iz[e]=t},V:function(e){delete iz[e]}},iX=null,iK={H:function(){if(!N(iX))return iX;if(iX=!0,M(i))iX=!1;else try{var e="__support__";iK.G(e,"xyz"),'"xyz"'!==iK.q(e)&&(iX=!1),iK.V(e)}catch(e){iX=!1}return iX},B:function(e){ta.error("sessionStorage error: ",e)},q:function(e){try{return null==i?void 0:i.sessionStorage.getItem(e)}catch(e){iK.B(e)}return null},W:function(e){try{return JSON.parse(iK.q(e))||null}catch(e){}return null},G:function(e,t){try{null==i||i.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){iK.B(e)}},V:function(e){try{null==i||i.sessionStorage.removeItem(e)}catch(e){iK.B(e)}}},iJ=((ny={})[ny.PENDING=-1]="PENDING",ny[ny.DENIED=0]="DENIED",ny[ny.GRANTED=1]="GRANTED",ny);class iZ{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?iJ.DENIED:this.K}isOptedOut(){return"always"===this.R.cookieless_mode||this.consent===iJ.DENIED||this.consent===iJ.PENDING&&(this.R.opt_out_capturing_by_default||"on_reject"===this.R.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===iJ.DENIED}optInOut(e){this.Y.G(this.X,+!!e,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return x(W,e)?iJ.GRANTED:x(z,e)?iJ.DENIED:iJ.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z="localStorage"===e?iG:iB;var t="localStorage"===e?iB:iG;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(x(W,t.q(this.X))),t.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!tE([null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,_.doNotTrack],e=>x(W,e))}}var iQ=tl("[Dead Clicks]"),i0=()=>!0,i1=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(tF)),r=e.instance.config.capture_dead_clicks;return H(r)?r:!!F(r)||i};class i2{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[tF]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.it(()=>{this.et()}):this.stop()}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?iQ.error("failed to load script",t):e()})}et(){var e;if(l){if(!this.tt&&null!=(e=_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=F(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(l),iQ.info("starting...")}}else iQ.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,iQ.info("stopping..."))}}var i3=tl("[ExceptionAutocapture]");class i5{constructor(e){var t,r,s;this.rt=()=>{var e;if(i&&this.isEnabled&&null!=(e=_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=t(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=r(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=s(this.captureException.bind(this)))}catch(e){i3.error("failed to start",e),this.ut()}}},this._instance=e,this.ht=!(null==(t=this._instance.persistence)||!t.props[tT]),this.dt=new X({refillRate:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?r:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,h:i3}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return F(e)?t=m({},t,e):(M(e)?this.ht:e)&&(t=m({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(i3.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return i3.error("failed to load script",t);e()})}ut(){var e,t,i;null==(e=this.st)||e.call(this),this.st=void 0,null==(t=this.nt)||t.call(this),this.nt=void 0,null==(i=this.ot)||i.call(this),this.ot=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.ht=!!t,this._instance.persistence&&this._instance.persistence.register({[tT]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}}onConfigChange(){this.R=this.vt()}captureException(e){var t,i,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.dt.consumeRateLimit(r)?i3.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}function i8(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);return O(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch(e){return()=>{}}}class i6{constructor(e){var t;this._instance=e,this.ct=(null==i||null==(t=i.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ta.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,ta.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(i&&i.history){var r=this;null!=(e=i.history.pushState)&&e.__posthog_wrapped__||i8(i.history,"pushState",e=>function(t,i,s){e.call(this,t,i,s),r._t("pushState")}),null!=(t=i.history.replaceState)&&t.__posthog_wrapped__||i8(i.history,"replaceState",e=>function(t,i,s){e.call(this,t,i,s),r._t("replaceState")}),this.bt()}}_t(e){try{var t,r=null==i||null==(t=i.location)?void 0:t.pathname;if(!r)return;r!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=r}catch(t){ta.error("Error capturing "+e+" pageview",t)}}bt(){if(!this.ft){var e=()=>{this._t("popstate")};tw(i,"popstate",e),this.ft=()=>{i&&i.removeEventListener("popstate",e)}}}}var i4=tl("[SegmentIntegration]"),i7="posthog-js";function i9(e,t){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if(!("*"===n||n.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var a,l,c,u,h,d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null==(a=t.exception)?void 0:a.values)||[],_=p.map(e=>m({},e,{stacktrace:e.stacktrace?m({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>m({},e,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_level:t.level,$exception_list:_,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(h=p[0])?void 0:h.type,$sentry_tags:t.tags};return i&&r&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),o&&e.exceptions.sendExceptionEvent(g),t}}class re{constructor(e,t,i,r,s,n){this.name=i7,this.setupOnce=function(o){o(i9(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}var rt=null!=i&&i.location?iT(i.location.hash,"__posthog")||iT(location.hash,"state"):null,ri="_postHogToolbarParams",rr=tl("[Toolbar]"),rs=((nb=rs||{})[nb.UNINITIALIZED=0]="UNINITIALIZED",nb[nb.LOADING=1]="LOADING",nb[nb.LOADED=2]="LOADED",nb);class rn{constructor(e){this.instance=e}yt(e){_.ph_toolbar_state=e}wt(){var e;return null!=(e=_.ph_toolbar_state)?e:rs.UNINITIALIZED}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.instance.config.name&&"ph_toolbar_internal"===this.instance.config.name||!i||!l)return!1;e=null!=e?e:i.location,r=null!=r?r:i.history;try{if(!t){try{i.localStorage.setItem("test","test"),i.localStorage.removeItem("test")}catch(e){return!1}t=null==i?void 0:i.localStorage}var s,n=rt||iT(e.hash,"__posthog")||iT(e.hash,"state"),o=n?tf(()=>JSON.parse(atob(decodeURIComponent(n))))||tf(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(ri)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch(e){return!1}}xt(e){var t=_.ph_load_toolbar||_.ph_load_editor;!D(t)&&O(t)?t(e,this.instance):rr.warn("No toolbar load function found")}loadToolbar(e){var t,r=!(null==l||!l.getElementById(tQ));if(!i||r)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=m({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(i.localStorage.setItem(ri,JSON.stringify(m({},n,{source:void 0}))),this.wt()===rs.LOADED)?this.xt(n):this.wt()===rs.UNINITIALIZED&&(this.yt(rs.LOADING),null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(rr.error("[Toolbar] Failed to load",e),this.yt(rs.UNINITIALIZED)):(this.yt(rs.LOADED),this.xt(n))}),tw(i,"turbolinks:load",()=>{this.yt(rs.UNINITIALIZED),this.loadToolbar(n)})),!0}$t(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var ro=tl("[TracingHeaders]");class ra{constructor(e){this.Et=void 0,this.St=void 0,this.rt=()=>{var e,t;M(this.Et)&&(null==(e=_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),M(this.St)&&(null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return ro.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):(null==(e=this.Et)||e.call(this),null==(t=this.St)||t.call(this),this.Et=void 0,this.St=void 0)}}var rl="https?://(.*)",rc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ru=tg(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rc),rh="<masked>",rd=["li_fat_id"];function rp(e,t,i){if(!l)return{};var r,s=t?tg([],rc,i||[]):[],n=r_(iR(l.URL,s,rh),e);return t_((r={},tp(rd,function(e){var t=iB.q(e);r[e]=t||null}),r),n)}function r_(e,t){var i=ru.concat(t||[]),r={};return tp(i,function(t){var i=iP(e,t);r[t]=i||null}),r}function rg(e){var t=e?0===e.search(rl+"google.([^/?]*)")?"google":0===e.search(rl+"bing.com")?"bing":0===e.search(rl+"yahoo.com")?"yahoo":0===e.search(rl+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!N(t)){i.$search_engine=t;var r=l?iP(l.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function rv(){return navigator.language||navigator.userLanguage}function rf(){return(null==l?void 0:l.referrer)||"$direct"}function rm(e,t){var i=e?tg([],rc,t||[]):[],r=null==c?void 0:c.href.substring(0,1e3);return{r:rf().substring(0,1e3),u:r?iR(r,i,rh):void 0}}function ry(e){var t,{r:i,u:r}=e,s={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=ik(i))?void 0:t.host};if(r){s.$current_url=r;var n=ik(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname,t_(s,r_(r))}return i&&t_(s,rg(i)),s}function rb(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rE=tl("[Web Vitals]");class rw{constructor(e){var t;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((e,t)=>m({},e,{["$web_vitals_"+t.name+"_event"]:m({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(M(i))rE.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.Ct();M(r)||(D(null==e?void 0:e.name)||D(null==e?void 0:e.value)?rE.error("Invalid metric received",e):this.Rt&&e.value>=this.Rt?rE.error("Ignoring metric with value >= "+this.Rt,e):(this.N.url!==r&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),M(this.N.url)&&(this.N.url=r),this.N.firstMetricTimestamp=M(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.N.metrics.push(m({},e,{$current_url:r,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{if(!this.P){var e,t,i,r,s=_.__PosthogExtensions__;M(s)||M(s.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=s.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.It.bind(this)),this.P=!0):rE.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.kt=!(null==(t=this._instance.persistence)||!t.props[tO]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=F(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return D(i)?(null==(t=this._instance.persistence)?void 0:t.props[tM])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(F(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=F(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=e&&e}get Rt(){var e=F(this._instance.config.capture_performance)&&U(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){var e=null==c?void 0:c.protocol;if("http:"!==e&&"https:"!==e)return rE.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=F(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:H(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return H(t)?t:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(rE.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){if("capturePerformance"in e){var t=F(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=F(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tO]:t}),this._instance.persistence.register({[tM]:i})),this.kt=t,this.startIfEnabled()}}it(e){var t,i;if(null!=(t=_.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,r,t=>{t?rE.error("failed to load script",t):e()})}}Ct(){var e=i?i.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties;return iR(e,t?tg([],rc,r||[]):[],rh)}rE.error("Could not determine current URL")}}var rx=tl("[Heatmaps]");function rk(e){return F(e)&&"clientX"in e&&"clientY"in e&&U(e.clientX)&&U(e.clientY)}class rS{constructor(e){var t;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!(null==(t=this.instance.persistence)||!t.props[tR]),this.rageclicks=new ix(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return F(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 D(this.instance.config.capture_heatmaps)?D(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.P||(rx.info("starting..."),this.Ot(),this.Mt());else{var e;clearInterval(null!=(e=this.Ft)?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tR]:t}),this.kt=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}jt(e){this.Dt(e.originalEvent,"deadclick")}Mt(){this.Ft&&clearInterval(this.Ft),this.Ft="visible"===(null==l?void 0:l.visibilityState)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}Ot(){i&&l&&(this.Nt=this.Lt.bind(this),tw(i,"beforeunload",this.Nt),this.Ut=e=>this.Dt(e||(null==i?void 0:i.event)),tw(l,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||(null==i?void 0:i.event)),tw(l,"mousemove",this.zt,{capture:!0}),this.Bt=new i2(this.instance,i0,this.jt.bind(this)),this.Bt.startIfEnabledOrStop(),this.qt=this.Mt.bind(this),tw(l,"visibilitychange",this.qt),this.P=!0)}At(){var e;i&&l&&(this.Nt&&i.removeEventListener("beforeunload",this.Nt),this.Ut&&l.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&l.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&l.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),null==(e=this.Bt)||e.stop(),this.P=!1)}Gt(e,t){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,r){for(var s=e;s&&t3(s)&&!t5(s,"body")&&s!==r;){if(x(t,null==i?void 0:i.getComputedStyle(s).position))return!0;s=io(s)}return!1}(ii(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:s),y:e.clientY+(o?0:r),target_fixed:o,type:t}}Dt(e,t){var i;if(void 0===t&&(t="click"),!t2(e.target)&&rk(e)){var r=this.Gt(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Vt(m({},r,{type:"rageclick"})),this.Vt(r)}}Ht(e){!t2(e.target)&&rk(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout(()=>{this.Vt(this.Gt(e,"mousemove"))},500))}Vt(e){if(i){var t=i.location.href,r=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=iR(t,r?tg([],rc,s||[]):[],rh);this.N=this.N||{},this.N[n]||(this.N[n]=[]),this.N[n].push(e)}}Lt(){this.N&&!C(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class rP{constructor(e){this.Jt=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(ta.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Jt)}destroy(){var e;null==(e=this.Xt)||e.call(this),this.Xt=void 0}doPageView(e,t){var r,s=this.Qt(e,t);return this.Kt={pathname:null!=(r=null==i?void 0:i.location.pathname)?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Qt(e,null==(t=this.Kt)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Kt)?void 0:e.pageViewId}}Qt(e,t){var i=this.Kt;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=s;if(!(M(n)||M(o)||M(a)||M(l)||M(c)||M(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:Y(o/n,0,1,ta),d=n<=1?1:Y(a/n,0,1,ta),p=l<=1?1:Y(c/l,0,1,ta),_=l<=1?1:Y(u/l,0,1,ta);r=t_(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var rR=((nE={}).GZipJS="gzip-js",nE.Base64="base64",nE),rT=Uint8Array,r$=Uint16Array,rI=Uint32Array,rO=new rT([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]),rF=new rT([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]),rC=new rT([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rM=function(e,t){for(var i=new r$(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var s=new rI(i[30]);for(r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)s[n]=n-i[r]<<5|r;return[i,s]},rA=rM(rO,2),rL=rA[0],rN=rA[1];rL[28]=258,rN[258]=28;for(var rD=rM(rF,0)[1],rU=new r$(32768),rj=0;rj<32768;++rj){var rH=(43690&rj)>>>1|(21845&rj)<<1;rH=(61680&(rH=(52428&rH)>>>2|(13107&rH)<<2))>>>4|(3855&rH)<<4,rU[rj]=((65280&rH)>>>8|(255&rH)<<8)>>>1}var rq=function(e,t,i){for(var r=e.length,s=0,n=new r$(t);s<r;++s)++n[e[s]-1];var o,a=new r$(t);for(s=0;s<t;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new r$(1<<t);var l=15-t;for(s=0;s<r;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[rU[h]>>>l]=c}else for(o=new r$(r),s=0;s<r;++s)o[s]=rU[a[e[s]-1]++]>>>15-e[s];return o},rB=new rT(288);for(rj=0;rj<144;++rj)rB[rj]=8;for(rj=144;rj<256;++rj)rB[rj]=9;for(rj=256;rj<280;++rj)rB[rj]=7;for(rj=280;rj<288;++rj)rB[rj]=8;var rV=new rT(32);for(rj=0;rj<32;++rj)rV[rj]=5;var rG=rq(rB,9,0),rW=rq(rV,5,0),rz=function(e){return(e/8|0)+(7&e&&1)},rY=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof r$?r$:e instanceof rI?rI:rT)(i-t);return r.set(e.subarray(t,i)),r},rX=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8},rK=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8,e[r+2]|=i>>>16},rJ=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new rT(0),0];if(1==s){var o=new rT(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(r=1;r<s;++r)n[r].s>d&&(d=n[r].s);var p=new r$(d+1),_=rZ(i[u-1],p,0);if(_>t){r=0;var g=0,v=_-t,f=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<s;++r){var m=n[r].s;if(!(p[m]>t))break;g+=f-(1<<_-p[m]),p[m]=t}for(g>>>=v;g>0;){var y=n[r].s;p[y]<t?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=n[r].s;p[b]==t&&(--p[b],++g)}_=t}return[new rT(p),_]},rZ=function(e,t,i){return -1==e.s?Math.max(rZ(e.l,t,i+1),rZ(e.r,t,i+1)):t[e.s]=i},rQ=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new r$(++t),r=0,s=e[0],n=1,o=function(e){i[r++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=e[a]}return[i.subarray(0,r),t]},r0=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},r1=function(e,t,i){var r=i.length,s=rz(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 n=0;n<r;++n)e[s+n+4]=i[n];return 8*(s+4+r)},r2=function(e,t,i,r,s,n,o,a,l,c,u){rX(t,u++,i),++s[256];for(var h=rJ(s,15),d=h[0],p=h[1],_=rJ(n,15),g=_[0],v=_[1],f=rQ(d),m=f[0],y=f[1],b=rQ(g),E=b[0],w=b[1],x=new r$(19),k=0;k<m.length;++k)x[31&m[k]]++;for(k=0;k<E.length;++k)x[31&E[k]]++;for(var S=rJ(x,7),P=S[0],R=S[1],T=19;T>4&&!P[rC[T-1]];--T);var $,I,O,F,C=c+5<<3,M=r0(s,rB)+r0(n,rV)+o,A=r0(s,d)+r0(n,g)+o+14+3*T+r0(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(C<=M&&C<=A)return r1(t,u,e.subarray(l,l+c));if(rX(t,u,1+(A<M)),u+=2,A<M){$=rq(d,p,0),I=d,O=rq(g,v,0),F=g;var L=rq(P,R,0);for(rX(t,u,y-257),rX(t,u+5,w-1),rX(t,u+10,T-4),u+=14,k=0;k<T;++k)rX(t,u+3*k,P[rC[k]]);u+=3*T;for(var N=[m,E],D=0;D<2;++D){var U=N[D];for(k=0;k<U.length;++k){var j=31&U[k];rX(t,u,L[j]),u+=P[j],j>15&&(rX(t,u,U[k]>>>5&127),u+=U[k]>>>12)}}}else $=rG,I=rB,O=rW,F=rV;for(k=0;k<a;++k)if(r[k]>255){rK(t,u,$[(j=r[k]>>>18&31)+257]),u+=I[j+257],j>7&&(rX(t,u,r[k]>>>23&31),u+=rO[j]);var H=31&r[k];rK(t,u,O[H]),u+=F[H],H>3&&(rK(t,u,r[k]>>>5&8191),u+=rF[H])}else rK(t,u,$[r[k]]),u+=I[r[k]];return rK(t,u,$[256]),u+I[256]},r3=new rI([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),r5=function(){for(var e=new rI(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),r8=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},r6=function(e){var t,i,r,s,n="";for(t=i=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<r;s++){var o=e.charCodeAt(s),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),N(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=s+1)}return i>t&&(n+=e.substring(t,e.length)),n},r4=!!h||!!u,r7="text/plain",r9=function(e,t,i){void 0===i&&(i=!0);var r,[s,n]=e.split("?"),o=m({},t),a=null!=(r=null==n?void 0:n.split("&").map(e=>{var t,[r,s]=e.split("="),n=i&&null!=(t=o[r])?t:s;return delete o[r],r+"="+n}))?r:[],l=iS(o);return l&&a.push(l),s+"?"+a.join("&")},se=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),st=e=>{var{data:t,compression:i}=e;if(t){if(i===rR.GZipJS){var r,s,n,o,a,l,c,u,h=new Blob([(r=function(e,t){var i=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new rT(e.length+(e.length>>>1)),s=0,n=function(e){r[s++]=e},o=0;o<i;++o){if(s+5>r.length){var a=new rT(s+8+(i-o<<1));a.set(r),r=a}var l=e.charCodeAt(o);l<128?n(l):(l<2048?n(192|l>>>6):(l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return rY(r,0,s)}(se(t)),s={mtime:0},n=0xffffffff,o={p:function(e){for(var t=n,i=0;i<e.length;++i)t=r5[255&t^e[i]]^t>>>8;n=t},d:function(){return 0xffffffff^n}},a=r.length,o.p(r),u=(l=10+(s.filename&&s.filename.length+1||0),c=function(e,t,i,r,s,n){var o=e.length,a=new rT(r+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(r,a.length-8),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=r1(l,c,e.subarray(u,h)):(l[u]=n,c=r1(l,c,e.subarray(u,o)))}else{for(var d=r3[t-1],p=d>>>13,_=8191&d,g=(1<<i)-1,v=new r$(32768),f=new r$(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},E=new rI(25e3),w=new r$(288),x=new r$(32),k=0,S=0,P=(u=0,0),R=0,T=0;u<o;++u){var $=b(u),I=32767&u,O=f[$];if(v[I]=O,f[$]=I,R<=u){var F=o-u;if((k>7e3||P>24576)&&F>423){c=r2(e,l,0,E,w,x,S,P,T,u-T,c),P=k=S=0,T=u;for(var C=0;C<286;++C)w[C]=0;for(C=0;C<30;++C)x[C]=0}var M=2,A=0,L=_,N=I-O&32767;if(F>2&&$==b(u-N))for(var D=Math.min(p,F)-1,U=Math.min(32767,u),j=Math.min(258,F);N<=U&&--L&&I!=O;){if(e[u+M]==e[u+M-N]){for(var H=0;H<j&&e[u+H]==e[u+H-N];++H);if(H>M){if(M=H,A=N,H>D)break;var q=Math.min(N,H-2),B=0;for(C=0;C<q;++C){var V=u-N+C+32768&32767,G=V-v[V]+32768&32767;G>B&&(B=G,O=V)}}}N+=(I=O)-(O=v[I])+32768&32767}if(A){E[P++]=0x10000000|rN[M]<<18|rD[A];var W=31&rN[M],z=31&rD[A];S+=rO[W]+rF[z],++w[257+W],++x[z],R=u+M,++k}else E[P++]=e[u],++w[e[u]]}}c=r2(e,l,n,E,w,x,S,P,T,u-T,c)}return rY(a,0,r+rz(c)+8)}(r,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,l,8,!0)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&r8(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(c,s),r8(c,u-8,o.d()),r8(c,u-4,a),c)],{type:r7});return{contentType:r7,body:h,estimatedSize:h.size}}if(i===rR.Base64){let e;var d="data="+encodeURIComponent("string"==typeof(e=function(e){var t,i,r,s,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=r6(e);do t=(n=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=n>>12&63,r=n>>6&63,s=63&n,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(r)+o.charAt(s);while(a<e.length)switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(se(t)))?e:se(e));return{contentType:"application/x-www-form-urlencoded",body:d,estimatedSize:new Blob([d]).size}}var p=se(t);return{contentType:"application/json",body:p,estimatedSize:new Blob([p]).size}}},si=[];u&&si.push({transport:"fetch",method:e=>{var t,i,{contentType:r,body:s,estimatedSize:n}=null!=(t=st(e))?t:{},o=new Headers;tp(e.headers,function(e,t){o.append(t,e)}),r&&o.append("Content-Type",r);var a=e.url,l=null;if(d){var c=new d;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}u(a,m({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&52428.8>(n||0),body:s,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){ta.error(e)}null==e.callback||e.callback(r)})).catch(t=>{ta.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),h&&si.push({transport:"XHR",method:e=>{var t,i=new h;i.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=null!=(t=st(e))?t:{};tp(e.headers,function(e,t){i.setRequestHeader(t,e)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(s)}}),null!=a&&a.sendBeacon&&si.push({transport:"sendBeacon",method:e=>{var t=r9(e.url,{beacon:"1"});try{var i,{contentType:r,body:s}=null!=(i=st(e))?i:{},n="string"==typeof s?new Blob([s],{type:r}):s;a.sendBeacon(t,n)}catch(e){}}});var sr=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function ss(e,t,i){return se({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var sn={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>sr(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!sr(t,e))),icontains:(e,t)=>t.map(so).some(t=>e.map(so).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(so).every(t=>e.map(so).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})},so=e=>e.toLowerCase();function sa(e,t){return!e||Object.entries(e).every(e=>{var[i,r]=e,s=null==t?void 0:t[i];if(M(s)||N(s))return!1;var n=[String(s)],o=sn[r.operator];return!!o&&o(r.values,n)})}var sl=tl("[Error tracking]");class sc{constructor(e){var t,i;this.Zt=[],this.ti=new eY([new e8,new tn,new e4,new e6,new tr,new ti,new e9,new ts],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var s=[],n=t.split("\n"),o=r;o<n.length;o++){var a=n[o];if(!(a.length>1024)){var l=e5.test(a)?a.replace(e5,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l,e);if(u){s.push(u);break}}if(s.length>=50)break}}}if(!s.length)return[];var h=Array.from(s);return h.reverse(),h.slice(0,50).map(e=>m({},e,{filename:e.filename||(h[h.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",e0,e3)),this._instance=e,this.Zt=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(t$))?t:[]}onRemoteConfig(e){var t,i,r;if("errorTracking"in e){var s=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.Zt=s,this._instance.persistence&&this._instance.persistence.register({[t$]:this.Zt,[tI]:n})}}get ii(){var e,t=!!this._instance.get_property(tI),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.ti.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ei(t)){if(this.ri(t))return void sl.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(t))return void sl.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(t))return void sl.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",oi:!0})}ri(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:i,value:r}=t;return A(i)&&i.length>0&&e.$exception_types.push(i),A(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.Zt.some(e=>{var i=e.values.map(e=>{var i,r=sn[e.operator],s=I(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return s.length>0&&r(s,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}si(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ni(e){if(e.length>0){var t,i,r,s,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],o=n[n.length-1];return null!=(r=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&r}return!1}ei(e){return!D(e)&&I(e)}}var su=tl("[FeatureFlags]"),sh=tl("[FeatureFlags]",{debugEnabled:!0}),sd="$active_feature_flags",sp="$override_feature_flags",s_="$feature_flag_payloads",sg="$override_feature_flag_payloads",sv="$feature_flag_request_id",sf="$feature_flag_evaluated_at",sm=e=>{var t={};for(var[i,r]of tv(e||{}))r&&(t[i]=r);return t},sy=((nw={}).FeatureFlags="feature_flags",nw.Recordings="recordings",nw);class sb{constructor(e){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.ci=!1,this._instance=e,this.featureFlagEventHandlers=[]}fi(){var e,t=null!=(e=this._instance.config.evaluation_contexts)?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(su.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||su.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}pi(){return this.fi().length>0}get hasLoadedFlags(){return this.li}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(tj),t=this._instance.get_property(sp),i=this._instance.get_property(sg);if(!i&&!t)return e||{};var r=t_({},e||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=r[s],l=null==t?void 0:t[s],c=M(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,u=M(l)?a.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[s],d=m({},a,{enabled:c,variant:c?null!=u?u:null==a?void 0:a.variant:void 0});c!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),u!==(null==a?void 0:a.variant)&&(d.original_variant=null==a?void 0:a.variant),h&&(d.metadata=m({},null==a?void 0:a.metadata,{payload:h,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),r[s]=d}return this.ai||(su.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ai=!0),r}getFlagVariants(){var e=this._instance.get_property(tD),t=this._instance.get_property(sp);if(!t)return e||{};for(var i=t_({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this.ai||(su.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ai=!0),i}getFlagPayloads(){var e=this._instance.get_property(s_),t=this._instance.get_property(sg);if(!t)return e||{};for(var i=t_({},e||{}),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this.ai||(su.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ai=!0),i}reloadFeatureFlags(){this.hi||this._instance.config.advanced_disable_feature_flags||this.gi||(this._instance.mi.emit("featureFlagsReloading",!0),this.gi=setTimeout(()=>{this.bi()},5))}yi(){clearTimeout(this.gi),this.gi=void 0}ensureFlagsLoaded(){this.li||this.ui||this.gi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.hi=e}bi(e){var t;if(this.yi(),!this._instance.M())if(this.ui)this.di=!0;else{var i=this._instance.config.token,r=this._instance.get_property("$device_id"),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:m({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(tH)||{}),group_properties:this._instance.get_property(tq),timezone:rb()};N(r)||M(r)||(s.$device_id=r),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.pi()&&(s.evaluation_contexts=this.fi());var n=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+n);this.ui=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this._instance.config.disable_compression?void 0:rR.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,n=!0;if(200===e.statusCode&&(this.di||(this.$anon_distinct_id=void 0),n=!1),this.ui=!1,!s.disable_flags||this.di){this.vi=!n;var o,a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==e.statusCode&&a.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes(sy.FeatureFlags));(l&&a.push("quota_limited"),null==(r=this._instance.persistence)||r.register({[tG]:a}),l)?su.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."):(s.disable_flags||this.receivedFeatureFlags(null!=(o=e.json)?o:{},n),this.di&&(this.di=!1,this.bi()))}}})}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.vi){if(this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlagResult(e,t);return null!=(i=null==r?void 0:r.variant)?i:null==r?void 0:r.enabled}su.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.vi)if(this.li||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants(),r=e in i,s=i[e],n=this.getFlagPayloads()[e],o=String(s),a=this._instance.get_property(sv)||void 0,l=this._instance.get_property(sf)||void 0,c=this._instance.get_property(tV)||{};if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(o))){I(c[e])?c[e].push(o):c[e]=[o],null==(p=this._instance.persistence)||p.register({[tV]:c});var u=this.getFeatureFlagDetails(e),h=[...null!=(_=this._instance.get_property(tG))?_:[]];M(s)&&h.push("flag_missing");var d={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(g=this._instance.config.bootstrap)||null==(g=g.featureFlags)?void 0:g[e])||null,$feature_flag_bootstrapped_payload:(null==(v=this._instance.config.bootstrap)||null==(v=v.featureFlagPayloads)?void 0:v[e])||null,$used_bootstrap_value:!this.vi};M(null==u||null==(f=u.metadata)?void 0:f.version)||(d.$feature_flag_version=u.metadata.version);var p,_,g,v,f,m,y,b,E,w,x,k=null!=(m=null==u||null==(y=u.reason)?void 0:y.description)?m:null==u||null==(b=u.reason)?void 0:b.code;k&&(d.$feature_flag_reason=k),null!=u&&null!=(E=u.metadata)&&E.id&&(d.$feature_flag_id=u.metadata.id),M(null==u?void 0:u.original_variant)&&M(null==u?void 0:u.original_enabled)||(d.$feature_flag_original_response=M(u.original_variant)?u.original_enabled:u.original_variant),null!=u&&null!=(w=u.metadata)&&w.original_payload&&(d.$feature_flag_original_payload=null==u||null==(x=u.metadata)?void 0:x.original_payload),h.length&&(d.$feature_flag_error=h.join(",")),this._instance.capture("$feature_flag_called",d)}if(r){var S=n;if(!M(n))try{S=JSON.parse(n)}catch(e){}return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:S}}}else su.warn('getFeatureFlagResult for key "'+e+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(e,t){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.pi()&&(r.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this._instance.config.disable_compression?void 0:rR.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var r,s=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.vi){if(this.li||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return M(i)?void 0:!!i}su.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.li=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,i,r,s){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var n,o=((n=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(n).map(e=>{var t;return[e,null!=(t=n[e].variant)?t:n[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(n).filter(e=>n[e].enabled).filter(e=>{var t;return null==(t=n[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))):su.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),a=o.flags,l=o.featureFlags,c=o.featureFlagPayloads;if(l){var u=e.requestId,h=e.evaluatedAt;if(I(l)){su.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var p=0;p<l.length;p++)d[l[p]]=!0;t&&t.register({[sd]:l,[tD]:d})}else{var _=l,g=c,v=a;if(e.errorsWhileComputingFlags)if(a){var f=new Set(Object.keys(a).filter(e=>{var t;return!(null!=(t=a[e])&&t.failed)}));_=m({},i,Object.fromEntries(Object.entries(_).filter(e=>{var[t]=e;return f.has(t)}))),g=m({},r,Object.fromEntries(Object.entries(g||{}).filter(e=>{var[t]=e;return f.has(t)}))),v=m({},s,Object.fromEntries(Object.entries(v||{}).filter(e=>{var[t]=e;return f.has(t)})))}else _=m({},i,_),g=m({},r,g),v=m({},s,v);t&&t.register(m({[sd]:Object.keys(sm(_)),[tD]:_||{},[s_]:g||{},[tj]:v||{}},u?{[sv]:u}:{},h?{[sf]:h}:{}))}}}(e,this._instance.persistence,i,r,s),this.wi(t)}}override(e,t){void 0===t&&(t=!1),su.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return su.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(sp),this._instance.persistence.unregister(sg),this.wi(),sh.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.ai=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(sp),sh.info("Flag overrides cleared");else if(e.flags){if(I(e.flags)){for(var i={},r=0;r<e.flags.length;r++)i[e.flags[r]]=!0;this._instance.persistence.register({[sp]:i})}else this._instance.persistence.register({[sp]:e.flags});sh.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this._instance.persistence.unregister(sg),sh.info("Payload overrides cleared")):e.payloads&&(this._instance.persistence.register({[sg]:e.payloads}),sh.info("Payload overrides set",{payloads:e.payloads}))),void this.wi()}this.wi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.li){var{flags:t,flagVariants:i}=this.xi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this._instance.get_property(tU)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(o.$early_access_feature_name=s.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=m({},this.getFlagVariants(),{[e]:t});null==(r=this._instance.persistence)||r.register({[sd]:Object.keys(sm(a)),[tD]:a}),this.wi()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this._instance.get_property(tU),s=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(tU),null==(r=this._instance.persistence)||r.register({[tU]:s}),e(s)}}})}xi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}wi(e){var{flags:t,flagVariants:i}=this.xi();this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(tH)||{};this._instance.register({[tH]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(tH)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(tq)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=m({},i[t],e[t]),delete e[t]}),this._instance.register({[tq]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(tq)||{};this._instance.register({[tq]:m({},t,{[e]:{}})})}else this._instance.unregister(tq)}reset(){this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.yi(),this.ai=!1}}var sE=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class sw{constructor(e,t){this.R=e,this.props={},this.$i=!1,this.Ei=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Y=this.Si(e),this.load(),e.debug&&ta.info("Persistence loaded",e.persistence,m({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.ki}Si(e){-1===sE.indexOf(e.persistence.toLowerCase())&&(ta.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,r,s=(void 0===(t=e.cookie_persisted_properties||[])&&(t=[]),r=[...iW,...t],m({},iG,{W:function(e){try{var t={};try{t=iB.W(e)||{}}catch(e){}var i=t_(t,JSON.parse(iG.q(e)||"{}"));return iG.G(e,i),i}catch(e){}return null},G:function(e,t,i,s,n,o){try{iG.G(e,t,void 0,void 0,o);var a={};r.forEach(e=>{t[e]&&(a[e]=t[e])}),Object.keys(a).length&&iB.G(e,a,i,s,n,o)}catch(e){iG.B(e)}},V:function(e,t){try{null==i||i.localStorage.removeItem(e),iB.V(e,t)}catch(e){iG.B(e)}}})),n=e.persistence.toLowerCase();return"localstorage"===n&&iG.H()?iG:"localstorage+cookie"===n&&s.H()?s:"sessionstorage"===n&&iK.H()?iK:"memory"===n?iY:"cookie"===n?iB:s.H()?s:iB}properties(){var e={};return tp(this.props,function(t,i){if(i===tD&&F(t))for(var r,s=Object.keys(t),n=0;n<s.length;n++)e["$feature/"+s[n]]=t[s[n]];else r=!1,(N(t1)?r:o&&t1.indexOf===o?-1!=t1.indexOf(i):(tp(t1,function(e){if(r||(r=e===i))return th}),r))||(e[i]=t)}),e}load(){if(!this.ki){var e=this.Y.W(this.Ei);e&&(this.props=t_({},e))}}save(){this.ki||this.Y.G(this.Ei,this.props,this.Pi,this.Ti,this.Ii,this.R.debug)}remove(){this.Y.V(this.Ei,!1),this.Y.V(this.Ei,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(F(e)){M(t)&&(t="None"),this.Pi=M(i)?this.Ci:i;var r=!1;if(tp(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(F(e)){this.Pi=M(t)?this.Ci:t;var i=!1;if(tp(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.$i){var e=rp(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);C(ty(e))||this.register(e),this.$i=!0}}update_search_keyword(){var e;this.register((e=null==l?void 0:l.referrer)?rg(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rf(),$referring_domain:null!=l&&l.referrer&&(null==(e=ik(l.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[tX]||this.props[tK]||this.register_once({[tJ]:rm(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};tp([tK,tX],t=>{var i=this.props[t];i&&tp(i,function(t,i){e["$initial_"+S(i)]=t})});var t,i,r=this.props[tJ];return r&&t_(e,(t=ry(r),i={},tp(t,function(e,t){i["$initial_"+S(t)]=e}),i)),e}safe_merge(e){return tp(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Ci=this.Pi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.Si(e),s=this.props;this.clear(),this.Y=r,this.props=s,this.save()}}set_disabled(e){this.ki=e,this.ki?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ti&&(this.Ti=e,this.remove(),this.save())}set_secure(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[tS]||{};i[e]=t,this.props[tS]=i,this.save()}remove_event_timer(e){var t=(this.props[tS]||{})[e];return M(t)||(delete this.props[tS][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var sx=tl("[Product Tours]"),sk="ph_product_tours";class sS{constructor(e){this.Ri=null,this.Fi=null,this._instance=e}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[tC]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ri||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(tC)||this.it(()=>this.Oi())}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?sx.error("Could not load product tours script",t):e()})}Oi(){var e;!this.Ri&&null!=(e=_.__PosthogExtensions__)&&e.generateProductTours&&(this.Ri=_.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!I(this.Fi)||t){var i=this._instance.persistence;if(i){var r=i.props[sk];if(I(r)&&!t)return this.Fi=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:t=>{var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return sx.error(s),void e([],{isLoaded:!1,error:s})}var n=I(t.json.product_tours)?t.json.product_tours:[];this.Fi=n,i&&i.register({[sk]:n}),e(n,{isLoaded:!0})}})}else e(this.Fi,{isLoaded:!0})}getActiveProductTours(e){D(this.Ri)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ri.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Ri)||t.showTourById(e)}previewTour(e){this.Ri?this.Ri.previewTour(e):this.it(()=>{var t;this.Oi(),null==(t=this.Ri)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Ri)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Ri)||e.nextStep()}previousStep(){var e;null==(e=this.Ri)||e.previousStep()}clearCache(){var e;this.Fi=null,null==(e=this._instance.persistence)||e.unregister(sk)}resetTour(e){var t;null==(t=this.Ri)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Ri)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Ri)||t.cancelPendingTour(e)}}var sP=((nx={}).Activation="events",nx.Cancellation="cancelEvents",nx),sR=((nk={}).Button="button",nk.Tab="tab",nk.Selector="selector",(nS={}).TopLeft="top_left",nS.TopRight="top_right",nS.TopCenter="top_center",nS.MiddleLeft="middle_left",nS.MiddleRight="middle_right",nS.MiddleCenter="middle_center",nS.Left="left",nS.Center="center",nS.Right="right",nS.NextToTrigger="next_to_trigger",(nP={}).Top="top",nP.Left="left",nP.Right="right",nP.Bottom="bottom",(nR={}).Popover="popover",nR.API="api",nR.Widget="widget",nR.ExternalSurvey="external_survey",nR),sT=((nT={}).Open="open",nT.MultipleChoice="multiple_choice",nT.SingleChoice="single_choice",nT.Rating="rating",nT.Link="link",(n$={}).NextQuestion="next_question",n$.End="end",n$.ResponseBased="response_based",n$.SpecificQuestion="specific_question",(nI={}).Once="once",nI.Recurring="recurring",nI.Always="always",(nO={}).SHOWN="survey shown",nO.DISMISSED="survey dismissed",nO.SENT="survey sent",nO.ABANDONED="survey abandoned",nO),s$=((nF={}).SURVEY_ID="$survey_id",nF.SURVEY_NAME="$survey_name",nF.SURVEY_RESPONSE="$survey_response",nF.SURVEY_ITERATION="$survey_iteration",nF.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",nF.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",nF.SURVEY_SUBMISSION_ID="$survey_submission_id",nF.SURVEY_QUESTIONS="$survey_questions",nF.SURVEY_COMPLETED="$survey_completed",nF.PRODUCT_TOUR_ID="$product_tour_id",nF.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",nF),sI=((nC={}).Popover="popover",nC.Inline="inline",nC),sO=tl("[Surveys]"),sF="seenSurvey_",sC=e=>{var t;return t=""+sF+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+sF+e.id+"_"+e.current_iteration),t},sM=[sR.Popover,sR.Widget,sR.API],sA={ignoreConditions:!1,ignoreDelay:!1,displayType:sI.Popover};class sL{constructor(){this.Mi={},this.Mi={}}on(e,t){return this.Mi[e]||(this.Mi[e]=[]),this.Mi[e].push(t),()=>{this.Mi[e]=this.Mi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Mi[e]||[])i(t);for(var r of this.Mi["*"]||[])r(e,t)}}function sN(e,t,i){if(D(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class sD{constructor(e){this.Ai=new sL,this.ji=(e,t)=>this.Di(e,t)&&this.Li(e,t)&&this.Ni(e,t)&&this.Ui(e,t),this.Di=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.zi=new Set,this.Hi=new Set}init(){var e,t;M(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!M(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.Hi)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.zi)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(e,t){var i;null!=t&&0!=e.length&&(this.zi.has(e)||this.zi.has(null==t?void 0:t.event))&&this.Hi&&(null==(i=this.Hi)?void 0:i.size)>0&&this.Hi.forEach(e=>{this.Bi(t,e)&&this.Ai.emit("actionCaptured",e.name)})}qi(e){this.onAction("actionCaptured",t=>e(t))}Bi(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.ji(e,i))return!0;return!1}onAction(e,t){return this.Ai.on(e,t)}Li(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!sN(r,t.url,t.url_matching||"contains"))return!1}return!0}Ni(e,t){return!!this.Wi(e,t)&&!!this.Gi(e,t)&&!!this.Vi(e,t)}Wi(e,t){if(null==t||!t.href)return!0;var i=this.Ji(e);if(i.length>0)return i.some(e=>sN(e.href,t.href,t.href_matching||"exact"));var r,s,n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!n&&sN((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}Gi(e,t){if(null==t||!t.text)return!0;var i=this.Ji(e);if(i.length>0)return i.some(e=>sN(e.text,t.text,t.text_matching||"exact")||sN(e.$el_text,t.text,t.text_matching||"exact"));var r,s,n,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(s=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!D(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),n=t.text,o=t.text_matching||"exact",s.some(e=>sN(e,n,o)))}Vi(e,t){if(null==t||!t.selector)return!0;var i,r,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=s&&s.includes(t.selector))return!0;var n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}Ji(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Ui(e,t){return null==t||!t.properties||0===t.properties.length||sa(t.properties.reduce((e,t)=>{var i=I(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class sU{constructor(e){this._instance=e,this.Ki=new Map,this.Yi=new Map,this.Xi=new Map}Qi(e,t){return!!e&&sa(e.propertyFilters,null==t?void 0:t.properties)}Zi(e,t){var i=new Map;return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null!=t&&t.name){var r=i.get(t.name)||[];r.push(e.id),i.set(t.name,r)}})}),i}te(e,t,i){var r=(i===sP.Activation?this.Ki:this.Yi).get(e),s=[];return this.ie(e=>{s=e.filter(e=>null==r?void 0:r.includes(e.id))}),s.filter(r=>{var s,n=null==(s=r.conditions)||null==(s=s[i])||null==(s=s.values)?void 0:s.find(t=>t.name===e);return this.Qi(n,t)})}register(e){var t;M(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.ee(e),this.re(e))}re(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.se&&(this.se=new sD(this._instance),this.se.init(),this.se.qi(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.se)||s.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.Xi.get(t.name);i&&i.push(e.id),this.Xi.set(t.name,i||[e.id])}}))}))}ee(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});(0!==i.length||0!==r.length)&&(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.Ki=this.Zi(e,sP.Activation),this.Yi=this.Zi(e,sP.Cancellation))}onEvent(e,t){var i,r=this.ne(),s=this.oe(),n=this.ae(),o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[s])||[];if(n===e&&t&&o.length>0){r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var a,l,c=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(c){var u=o.indexOf(c);u>=0&&(o.splice(u,1),this.le(o))}}else{if(this.Yi.has(e)){var h=this.te(e,t,sP.Cancellation);h.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:h.map(e=>e.id)}),h.forEach(e=>{var t=o.indexOf(e.id);t>=0&&o.splice(t,1),this.ue(e.id)}),this.le(o))}if(this.Ki.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Ki.get(e)});var d=this.te(e,t,sP.Activation);this.le(o.concat(d.map(e=>e.id)||[]))}}}onAction(e){var t,i=this.oe(),r=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[i])||[];this.Xi.has(e)&&this.le(r.concat(this.Xi.get(e)||[]))}le(e){var t,i=this.ne(),r=this.oe(),s=[...new Set(e)].filter(e=>!this.he(e));i.info("updating activated items",{activatedItems:s}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[r]:s})}getActivatedIds(){var e,t=this.oe();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Ki}de(){return this.se}}class sj extends sU{constructor(e){super(e)}oe(){return"$surveys_activated"}ae(){return sT.SHOWN}ie(e){var t;null==(t=this._instance)||t.getSurveys(e)}ue(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}ne(){return sO}he(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class sH{constructor(e){this.ve=void 0,this._surveyManager=null,this.ce=!1,this.fe=[],this.pe=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(D(t))return sO.warn("Flags not loaded yet. Not loading surveys.");var i=I(t);this.ve=i?t.length>0:t,sO.info("flags response received, isSurveysEnabled: "+this.ve),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(sF)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.ce)sO.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)sO.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())sO.info("Not loading surveys in cookieless mode without consent.");else{var e=null==_?void 0:_.__PosthogExtensions__;if(e){if(!M(this.ve)||this._instance.config.advanced_enable_surveys){var t=this.ve||this._instance.config.advanced_enable_surveys;this.ce=!0;try{var i=e.generateSurveys;if(i)return void this._e(i,t);var r=e.loadExternalDependency;if(!r)return void this.ge("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.ge("Could not load surveys script",i):this._e(e.generateSurveys,t)})}catch(e){throw this.ge("Error initializing surveys",e),e}finally{this.ce=!1}}}else sO.error("PostHog Extensions not found.")}}_e(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new sj(this._instance),sO.info("Surveys loaded successfully"),this.me({isLoaded:!0})}ge(e,t){sO.error(e,t),this.me({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.fe.push(e),this._surveyManager&&this.me({isLoaded:!0}),()=>{this.fe=this.fe.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return sO.info("Disabled. Not loading surveys."),e([]);var i,r=this._instance.get_property(tB);if(r&&!t)return e(r,{isLoaded:!0});"u">typeof Promise&&this.pe?this.pe.then(t=>{var{surveys:i,context:r}=t;return e(i,r)}):("u">typeof Promise&&(this.pe=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{this.pe=null;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;sO.error(s);var n={isLoaded:!1,error:s};return e([],n),void(null==i||i({surveys:[],context:n}))}var o,a,l=t.json.surveys||[],c=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});c.length>0&&(null==(a=this._surveyEventReceiver)||a.register(c)),null==(o=this._instance.persistence)||o.register({[tB]:l});var u={isLoaded:!0};e(l,u),null==i||i({surveys:l,context:u})}}))}me(e){for(var t of this.fe)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){sO.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!D(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);sO.warn("init was not called")}be(e){var t=null;return this.getSurveys(i=>{var r;t=null!=(r=i.find(t=>t.id===e))?r:null}),t}ye(e){if(D(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.be(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(D(this._surveyManager))return sO.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ye(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return D(this._surveyManager)?(sO.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!=(r=t.find(t=>t.id===e))?r:null;if(s){var n=this.ye(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(D(this._surveyManager))sO.warn("init was not called");else{var s="string"==typeof e?this.be(e):e;if(null!=s&&s.id)if(sM.includes(s.type)){var n=null==l?void 0:l.querySelector(t);if(n)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(sO.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;sO.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,n,i),sO.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,i);sO.warn("Survey element not found")}else sO.warn("Surveys of type "+s.type+" cannot be rendered in the app");else sO.warn("Survey not found")}}displaySurvey(e,t){var i;if(D(this._surveyManager))sO.warn("init was not called");else{var r=this.be(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=m({},r,{appearance:m({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==sI.Popover&&t.initialResponses&&sO.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void sO.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==sI.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else sO.warn("Survey not found")}}cancelPendingSurvey(e){D(this._surveyManager)?sO.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var sq=tl("[Conversations]");class sB{constructor(e){this.we=void 0,this._conversationsManager=null,this.xe=!1,this.$e=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;D(t)||(H(t)?this.we=t:(this.we=t.enabled,this.$e=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.we=void 0,this.$e=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xe&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==_?void 0:_.__PosthogExtensions__;if(e&&!M(this.we)&&this.we)if(this.$e&&this.$e.token){this.xe=!0;try{var t=e.initConversations;if(t)return this.Ee(t),void(this.xe=!1);var i=e.loadExternalDependency;if(!i)return void this.Se("PostHog loadExternalDependency extension not found.");i(this._instance,"conversations",t=>{t||!e.initConversations?this.Se("Could not load conversations script",t):this.Ee(e.initConversations),this.xe=!1})}catch(e){this.Se("Error initializing conversations",e),this.xe=!1}}else sq.error("Conversations enabled but missing token in remote config.")}}Ee(e){if(this.$e)try{this._conversationsManager=e(this.$e,this._instance),sq.info("Conversations loaded successfully")}catch(e){this.Se("Error completing conversations initialization",e)}else sq.error("Cannot complete initialization: remote config is null")}Se(e,t){sq.error(e,t),this._conversationsManager=null,this.xe=!1}show(){this._conversationsManager?this._conversationsManager.show():sq.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.we&&!N(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var r=this;return f(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(sq.warn("Conversations not available yet."),null)})()}getMessages(e,t){var i=this;return f(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(sq.warn("Conversations not available yet."),null)})()}markAsRead(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(sq.warn("Conversations not available yet."),null)})()}getTickets(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(sq.warn("Conversations not available yet."),null)})()}requestRestoreLink(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(sq.warn("Conversations not available yet."),null)})()}restoreFromToken(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(sq.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var e=this;return f(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(sq.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}}class sV{constructor(e){var t;this.ke=!1,this.Pe=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.ke=!0)}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!D(i)&&i&&(this.ke=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.ke&&!this.Pe){var e=tl("[logs]"),t=null==_?void 0:_.__PosthogExtensions__;if(t){var i=t.loadExternalDependency;i?i(this._instance,"logs",i=>{var r;i||null==(r=t.logs)||!r.initializeLogs?e.error("Could not load logs script",i):(t.logs.initializeLogs(this._instance),this.Pe=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var sG=tl("[RateLimiter]");class sW{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{sG.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sG.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,r,{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(tY))?t:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var l=a.tokens<1;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(tY,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var sz=tl("[RemoteConfig]");class sY{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Te(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ie(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return sz.info("Using preloaded remote config",this.remoteConfig),this.Ce(this.remoteConfig),void this.Re();if(this._instance.M())return void sz.warn("Remote config is disabled. Falling back to local config.");this.Te(e=>{e?(this.Ce(e),this.Re()):(sz.info("No config found after loading remote JS config. Falling back to JSON."),this.Ie(e=>{this.Ce(e),this.Re()}))})}catch(e){sz.error("Error loading remote config",e)}}stop(){this.Fe&&(clearInterval(this.Fe),this.Fe=void 0)}refresh(){this._instance.M()||"hidden"===(null==l?void 0:l.visibilityState)||this._instance.featureFlags.reloadFeatureFlags()}Re(){this.Fe||(this.Fe=setInterval(()=>{this.refresh()},3e5))}Ce(e){e||sz.error("Failed to fetch remote config from PostHog."),this._instance.Ce(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}class sX{constructor(e,t){this.Oe=!0,this.Me=[],this.Ae=Y((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,ta.createLogger("flush interval"),3e3),this.je=e}enqueue(e){this.Me.push(e),this.De||this.Le()}unload(){this.Ne();var e=Object.values(this.Me.length>0?this.Ue():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.je(m({},e,{transport:"sendBeacon"}))})}enable(){this.Oe=!1,this.Le()}Le(){var e=this;this.Oe||(this.De=setTimeout(()=>{if(this.Ne(),this.Me.length>0){var t=this.Ue();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&I(r.data)&&tp(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.je(r)}()}},this.Ae))}Ne(){clearTimeout(this.De),this.De=void 0}Ue(){var e={};return tp(this.Me,t=>{var i,r=(t?t.batchKey:null)||t.url;M(e[r])&&(e[r]=m({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.Me=[],e}}var sK=["retriesPerformedSoFar"];class sJ{constructor(e){this.ze=!1,this.He=3e3,this.Me=[],this._instance=e,this.Me=[],this.Be=!0,!M(i)&&"onLine"in i.navigator&&(this.Be=i.navigator.onLine,this.qe=()=>{this.Be=!0,this.Lt()},this.We=()=>{this.Be=!1},tw(i,"online",this.qe),tw(i,"offline",this.We))}get length(){return this.Me.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=y(e,sK);j(t)&&(i.url=r9(i.url,{retry_count:t})),this._instance._send_request(m({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Ge(m({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}Ge(e){var t,i,r,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var n=(r=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,s)))-t/2),Math.ceil(i+r)),o=Date.now()+n;this.Me.push({retryAt:o,requestOptions:e});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),ta.warn(a),this.ze||(this.ze=!0,this.Ve())}Ve(){(this.Je&&clearTimeout(this.Je),0===this.Me.length)?(this.ze=!1,this.Je=void 0):this.Je=setTimeout(()=>{this.Be&&this.Me.length>0&&this.Lt(),this.Ve()},this.He)}Lt(){var e=Date.now(),t=[],i=this.Me.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.Me=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Je&&(clearTimeout(this.Je),this.Je=void 0),this.ze=!1,M(i)||(this.qe&&(i.removeEventListener("online",this.qe),this.qe=void 0),this.We&&(i.removeEventListener("offline",this.We),this.We=void 0)),this.Me))try{this._instance._send_request(m({},e,{transport:"sendBeacon"}))}catch(e){ta.error(e)}this.Me=[]}}class sZ{constructor(e){this.Ke=()=>{this.Ye||(this.Ye={});var e,t,i,r,s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.Ye.lastScrollY=Math.ceil(n),this.Ye.maxScrollY=Math.max(n,null!=(e=this.Ye.maxScrollY)?e:0),this.Ye.maxScrollHeight=Math.max(o,null!=(t=this.Ye.maxScrollHeight)?t:0),this.Ye.lastContentY=a,this.Ye.maxContentY=Math.max(a,null!=(i=this.Ye.maxContentY)?i:0),this.Ye.maxContentHeight=Math.max(l,null!=(r=this.Ye.maxContentHeight)?r:0)},this._instance=e}getContext(){return this.Ye}resetContext(){var e=this.Ye;return setTimeout(this.Ke,0),e}startMeasuringScrollPosition(){tw(i,"scroll",this.Ke,{capture:!0}),tw(i,"scrollend",this.Ke,{capture:!0}),tw(i,"resize",this.Ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==i?void 0:i.document.documentElement;for(var e of I(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var t=null==i?void 0:i.document.querySelector(e);if(t)return t}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return i&&(i.scrollY||i.pageYOffset||i.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return i&&(i.scrollX||i.pageXOffset||i.document.documentElement.scrollLeft)||0}}var sQ=e=>rm(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class s0{constructor(e,t,i,r){this.Xe=e=>{var t=this.Qe();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ze(this._instance)};this.tr.register({[tz]:i})}},this._instance=e,this.ir=t,this.tr=i,this.Ze=r||sQ,this.ir.onSessionId(this.Xe)}Qe(){return this.tr.props[tz]}getSetOnceProps(){var e,t=null==(e=this.Qe())?void 0:e.props;return t?"r"in t?ry(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return tp(ty(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+S(i)]=t}),e}}var s1=tl("[SessionId]");class s2{on(e,t){return this.er.on(e,t)}constructor(e,t,i){if(this.rr=[],this.sr=void 0,this.er=new sL,this.nr=(e,t)=>!(!j(e)||!j(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.R=e.config,this.tr=e.persistence,this.ar=void 0,this.lr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ur=t||iU,this.hr=i||iU;var r,s=this.R.persistence_name||this.R.token,n=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Y(n,60,36e3,s1.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.dr(),this.vr="ph_"+s+"_window_id",this.cr="ph_"+s+"_primary_window_exists",this.pr()){var o=iK.W(this.vr),a=iK.W(this.cr);o&&!a?this.ar=o:iK.V(this.vr),iK.G(this.cr,!0)}if(null!=(r=this.R.bootstrap)&&r.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.R.bootstrap.sessionID);this._r(this.R.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){s1.error("Invalid sessionID in bootstrap",e)}this.gr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return M(this.rr)&&(this.rr=[]),this.rr.push(e),this.lr&&e(this.lr,this.ar),()=>{this.rr=this.rr.filter(t=>t!==e)}}pr(){return"memory"!==this.R.persistence&&!this.tr.ki&&iK.H()}mr(e){e!==this.ar&&(this.ar=e,this.pr()&&iK.G(this.vr,e))}br(){return this.ar?this.ar:this.pr()?iK.W(this.vr):null}_r(e,t,i){e===this.lr&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.lr=e,this.tr.register({[tL]:[t,e,i]}))}yr(){var e=this.tr.props[tL];return I(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._r(null,null,null)}destroy(){clearTimeout(this.wr),this.wr=void 0,this.sr&&i&&(i.removeEventListener("beforeunload",this.sr,{capture:!1}),this.sr=void 0),this.rr=[]}gr(){this.sr=()=>{this.pr()&&iK.V(this.cr)},tw(i,"beforeunload",this.sr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.R.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[r,s,n]=this.yr(),o=this.br(),a=j(n)&&Math.abs(i-n)>864e5,l=!1,c=!s,u=!c&&!e&&this.nr(i,r);c||u||a?(s=this.ur(),o=this.hr(),s1.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.hr(),l=!0);var h=j(r)&&e&&!a?r:i,d=j(n)?n:(new Date).getTime();return this.mr(o),this._r(s,h,d),e||this.dr(),l&&this.rr.forEach(e=>e(s,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:s,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}dr(){clearTimeout(this.wr),this.wr=setTimeout(()=>{var[e]=this.yr();if(this.nr((new Date).getTime(),e)){var t=this.lr;this.resetSessionId(),this.er.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var s3=["$set_once","$set"],s5=tl("[SiteApps]");class s8{constructor(e){this._instance=e,this.$r=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Er(e,t){if(t){var i=this.globalsForEvent(t);this.$r.push(i),this.$r.length>1e3&&(this.$r=this.$r.slice(10))}}get siteAppLoaders(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Er.bind(this));this.Sr=()=>{e(),this.$r=[],this.Sr=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,r,s,n,o,a,l={},c=this._instance.get_property("$groups")||[];for(var[u,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:h};var{$set_once:d,$set:p}=e;return{event:m({},y(e,s3),{properties:m({},e.properties,p?{$set:m({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:m({},null!=(r=null==(s=e.properties)?void 0:s.$set_once)?r:{},d)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.$r.length&&(s5.info("Processing "+this.$r.length+" events for site app with id "+e.id),this.$r.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Sr)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,s5.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{s(e)}});n&&(t.processEvent=n),r=!0}catch(t){s5.error("Error while initializing PostHog app with config id "+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){s5.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}kr(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Pr(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){s5.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.kr(),void this._instance.on("eventCaptured",e=>this.Pr(e))):void s5.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Sr)||i.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var n=function(e){var t;_["__$$ph_site_app_"+e]=s._instance,null==(t=_.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,a,t=>{if(t)return s5.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else s5.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var s6=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&w(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>w(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},s4=((nM={}).US="us",nM.EU="eu",nM.CUSTOM="custom",nM),s7="i.posthog.com";class s9{constructor(e){this.Tr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+s7,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Tr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Tr[this.apiHost]=s4.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Tr[this.apiHost]=s4.EU:this.Tr[this.apiHost]=s4.CUSTOM),this.Tr[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===s4.CUSTOM)return this.apiHost+t;var i=s7+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var ne={icontains:(e,t)=>!!i&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!i&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!i&&sr(t.href,e),not_regex:(e,t)=>!!i&&!sr(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class nt{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{nt.Ir("retrieved web experiments from the server"),t.Cr=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Cr&&(nt.Ir("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Cr)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);A(r)&&e.variants[r]&&t.Rr(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];nt.Fr(n)&&t.Rr(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())nt.Ir("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(D(this.Cr))return this.Cr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nt.Ir("applying feature flags",e),e.forEach(e=>{var t;if(this.Cr&&null!=(t=this.Cr)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.Cr)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.Rr(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=nt.getWindowLocation();if(null!=e&&e.search){var t=iP(null==e?void 0:e.search,"__experiment_id"),i=iP(null==e?void 0:e.search,"__experiment_variant");t&&i&&(nt.Ir("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Or(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}Or(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(nt.Ir("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Rr(r[0].name,t,r[0].variants[t].transforms))}static Fr(e){return!D(e.conditions)&&nt.Mr(e)&&nt.Ar(e)}static Mr(e){if(D(e.conditions)||D(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,r,s,n=nt.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||ne[null!=(r=null==(s=e.conditions)?void 0:s.urlMatchType)?r:"icontains"](e.conditions.url,n))}static getWindowLocation(){return null==i?void 0:i.location}static Ar(e){if(D(e.conditions)||D(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rp();if(t.utm_source){var i,r,s,n,o,a,l,c,u,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,_=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==t.utm_term;return h&&p&&_&&d}return!1}static Ir(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];ta.info("[WebExperiments] "+e,i)}Rr(e,t,i){this._is_bot()?nt.Ir("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){nt.Ir("applying transform of variant "+t+" for experiment "+e+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):nt.Ir("Control variants leave the page unmodified.")}_is_bot(){return a&&this._instance?s6(a,this._instance.config.custom_blocked_useragents):void 0}}var ni=tl("[PostHog ExternalIntegrations]"),nr={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ns{constructor(e){this._instance=e}it(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return ni.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,r,n;!s||null!=(i=_.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.it(nr[e],()=>{var i;null==(i=_.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!s&&null!=(r=_.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]&&(null==(n=_.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[r,s]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(r)}}tl("[SessionRecording]");var nn="[SessionRecording]",no=tl(nn);class na{get started(){var e;return!(null==(e=this.jr)||!e.isStarted)}get status(){return this.jr?this.jr.status:this.Dr&&!this.Lr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Dr=!1,this.Nr=!1,this.Ur=void 0,this._instance=e,!this._instance.sessionManager)throw no.error("started without valid sessionManager"),Error(nn+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw Error(nn+' cannot be used with cookieless_mode="always"')}get Lr(){var e,t=!(null==(e=this._instance.get_property(tA))||!e.enabled),r=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return i&&t&&r&&!s}startIfEnabledOrStop(e){var t;if(!this.Lr||null==(t=this.jr)||!t.isStarted){var i=!M(Object.assign)&&!M(Array.from);this.Lr&&i?(this.zr(e),no.info("starting")):this.stopRecording()}}zr(e){var t,i,r;this.Lr&&(null!=_&&null!=(t=_.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=_.__PosthogExtensions__)&&i.initSessionRecording?this.Hr(e):null==(r=_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Br,t=>{if(t)return no.error("could not load recorder",t);this.Hr(e)}))}stopRecording(){var e,t;null==(e=this.Ur)||e.call(this),this.Ur=void 0,null==(t=this.jr)||t.stop()}qr(){var e;null==(e=this._instance.persistence)||e.unregister(tN)}Wr(e){if(this._instance.persistence){var t,i,r=this._instance.persistence,s=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,s=D(i)?null:parseFloat(i);D(s)&&this.qr();var n=null==t?void 0:t.minimumDurationMilliseconds;r.register({[tA]:m({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:m({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:s,minimumDurationMilliseconds:M(n)?null:n,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};s(),null==(t=this.Ur)||t.call(this),this.Ur=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.Nr=!1,this.Wr(e),this.Dr=!0,this.startIfEnabledOrStop()):this.Dr=!0:no.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.jr)&&i.log?this.jr.log(e,t):no.warn("log called before recorder was ready")}get Br(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(tA);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Gr(){var e,t=this._instance.get_property(tA);if(!t)return!1;var i=null!=(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)?e:Date.now();return Date.now()-i<=3e5}Hr(e){var t,i;if(null==(t=_.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.jr||(this.jr=null==(i=_.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.jr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Gr()?this.jr.start(e):this.Nr||(this.Nr=!0,no.info("persisted remote config is stale, requesting fresh config before starting"),new sY(this._instance).load())}onRRwebEmit(e){var t;null==(t=this.jr)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.jr||null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}),null==(e=this.jr)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.jr||null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}),null==(e=this.jr)||e.overrideSampling()}overrideTrigger(e){var t,i;this.jr||null==(i=this._instance.persistence)||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(t=this.jr)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.jr)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.jr)||!i.tryAddCustomEvent(e,t))}}var nl={},nc=0,nu=()=>{},nh="posthog",nd=!r4&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),np=e=>{var t;return m({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!A(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of tb)if(i===r)return!1;return!0}(null==l?void 0:l.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nu,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:c&&A(null==c?void 0:c.search)&&-1!==c.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==i||null==(t=i.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;ta.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nu,__preview_eager_load_replay:!1},{rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0})},n_=e=>{var t={};M(e.process_person)||(t.person_profiles=e.process_person),M(e.xhr_headers)||(t.request_headers=e.xhr_headers),M(e.cookie_name)||(t.persistence_name=e.cookie_name),M(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),M(e.store_google)||(t.save_campaign_params=e.store_google),M(e.verbose)||(t.debug=e.verbose);var i=t_({},t,e);return I(e.property_blacklist)&&(M(e.property_denylist)?i.property_denylist=e.property_blacklist:I(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:ta.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class ng{constructor(){this.__forceAllowLocalhost=!1}get Vr(){return this.__forceAllowLocalhost}set Vr(e){ta.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nv{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new ng,this.Jr=!1,this.version=g.LIB_VERSION,this.mi=new sL,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=np(),this.SentryIntegration=re,this.sentryIntegration=e=>{var t;return t=i9(this,e),{name:i7,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Kr=!1,this.Yr=null,this.Xr=null,this.Qr=null,this.featureFlags=new sb(this),this.toolbar=new rn(this),this.scrollManager=new sZ(this),this.pageViewManager=new rP(this),this.surveys=new sH(this),this.conversations=new sB(this),this.logs=new sV(this),this.experiments=new nt(this),this.exceptions=new sc(this),this.rateLimiter=new sW(this),this.requestRouter=new s9(this),this.consent=new iZ(this),this.externalIntegrations=new ns(this),this.people={set:(e,t,i)=>{var r=A(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=A(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>ta.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==nh){var r,s=null!=(r=nl[i])?r:new nv;return s._init(e,t,i),nl[i]=s,nl[nh][i]=s,s}return this._init(e,t,i)}_init(e,t,r){if(void 0===t&&(t={}),M(e)||L(e))return ta.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Zr(t.debug),this.ts=t,this.es=[],t.person_profiles?this.Xr=t.person_profiles:t.process_person&&(this.Xr=t.process_person),this.set_config(t_({},np(t.defaults),n_(t),{name:r,token:e})),this.config.on_xhr_error&&ta.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rR.GZipJS;var s=this.rs();this.persistence=new sw(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sw(m({},this.config,{persistence:"sessionStorage"}),s);var n=m({},this.persistence.props),o=m({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.ss=new sX(e=>this.ns(e),this.config.request_queue_config),this.os=new sJ(this),this.__request_queue=[];var a="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(a||(this.sessionManager=new s2(this),this.sessionPropsManager=new s0(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ta.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.ls(a)},0)):(ta.info("Initializing extensions synchronously"),this.ls(a)),g.DEBUG=g.DEBUG||this.config.debug,g.DEBUG&&ta.info("Starting in debug mode",{this:this,config:t,thisC:m({},this.config),p:n,s:o}),void 0!==(null==(l=t.bootstrap)?void 0:l.distinctID)){var l,c,u,h=this.config.get_device_id(iU()),d=null!=(c=t.bootstrap)&&c.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(tW,null!=(u=t.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.us()){var p,_,v=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])}).reduce((e,i)=>{var r;return e[i]=(null==(r=t.bootstrap)||null==(r=r.featureFlags)?void 0:r[i])||!1,e},{}),f=Object.keys((null==(_=t.bootstrap)?void 0:_.featureFlagPayloads)||{}).filter(e=>v[e]).reduce((e,i)=>{var r,s;return null!=(r=t.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[i]&&(e[i]=null==(s=t.bootstrap)||null==(s=s.featureFlagPayloads)?void 0:s[i]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:f})}if(a)this.register_once({distinct_id:t0,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(iU());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(tW,"anonymous")}return tw(i,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||iU();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(tW,"identified")),t()},s=i.user();"then"in s&&O(s.then)?s.then(r):r(s)}(e,()=>{var r;i.register((Promise&&Promise.resolve||i4.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(i4.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(i4.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,"$pageview"),identify:e=>r(e,"$identify"),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.hs()):this.hs(),O(this.config._onCapture)&&this.config._onCapture!==nu&&(ta.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&ta.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}ls(e){var t=performance.now();this.historyAutocapture=new i6(this),this.historyAutocapture.startIfEnabled();var i=[];i.push(()=>{new ra(this).startIfEnabledOrStop()}),i.push(()=>{var e;this.siteApps=new s8(this),null==(e=this.siteApps)||e.init()}),e||i.push(()=>{this.sessionRecording=new na(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||i.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),i.push(()=>{this.autocapture=new iF(this),this.autocapture.startIfEnabled()}),i.push(()=>{this.surveys.loadIfEnabled()}),i.push(()=>{this.logs.loadIfEnabled()}),i.push(()=>{this.conversations.loadIfEnabled()}),i.push(()=>{this.productTours=new sS(this),this.productTours.loadIfEnabled()}),i.push(()=>{this.heatmaps=new rS(this),this.heatmaps.startIfEnabled()}),i.push(()=>{this.webVitalsAutocapture=new rw(this)}),i.push(()=>{this.exceptionObserver=new i5(this),this.exceptionObserver.startIfEnabledOrStop()}),i.push(()=>{this.deadClicksAutocapture=new i2(this,i1),this.deadClicksAutocapture.startIfEnabledOrStop()}),i.push(()=>{if(this.ds){var e=this.ds;this.ds=void 0,this.Ce(e)}}),this.vs(i,t)}vs(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.vs(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){ta.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&ta.info("PostHog extensions initialized ("+r+"ms)")}Ce(e){var t,i,r,s,n,o,a,c,u;l&&l.body?(this.config.__preview_deferred_init_extensions&&(this.ds=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=x(e.supportedCompression,rR.GZipJS)?rR.GZipJS:x(e.supportedCompression,rR.Base64)?rR.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Xr?this.Xr:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(s=this.autocapture)||s.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(o=this.productTours)||o.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(c=this.exceptionObserver)||c.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)):(ta.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.Ce(e)},500))}hs(){try{this.config.loaded(this)}catch(e){ta.critical("`loaded` function failed",e)}if(this.cs(),this.config.internal_or_test_user_hostname&&null!=c&&c.hostname){var e=c.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.fs()},1),this.ps=new sY(this),this.ps.load()}cs(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.ss)||e.enable())}_dom_loaded(){this.is_capturing()&&td(this.__request_queue,e=>this.ns(e)),this.__request_queue=[],this.cs()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this._s()&&this.capture("$pageleave"),null==(e=this.ss)||e.unload(),null==(t=this.os)||t.unload()):this._s()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(nd?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=r9(e.url,{ip:+!!this.config.ip}),e.headers=m({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,s=m({},e);s.timeout=s.timeout||6e4,s.url=r9(s.url,{_:(new Date).getTime().toString(),ver:g.LIB_VERSION,compression:s.compression});var n=null!=(t=s.transport)?t:"fetch",o=si.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),a=null!=(i=null==(r=tE(o,e=>e.transport===n))?void 0:r.method)?i:o[0].method;if(!a)throw Error("No available transport method");a(s)})(m({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(r=this.config).on_request_error)||i.call(r,t)),null==e.callback||e.callback(t)}}))))}ns(e){this.os?this.os.retriableRequest(e):this._send_request(e)}_execute_array(e){nc++;try{var t,i=[],r=[],s=[];td(e,e=>{e&&(t=e[0],I(t)?s.push(e):O(e)?e.call(this):I(e)&&"alias"===t?i.push(e):I(e)&&-1!==t.indexOf("capture")&&O(this[t])?s.push(e):r.push(e))});var n=function(e,t){td(e,function(e){if(I(e[0])){var i=t;tp(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(r,this),n(s,this)}finally{nc--}}us(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){if(nc>0&&I(e)&&A(e[0])){var t=nv.prototype[e[0]];O(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.ss){if(this.is_capturing())if(!M(e)&&A(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var n=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){null!=t&&t.$current_url&&!A(null==t?void 0:t.$current_url)&&(ta.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.oi||ta.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 o=new Date,a=(null==i?void 0:i.timestamp)||o,l=iU(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},a,l)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&s&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),n&&(c.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var u,h="$groupidentify"!==e,d=this.gs(null==i?void 0:i.$set_once,h);if(d&&(c.$set_once=d),(p=c,_=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,g=e=>A(e)&&!N(_)?e.slice(0,_):e,v=new Set,c=function e(t,i){var r;return t!==Object(t)?g?g(t,i):t:v.has(t)?void 0:(v.add(t),I(t)?(r=[],td(t,t=>{r.push(e(t))})):(r={},tp(t,(t,i)=>{v.has(t)||(r[i]=e(t,i))})),r)}(p)).timestamp=a,M(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=o),e===sT.DISMISSED||e===sT.SENT){var p,_,g,v,f,y,b,E=null==t?void 0:t[s$.SURVEY_ID],w=null==t?void 0:t[s$.SURVEY_ITERATION];u={id:E,current_iteration:w},localStorage.getItem(sC(u))||localStorage.setItem(sC(u),"true"),c.$set=m({},c.$set,{[(f={id:E,current_iteration:w},b="$survey_"+(y=e===sT.SENT?"responded":"dismissed")+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(b="$survey_"+y+"/"+f.id+"/"+f.current_iteration),b)]:!0})}else e===sT.SHOWN&&(c.$set=m({},c.$set,{[s$.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var x=m({},c.properties.$set,c.$set);if(C(x)||this.setPersonPropertiesForFlags(x),!D(this.config.before_send)){var k=this.bs(c);if(!k)return;c=k}this.mi.emit("eventCaptured",c);var S={method:"POST",url:null!=(r=null==i?void 0:i._url)?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.ns(S):this.ss.enqueue(S),c}ta.critical("This capture call is ignored due to client rate limiting.")}}else ta.error("No event name provided to posthog.capture")}else ta.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,r,s,n){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var o,a=n?void 0:this.persistence.remove_event_timer(e),u=m({},t);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(u.$cookieless_mode=!0),"$snapshot"===e){var h=m({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=h.distinct_id,(!A(u.distinct_id)&&!U(u.distinct_id)||L(u.distinct_id))&&ta.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,_=function(e,t){if(!p)return{};var r,s,n=e?tg([],rc,t||[]):[],[o,a]=function(e){for(var t=0;t<eG.length;t++){var[i,r]=eG[t],s=i.exec(e),n=s&&(O(r)?r(s,e):r);if(n)return n}return["",""]}(p);return t_(ty({$os:o,$os_version:a,$browser:eq(p,navigator.vendor),$device:eW(p),$device_type:(s=eW(p))===er||s===ei||"Kobo"===s||"Kindle Fire"===s||s===eC?et:s===ew||s===ek||s===ex||s===eI?"Console":s===en?"Wearable":s?Q:"Desktop",$timezone:rb(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:iR(null==c?void 0:c.href,n,rh),$host:null==c?void 0:c.host,$pathname:null==c?void 0:c.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:eV(p,navigator.vendor),$browser_language:rv(),$browser_language_prefix:"string"==typeof(r=rv())?r.split("-")[0]:void 0,$screen_height:null==i?void 0:i.screen.height,$screen_width:null==i?void 0:i.screen.width,$viewport_height:null==i?void 0:i.innerHeight,$viewport_width:null==i?void 0:i.innerWidth,$lib:"web",$lib_version:g.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:v,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,r.getTime());u.$session_id=v,u.$window_id=f}this.sessionPropsManager&&t_(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&t_(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(o=this.os)?void 0:o.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===s4.CUSTOM&&(u.$lib_custom_api_host=this.config.api_host),d="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=t_(u,d),"$pageview"===e&&l&&(u.title=l.title),!M(a)){var y=r.getTime()-a;u.$duration=parseFloat((y/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=t_({},_,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),I(this.config.property_denylist)?tp(this.config.property_denylist,function(e){delete u[e]}):ta.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(ta.error("sanitize_properties is deprecated. Use before_send instead"),u=b(u,e));var E=this.ys();return u.$process_person_profile=E,E&&!n&&this.ws("_calculate_event_properties"),u}gs(e,t){if(void 0===t&&(t=!0),!this.persistence||!this.ys()||this.Jr)return e;var i,r=t_({},this.persistence.get_initial_props(),(null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(ta.error("sanitize_properties is deprecated. Use before_send instead"),r=s(r,"$set_once")),t&&(this.Jr=!0),C(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}xs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var r=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},n=m({},r,e),o=m({},s,t),a={};for(var[l,c]of Object.entries(n)){var u="string"==typeof c;a[l]={key:l,enabled:!!u||!!c,variant:u?c:void 0,reason:void 0,metadata:M(null==o?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.featureFlags.receivedFeatureFlags({flags:a})}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.mi.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=sA),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ta.uninitializedWarning("posthog.identify");if(U(e)&&(e=e.toString(),ta.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))ta.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==t0){if(this.ws("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(tk)&&(this.unregister(tk),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(tW)||"anonymous");e!==r&&s?(this.persistence.set_property(tW,"identified"),this.setPersonPropertiesForFlags(m({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.Qr=ss(e,t,i),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(tV))}}else ta.critical('The string "'+t0+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ta.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.ws("posthog.setPersonProperties")){var i=ss(this.get_distinct_id(),e,t);this.Qr!==i?(this.setPersonPropertiesForFlags(m({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Qr=i):ta.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:m({},r,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===t||i||this.reloadFeatureFlags()}else ta.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.ws("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(ta.info("reset"),!this.__loaded)return ta.uninitializedWarning("posthog.reset");var t,i,r,s,n,o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),null==(r=this.ps)||r.stop(),this.featureFlags.reset(),null==(s=this.persistence)||s.set_property(tW,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Qr=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:t0,$device_id:null},"");else{var a=this.config.get_device_id(iU());this.register_once({distinct_id:a,$device_id:e?a:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var s,n=null!=(s=e.timestampLookBack)?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(e,t){return e===this.get_property(tx)?(ta.critical("Attempting to create alias for existing People user - aborting."),-2):this.ws("posthog.alias")?(M(t)&&(t=this.get_distinct_id()),e!==t?(this.xs(tk,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ta.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=m({},this.config);if(F(e)){t_(this.config,n_(e));var i,r,s,n,o,a,l,c,u=this.rs();null==(i=this.persistence)||i.update_config(this.config,t,u),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sw(m({},this.config,{persistence:"sessionStorage"}),u);var h=this.Zr(this.config.debug);H(h)&&(this.config.debug=h),H(this.config.debug)&&(this.config.debug?(g.DEBUG=!0,iG.H()&&iG.G("ph_debug","true"),ta.info("set_config",{config:e,oldConfig:t,newConfig:m({},this.config)})):(g.DEBUG=!1,iG.H()&&iG.V("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(n=this.autocapture)||n.startIfEnabled(),null==(o=this.heatmaps)||o.startIfEnabled(),null==(a=this.exceptionObserver)||a.startIfEnabledOrStop(),null==(l=this.deadClicksAutocapture)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.$s(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,r,s,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(m({},r,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:nh;return t!==nh&&(t=nh+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(tW))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(tW))}ys(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&C(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tk])&&(null==(t=this.persistence)||null==(t=t.props)||!t[tZ]))}_s(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.ys()||this.ws("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ws("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ws(e){return"never"===this.config.person_profiles?(ta.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.xs(tZ,!0),!0)}rs(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}$s(){var e,t,i,r,s=this.rs();return(null==(e=this.persistence)?void 0:e.ki)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.ki)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t,i,r,s;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new s2(this),this.pageViewManager=new rP(this),this.persistence&&(this.sessionPropsManager=new s0(this,this.sessionManager,this.persistence)),this.sessionRecording=new na(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.$s(),this.cs(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(M(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.fs()):ta.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.$s(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:t0,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.fs())):ta.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===iJ.GRANTED?"granted":e===iJ.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.$s()}_is_bot(){return a?s6(a,this.config.custom_blocked_useragents):void 0}fs(){l&&("visible"===l.visibilityState?this.Kr||(this.Kr=!0,this.capture("$pageview",{title:l.title},{send_instantly:!0}),this.Yr&&(l.removeEventListener("visibilitychange",this.Yr),this.Yr=null)):this.Yr||(this.Yr=this.fs.bind(this),tw(l,"visibilitychange",this.Yr)))}debug(e){!1===e?(null==i||i.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==i||i.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}M(){var e,t,i,r,s=this.ts||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ta.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in s&&!D(s[e]),r=t in s&&!D(s[t]),i?s[e]:!!r&&(ta&&ta.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}bs(e){if(D(this.config.before_send))return e;var t=I(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(D(i=r(i))){var s="Event '"+e.event+"' was rejected in beforeSend function";return q(e.event)?ta.warn(s+". This can cause unexpected behavior."):ta.info(s),null}i.properties&&!C(i.properties)||ta.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.Kt)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Zr(e){var t=H(e)&&!e,i=iG.H()&&"true"===iG.q("ph_debug");return!t&&(!!i||e)}}for(var nf=["identify"],nm=0;nm<nf.length;nm++)nv.prototype[nf[nm]]=tm(nv.prototype[nf[nm]]);(nA={}).SHOWN="product tour shown",nA.DISMISSED="product tour dismissed",nA.COMPLETED="product tour completed",nA.STEP_SHOWN="product tour step shown",nA.STEP_COMPLETED="product tour step completed",nA.BUTTON_CLICKED="product tour button clicked",nA.STEP_SELECTOR_FAILED="product tour step selector failed",nA.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",nA.BANNER_ACTION_CLICKED="product tour banner action clicked",(nL={}).TOUR_ID="$product_tour_id",nL.TOUR_NAME="$product_tour_name",nL.TOUR_ITERATION="$product_tour_iteration",nL.TOUR_RENDER_REASON="$product_tour_render_reason",nL.TOUR_STEP_ID="$product_tour_step_id",nL.TOUR_STEP_ORDER="$product_tour_step_order",nL.TOUR_STEP_TYPE="$product_tour_step_type",nL.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",nL.TOUR_BUTTON_TEXT="$product_tour_button_text",nL.TOUR_BUTTON_ACTION="$product_tour_button_action",nL.TOUR_BUTTON_LINK="$product_tour_button_link",nL.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",nL.TOUR_STEPS_COUNT="$product_tour_steps_count",nL.TOUR_STEP_SELECTOR="$product_tour_step_selector",nL.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",nL.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",nL.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",nL.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",nL.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",nL.TOUR_ERROR="$product_tour_error",nL.TOUR_MATCHES_COUNT="$product_tour_matches_count",nL.TOUR_FAILURE_PHASE="$product_tour_failure_phase",nL.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",nL.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",nL.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",nL.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",nL.USE_MANUAL_SELECTOR="$use_manual_selector",nL.INFERENCE_DATA_PRESENT="$inference_data_present";var ny,nb,nE,nw,nx,nk,nS,nP,nR,nT,n$,nI,nO,nF,nC,nM,nA,nL,nN,nD=(nN=nl[nh]=new nv,function(){function e(){e.done||(e.done=!0,nd=!1,tp(nl,function(e){e._dom_loaded()}))}null!=l&&l.addEventListener?"complete"===l.readyState?e():tw(l,"DOMContentLoaded",e,{capture:!1}):i&&ta.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),nN);let nU=t.default.env.NEXT_PUBLIC_POSTHOG_KEY||"",nj=t.default.env.NEXT_PUBLIC_POSTHOG_HOST||"https://us.i.posthog.com",nH=!1,nq=!1;function nB(e,t){!nH&&nU&&(nq=t,nD.init(nU,{api_host:nj,autocapture:!1,capture_pageview:!1,capture_pageleave:!1,persistence:"memory",disable_session_recording:!0,bootstrap:{distinctID:e},sanitize_properties:e=>(e.$current_url&&(e.$current_url=e.$current_url.replace(/https?:\/\/127\.0\.0\.1:\d+/,"")),e.$pathname&&(e.$pathname=e.$pathname.replace(/https?:\/\/127\.0\.0\.1:\d+/,"")),e)}),nD.identify(e),t&&nD.opt_out_capturing(),nH=!0)}function nV(e,t){nH&&!nq&&nD.capture(e,t)}function nG(e){nH&&!nq&&nD.capture("$pageview",{page:e})}function nW(e){nq=e,nH&&(e?nD.opt_out_capturing():nD.opt_in_capturing())}e.s(["initTelemetry",()=>nB,"setOptOut",()=>nW,"track",()=>nV,"trackPageView",()=>nG],9593)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9593,e=>{"use strict";var t=e.i(47167),i="u">typeof window?window:void 0,r="u">typeof globalThis?globalThis:i;"u"<typeof self&&(r.self=r),"u"<typeof File&&(r.File=function(){});var s=Array.prototype,n=s.forEach,o=s.indexOf,a=null==r?void 0:r.navigator,l=null==r?void 0:r.document,c=null==r?void 0:r.location,u=null==r?void 0:r.fetch,h=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,d=null==r?void 0:r.AbortController,p=null==a?void 0:a.userAgent,_=null!=i?i:{},g={DEBUG:!1,LIB_VERSION:"1.352.0"};function v(e,t,i,r,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(r,s)}function f(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function o(e){v(n,r,s,o,a,"next",e)}function a(e){v(n,r,s,o,a,"throw",e)}o(void 0)})}}function m(){return(m=Object.assign.bind()).apply(null,arguments)}function y(e,t){if(null==e)return{};var i={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var b=["$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"],E=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],w=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return E.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function x(e,t){return -1!==e.indexOf(t)}var k=function(e){return e.trim()},S=function(e){return e.replace(/^\$/,"")},P=Array.isArray,R=Object.prototype,T=R.hasOwnProperty,$=R.toString,I=P||function(e){return"[object Array]"===$.call(e)},O=e=>"function"==typeof e,F=e=>e===Object(e)&&!I(e),C=e=>{if(F(e)){for(var t in e)if(T.call(e,t))return!1;return!0}return!1},M=e=>void 0===e,A=e=>"[object String]"==$.call(e),L=e=>A(e)&&0===e.trim().length,N=e=>null===e,D=e=>M(e)||N(e),U=e=>"[object Number]"==$.call(e)&&e==e,j=e=>U(e)&&e>0,H=e=>"[object Boolean]"===$.call(e),q=e=>x(b,e);function B(e){return null===e||"object"!=typeof e}function V(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function W(e){return!M(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var G=[!0,"true",1,"1","yes"],z=[!1,"false",0,"0","no"];function Y(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),U(e)?e>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):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: "+i+", fallback: "+s),Y(s||i,t,i,r))}class X{constructor(e){this.t={},this.i=e.i,this.o=Y(e.bucketSize,0,100,e.h),this.m=Y(e.refillRate,0,this.o,e.h),this.$=Y(e.refillInterval,0,864e5,e.h)}S(e,t){var i=Math.floor((t-e.lastAccess)/this.$);if(i>0){var r=i*this.m;e.tokens=Math.min(e.tokens+r,this.o),e.lastAccess=e.lastAccess+i*this.$}}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.t[r];return s?this.S(s,i):(s={tokens:this.o,lastAccess:i},this.t[r]=s),0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.i)||t.call(this,e)),0===s.tokens)}stop(){this.t={}}}var K,J,Z,Q="Mobile",ee="Android",et="Tablet",ei=ee+" "+et,er="iPad",es="Apple",en=es+" Watch",eo="Safari",ea="BlackBerry",el="Samsung",ec=el+"Browser",eu=el+" Internet",eh="Chrome",ed=eh+" OS",ep=eh+" iOS",e_="Internet Explorer",eg=e_+" "+Q,ev="Opera",ef=ev+" Mini",em="Edge",ey="Microsoft "+em,eb="Firefox",eE=eb+" iOS",ew="Nintendo",ex="PlayStation",ek="Xbox",eS=ee+" "+Q,eP=Q+" "+eo,eR="Windows",eT=eR+" Phone",e$="Nokia",eI="Ouya",eO="Generic",eF=eO+" "+Q.toLowerCase(),eC=eO+" "+et.toLowerCase(),eM="Konqueror",eA="(\\d+(\\.\\d+)?)",eL=RegExp("Version/"+eA),eN=RegExp(ek,"i"),eD=RegExp(ex+" \\w+","i"),eU=RegExp(ew+" \\w+","i"),ej=RegExp(ea+"|PlayBook|BB10","i"),eH={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},eq=function(e,t){var i;return t=t||"",x(e," OPR/")&&x(e,"Mini")?ef:x(e," OPR/")?ev:ej.test(e)?ea:x(e,"IE"+Q)||x(e,"WPDesktop")?eg:x(e,ec)?eu:x(e,em)||x(e,"Edg/")?ey:x(e,"FBIOS")?"Facebook "+Q:x(e,"UCWEB")||x(e,"UCBrowser")?"UC Browser":x(e,"CriOS")?ep:x(e,"CrMo")||x(e,eh)?eh:x(e,ee)&&x(e,eo)?eS:x(e,"FxiOS")?eE:x(e.toLowerCase(),eM.toLowerCase())?eM:(i=t)&&x(i,es)||x(e,eo)&&!x(e,eh)&&!x(e,ee)?x(e,Q)?eP:eo:x(e,eb)?eb:x(e,"MSIE")||x(e,"Trident/")?e_:x(e,"Gecko")?eb:""},eB={[eg]:[RegExp("rv:"+eA)],[ey]:[RegExp(em+"?\\/"+eA)],[eh]:[RegExp("("+eh+"|CrMo)\\/"+eA)],[ep]:[RegExp("CriOS\\/"+eA)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+eA)],[eo]:[eL],[eP]:[eL],[ev]:[RegExp("(Opera|OPR)\\/"+eA)],[eb]:[RegExp(eb+"\\/"+eA)],[eE]:[RegExp("FxiOS\\/"+eA)],[eM]:[RegExp("Konqueror[:/]?"+eA,"i")],[ea]:[RegExp(ea+" "+eA),eL],[eS]:[RegExp("android\\s"+eA,"i")],[eu]:[RegExp(ec+"\\/"+eA)],[e_]:[RegExp("(rv:|MSIE )"+eA)],Mozilla:[RegExp("rv:"+eA)]},eV=function(e,t){var i=eB[eq(e,t)];if(M(i))return null;for(var r=0;r<i.length;r++){var s=i[r],n=e.match(s);if(n)return parseFloat(n[n.length-2])}return null},eW=[[RegExp(ek+"; "+ek+" (.*?)[);]","i"),e=>[ek,e&&e[1]||""]],[RegExp(ew,"i"),[ew,""]],[RegExp(ex,"i"),[ex,""]],[ej,[ea,""]],[RegExp(eR,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eT,""];if(new RegExp(Q).test(t)&&!/IEMobile\b/.test(t))return[eR+" "+Q,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=eH[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[eR,r]}return[eR,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=M(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ee+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ee+")","i"),e=>e&&e[2]?[ee,[e[2],e[3],e[4]||"0"].join(".")]:[ee,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ed,""]],[/Linux|debian/i,["Linux",""]]],eG=function(e){return eU.test(e)?ew:eD.test(e)?ex:eN.test(e)?ek:RegExp(eI,"i").test(e)?eI:RegExp("("+eT+"|WPDesktop)","i").test(e)?eT:/iPad/.test(e)?er:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?en:ej.test(e)?ea:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(e$,"i").test(e)?e$:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Q).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)?ee:ei:RegExp("(pda|"+Q+")","i").test(e)?eF:RegExp(et,"i").test(e)&&!RegExp(et+" pc","i").test(e)?eC:""},ez=e=>e instanceof Error;class eY{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(t),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return f(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&I(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),m({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return f(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(r=t.handled)||r,synthetic:null!=(s=e.synthetic)&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,m({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return Z&&i.length===J||(J=i.length,Z=i.reduce((i,r)=>{K||(K={});var s=K[r];if(s)i[s[0]]=s[1];else for(var n=e(r),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,c=t[r];if(l&&c){i[l]=c,K[r]=[l,c];break}}return i},{})),Z}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(r<=4){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return m({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}function eX(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return M(r)||(n.lineno=r),M(s)||(n.colno=s),n}var eK=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},eJ=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,eZ=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,eQ=/\((\S*)(?::(\d+))(?::(\d+))\)/,e0=(e,t)=>{var i=eJ.exec(e);if(i){var[,r,s,n]=i;return eX(t,r,"?",+s,+n)}var o=eZ.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=eQ.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,c]=eK(o[1]||"?",o[2]);return eX(t,c,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},e1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,e2=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,e3=(e,t)=>{var i=e1.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=e2.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var s=i[3],n=i[1]||"?";return[n,s]=eK(n,s),eX(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},e5=/\(error: (.*)\)/;class e6{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=A(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return V(e,"DOMException")}isDOMError(e){return V(e,"DOMError")}}class e8{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class e4{match(e){return V(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var e7=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class e9{match(e){return"string"==typeof e}coerce(e,t){var i,[r,s]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(e7);return r&&(t=r[1],i=r[2]),[t,i]}}var te=["fatal","error","warning","log","info","debug"];function tt(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");if(!(s.length>t))return r===i.length||s.length<=t?s:s.slice(0,t)+"..."}return""}class ti{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return W(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tt(e)}isSeverityLevel(e){return A(e)&&!L(e)&&te.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(ez(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tr{match(e){return W(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tt(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class ts{match(e){return B(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tn{match(e){return V(e,"PromiseRejectionEvent")}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return B(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){if(B(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var to=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,s={k:function(t){if(i&&(g.DEBUG||_.POSTHOG_DEBUG||r)&&!M(i.console)&&i.console){for(var s=("__rrweb_original__"in i.console[t])?i.console[t].__rrweb_original__:i.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];s(e,...o)}},info:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];s.k("log",...t)},warn:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];s.k("warn",...t)},error:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];s.k("error",...t)},critical:function(){for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning:e=>{s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>to(e+" "+t,i)};return s},ta=to("[PostHog.js]"),tl=ta.createLogger,tc=tl("[ExternalScriptsLoader]"),tu=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tc.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==l?void 0:l.querySelectorAll("script");if(r){for(var s,n=0;n<r.length;n++)if(s=function(){if(r[n].src===t){var e=r[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return s.v}var o=()=>{if(!l)return i("document not found");var r=l.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)l.head.appendChild(r);else{var s,n=l.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):l.body.appendChild(r)}};null!=l&&l.body?o():null==l||l.addEventListener("DOMContentLoaded",o)};_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var r="/static/"+t+".js?v="+e.version;"remote-config"===t&&(r="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5));var s=e.requestRouter.endpointFor("assets",r);tu(e,s,i)},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);tu(e,r,i)};var th={};function td(e,t,i){if(I(e)){if(n&&e.forEach===n)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(r in e&&t.call(i,e[r],r)===th)return}}}function tp(e,t,i){if(!D(e)){if(I(e))return td(e,t,i);if(e instanceof FormData){for(var r of e.entries())if(t.call(i,r[1],r[0])===th)return}else for(var s in e)if(T.call(e,s)&&t.call(i,e[s],s)===th)return}}var t_=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return td(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},tg=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return td(i,function(t){td(t,function(t){e.push(t)})}),e};function tv(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var tf=function(e){try{return e()}catch(e){return}},tm=function(e){return function(){try{for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){ta.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ta.critical(e)}}},ty=function(e){var t={};return tp(e,function(e,i){(A(e)&&e.length>0||U(e))&&(t[i]=e)}),t},tb=["herokuapp.com","vercel.app","netlify.app"];function tE(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function tw(e,t,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}var tx="$people_distinct_id",tk="__alias",tS="__timers",tP="$autocapture_disabled_server_side",tR="$heatmaps_enabled_server_side",tT="$exception_capture_enabled_server_side",t$="$error_tracking_suppression_rules",tI="$error_tracking_capture_extension_exceptions",tO="$web_vitals_enabled_server_side",tF="$dead_clicks_enabled_server_side",tC="$product_tours_enabled_server_side",tM="$web_vitals_allowed_metrics",tA="$session_recording_remote_config",tL="$sesid",tN="$session_is_sampled",tD="$enabled_feature_flags",tU="$early_access_features",tj="$feature_flag_details",tH="$stored_person_properties",tq="$stored_group_properties",tB="$surveys",tV="$flag_call_reported",tW="$feature_flag_errors",tG="$user_state",tz="$client_session_props",tY="$capture_rate_limit",tX="$initial_campaign_params",tK="$initial_referrer_info",tJ="$initial_person_info",tZ="$epp",tQ="__POSTHOG_TOOLBAR__",t0="$posthog_cookieless",t1=[tx,tk,"__cmpns",tS,"$session_recording_enabled_server_side",tR,tL,tD,t$,tG,tU,tj,tq,tH,tB,tV,tW,tz,tY,tX,tK,tZ,tJ];function t2(e){return e instanceof Element&&(e.id===tQ||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function t3(e){return!!e&&1===e.nodeType}function t5(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function t6(e){return!!e&&3===e.nodeType}function t8(e){return!!e&&11===e.nodeType}function t4(e){return e?k(e).split(/\s+/):[]}function t7(e){var t=null==i?void 0:i.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function t9(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 t4(t)}function ie(e){return D(e)?null:k(e).split(/(\s+)/).filter(e=>ib(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function it(e){var t="";return ih(e)&&!id(e)&&e.childNodes&&e.childNodes.length&&tp(e.childNodes,function(e){var i;t6(e)&&e.textContent&&(t+=null!=(i=ie(e.textContent))?i:"")}),k(t)}function ii(e){var t;return M(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var ir=["a","button","form","input","select","textarea","label"];function is(e,t){if(M(t))return!0;var i,r=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function io(e){var t=e.parentNode;return!(!t||!t3(t))&&t}var ia=["next","previous","prev",">","<"],il=[".ph-no-rageclick",".ph-no-capture"],ic=e=>!e||t5(e,"html")||!t3(e),iu=(e,t)=>{if(!i||ic(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,s=[e],n=e;n.parentNode&&!t5(n,"body");)if(t8(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var o=io(n);if(!o)break;if(t||ir.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var a=i.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}s.push(o),n=o}return{parentIsUsefulElement:r,targetElementList:s}};function ih(e){for(var t=e;t.parentNode&&!t5(t,"body");t=t.parentNode){var i=t9(t);if(x(i,"ph-sensitive")||x(i,"ph-no-capture"))return!1}if(x(t9(e),"ph-include"))return!0;var r=e.type||"";if(A(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(A(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 id(e){return!!(t5(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||t5(e,"select")||t5(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ip="(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})",i_=RegExp("^(?:"+ip+")$"),ig=new RegExp(ip),iv="\\d{3}-?\\d{2}-?\\d{4}",im=RegExp("^("+iv+")$"),iy=RegExp("("+iv+")");function ib(e,t){return void 0===t&&(t=!0),!(D(e)||A(e)&&(e=k(e),(t?i_:ig).test((e||"").replace(/[- ]/g,""))||(t?im:iy).test(e)))&&!0}function iE(e){var t=it(e);return ib(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&tp(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=it(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){ta.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function iw(e){return e.replace(/"|\\"/g,'\\"')}class ix{constructor(e){this.disabled=!1===e;var t=F(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var ik=e=>{var t=null==l?void 0:l.createElement("a");return M(t)?null:(t.href=e,t)},iS=function(e,t){void 0===t&&(t="&");var i,r,s=[];return tp(e,function(e,t){M(e)||M(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),r=encodeURIComponent(t),s[s.length]=r+"="+i)}),s.join(t)},iP=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var n=r[s].split("=");if(n[0]===t){i=n;break}}if(!I(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){ta.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},iR=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",n=r[1],o=s.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");I(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},iT=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},i$="$copy_autocapture",iI=tl("[AutoCapture]");function iO(e,t){return t.length>e?t.slice(0,e)+"...":t}class iF{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new ix(e.config.rageclick),this.C=null}get R(){var e,t,i=F(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}F(){if(this.isBrowserSupported()){if(i&&l){var e=e=>{e=e||(null==i?void 0:i.event);try{this.O(e)}catch(e){iI.error("Failed to capture event",e)}};if(tw(l,"submit",e,{capture:!0}),tw(l,"change",e,{capture:!0}),tw(l,"click",e,{capture:!0}),this.R.capture_copied_text){var t=e=>{e=e||(null==i?void 0:i.event),this.O(e,i$)};tw(l,"copy",t,{capture:!0}),tw(l,"cut",t,{capture:!0})}}}else iI.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tP]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var t,i=[];return null==(t=this.C)||t.forEach(t=>{var r=null==l?void 0:l.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[tP];if(N(this.T)&&!H(i)&&!this.instance.M())return!1;var r=null!=(t=this.T)?t:!!i;return!!this.instance.config.autocapture&&!r}O(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,s=ii(e);t6(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&function(e,t){if(!i||ic(e)||(H(t)?(r=!!t&&il,s=void 0):(r=null!=(n=null==t?void 0:t.css_selector_ignorelist)?n:il,s=null==t?void 0:t.content_ignorelist),!1===r))return!1;var r,s,n,{targetElementList:o}=iu(e,!1);return!function(e,t){var i;if(!1===e||M(e))return!1;if(!0===e)i=ia;else{if(!I(e))return!1;if(e.length>10)return ta.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:r}=e;return i.some(e=>t.includes(e)||r.includes(e))})}(s,o.map(e=>{var t;return{safeText:it(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!is(o,r)}(s,this.instance.config.rageclick)&&this.O(e,"$rageclick");var n=t===i$;if(s&&function(e,t,r,s,n){if(void 0===r&&(r=void 0),!i||ic(e)||null!=(o=r)&&o.url_allowlist&&!t7(r.url_allowlist)||null!=(a=r)&&a.url_ignorelist&&t7(r.url_ignorelist))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var o,a,l,c,u=r.dom_event_allowlist;if(u&&!u.some(e=>t.type===e))return!1}var{parentIsUsefulElement:h,targetElementList:d}=iu(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(M(i))return!0;var r,s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(r=s(n))return r.v;return!1}(d,r)||!is(d,null==(c=r)?void 0:c.css_selector_allowlist))return!1;var p=i.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var _=e.tagName.toLowerCase();switch(_){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(ir.indexOf(_)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.R,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){for(var r,s,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!t5(h,"body");)t8(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],_={},g=!1,v=!1;if(tp(u,e=>{var t=ih(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&ib(g)&&g),x(t9(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,r){var s=e.tagName.toLowerCase(),n={tag_name:s};ir.indexOf(s)>-1&&!i&&("a"===s.toLowerCase()||"button"===s.toLowerCase()?n.$el_text=iO(1024,iE(e)):n.$el_text=iO(1024,it(e)));var o=t9(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),tp(e.attributes,function(i){var s;if((!id(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&ib(i.value)&&(!A(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=t4(o).join(" ")),n["attr__"+i.name]=iO(1024,o)}});for(var a=1,l=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!t3(t))return t}(c);)a++,c.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l)),t_(_,function(e){if(!ih(e))return{};var t={};return tp(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&ib(r)&&(t[i]=r)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=iE(e):p[0].$el_text=it(e)),g){p[0].attr__href=g;var f,y,b=null==(f=ik(g))?void 0:f.host,E=null==i||null==(y=i.location)?void 0:y.host;b&&E&&b!==E&&(d=g)}return{props:t_({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,r,s={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?I(t)?t:t4(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return tv(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s}).map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=m({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return tv(n).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return o[iw(t.toString())]=iw(i.toString())}),r+=":",r+=tv(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(r=p[0])&&r.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},_)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===i$){var c,u=ie(null==i||null==(c=i.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return O(null==l?void 0:l.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return U(e)&&isFinite(e)&&Math.floor(e)===e});var iC="0123456789abcdef";class iM{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/0x10000000000,s[1]=e/0x100000000,s[2]=e/0x1000000,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new iM(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+iC.charAt(this.bytes[t]>>>4)+iC.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new iM(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class iA{constructor(){this.A=0,this.j=0,this.D=new iD}generate(){var e=this.generateOrAbort();if(M(e)){this.A=0;var t=this.generateOrAbort();if(M(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.j++,this.j>0x3ffffffffff&&(this.A++,this.L())}return iM.fromFieldsV7(this.A,Math.trunc(this.j/0x40000000),0x3fffffff&this.j,this.D.nextUint32())}L(){this.j=1024*this.D.nextUint32()+(1023&this.D.nextUint32())}}var iL,iN=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};i&&!M(i.crypto)&&crypto.getRandomValues&&(iN=e=>crypto.getRandomValues(e));class iD{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(iN(this.N),this.U=0),this.N[this.U++]}}var iU=()=>ij().toString(),ij=()=>(iL||(iL=new iA)).generate(),iH="",iq=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,iB={H:()=>!!l,B:function(e){ta.error("cookieStore error: "+e)},q:function(e){if(l){try{for(var t=e+"=",i=l.cookie.split(";").filter(e=>e.length),r=0;r<i.length;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},W:function(e){var t;try{t=JSON.parse(iB.q(e))||{}}catch(e){}return t},G:function(e,t,i,r,s){if(l)try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=l),iH)return iH;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+iU();!iH&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",iH=n)}return iH}(e);if(!i){var r,s=(r=e.match(iq))?r[0]:"";s!==i&&ta.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(l.location.hostname,r);if(i){var c=new Date;c.setTime(c.getTime()+24*i*36e5),n="; expires="+c.toUTCString()}s&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ta.warn("cookieStore warning: large cookie, len="+u.length),l.cookie=u,u}catch(e){return}},V:function(e,t){if(null!=l&&l.cookie)try{iB.G(e,"",-1,t)}catch(e){return}}},iV=null,iW={H:function(){if(!N(iV))return iV;var e=!0;if(M(i))e=!1;else try{var t="__mplssupport__";iW.G(t,"xyz"),'"xyz"'!==iW.q(t)&&(e=!1),iW.V(t)}catch(t){e=!1}return e||ta.error("localStorage unsupported; falling back to cookie store"),iV=e,e},B:function(e){ta.error("localStorage error: "+e)},q:function(e){try{return null==i?void 0:i.localStorage.getItem(e)}catch(e){iW.B(e)}return null},W:function(e){try{return JSON.parse(iW.q(e))||{}}catch(e){}return null},G:function(e,t){try{null==i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){iW.B(e)}},V:function(e){try{null==i||i.localStorage.removeItem(e)}catch(e){iW.B(e)}}},iG=["$device_id","distinct_id",tL,tN,tZ,tJ],iz={},iY={H:function(){return!0},B:function(e){ta.error("memoryStorage error: "+e)},q:function(e){return iz[e]||null},W:function(e){return iz[e]||null},G:function(e,t){iz[e]=t},V:function(e){delete iz[e]}},iX=null,iK={H:function(){if(!N(iX))return iX;if(iX=!0,M(i))iX=!1;else try{var e="__support__";iK.G(e,"xyz"),'"xyz"'!==iK.q(e)&&(iX=!1),iK.V(e)}catch(e){iX=!1}return iX},B:function(e){ta.error("sessionStorage error: ",e)},q:function(e){try{return null==i?void 0:i.sessionStorage.getItem(e)}catch(e){iK.B(e)}return null},W:function(e){try{return JSON.parse(iK.q(e))||null}catch(e){}return null},G:function(e,t){try{null==i||i.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){iK.B(e)}},V:function(e){try{null==i||i.sessionStorage.removeItem(e)}catch(e){iK.B(e)}}},iJ=((ny={})[ny.PENDING=-1]="PENDING",ny[ny.DENIED=0]="DENIED",ny[ny.GRANTED=1]="GRANTED",ny);class iZ{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?iJ.DENIED:this.K}isOptedOut(){return"always"===this.R.cookieless_mode||this.consent===iJ.DENIED||this.consent===iJ.PENDING&&(this.R.opt_out_capturing_by_default||"on_reject"===this.R.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===iJ.DENIED}optInOut(e){this.Y.G(this.X,+!!e,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return x(G,e)?iJ.GRANTED:x(z,e)?iJ.DENIED:iJ.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z="localStorage"===e?iW:iB;var t="localStorage"===e?iB:iW;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(x(G,t.q(this.X))),t.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!tE([null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,_.doNotTrack],e=>x(G,e))}}var iQ=tl("[Dead Clicks]"),i0=()=>!0,i1=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(tF)),r=e.instance.config.capture_dead_clicks;return H(r)?r:!!F(r)||i};class i2{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[tF]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.it(()=>{this.et()}):this.stop()}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?iQ.error("failed to load script",t):e()})}et(){var e;if(l){if(!this.tt&&null!=(e=_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=F(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(l),iQ.info("starting...")}}else iQ.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,iQ.info("stopping..."))}}var i3=tl("[ExceptionAutocapture]");class i5{constructor(e){var t,r,s;this.rt=()=>{var e;if(i&&this.isEnabled&&null!=(e=_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=t(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=r(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=s(this.captureException.bind(this)))}catch(e){i3.error("failed to start",e),this.ut()}}},this._instance=e,this.ht=!(null==(t=this._instance.persistence)||!t.props[tT]),this.dt=new X({refillRate:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?r:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,h:i3}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return F(e)?t=m({},t,e):(M(e)?this.ht:e)&&(t=m({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(i3.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return i3.error("failed to load script",t);e()})}ut(){var e,t,i;null==(e=this.st)||e.call(this),this.st=void 0,null==(t=this.nt)||t.call(this),this.nt=void 0,null==(i=this.ot)||i.call(this),this.ot=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.ht=!!t,this._instance.persistence&&this._instance.persistence.register({[tT]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}}onConfigChange(){this.R=this.vt()}captureException(e){var t,i,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.dt.consumeRateLimit(r)?i3.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}function i6(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);return O(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch(e){return()=>{}}}class i8{constructor(e){var t;this._instance=e,this.ct=(null==i||null==(t=i.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ta.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,ta.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(i&&i.history){var r=this;null!=(e=i.history.pushState)&&e.__posthog_wrapped__||i6(i.history,"pushState",e=>function(t,i,s){e.call(this,t,i,s),r._t("pushState")}),null!=(t=i.history.replaceState)&&t.__posthog_wrapped__||i6(i.history,"replaceState",e=>function(t,i,s){e.call(this,t,i,s),r._t("replaceState")}),this.bt()}}_t(e){try{var t,r=null==i||null==(t=i.location)?void 0:t.pathname;if(!r)return;r!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=r}catch(t){ta.error("Error capturing "+e+" pageview",t)}}bt(){if(!this.ft){var e=()=>{this._t("popstate")};tw(i,"popstate",e),this.ft=()=>{i&&i.removeEventListener("popstate",e)}}}}var i4=tl("[SegmentIntegration]"),i7="posthog-js";function i9(e,t){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if(!("*"===n||n.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var a,l,c,u,h,d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null==(a=t.exception)?void 0:a.values)||[],_=p.map(e=>m({},e,{stacktrace:e.stacktrace?m({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>m({},e,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_level:t.level,$exception_list:_,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(h=p[0])?void 0:h.type,$sentry_tags:t.tags};return i&&r&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),o&&e.exceptions.sendExceptionEvent(g),t}}class re{constructor(e,t,i,r,s,n){this.name=i7,this.setupOnce=function(o){o(i9(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}var rt=null!=i&&i.location?iT(i.location.hash,"__posthog")||iT(location.hash,"state"):null,ri="_postHogToolbarParams",rr=tl("[Toolbar]"),rs=((nb=rs||{})[nb.UNINITIALIZED=0]="UNINITIALIZED",nb[nb.LOADING=1]="LOADING",nb[nb.LOADED=2]="LOADED",nb);class rn{constructor(e){this.instance=e}yt(e){_.ph_toolbar_state=e}wt(){var e;return null!=(e=_.ph_toolbar_state)?e:rs.UNINITIALIZED}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.instance.config.name&&"ph_toolbar_internal"===this.instance.config.name||!i||!l)return!1;e=null!=e?e:i.location,r=null!=r?r:i.history;try{if(!t){try{i.localStorage.setItem("test","test"),i.localStorage.removeItem("test")}catch(e){return!1}t=null==i?void 0:i.localStorage}var s,n=rt||iT(e.hash,"__posthog")||iT(e.hash,"state"),o=n?tf(()=>JSON.parse(atob(decodeURIComponent(n))))||tf(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(ri)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch(e){return!1}}xt(e){var t=_.ph_load_toolbar||_.ph_load_editor;!D(t)&&O(t)?t(e,this.instance):rr.warn("No toolbar load function found")}loadToolbar(e){var t,r=!(null==l||!l.getElementById(tQ));if(!i||r)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=m({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(i.localStorage.setItem(ri,JSON.stringify(m({},n,{source:void 0}))),this.wt()===rs.LOADED)?this.xt(n):this.wt()===rs.UNINITIALIZED&&(this.yt(rs.LOADING),null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(rr.error("[Toolbar] Failed to load",e),this.yt(rs.UNINITIALIZED)):(this.yt(rs.LOADED),this.xt(n))}),tw(i,"turbolinks:load",()=>{this.yt(rs.UNINITIALIZED),this.loadToolbar(n)})),!0}$t(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var ro=tl("[TracingHeaders]");class ra{constructor(e){this.Et=void 0,this.St=void 0,this.rt=()=>{var e,t;M(this.Et)&&(null==(e=_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),M(this.St)&&(null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return ro.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):(null==(e=this.Et)||e.call(this),null==(t=this.St)||t.call(this),this.Et=void 0,this.St=void 0)}}var rl="https?://(.*)",rc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ru=tg(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rc),rh="<masked>",rd=["li_fat_id"];function rp(e,t,i){if(!l)return{};var r,s=t?tg([],rc,i||[]):[],n=r_(iR(l.URL,s,rh),e);return t_((r={},tp(rd,function(e){var t=iB.q(e);r[e]=t||null}),r),n)}function r_(e,t){var i=ru.concat(t||[]),r={};return tp(i,function(t){var i=iP(e,t);r[t]=i||null}),r}function rg(e){var t=e?0===e.search(rl+"google.([^/?]*)")?"google":0===e.search(rl+"bing.com")?"bing":0===e.search(rl+"yahoo.com")?"yahoo":0===e.search(rl+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!N(t)){i.$search_engine=t;var r=l?iP(l.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function rv(){return navigator.language||navigator.userLanguage}function rf(){return(null==l?void 0:l.referrer)||"$direct"}function rm(e,t){var i=e?tg([],rc,t||[]):[],r=null==c?void 0:c.href.substring(0,1e3);return{r:rf().substring(0,1e3),u:r?iR(r,i,rh):void 0}}function ry(e){var t,{r:i,u:r}=e,s={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=ik(i))?void 0:t.host};if(r){s.$current_url=r;var n=ik(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname,t_(s,r_(r))}return i&&t_(s,rg(i)),s}function rb(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rE=tl("[Web Vitals]");class rw{constructor(e){var t;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((e,t)=>m({},e,{["$web_vitals_"+t.name+"_event"]:m({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(M(i))rE.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.Ct();M(r)||(D(null==e?void 0:e.name)||D(null==e?void 0:e.value)?rE.error("Invalid metric received",e):this.Rt&&e.value>=this.Rt?rE.error("Ignoring metric with value >= "+this.Rt,e):(this.N.url!==r&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),M(this.N.url)&&(this.N.url=r),this.N.firstMetricTimestamp=M(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.N.metrics.push(m({},e,{$current_url:r,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{if(!this.P){var e,t,i,r,s=_.__PosthogExtensions__;M(s)||M(s.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=s.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.It.bind(this)),this.P=!0):rE.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.kt=!(null==(t=this._instance.persistence)||!t.props[tO]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=F(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return D(i)?(null==(t=this._instance.persistence)?void 0:t.props[tM])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(F(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=F(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=e&&e}get Rt(){var e=F(this._instance.config.capture_performance)&&U(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){var e=null==c?void 0:c.protocol;if("http:"!==e&&"https:"!==e)return rE.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=F(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:H(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return H(t)?t:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(rE.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){if("capturePerformance"in e){var t=F(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=F(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tO]:t}),this._instance.persistence.register({[tM]:i})),this.kt=t,this.startIfEnabled()}}it(e){var t,i;if(null!=(t=_.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,r,t=>{t?rE.error("failed to load script",t):e()})}}Ct(){var e=i?i.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties;return iR(e,t?tg([],rc,r||[]):[],rh)}rE.error("Could not determine current URL")}}var rx=tl("[Heatmaps]");function rk(e){return F(e)&&"clientX"in e&&"clientY"in e&&U(e.clientX)&&U(e.clientY)}class rS{constructor(e){var t;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!(null==(t=this.instance.persistence)||!t.props[tR]),this.rageclicks=new ix(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return F(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 D(this.instance.config.capture_heatmaps)?D(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.P||(rx.info("starting..."),this.Ot(),this.Mt());else{var e;clearInterval(null!=(e=this.Ft)?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tR]:t}),this.kt=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}jt(e){this.Dt(e.originalEvent,"deadclick")}Mt(){this.Ft&&clearInterval(this.Ft),this.Ft="visible"===(null==l?void 0:l.visibilityState)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}Ot(){i&&l&&(this.Nt=this.Lt.bind(this),tw(i,"beforeunload",this.Nt),this.Ut=e=>this.Dt(e||(null==i?void 0:i.event)),tw(l,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||(null==i?void 0:i.event)),tw(l,"mousemove",this.zt,{capture:!0}),this.Bt=new i2(this.instance,i0,this.jt.bind(this)),this.Bt.startIfEnabledOrStop(),this.qt=this.Mt.bind(this),tw(l,"visibilitychange",this.qt),this.P=!0)}At(){var e;i&&l&&(this.Nt&&i.removeEventListener("beforeunload",this.Nt),this.Ut&&l.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&l.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&l.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),null==(e=this.Bt)||e.stop(),this.P=!1)}Gt(e,t){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,r){for(var s=e;s&&t3(s)&&!t5(s,"body")&&s!==r;){if(x(t,null==i?void 0:i.getComputedStyle(s).position))return!0;s=io(s)}return!1}(ii(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:s),y:e.clientY+(o?0:r),target_fixed:o,type:t}}Dt(e,t){var i;if(void 0===t&&(t="click"),!t2(e.target)&&rk(e)){var r=this.Gt(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Vt(m({},r,{type:"rageclick"})),this.Vt(r)}}Ht(e){!t2(e.target)&&rk(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout(()=>{this.Vt(this.Gt(e,"mousemove"))},500))}Vt(e){if(i){var t=i.location.href,r=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=iR(t,r?tg([],rc,s||[]):[],rh);this.N=this.N||{},this.N[n]||(this.N[n]=[]),this.N[n].push(e)}}Lt(){this.N&&!C(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class rP{constructor(e){this.Jt=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(ta.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Jt)}destroy(){var e;null==(e=this.Xt)||e.call(this),this.Xt=void 0}doPageView(e,t){var r,s=this.Qt(e,t);return this.Kt={pathname:null!=(r=null==i?void 0:i.location.pathname)?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Qt(e,null==(t=this.Kt)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Kt)?void 0:e.pageViewId}}Qt(e,t){var i=this.Kt;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=s;if(!(M(n)||M(o)||M(a)||M(l)||M(c)||M(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:Y(o/n,0,1,ta),d=n<=1?1:Y(a/n,0,1,ta),p=l<=1?1:Y(c/l,0,1,ta),_=l<=1?1:Y(u/l,0,1,ta);r=t_(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var rR=((nE={}).GZipJS="gzip-js",nE.Base64="base64",nE),rT=Uint8Array,r$=Uint16Array,rI=Uint32Array,rO=new rT([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]),rF=new rT([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]),rC=new rT([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rM=function(e,t){for(var i=new r$(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var s=new rI(i[30]);for(r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)s[n]=n-i[r]<<5|r;return[i,s]},rA=rM(rO,2),rL=rA[0],rN=rA[1];rL[28]=258,rN[258]=28;for(var rD=rM(rF,0)[1],rU=new r$(32768),rj=0;rj<32768;++rj){var rH=(43690&rj)>>>1|(21845&rj)<<1;rH=(61680&(rH=(52428&rH)>>>2|(13107&rH)<<2))>>>4|(3855&rH)<<4,rU[rj]=((65280&rH)>>>8|(255&rH)<<8)>>>1}var rq=function(e,t,i){for(var r=e.length,s=0,n=new r$(t);s<r;++s)++n[e[s]-1];var o,a=new r$(t);for(s=0;s<t;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new r$(1<<t);var l=15-t;for(s=0;s<r;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[rU[h]>>>l]=c}else for(o=new r$(r),s=0;s<r;++s)o[s]=rU[a[e[s]-1]++]>>>15-e[s];return o},rB=new rT(288);for(rj=0;rj<144;++rj)rB[rj]=8;for(rj=144;rj<256;++rj)rB[rj]=9;for(rj=256;rj<280;++rj)rB[rj]=7;for(rj=280;rj<288;++rj)rB[rj]=8;var rV=new rT(32);for(rj=0;rj<32;++rj)rV[rj]=5;var rW=rq(rB,9,0),rG=rq(rV,5,0),rz=function(e){return(e/8|0)+(7&e&&1)},rY=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof r$?r$:e instanceof rI?rI:rT)(i-t);return r.set(e.subarray(t,i)),r},rX=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8},rK=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8,e[r+2]|=i>>>16},rJ=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new rT(0),0];if(1==s){var o=new rT(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(r=1;r<s;++r)n[r].s>d&&(d=n[r].s);var p=new r$(d+1),_=rZ(i[u-1],p,0);if(_>t){r=0;var g=0,v=_-t,f=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<s;++r){var m=n[r].s;if(!(p[m]>t))break;g+=f-(1<<_-p[m]),p[m]=t}for(g>>>=v;g>0;){var y=n[r].s;p[y]<t?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=n[r].s;p[b]==t&&(--p[b],++g)}_=t}return[new rT(p),_]},rZ=function(e,t,i){return -1==e.s?Math.max(rZ(e.l,t,i+1),rZ(e.r,t,i+1)):t[e.s]=i},rQ=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new r$(++t),r=0,s=e[0],n=1,o=function(e){i[r++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=e[a]}return[i.subarray(0,r),t]},r0=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},r1=function(e,t,i){var r=i.length,s=rz(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 n=0;n<r;++n)e[s+n+4]=i[n];return 8*(s+4+r)},r2=function(e,t,i,r,s,n,o,a,l,c,u){rX(t,u++,i),++s[256];for(var h=rJ(s,15),d=h[0],p=h[1],_=rJ(n,15),g=_[0],v=_[1],f=rQ(d),m=f[0],y=f[1],b=rQ(g),E=b[0],w=b[1],x=new r$(19),k=0;k<m.length;++k)x[31&m[k]]++;for(k=0;k<E.length;++k)x[31&E[k]]++;for(var S=rJ(x,7),P=S[0],R=S[1],T=19;T>4&&!P[rC[T-1]];--T);var $,I,O,F,C=c+5<<3,M=r0(s,rB)+r0(n,rV)+o,A=r0(s,d)+r0(n,g)+o+14+3*T+r0(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(C<=M&&C<=A)return r1(t,u,e.subarray(l,l+c));if(rX(t,u,1+(A<M)),u+=2,A<M){$=rq(d,p,0),I=d,O=rq(g,v,0),F=g;var L=rq(P,R,0);for(rX(t,u,y-257),rX(t,u+5,w-1),rX(t,u+10,T-4),u+=14,k=0;k<T;++k)rX(t,u+3*k,P[rC[k]]);u+=3*T;for(var N=[m,E],D=0;D<2;++D){var U=N[D];for(k=0;k<U.length;++k){var j=31&U[k];rX(t,u,L[j]),u+=P[j],j>15&&(rX(t,u,U[k]>>>5&127),u+=U[k]>>>12)}}}else $=rW,I=rB,O=rG,F=rV;for(k=0;k<a;++k)if(r[k]>255){rK(t,u,$[(j=r[k]>>>18&31)+257]),u+=I[j+257],j>7&&(rX(t,u,r[k]>>>23&31),u+=rO[j]);var H=31&r[k];rK(t,u,O[H]),u+=F[H],H>3&&(rK(t,u,r[k]>>>5&8191),u+=rF[H])}else rK(t,u,$[r[k]]),u+=I[r[k]];return rK(t,u,$[256]),u+I[256]},r3=new rI([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),r5=function(){for(var e=new rI(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),r6=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},r8=function(e){var t,i,r,s,n="";for(t=i=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<r;s++){var o=e.charCodeAt(s),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),N(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=s+1)}return i>t&&(n+=e.substring(t,e.length)),n},r4=!!h||!!u,r7="text/plain",r9=function(e,t,i){void 0===i&&(i=!0);var r,[s,n]=e.split("?"),o=m({},t),a=null!=(r=null==n?void 0:n.split("&").map(e=>{var t,[r,s]=e.split("="),n=i&&null!=(t=o[r])?t:s;return delete o[r],r+"="+n}))?r:[],l=iS(o);return l&&a.push(l),s+"?"+a.join("&")},se=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),st=e=>{var{data:t,compression:i}=e;if(t){if(i===rR.GZipJS){var r,s,n,o,a,l,c,u,h=new Blob([(r=function(e,t){var i=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new rT(e.length+(e.length>>>1)),s=0,n=function(e){r[s++]=e},o=0;o<i;++o){if(s+5>r.length){var a=new rT(s+8+(i-o<<1));a.set(r),r=a}var l=e.charCodeAt(o);l<128?n(l):(l<2048?n(192|l>>>6):(l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return rY(r,0,s)}(se(t)),s={mtime:0},n=0xffffffff,o={p:function(e){for(var t=n,i=0;i<e.length;++i)t=r5[255&t^e[i]]^t>>>8;n=t},d:function(){return 0xffffffff^n}},a=r.length,o.p(r),u=(l=10+(s.filename&&s.filename.length+1||0),c=function(e,t,i,r,s,n){var o=e.length,a=new rT(r+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(r,a.length-8),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=r1(l,c,e.subarray(u,h)):(l[u]=n,c=r1(l,c,e.subarray(u,o)))}else{for(var d=r3[t-1],p=d>>>13,_=8191&d,g=(1<<i)-1,v=new r$(32768),f=new r$(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},E=new rI(25e3),w=new r$(288),x=new r$(32),k=0,S=0,P=(u=0,0),R=0,T=0;u<o;++u){var $=b(u),I=32767&u,O=f[$];if(v[I]=O,f[$]=I,R<=u){var F=o-u;if((k>7e3||P>24576)&&F>423){c=r2(e,l,0,E,w,x,S,P,T,u-T,c),P=k=S=0,T=u;for(var C=0;C<286;++C)w[C]=0;for(C=0;C<30;++C)x[C]=0}var M=2,A=0,L=_,N=I-O&32767;if(F>2&&$==b(u-N))for(var D=Math.min(p,F)-1,U=Math.min(32767,u),j=Math.min(258,F);N<=U&&--L&&I!=O;){if(e[u+M]==e[u+M-N]){for(var H=0;H<j&&e[u+H]==e[u+H-N];++H);if(H>M){if(M=H,A=N,H>D)break;var q=Math.min(N,H-2),B=0;for(C=0;C<q;++C){var V=u-N+C+32768&32767,W=V-v[V]+32768&32767;W>B&&(B=W,O=V)}}}N+=(I=O)-(O=v[I])+32768&32767}if(A){E[P++]=0x10000000|rN[M]<<18|rD[A];var G=31&rN[M],z=31&rD[A];S+=rO[G]+rF[z],++w[257+G],++x[z],R=u+M,++k}else E[P++]=e[u],++w[e[u]]}}c=r2(e,l,n,E,w,x,S,P,T,u-T,c)}return rY(a,0,r+rz(c)+8)}(r,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,l,8,!0)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&r6(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(c,s),r6(c,u-8,o.d()),r6(c,u-4,a),c)],{type:r7});return{contentType:r7,body:h,estimatedSize:h.size}}if(i===rR.Base64){let e;var d="data="+encodeURIComponent("string"==typeof(e=function(e){var t,i,r,s,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=r8(e);do t=(n=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=n>>12&63,r=n>>6&63,s=63&n,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(r)+o.charAt(s);while(a<e.length)switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(se(t)))?e:se(e));return{contentType:"application/x-www-form-urlencoded",body:d,estimatedSize:new Blob([d]).size}}var p=se(t);return{contentType:"application/json",body:p,estimatedSize:new Blob([p]).size}}},si=[];u&&si.push({transport:"fetch",method:e=>{var t,i,{contentType:r,body:s,estimatedSize:n}=null!=(t=st(e))?t:{},o=new Headers;tp(e.headers,function(e,t){o.append(t,e)}),r&&o.append("Content-Type",r);var a=e.url,l=null;if(d){var c=new d;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}u(a,m({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&52428.8>(n||0),body:s,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){ta.error(e)}null==e.callback||e.callback(r)})).catch(t=>{ta.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),h&&si.push({transport:"XHR",method:e=>{var t,i=new h;i.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=null!=(t=st(e))?t:{};tp(e.headers,function(e,t){i.setRequestHeader(t,e)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(s)}}),null!=a&&a.sendBeacon&&si.push({transport:"sendBeacon",method:e=>{var t=r9(e.url,{beacon:"1"});try{var i,{contentType:r,body:s}=null!=(i=st(e))?i:{},n="string"==typeof s?new Blob([s],{type:r}):s;a.sendBeacon(t,n)}catch(e){}}});var sr=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function ss(e,t,i){return se({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var sn={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>sr(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!sr(t,e))),icontains:(e,t)=>t.map(so).some(t=>e.map(so).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(so).every(t=>e.map(so).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})},so=e=>e.toLowerCase();function sa(e,t){return!e||Object.entries(e).every(e=>{var[i,r]=e,s=null==t?void 0:t[i];if(M(s)||N(s))return!1;var n=[String(s)],o=sn[r.operator];return!!o&&o(r.values,n)})}var sl=tl("[Error tracking]");class sc{constructor(e){var t,i;this.Zt=[],this.ti=new eY([new e6,new tn,new e4,new e8,new tr,new ti,new e9,new ts],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var s=[],n=t.split("\n"),o=r;o<n.length;o++){var a=n[o];if(!(a.length>1024)){var l=e5.test(a)?a.replace(e5,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l,e);if(u){s.push(u);break}}if(s.length>=50)break}}}if(!s.length)return[];var h=Array.from(s);return h.reverse(),h.slice(0,50).map(e=>m({},e,{filename:e.filename||(h[h.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",e0,e3)),this._instance=e,this.Zt=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(t$))?t:[]}onRemoteConfig(e){var t,i,r;if("errorTracking"in e){var s=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.Zt=s,this._instance.persistence&&this._instance.persistence.register({[t$]:this.Zt,[tI]:n})}}get ii(){var e,t=!!this._instance.get_property(tI),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.ti.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ei(t)){if(this.ri(t))return void sl.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(t))return void sl.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(t))return void sl.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",oi:!0})}ri(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:i,value:r}=t;return A(i)&&i.length>0&&e.$exception_types.push(i),A(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.Zt.some(e=>{var i=e.values.map(e=>{var i,r=sn[e.operator],s=I(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return s.length>0&&r(s,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}si(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ni(e){if(e.length>0){var t,i,r,s,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],o=n[n.length-1];return null!=(r=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&r}return!1}ei(e){return!D(e)&&I(e)}}var su=tl("[FeatureFlags]"),sh=tl("[FeatureFlags]",{debugEnabled:!0}),sd="$active_feature_flags",sp="$override_feature_flags",s_="$feature_flag_payloads",sg="$override_feature_flag_payloads",sv="$feature_flag_request_id",sf="$feature_flag_evaluated_at",sm=e=>{var t={};for(var[i,r]of tv(e||{}))r&&(t[i]=r);return t},sy=((nw={}).FeatureFlags="feature_flags",nw.Recordings="recordings",nw);class sb{constructor(e){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.ci=!1,this._instance=e,this.featureFlagEventHandlers=[]}fi(){var e,t=null!=(e=this._instance.config.evaluation_contexts)?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(su.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||su.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}pi(){return this.fi().length>0}get hasLoadedFlags(){return this.li}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(tj),t=this._instance.get_property(sp),i=this._instance.get_property(sg);if(!i&&!t)return e||{};var r=t_({},e||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=r[s],l=null==t?void 0:t[s],c=M(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,u=M(l)?a.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[s],d=m({},a,{enabled:c,variant:c?null!=u?u:null==a?void 0:a.variant:void 0});c!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),u!==(null==a?void 0:a.variant)&&(d.original_variant=null==a?void 0:a.variant),h&&(d.metadata=m({},null==a?void 0:a.metadata,{payload:h,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),r[s]=d}return this.ai||(su.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ai=!0),r}getFlagVariants(){var e=this._instance.get_property(tD),t=this._instance.get_property(sp);if(!t)return e||{};for(var i=t_({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this.ai||(su.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ai=!0),i}getFlagPayloads(){var e=this._instance.get_property(s_),t=this._instance.get_property(sg);if(!t)return e||{};for(var i=t_({},e||{}),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this.ai||(su.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ai=!0),i}reloadFeatureFlags(){this.hi||this._instance.config.advanced_disable_feature_flags||this.gi||(this._instance.mi.emit("featureFlagsReloading",!0),this.gi=setTimeout(()=>{this.bi()},5))}yi(){clearTimeout(this.gi),this.gi=void 0}ensureFlagsLoaded(){this.li||this.ui||this.gi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.hi=e}bi(e){var t;if(this.yi(),!this._instance.M())if(this.ui)this.di=!0;else{var i=this._instance.config.token,r=this._instance.get_property("$device_id"),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:m({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(tH)||{}),group_properties:this._instance.get_property(tq),timezone:rb()};N(r)||M(r)||(s.$device_id=r),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.pi()&&(s.evaluation_contexts=this.fi());var n=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+n);this.ui=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this._instance.config.disable_compression?void 0:rR.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,n=!0;if(200===e.statusCode&&(this.di||(this.$anon_distinct_id=void 0),n=!1),this.ui=!1,!s.disable_flags||this.di){this.vi=!n;var o,a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==e.statusCode&&a.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes(sy.FeatureFlags));(l&&a.push("quota_limited"),null==(r=this._instance.persistence)||r.register({[tW]:a}),l)?su.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."):(s.disable_flags||this.receivedFeatureFlags(null!=(o=e.json)?o:{},n),this.di&&(this.di=!1,this.bi()))}}})}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.vi){if(this.li||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlagResult(e,t);return null!=(i=null==r?void 0:r.variant)?i:null==r?void 0:r.enabled}su.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.vi)if(this.li||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants(),r=e in i,s=i[e],n=this.getFlagPayloads()[e],o=String(s),a=this._instance.get_property(sv)||void 0,l=this._instance.get_property(sf)||void 0,c=this._instance.get_property(tV)||{};if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(o))){I(c[e])?c[e].push(o):c[e]=[o],null==(p=this._instance.persistence)||p.register({[tV]:c});var u=this.getFeatureFlagDetails(e),h=[...null!=(_=this._instance.get_property(tW))?_:[]];M(s)&&h.push("flag_missing");var d={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(g=this._instance.config.bootstrap)||null==(g=g.featureFlags)?void 0:g[e])||null,$feature_flag_bootstrapped_payload:(null==(v=this._instance.config.bootstrap)||null==(v=v.featureFlagPayloads)?void 0:v[e])||null,$used_bootstrap_value:!this.vi};M(null==u||null==(f=u.metadata)?void 0:f.version)||(d.$feature_flag_version=u.metadata.version);var p,_,g,v,f,m,y,b,E,w,x,k=null!=(m=null==u||null==(y=u.reason)?void 0:y.description)?m:null==u||null==(b=u.reason)?void 0:b.code;k&&(d.$feature_flag_reason=k),null!=u&&null!=(E=u.metadata)&&E.id&&(d.$feature_flag_id=u.metadata.id),M(null==u?void 0:u.original_variant)&&M(null==u?void 0:u.original_enabled)||(d.$feature_flag_original_response=M(u.original_variant)?u.original_enabled:u.original_variant),null!=u&&null!=(w=u.metadata)&&w.original_payload&&(d.$feature_flag_original_payload=null==u||null==(x=u.metadata)?void 0:x.original_payload),h.length&&(d.$feature_flag_error=h.join(",")),this._instance.capture("$feature_flag_called",d)}if(r){var S=n;if(!M(n))try{S=JSON.parse(n)}catch(e){}return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:S}}}else su.warn('getFeatureFlagResult for key "'+e+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(e,t){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.pi()&&(r.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this._instance.config.disable_compression?void 0:rR.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var r,s=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.vi){if(this.li||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return M(i)?void 0:!!i}su.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.li=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,i,r,s){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var n,o=((n=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(n).map(e=>{var t;return[e,null!=(t=n[e].variant)?t:n[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(n).filter(e=>n[e].enabled).filter(e=>{var t;return null==(t=n[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))):su.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),a=o.flags,l=o.featureFlags,c=o.featureFlagPayloads;if(l){var u=e.requestId,h=e.evaluatedAt;if(I(l)){su.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var p=0;p<l.length;p++)d[l[p]]=!0;t&&t.register({[sd]:l,[tD]:d})}else{var _=l,g=c,v=a;if(e.errorsWhileComputingFlags)if(a){var f=new Set(Object.keys(a).filter(e=>{var t;return!(null!=(t=a[e])&&t.failed)}));_=m({},i,Object.fromEntries(Object.entries(_).filter(e=>{var[t]=e;return f.has(t)}))),g=m({},r,Object.fromEntries(Object.entries(g||{}).filter(e=>{var[t]=e;return f.has(t)}))),v=m({},s,Object.fromEntries(Object.entries(v||{}).filter(e=>{var[t]=e;return f.has(t)})))}else _=m({},i,_),g=m({},r,g),v=m({},s,v);t&&t.register(m({[sd]:Object.keys(sm(_)),[tD]:_||{},[s_]:g||{},[tj]:v||{}},u?{[sv]:u}:{},h?{[sf]:h}:{}))}}}(e,this._instance.persistence,i,r,s),this.wi(t)}}override(e,t){void 0===t&&(t=!1),su.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return su.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(sp),this._instance.persistence.unregister(sg),this.wi(),sh.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.ai=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(sp),sh.info("Flag overrides cleared");else if(e.flags){if(I(e.flags)){for(var i={},r=0;r<e.flags.length;r++)i[e.flags[r]]=!0;this._instance.persistence.register({[sp]:i})}else this._instance.persistence.register({[sp]:e.flags});sh.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this._instance.persistence.unregister(sg),sh.info("Payload overrides cleared")):e.payloads&&(this._instance.persistence.register({[sg]:e.payloads}),sh.info("Payload overrides set",{payloads:e.payloads}))),void this.wi()}this.wi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.li){var{flags:t,flagVariants:i}=this.xi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this._instance.get_property(tU)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(o.$early_access_feature_name=s.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=m({},this.getFlagVariants(),{[e]:t});null==(r=this._instance.persistence)||r.register({[sd]:Object.keys(sm(a)),[tD]:a}),this.wi()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this._instance.get_property(tU),s=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(tU),null==(r=this._instance.persistence)||r.register({[tU]:s}),e(s)}}})}xi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}wi(e){var{flags:t,flagVariants:i}=this.xi();this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(tH)||{};this._instance.register({[tH]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(tH)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(tq)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=m({},i[t],e[t]),delete e[t]}),this._instance.register({[tq]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(tq)||{};this._instance.register({[tq]:m({},t,{[e]:{}})})}else this._instance.unregister(tq)}reset(){this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.yi(),this.ai=!1}}var sE=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class sw{constructor(e,t){this.R=e,this.props={},this.$i=!1,this.Ei=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Y=this.Si(e),this.load(),e.debug&&ta.info("Persistence loaded",e.persistence,m({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.ki}Si(e){-1===sE.indexOf(e.persistence.toLowerCase())&&(ta.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,r,s=(void 0===(t=e.cookie_persisted_properties||[])&&(t=[]),r=[...iG,...t],m({},iW,{W:function(e){try{var t={};try{t=iB.W(e)||{}}catch(e){}var i=t_(t,JSON.parse(iW.q(e)||"{}"));return iW.G(e,i),i}catch(e){}return null},G:function(e,t,i,s,n,o){try{iW.G(e,t,void 0,void 0,o);var a={};r.forEach(e=>{t[e]&&(a[e]=t[e])}),Object.keys(a).length&&iB.G(e,a,i,s,n,o)}catch(e){iW.B(e)}},V:function(e,t){try{null==i||i.localStorage.removeItem(e),iB.V(e,t)}catch(e){iW.B(e)}}})),n=e.persistence.toLowerCase();return"localstorage"===n&&iW.H()?iW:"localstorage+cookie"===n&&s.H()?s:"sessionstorage"===n&&iK.H()?iK:"memory"===n?iY:"cookie"===n?iB:s.H()?s:iB}properties(){var e={};return tp(this.props,function(t,i){if(i===tD&&F(t))for(var r,s=Object.keys(t),n=0;n<s.length;n++)e["$feature/"+s[n]]=t[s[n]];else r=!1,(N(t1)?r:o&&t1.indexOf===o?-1!=t1.indexOf(i):(tp(t1,function(e){if(r||(r=e===i))return th}),r))||(e[i]=t)}),e}load(){if(!this.ki){var e=this.Y.W(this.Ei);e&&(this.props=t_({},e))}}save(){this.ki||this.Y.G(this.Ei,this.props,this.Pi,this.Ti,this.Ii,this.R.debug)}remove(){this.Y.V(this.Ei,!1),this.Y.V(this.Ei,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(F(e)){M(t)&&(t="None"),this.Pi=M(i)?this.Ci:i;var r=!1;if(tp(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(F(e)){this.Pi=M(t)?this.Ci:t;var i=!1;if(tp(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.$i){var e=rp(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);C(ty(e))||this.register(e),this.$i=!0}}update_search_keyword(){var e;this.register((e=null==l?void 0:l.referrer)?rg(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rf(),$referring_domain:null!=l&&l.referrer&&(null==(e=ik(l.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[tX]||this.props[tK]||this.register_once({[tJ]:rm(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};tp([tK,tX],t=>{var i=this.props[t];i&&tp(i,function(t,i){e["$initial_"+S(i)]=t})});var t,i,r=this.props[tJ];return r&&t_(e,(t=ry(r),i={},tp(t,function(e,t){i["$initial_"+S(t)]=e}),i)),e}safe_merge(e){return tp(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Ci=this.Pi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.Si(e),s=this.props;this.clear(),this.Y=r,this.props=s,this.save()}}set_disabled(e){this.ki=e,this.ki?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ti&&(this.Ti=e,this.remove(),this.save())}set_secure(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[tS]||{};i[e]=t,this.props[tS]=i,this.save()}remove_event_timer(e){var t=(this.props[tS]||{})[e];return M(t)||(delete this.props[tS][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var sx=tl("[Product Tours]"),sk="ph_product_tours";class sS{constructor(e){this.Ri=null,this.Fi=null,this._instance=e}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[tC]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ri||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(tC)||this.it(()=>this.Oi())}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?sx.error("Could not load product tours script",t):e()})}Oi(){var e;!this.Ri&&null!=(e=_.__PosthogExtensions__)&&e.generateProductTours&&(this.Ri=_.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!I(this.Fi)||t){var i=this._instance.persistence;if(i){var r=i.props[sk];if(I(r)&&!t)return this.Fi=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:t=>{var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return sx.error(s),void e([],{isLoaded:!1,error:s})}var n=I(t.json.product_tours)?t.json.product_tours:[];this.Fi=n,i&&i.register({[sk]:n}),e(n,{isLoaded:!0})}})}else e(this.Fi,{isLoaded:!0})}getActiveProductTours(e){D(this.Ri)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ri.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Ri)||t.showTourById(e)}previewTour(e){this.Ri?this.Ri.previewTour(e):this.it(()=>{var t;this.Oi(),null==(t=this.Ri)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Ri)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Ri)||e.nextStep()}previousStep(){var e;null==(e=this.Ri)||e.previousStep()}clearCache(){var e;this.Fi=null,null==(e=this._instance.persistence)||e.unregister(sk)}resetTour(e){var t;null==(t=this.Ri)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Ri)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Ri)||t.cancelPendingTour(e)}}var sP=((nx={}).Activation="events",nx.Cancellation="cancelEvents",nx),sR=((nk={}).Button="button",nk.Tab="tab",nk.Selector="selector",(nS={}).TopLeft="top_left",nS.TopRight="top_right",nS.TopCenter="top_center",nS.MiddleLeft="middle_left",nS.MiddleRight="middle_right",nS.MiddleCenter="middle_center",nS.Left="left",nS.Center="center",nS.Right="right",nS.NextToTrigger="next_to_trigger",(nP={}).Top="top",nP.Left="left",nP.Right="right",nP.Bottom="bottom",(nR={}).Popover="popover",nR.API="api",nR.Widget="widget",nR.ExternalSurvey="external_survey",nR),sT=((nT={}).Open="open",nT.MultipleChoice="multiple_choice",nT.SingleChoice="single_choice",nT.Rating="rating",nT.Link="link",(n$={}).NextQuestion="next_question",n$.End="end",n$.ResponseBased="response_based",n$.SpecificQuestion="specific_question",(nI={}).Once="once",nI.Recurring="recurring",nI.Always="always",(nO={}).SHOWN="survey shown",nO.DISMISSED="survey dismissed",nO.SENT="survey sent",nO.ABANDONED="survey abandoned",nO),s$=((nF={}).SURVEY_ID="$survey_id",nF.SURVEY_NAME="$survey_name",nF.SURVEY_RESPONSE="$survey_response",nF.SURVEY_ITERATION="$survey_iteration",nF.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",nF.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",nF.SURVEY_SUBMISSION_ID="$survey_submission_id",nF.SURVEY_QUESTIONS="$survey_questions",nF.SURVEY_COMPLETED="$survey_completed",nF.PRODUCT_TOUR_ID="$product_tour_id",nF.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",nF),sI=((nC={}).Popover="popover",nC.Inline="inline",nC),sO=tl("[Surveys]"),sF="seenSurvey_",sC=e=>{var t;return t=""+sF+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+sF+e.id+"_"+e.current_iteration),t},sM=[sR.Popover,sR.Widget,sR.API],sA={ignoreConditions:!1,ignoreDelay:!1,displayType:sI.Popover};class sL{constructor(){this.Mi={},this.Mi={}}on(e,t){return this.Mi[e]||(this.Mi[e]=[]),this.Mi[e].push(t),()=>{this.Mi[e]=this.Mi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Mi[e]||[])i(t);for(var r of this.Mi["*"]||[])r(e,t)}}function sN(e,t,i){if(D(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class sD{constructor(e){this.Ai=new sL,this.ji=(e,t)=>this.Di(e,t)&&this.Li(e,t)&&this.Ni(e,t)&&this.Ui(e,t),this.Di=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.zi=new Set,this.Hi=new Set}init(){var e,t;M(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!M(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.Hi)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.zi)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(e,t){var i;null!=t&&0!=e.length&&(this.zi.has(e)||this.zi.has(null==t?void 0:t.event))&&this.Hi&&(null==(i=this.Hi)?void 0:i.size)>0&&this.Hi.forEach(e=>{this.Bi(t,e)&&this.Ai.emit("actionCaptured",e.name)})}qi(e){this.onAction("actionCaptured",t=>e(t))}Bi(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.ji(e,i))return!0;return!1}onAction(e,t){return this.Ai.on(e,t)}Li(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!sN(r,t.url,t.url_matching||"contains"))return!1}return!0}Ni(e,t){return!!this.Wi(e,t)&&!!this.Gi(e,t)&&!!this.Vi(e,t)}Wi(e,t){if(null==t||!t.href)return!0;var i=this.Ji(e);if(i.length>0)return i.some(e=>sN(e.href,t.href,t.href_matching||"exact"));var r,s,n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!n&&sN((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}Gi(e,t){if(null==t||!t.text)return!0;var i=this.Ji(e);if(i.length>0)return i.some(e=>sN(e.text,t.text,t.text_matching||"exact")||sN(e.$el_text,t.text,t.text_matching||"exact"));var r,s,n,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(s=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!D(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),n=t.text,o=t.text_matching||"exact",s.some(e=>sN(e,n,o)))}Vi(e,t){if(null==t||!t.selector)return!0;var i,r,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=s&&s.includes(t.selector))return!0;var n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}Ji(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Ui(e,t){return null==t||!t.properties||0===t.properties.length||sa(t.properties.reduce((e,t)=>{var i=I(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class sU{constructor(e){this._instance=e,this.Ki=new Map,this.Yi=new Map,this.Xi=new Map}Qi(e,t){return!!e&&sa(e.propertyFilters,null==t?void 0:t.properties)}Zi(e,t){var i=new Map;return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null!=t&&t.name){var r=i.get(t.name)||[];r.push(e.id),i.set(t.name,r)}})}),i}te(e,t,i){var r=(i===sP.Activation?this.Ki:this.Yi).get(e),s=[];return this.ie(e=>{s=e.filter(e=>null==r?void 0:r.includes(e.id))}),s.filter(r=>{var s,n=null==(s=r.conditions)||null==(s=s[i])||null==(s=s.values)?void 0:s.find(t=>t.name===e);return this.Qi(n,t)})}register(e){var t;M(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.ee(e),this.re(e))}re(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.se&&(this.se=new sD(this._instance),this.se.init(),this.se.qi(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.se)||s.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.Xi.get(t.name);i&&i.push(e.id),this.Xi.set(t.name,i||[e.id])}}))}))}ee(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});(0!==i.length||0!==r.length)&&(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.Ki=this.Zi(e,sP.Activation),this.Yi=this.Zi(e,sP.Cancellation))}onEvent(e,t){var i,r=this.ne(),s=this.oe(),n=this.ae(),o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[s])||[];if(n===e&&t&&o.length>0){r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var a,l,c=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(c){var u=o.indexOf(c);u>=0&&(o.splice(u,1),this.le(o))}}else{if(this.Yi.has(e)){var h=this.te(e,t,sP.Cancellation);h.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:h.map(e=>e.id)}),h.forEach(e=>{var t=o.indexOf(e.id);t>=0&&o.splice(t,1),this.ue(e.id)}),this.le(o))}if(this.Ki.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Ki.get(e)});var d=this.te(e,t,sP.Activation);this.le(o.concat(d.map(e=>e.id)||[]))}}}onAction(e){var t,i=this.oe(),r=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[i])||[];this.Xi.has(e)&&this.le(r.concat(this.Xi.get(e)||[]))}le(e){var t,i=this.ne(),r=this.oe(),s=[...new Set(e)].filter(e=>!this.he(e));i.info("updating activated items",{activatedItems:s}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[r]:s})}getActivatedIds(){var e,t=this.oe();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Ki}de(){return this.se}}class sj extends sU{constructor(e){super(e)}oe(){return"$surveys_activated"}ae(){return sT.SHOWN}ie(e){var t;null==(t=this._instance)||t.getSurveys(e)}ue(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}ne(){return sO}he(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class sH{constructor(e){this.ve=void 0,this._surveyManager=null,this.ce=!1,this.fe=[],this.pe=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(D(t))return sO.warn("Flags not loaded yet. Not loading surveys.");var i=I(t);this.ve=i?t.length>0:t,sO.info("flags response received, isSurveysEnabled: "+this.ve),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(sF)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.ce)sO.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)sO.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())sO.info("Not loading surveys in cookieless mode without consent.");else{var e=null==_?void 0:_.__PosthogExtensions__;if(e){if(!M(this.ve)||this._instance.config.advanced_enable_surveys){var t=this.ve||this._instance.config.advanced_enable_surveys;this.ce=!0;try{var i=e.generateSurveys;if(i)return void this._e(i,t);var r=e.loadExternalDependency;if(!r)return void this.ge("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.ge("Could not load surveys script",i):this._e(e.generateSurveys,t)})}catch(e){throw this.ge("Error initializing surveys",e),e}finally{this.ce=!1}}}else sO.error("PostHog Extensions not found.")}}_e(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new sj(this._instance),sO.info("Surveys loaded successfully"),this.me({isLoaded:!0})}ge(e,t){sO.error(e,t),this.me({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.fe.push(e),this._surveyManager&&this.me({isLoaded:!0}),()=>{this.fe=this.fe.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return sO.info("Disabled. Not loading surveys."),e([]);var i,r=this._instance.get_property(tB);if(r&&!t)return e(r,{isLoaded:!0});"u">typeof Promise&&this.pe?this.pe.then(t=>{var{surveys:i,context:r}=t;return e(i,r)}):("u">typeof Promise&&(this.pe=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{this.pe=null;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;sO.error(s);var n={isLoaded:!1,error:s};return e([],n),void(null==i||i({surveys:[],context:n}))}var o,a,l=t.json.surveys||[],c=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});c.length>0&&(null==(a=this._surveyEventReceiver)||a.register(c)),null==(o=this._instance.persistence)||o.register({[tB]:l});var u={isLoaded:!0};e(l,u),null==i||i({surveys:l,context:u})}}))}me(e){for(var t of this.fe)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){sO.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!D(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);sO.warn("init was not called")}be(e){var t=null;return this.getSurveys(i=>{var r;t=null!=(r=i.find(t=>t.id===e))?r:null}),t}ye(e){if(D(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.be(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(D(this._surveyManager))return sO.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ye(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return D(this._surveyManager)?(sO.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!=(r=t.find(t=>t.id===e))?r:null;if(s){var n=this.ye(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(D(this._surveyManager))sO.warn("init was not called");else{var s="string"==typeof e?this.be(e):e;if(null!=s&&s.id)if(sM.includes(s.type)){var n=null==l?void 0:l.querySelector(t);if(n)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(sO.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;sO.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,n,i),sO.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,i);sO.warn("Survey element not found")}else sO.warn("Surveys of type "+s.type+" cannot be rendered in the app");else sO.warn("Survey not found")}}displaySurvey(e,t){var i;if(D(this._surveyManager))sO.warn("init was not called");else{var r=this.be(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=m({},r,{appearance:m({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==sI.Popover&&t.initialResponses&&sO.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void sO.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==sI.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else sO.warn("Survey not found")}}cancelPendingSurvey(e){D(this._surveyManager)?sO.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var sq=tl("[Conversations]");class sB{constructor(e){this.we=void 0,this._conversationsManager=null,this.xe=!1,this.$e=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;D(t)||(H(t)?this.we=t:(this.we=t.enabled,this.$e=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.we=void 0,this.$e=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xe&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==_?void 0:_.__PosthogExtensions__;if(e&&!M(this.we)&&this.we)if(this.$e&&this.$e.token){this.xe=!0;try{var t=e.initConversations;if(t)return this.Ee(t),void(this.xe=!1);var i=e.loadExternalDependency;if(!i)return void this.Se("PostHog loadExternalDependency extension not found.");i(this._instance,"conversations",t=>{t||!e.initConversations?this.Se("Could not load conversations script",t):this.Ee(e.initConversations),this.xe=!1})}catch(e){this.Se("Error initializing conversations",e),this.xe=!1}}else sq.error("Conversations enabled but missing token in remote config.")}}Ee(e){if(this.$e)try{this._conversationsManager=e(this.$e,this._instance),sq.info("Conversations loaded successfully")}catch(e){this.Se("Error completing conversations initialization",e)}else sq.error("Cannot complete initialization: remote config is null")}Se(e,t){sq.error(e,t),this._conversationsManager=null,this.xe=!1}show(){this._conversationsManager?this._conversationsManager.show():sq.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.we&&!N(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var r=this;return f(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(sq.warn("Conversations not available yet."),null)})()}getMessages(e,t){var i=this;return f(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(sq.warn("Conversations not available yet."),null)})()}markAsRead(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(sq.warn("Conversations not available yet."),null)})()}getTickets(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(sq.warn("Conversations not available yet."),null)})()}requestRestoreLink(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(sq.warn("Conversations not available yet."),null)})()}restoreFromToken(e){var t=this;return f(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(sq.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var e=this;return f(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(sq.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}}class sV{constructor(e){var t;this.ke=!1,this.Pe=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.ke=!0)}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!D(i)&&i&&(this.ke=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.ke&&!this.Pe){var e=tl("[logs]"),t=null==_?void 0:_.__PosthogExtensions__;if(t){var i=t.loadExternalDependency;i?i(this._instance,"logs",i=>{var r;i||null==(r=t.logs)||!r.initializeLogs?e.error("Could not load logs script",i):(t.logs.initializeLogs(this._instance),this.Pe=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var sW=tl("[RateLimiter]");class sG{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{sW.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sW.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,r,{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(tY))?t:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var l=a.tokens<1;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(tY,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var sz=tl("[RemoteConfig]");class sY{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Te(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ie(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return sz.info("Using preloaded remote config",this.remoteConfig),this.Ce(this.remoteConfig),void this.Re();if(this._instance.M())return void sz.warn("Remote config is disabled. Falling back to local config.");this.Te(e=>{e?(this.Ce(e),this.Re()):(sz.info("No config found after loading remote JS config. Falling back to JSON."),this.Ie(e=>{this.Ce(e),this.Re()}))})}catch(e){sz.error("Error loading remote config",e)}}stop(){this.Fe&&(clearInterval(this.Fe),this.Fe=void 0)}refresh(){this._instance.M()||"hidden"===(null==l?void 0:l.visibilityState)||this._instance.featureFlags.reloadFeatureFlags()}Re(){this.Fe||(this.Fe=setInterval(()=>{this.refresh()},3e5))}Ce(e){e||sz.error("Failed to fetch remote config from PostHog."),this._instance.Ce(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}class sX{constructor(e,t){this.Oe=!0,this.Me=[],this.Ae=Y((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,ta.createLogger("flush interval"),3e3),this.je=e}enqueue(e){this.Me.push(e),this.De||this.Le()}unload(){this.Ne();var e=Object.values(this.Me.length>0?this.Ue():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.je(m({},e,{transport:"sendBeacon"}))})}enable(){this.Oe=!1,this.Le()}Le(){var e=this;this.Oe||(this.De=setTimeout(()=>{if(this.Ne(),this.Me.length>0){var t=this.Ue();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&I(r.data)&&tp(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.je(r)}()}},this.Ae))}Ne(){clearTimeout(this.De),this.De=void 0}Ue(){var e={};return tp(this.Me,t=>{var i,r=(t?t.batchKey:null)||t.url;M(e[r])&&(e[r]=m({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.Me=[],e}}var sK=["retriesPerformedSoFar"];class sJ{constructor(e){this.ze=!1,this.He=3e3,this.Me=[],this._instance=e,this.Me=[],this.Be=!0,!M(i)&&"onLine"in i.navigator&&(this.Be=i.navigator.onLine,this.qe=()=>{this.Be=!0,this.Lt()},this.We=()=>{this.Be=!1},tw(i,"online",this.qe),tw(i,"offline",this.We))}get length(){return this.Me.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=y(e,sK);j(t)&&(i.url=r9(i.url,{retry_count:t})),this._instance._send_request(m({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Ge(m({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}Ge(e){var t,i,r,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var n=(r=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,s)))-t/2),Math.ceil(i+r)),o=Date.now()+n;this.Me.push({retryAt:o,requestOptions:e});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),ta.warn(a),this.ze||(this.ze=!0,this.Ve())}Ve(){(this.Je&&clearTimeout(this.Je),0===this.Me.length)?(this.ze=!1,this.Je=void 0):this.Je=setTimeout(()=>{this.Be&&this.Me.length>0&&this.Lt(),this.Ve()},this.He)}Lt(){var e=Date.now(),t=[],i=this.Me.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.Me=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Je&&(clearTimeout(this.Je),this.Je=void 0),this.ze=!1,M(i)||(this.qe&&(i.removeEventListener("online",this.qe),this.qe=void 0),this.We&&(i.removeEventListener("offline",this.We),this.We=void 0)),this.Me))try{this._instance._send_request(m({},e,{transport:"sendBeacon"}))}catch(e){ta.error(e)}this.Me=[]}}class sZ{constructor(e){this.Ke=()=>{this.Ye||(this.Ye={});var e,t,i,r,s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.Ye.lastScrollY=Math.ceil(n),this.Ye.maxScrollY=Math.max(n,null!=(e=this.Ye.maxScrollY)?e:0),this.Ye.maxScrollHeight=Math.max(o,null!=(t=this.Ye.maxScrollHeight)?t:0),this.Ye.lastContentY=a,this.Ye.maxContentY=Math.max(a,null!=(i=this.Ye.maxContentY)?i:0),this.Ye.maxContentHeight=Math.max(l,null!=(r=this.Ye.maxContentHeight)?r:0)},this._instance=e}getContext(){return this.Ye}resetContext(){var e=this.Ye;return setTimeout(this.Ke,0),e}startMeasuringScrollPosition(){tw(i,"scroll",this.Ke,{capture:!0}),tw(i,"scrollend",this.Ke,{capture:!0}),tw(i,"resize",this.Ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==i?void 0:i.document.documentElement;for(var e of I(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var t=null==i?void 0:i.document.querySelector(e);if(t)return t}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return i&&(i.scrollY||i.pageYOffset||i.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return i&&(i.scrollX||i.pageXOffset||i.document.documentElement.scrollLeft)||0}}var sQ=e=>rm(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class s0{constructor(e,t,i,r){this.Xe=e=>{var t=this.Qe();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ze(this._instance)};this.tr.register({[tz]:i})}},this._instance=e,this.ir=t,this.tr=i,this.Ze=r||sQ,this.ir.onSessionId(this.Xe)}Qe(){return this.tr.props[tz]}getSetOnceProps(){var e,t=null==(e=this.Qe())?void 0:e.props;return t?"r"in t?ry(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return tp(ty(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+S(i)]=t}),e}}var s1=tl("[SessionId]");class s2{on(e,t){return this.er.on(e,t)}constructor(e,t,i){if(this.rr=[],this.sr=void 0,this.er=new sL,this.nr=(e,t)=>!(!j(e)||!j(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.R=e.config,this.tr=e.persistence,this.ar=void 0,this.lr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ur=t||iU,this.hr=i||iU;var r,s=this.R.persistence_name||this.R.token,n=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Y(n,60,36e3,s1.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.dr(),this.vr="ph_"+s+"_window_id",this.cr="ph_"+s+"_primary_window_exists",this.pr()){var o=iK.W(this.vr),a=iK.W(this.cr);o&&!a?this.ar=o:iK.V(this.vr),iK.G(this.cr,!0)}if(null!=(r=this.R.bootstrap)&&r.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.R.bootstrap.sessionID);this._r(this.R.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){s1.error("Invalid sessionID in bootstrap",e)}this.gr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return M(this.rr)&&(this.rr=[]),this.rr.push(e),this.lr&&e(this.lr,this.ar),()=>{this.rr=this.rr.filter(t=>t!==e)}}pr(){return"memory"!==this.R.persistence&&!this.tr.ki&&iK.H()}mr(e){e!==this.ar&&(this.ar=e,this.pr()&&iK.G(this.vr,e))}br(){return this.ar?this.ar:this.pr()?iK.W(this.vr):null}_r(e,t,i){e===this.lr&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.lr=e,this.tr.register({[tL]:[t,e,i]}))}yr(){var e=this.tr.props[tL];return I(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._r(null,null,null)}destroy(){clearTimeout(this.wr),this.wr=void 0,this.sr&&i&&(i.removeEventListener("beforeunload",this.sr,{capture:!1}),this.sr=void 0),this.rr=[]}gr(){this.sr=()=>{this.pr()&&iK.V(this.cr)},tw(i,"beforeunload",this.sr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.R.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[r,s,n]=this.yr(),o=this.br(),a=j(n)&&Math.abs(i-n)>864e5,l=!1,c=!s,u=!c&&!e&&this.nr(i,r);c||u||a?(s=this.ur(),o=this.hr(),s1.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.hr(),l=!0);var h=j(r)&&e&&!a?r:i,d=j(n)?n:(new Date).getTime();return this.mr(o),this._r(s,h,d),e||this.dr(),l&&this.rr.forEach(e=>e(s,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:s,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}dr(){clearTimeout(this.wr),this.wr=setTimeout(()=>{var[e]=this.yr();if(this.nr((new Date).getTime(),e)){var t=this.lr;this.resetSessionId(),this.er.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var s3=["$set_once","$set"],s5=tl("[SiteApps]");class s6{constructor(e){this._instance=e,this.$r=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Er(e,t){if(t){var i=this.globalsForEvent(t);this.$r.push(i),this.$r.length>1e3&&(this.$r=this.$r.slice(10))}}get siteAppLoaders(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Er.bind(this));this.Sr=()=>{e(),this.$r=[],this.Sr=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,r,s,n,o,a,l={},c=this._instance.get_property("$groups")||[];for(var[u,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:h};var{$set_once:d,$set:p}=e;return{event:m({},y(e,s3),{properties:m({},e.properties,p?{$set:m({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:m({},null!=(r=null==(s=e.properties)?void 0:s.$set_once)?r:{},d)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.$r.length&&(s5.info("Processing "+this.$r.length+" events for site app with id "+e.id),this.$r.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Sr)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,s5.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{s(e)}});n&&(t.processEvent=n),r=!0}catch(t){s5.error("Error while initializing PostHog app with config id "+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){s5.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}kr(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Pr(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){s5.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.kr(),void this._instance.on("eventCaptured",e=>this.Pr(e))):void s5.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Sr)||i.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var n=function(e){var t;_["__$$ph_site_app_"+e]=s._instance,null==(t=_.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,a,t=>{if(t)return s5.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else s5.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var s8=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&w(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>w(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},s4=((nM={}).US="us",nM.EU="eu",nM.CUSTOM="custom",nM),s7="i.posthog.com";class s9{constructor(e){this.Tr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+s7,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Tr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Tr[this.apiHost]=s4.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Tr[this.apiHost]=s4.EU:this.Tr[this.apiHost]=s4.CUSTOM),this.Tr[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===s4.CUSTOM)return this.apiHost+t;var i=s7+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var ne={icontains:(e,t)=>!!i&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!i&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!i&&sr(t.href,e),not_regex:(e,t)=>!!i&&!sr(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class nt{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{nt.Ir("retrieved web experiments from the server"),t.Cr=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Cr&&(nt.Ir("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Cr)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);A(r)&&e.variants[r]&&t.Rr(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];nt.Fr(n)&&t.Rr(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())nt.Ir("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(D(this.Cr))return this.Cr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nt.Ir("applying feature flags",e),e.forEach(e=>{var t;if(this.Cr&&null!=(t=this.Cr)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.Cr)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.Rr(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=nt.getWindowLocation();if(null!=e&&e.search){var t=iP(null==e?void 0:e.search,"__experiment_id"),i=iP(null==e?void 0:e.search,"__experiment_variant");t&&i&&(nt.Ir("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Or(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}Or(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(nt.Ir("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Rr(r[0].name,t,r[0].variants[t].transforms))}static Fr(e){return!D(e.conditions)&&nt.Mr(e)&&nt.Ar(e)}static Mr(e){if(D(e.conditions)||D(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,r,s,n=nt.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||ne[null!=(r=null==(s=e.conditions)?void 0:s.urlMatchType)?r:"icontains"](e.conditions.url,n))}static getWindowLocation(){return null==i?void 0:i.location}static Ar(e){if(D(e.conditions)||D(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rp();if(t.utm_source){var i,r,s,n,o,a,l,c,u,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,_=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==t.utm_term;return h&&p&&_&&d}return!1}static Ir(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];ta.info("[WebExperiments] "+e,i)}Rr(e,t,i){this._is_bot()?nt.Ir("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){nt.Ir("applying transform of variant "+t+" for experiment "+e+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):nt.Ir("Control variants leave the page unmodified.")}_is_bot(){return a&&this._instance?s8(a,this._instance.config.custom_blocked_useragents):void 0}}var ni=tl("[PostHog ExternalIntegrations]"),nr={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ns{constructor(e){this._instance=e}it(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return ni.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,r,n;!s||null!=(i=_.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.it(nr[e],()=>{var i;null==(i=_.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!s&&null!=(r=_.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]&&(null==(n=_.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[r,s]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(r)}}tl("[SessionRecording]");var nn="[SessionRecording]",no=tl(nn);class na{get started(){var e;return!(null==(e=this.jr)||!e.isStarted)}get status(){return this.jr?this.jr.status:this.Dr&&!this.Lr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Dr=!1,this.Nr=!1,this.Ur=void 0,this._instance=e,!this._instance.sessionManager)throw no.error("started without valid sessionManager"),Error(nn+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw Error(nn+' cannot be used with cookieless_mode="always"')}get Lr(){var e,t=!(null==(e=this._instance.get_property(tA))||!e.enabled),r=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return i&&t&&r&&!s}startIfEnabledOrStop(e){var t;if(!this.Lr||null==(t=this.jr)||!t.isStarted){var i=!M(Object.assign)&&!M(Array.from);this.Lr&&i?(this.zr(e),no.info("starting")):this.stopRecording()}}zr(e){var t,i,r;this.Lr&&(null!=_&&null!=(t=_.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=_.__PosthogExtensions__)&&i.initSessionRecording?this.Hr(e):null==(r=_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Br,t=>{if(t)return no.error("could not load recorder",t);this.Hr(e)}))}stopRecording(){var e,t;null==(e=this.Ur)||e.call(this),this.Ur=void 0,null==(t=this.jr)||t.stop()}qr(){var e;null==(e=this._instance.persistence)||e.unregister(tN)}Wr(e){if(this._instance.persistence){var t,i,r=this._instance.persistence,s=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,s=D(i)?null:parseFloat(i);D(s)&&this.qr();var n=null==t?void 0:t.minimumDurationMilliseconds;r.register({[tA]:m({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:m({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:s,minimumDurationMilliseconds:M(n)?null:n,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};s(),null==(t=this.Ur)||t.call(this),this.Ur=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.Nr=!1,this.Wr(e),this.Dr=!0,this.startIfEnabledOrStop()):this.Dr=!0:no.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.jr)&&i.log?this.jr.log(e,t):no.warn("log called before recorder was ready")}get Br(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(tA);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Gr(){var e,t=this._instance.get_property(tA);if(!t)return!1;var i=null!=(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)?e:Date.now();return Date.now()-i<=3e5}Hr(e){var t,i;if(null==(t=_.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.jr||(this.jr=null==(i=_.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.jr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Gr()?this.jr.start(e):this.Nr||(this.Nr=!0,no.info("persisted remote config is stale, requesting fresh config before starting"),new sY(this._instance).load())}onRRwebEmit(e){var t;null==(t=this.jr)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.jr||null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}),null==(e=this.jr)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.jr||null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}),null==(e=this.jr)||e.overrideSampling()}overrideTrigger(e){var t,i;this.jr||null==(i=this._instance.persistence)||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(t=this.jr)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.jr)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.jr)||!i.tryAddCustomEvent(e,t))}}var nl={},nc=0,nu=()=>{},nh="posthog",nd=!r4&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),np=e=>{var t;return m({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!A(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of tb)if(i===r)return!1;return!0}(null==l?void 0:l.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nu,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:c&&A(null==c?void 0:c.search)&&-1!==c.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==i||null==(t=i.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;ta.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nu,__preview_eager_load_replay:!1},{rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0})},n_=e=>{var t={};M(e.process_person)||(t.person_profiles=e.process_person),M(e.xhr_headers)||(t.request_headers=e.xhr_headers),M(e.cookie_name)||(t.persistence_name=e.cookie_name),M(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),M(e.store_google)||(t.save_campaign_params=e.store_google),M(e.verbose)||(t.debug=e.verbose);var i=t_({},t,e);return I(e.property_blacklist)&&(M(e.property_denylist)?i.property_denylist=e.property_blacklist:I(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:ta.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class ng{constructor(){this.__forceAllowLocalhost=!1}get Vr(){return this.__forceAllowLocalhost}set Vr(e){ta.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nv{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new ng,this.Jr=!1,this.version=g.LIB_VERSION,this.mi=new sL,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=np(),this.SentryIntegration=re,this.sentryIntegration=e=>{var t;return t=i9(this,e),{name:i7,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Kr=!1,this.Yr=null,this.Xr=null,this.Qr=null,this.featureFlags=new sb(this),this.toolbar=new rn(this),this.scrollManager=new sZ(this),this.pageViewManager=new rP(this),this.surveys=new sH(this),this.conversations=new sB(this),this.logs=new sV(this),this.experiments=new nt(this),this.exceptions=new sc(this),this.rateLimiter=new sG(this),this.requestRouter=new s9(this),this.consent=new iZ(this),this.externalIntegrations=new ns(this),this.people={set:(e,t,i)=>{var r=A(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=A(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>ta.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==nh){var r,s=null!=(r=nl[i])?r:new nv;return s._init(e,t,i),nl[i]=s,nl[nh][i]=s,s}return this._init(e,t,i)}_init(e,t,r){if(void 0===t&&(t={}),M(e)||L(e))return ta.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Zr(t.debug),this.ts=t,this.es=[],t.person_profiles?this.Xr=t.person_profiles:t.process_person&&(this.Xr=t.process_person),this.set_config(t_({},np(t.defaults),n_(t),{name:r,token:e})),this.config.on_xhr_error&&ta.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rR.GZipJS;var s=this.rs();this.persistence=new sw(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sw(m({},this.config,{persistence:"sessionStorage"}),s);var n=m({},this.persistence.props),o=m({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.ss=new sX(e=>this.ns(e),this.config.request_queue_config),this.os=new sJ(this),this.__request_queue=[];var a="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(a||(this.sessionManager=new s2(this),this.sessionPropsManager=new s0(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ta.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.ls(a)},0)):(ta.info("Initializing extensions synchronously"),this.ls(a)),g.DEBUG=g.DEBUG||this.config.debug,g.DEBUG&&ta.info("Starting in debug mode",{this:this,config:t,thisC:m({},this.config),p:n,s:o}),void 0!==(null==(l=t.bootstrap)?void 0:l.distinctID)){var l,c,u,h=this.config.get_device_id(iU()),d=null!=(c=t.bootstrap)&&c.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(tG,null!=(u=t.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.us()){var p,_,v=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])}).reduce((e,i)=>{var r;return e[i]=(null==(r=t.bootstrap)||null==(r=r.featureFlags)?void 0:r[i])||!1,e},{}),f=Object.keys((null==(_=t.bootstrap)?void 0:_.featureFlagPayloads)||{}).filter(e=>v[e]).reduce((e,i)=>{var r,s;return null!=(r=t.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[i]&&(e[i]=null==(s=t.bootstrap)||null==(s=s.featureFlagPayloads)?void 0:s[i]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:f})}if(a)this.register_once({distinct_id:t0,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(iU());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(tG,"anonymous")}return tw(i,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||iU();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(tG,"identified")),t()},s=i.user();"then"in s&&O(s.then)?s.then(r):r(s)}(e,()=>{var r;i.register((Promise&&Promise.resolve||i4.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(i4.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(i4.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,"$pageview"),identify:e=>r(e,"$identify"),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.hs()):this.hs(),O(this.config._onCapture)&&this.config._onCapture!==nu&&(ta.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&ta.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}ls(e){var t=performance.now();this.historyAutocapture=new i8(this),this.historyAutocapture.startIfEnabled();var i=[];i.push(()=>{new ra(this).startIfEnabledOrStop()}),i.push(()=>{var e;this.siteApps=new s6(this),null==(e=this.siteApps)||e.init()}),e||i.push(()=>{this.sessionRecording=new na(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||i.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),i.push(()=>{this.autocapture=new iF(this),this.autocapture.startIfEnabled()}),i.push(()=>{this.surveys.loadIfEnabled()}),i.push(()=>{this.logs.loadIfEnabled()}),i.push(()=>{this.conversations.loadIfEnabled()}),i.push(()=>{this.productTours=new sS(this),this.productTours.loadIfEnabled()}),i.push(()=>{this.heatmaps=new rS(this),this.heatmaps.startIfEnabled()}),i.push(()=>{this.webVitalsAutocapture=new rw(this)}),i.push(()=>{this.exceptionObserver=new i5(this),this.exceptionObserver.startIfEnabledOrStop()}),i.push(()=>{this.deadClicksAutocapture=new i2(this,i1),this.deadClicksAutocapture.startIfEnabledOrStop()}),i.push(()=>{if(this.ds){var e=this.ds;this.ds=void 0,this.Ce(e)}}),this.vs(i,t)}vs(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.vs(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){ta.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&ta.info("PostHog extensions initialized ("+r+"ms)")}Ce(e){var t,i,r,s,n,o,a,c,u;l&&l.body?(this.config.__preview_deferred_init_extensions&&(this.ds=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=x(e.supportedCompression,rR.GZipJS)?rR.GZipJS:x(e.supportedCompression,rR.Base64)?rR.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Xr?this.Xr:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(s=this.autocapture)||s.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(o=this.productTours)||o.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(c=this.exceptionObserver)||c.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)):(ta.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.Ce(e)},500))}hs(){try{this.config.loaded(this)}catch(e){ta.critical("`loaded` function failed",e)}if(this.cs(),this.config.internal_or_test_user_hostname&&null!=c&&c.hostname){var e=c.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.fs()},1),this.ps=new sY(this),this.ps.load()}cs(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.ss)||e.enable())}_dom_loaded(){this.is_capturing()&&td(this.__request_queue,e=>this.ns(e)),this.__request_queue=[],this.cs()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this._s()&&this.capture("$pageleave"),null==(e=this.ss)||e.unload(),null==(t=this.os)||t.unload()):this._s()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(nd?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=r9(e.url,{ip:+!!this.config.ip}),e.headers=m({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,s=m({},e);s.timeout=s.timeout||6e4,s.url=r9(s.url,{_:(new Date).getTime().toString(),ver:g.LIB_VERSION,compression:s.compression});var n=null!=(t=s.transport)?t:"fetch",o=si.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),a=null!=(i=null==(r=tE(o,e=>e.transport===n))?void 0:r.method)?i:o[0].method;if(!a)throw Error("No available transport method");a(s)})(m({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(r=this.config).on_request_error)||i.call(r,t)),null==e.callback||e.callback(t)}}))))}ns(e){this.os?this.os.retriableRequest(e):this._send_request(e)}_execute_array(e){nc++;try{var t,i=[],r=[],s=[];td(e,e=>{e&&(t=e[0],I(t)?s.push(e):O(e)?e.call(this):I(e)&&"alias"===t?i.push(e):I(e)&&-1!==t.indexOf("capture")&&O(this[t])?s.push(e):r.push(e))});var n=function(e,t){td(e,function(e){if(I(e[0])){var i=t;tp(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(r,this),n(s,this)}finally{nc--}}us(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){if(nc>0&&I(e)&&A(e[0])){var t=nv.prototype[e[0]];O(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.ss){if(this.is_capturing())if(!M(e)&&A(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var n=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){null!=t&&t.$current_url&&!A(null==t?void 0:t.$current_url)&&(ta.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.oi||ta.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 o=new Date,a=(null==i?void 0:i.timestamp)||o,l=iU(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},a,l)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&s&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),n&&(c.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var u,h="$groupidentify"!==e,d=this.gs(null==i?void 0:i.$set_once,h);if(d&&(c.$set_once=d),(p=c,_=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,g=e=>A(e)&&!N(_)?e.slice(0,_):e,v=new Set,c=function e(t,i){var r;return t!==Object(t)?g?g(t,i):t:v.has(t)?void 0:(v.add(t),I(t)?(r=[],td(t,t=>{r.push(e(t))})):(r={},tp(t,(t,i)=>{v.has(t)||(r[i]=e(t,i))})),r)}(p)).timestamp=a,M(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=o),e===sT.DISMISSED||e===sT.SENT){var p,_,g,v,f,y,b,E=null==t?void 0:t[s$.SURVEY_ID],w=null==t?void 0:t[s$.SURVEY_ITERATION];u={id:E,current_iteration:w},localStorage.getItem(sC(u))||localStorage.setItem(sC(u),"true"),c.$set=m({},c.$set,{[(f={id:E,current_iteration:w},b="$survey_"+(y=e===sT.SENT?"responded":"dismissed")+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(b="$survey_"+y+"/"+f.id+"/"+f.current_iteration),b)]:!0})}else e===sT.SHOWN&&(c.$set=m({},c.$set,{[s$.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var x=m({},c.properties.$set,c.$set);if(C(x)||this.setPersonPropertiesForFlags(x),!D(this.config.before_send)){var k=this.bs(c);if(!k)return;c=k}this.mi.emit("eventCaptured",c);var S={method:"POST",url:null!=(r=null==i?void 0:i._url)?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.ns(S):this.ss.enqueue(S),c}ta.critical("This capture call is ignored due to client rate limiting.")}}else ta.error("No event name provided to posthog.capture")}else ta.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,r,s,n){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var o,a=n?void 0:this.persistence.remove_event_timer(e),u=m({},t);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(u.$cookieless_mode=!0),"$snapshot"===e){var h=m({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=h.distinct_id,(!A(u.distinct_id)&&!U(u.distinct_id)||L(u.distinct_id))&&ta.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,_=function(e,t){if(!p)return{};var r,s,n=e?tg([],rc,t||[]):[],[o,a]=function(e){for(var t=0;t<eW.length;t++){var[i,r]=eW[t],s=i.exec(e),n=s&&(O(r)?r(s,e):r);if(n)return n}return["",""]}(p);return t_(ty({$os:o,$os_version:a,$browser:eq(p,navigator.vendor),$device:eG(p),$device_type:(s=eG(p))===er||s===ei||"Kobo"===s||"Kindle Fire"===s||s===eC?et:s===ew||s===ek||s===ex||s===eI?"Console":s===en?"Wearable":s?Q:"Desktop",$timezone:rb(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:iR(null==c?void 0:c.href,n,rh),$host:null==c?void 0:c.host,$pathname:null==c?void 0:c.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:eV(p,navigator.vendor),$browser_language:rv(),$browser_language_prefix:"string"==typeof(r=rv())?r.split("-")[0]:void 0,$screen_height:null==i?void 0:i.screen.height,$screen_width:null==i?void 0:i.screen.width,$viewport_height:null==i?void 0:i.innerHeight,$viewport_width:null==i?void 0:i.innerWidth,$lib:"web",$lib_version:g.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:v,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,r.getTime());u.$session_id=v,u.$window_id=f}this.sessionPropsManager&&t_(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&t_(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(o=this.os)?void 0:o.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===s4.CUSTOM&&(u.$lib_custom_api_host=this.config.api_host),d="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=t_(u,d),"$pageview"===e&&l&&(u.title=l.title),!M(a)){var y=r.getTime()-a;u.$duration=parseFloat((y/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=t_({},_,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),I(this.config.property_denylist)?tp(this.config.property_denylist,function(e){delete u[e]}):ta.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(ta.error("sanitize_properties is deprecated. Use before_send instead"),u=b(u,e));var E=this.ys();return u.$process_person_profile=E,E&&!n&&this.ws("_calculate_event_properties"),u}gs(e,t){if(void 0===t&&(t=!0),!this.persistence||!this.ys()||this.Jr)return e;var i,r=t_({},this.persistence.get_initial_props(),(null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(ta.error("sanitize_properties is deprecated. Use before_send instead"),r=s(r,"$set_once")),t&&(this.Jr=!0),C(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}xs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var r=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},n=m({},r,e),o=m({},s,t),a={};for(var[l,c]of Object.entries(n)){var u="string"==typeof c;a[l]={key:l,enabled:!!u||!!c,variant:u?c:void 0,reason:void 0,metadata:M(null==o?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.featureFlags.receivedFeatureFlags({flags:a})}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.mi.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=sA),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ta.uninitializedWarning("posthog.identify");if(U(e)&&(e=e.toString(),ta.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))ta.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==t0){if(this.ws("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(tk)&&(this.unregister(tk),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(tG)||"anonymous");e!==r&&s?(this.persistence.set_property(tG,"identified"),this.setPersonPropertiesForFlags(m({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.Qr=ss(e,t,i),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(tV))}}else ta.critical('The string "'+t0+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ta.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.ws("posthog.setPersonProperties")){var i=ss(this.get_distinct_id(),e,t);this.Qr!==i?(this.setPersonPropertiesForFlags(m({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Qr=i):ta.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:m({},r,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===t||i||this.reloadFeatureFlags()}else ta.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.ws("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(ta.info("reset"),!this.__loaded)return ta.uninitializedWarning("posthog.reset");var t,i,r,s,n,o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),null==(r=this.ps)||r.stop(),this.featureFlags.reset(),null==(s=this.persistence)||s.set_property(tG,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Qr=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:t0,$device_id:null},"");else{var a=this.config.get_device_id(iU());this.register_once({distinct_id:a,$device_id:e?a:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var s,n=null!=(s=e.timestampLookBack)?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(e,t){return e===this.get_property(tx)?(ta.critical("Attempting to create alias for existing People user - aborting."),-2):this.ws("posthog.alias")?(M(t)&&(t=this.get_distinct_id()),e!==t?(this.xs(tk,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ta.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=m({},this.config);if(F(e)){t_(this.config,n_(e));var i,r,s,n,o,a,l,c,u=this.rs();null==(i=this.persistence)||i.update_config(this.config,t,u),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sw(m({},this.config,{persistence:"sessionStorage"}),u);var h=this.Zr(this.config.debug);H(h)&&(this.config.debug=h),H(this.config.debug)&&(this.config.debug?(g.DEBUG=!0,iW.H()&&iW.G("ph_debug","true"),ta.info("set_config",{config:e,oldConfig:t,newConfig:m({},this.config)})):(g.DEBUG=!1,iW.H()&&iW.V("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(n=this.autocapture)||n.startIfEnabled(),null==(o=this.heatmaps)||o.startIfEnabled(),null==(a=this.exceptionObserver)||a.startIfEnabledOrStop(),null==(l=this.deadClicksAutocapture)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.$s(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,r,s,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(m({},r,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:nh;return t!==nh&&(t=nh+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(tG))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(tG))}ys(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&C(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tk])&&(null==(t=this.persistence)||null==(t=t.props)||!t[tZ]))}_s(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.ys()||this.ws("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ws("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ws(e){return"never"===this.config.person_profiles?(ta.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.xs(tZ,!0),!0)}rs(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}$s(){var e,t,i,r,s=this.rs();return(null==(e=this.persistence)?void 0:e.ki)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.ki)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t,i,r,s;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new s2(this),this.pageViewManager=new rP(this),this.persistence&&(this.sessionPropsManager=new s0(this,this.sessionManager,this.persistence)),this.sessionRecording=new na(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.$s(),this.cs(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(M(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.fs()):ta.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.$s(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:t0,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.fs())):ta.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===iJ.GRANTED?"granted":e===iJ.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.$s()}_is_bot(){return a?s8(a,this.config.custom_blocked_useragents):void 0}fs(){l&&("visible"===l.visibilityState?this.Kr||(this.Kr=!0,this.capture("$pageview",{title:l.title},{send_instantly:!0}),this.Yr&&(l.removeEventListener("visibilitychange",this.Yr),this.Yr=null)):this.Yr||(this.Yr=this.fs.bind(this),tw(l,"visibilitychange",this.Yr)))}debug(e){!1===e?(null==i||i.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==i||i.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}M(){var e,t,i,r,s=this.ts||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ta.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in s&&!D(s[e]),r=t in s&&!D(s[t]),i?s[e]:!!r&&(ta&&ta.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}bs(e){if(D(this.config.before_send))return e;var t=I(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(D(i=r(i))){var s="Event '"+e.event+"' was rejected in beforeSend function";return q(e.event)?ta.warn(s+". This can cause unexpected behavior."):ta.info(s),null}i.properties&&!C(i.properties)||ta.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.Kt)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Zr(e){var t=H(e)&&!e,i=iW.H()&&"true"===iW.q("ph_debug");return!t&&(!!i||e)}}for(var nf=["identify"],nm=0;nm<nf.length;nm++)nv.prototype[nf[nm]]=tm(nv.prototype[nf[nm]]);(nA={}).SHOWN="product tour shown",nA.DISMISSED="product tour dismissed",nA.COMPLETED="product tour completed",nA.STEP_SHOWN="product tour step shown",nA.STEP_COMPLETED="product tour step completed",nA.BUTTON_CLICKED="product tour button clicked",nA.STEP_SELECTOR_FAILED="product tour step selector failed",nA.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",nA.BANNER_ACTION_CLICKED="product tour banner action clicked",(nL={}).TOUR_ID="$product_tour_id",nL.TOUR_NAME="$product_tour_name",nL.TOUR_ITERATION="$product_tour_iteration",nL.TOUR_RENDER_REASON="$product_tour_render_reason",nL.TOUR_STEP_ID="$product_tour_step_id",nL.TOUR_STEP_ORDER="$product_tour_step_order",nL.TOUR_STEP_TYPE="$product_tour_step_type",nL.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",nL.TOUR_BUTTON_TEXT="$product_tour_button_text",nL.TOUR_BUTTON_ACTION="$product_tour_button_action",nL.TOUR_BUTTON_LINK="$product_tour_button_link",nL.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",nL.TOUR_STEPS_COUNT="$product_tour_steps_count",nL.TOUR_STEP_SELECTOR="$product_tour_step_selector",nL.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",nL.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",nL.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",nL.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",nL.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",nL.TOUR_ERROR="$product_tour_error",nL.TOUR_MATCHES_COUNT="$product_tour_matches_count",nL.TOUR_FAILURE_PHASE="$product_tour_failure_phase",nL.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",nL.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",nL.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",nL.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",nL.USE_MANUAL_SELECTOR="$use_manual_selector",nL.INFERENCE_DATA_PRESENT="$inference_data_present";var ny,nb,nE,nw,nx,nk,nS,nP,nR,nT,n$,nI,nO,nF,nC,nM,nA,nL,nN,nD=(nN=nl[nh]=new nv,function(){function e(){e.done||(e.done=!0,nd=!1,tp(nl,function(e){e._dom_loaded()}))}null!=l&&l.addEventListener?"complete"===l.readyState?e():tw(l,"DOMContentLoaded",e,{capture:!1}):i&&ta.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),nN);let nU=t.default.env.NEXT_PUBLIC_POSTHOG_KEY||"phx_OzJfiDl1pVcli6bZ8uN3yv6jLXzFVL33Wd3m11ZFfRqvzIe",nj=t.default.env.NEXT_PUBLIC_POSTHOG_HOST||"https://us.i.posthog.com",nH=!1,nq=!1;function nB(e,t){!nH&&nU&&(nq=t,nD.init(nU,{api_host:nj,autocapture:!1,capture_pageview:!1,capture_pageleave:!1,persistence:"memory",disable_session_recording:!0,bootstrap:{distinctID:e},sanitize_properties:e=>(e.$current_url&&(e.$current_url=e.$current_url.replace(/https?:\/\/127\.0\.0\.1:\d+/,"")),e.$pathname&&(e.$pathname=e.$pathname.replace(/https?:\/\/127\.0\.0\.1:\d+/,"")),e)}),nD.identify(e),t&&nD.opt_out_capturing(),nH=!0)}function nV(e,t){nH&&!nq&&nD.capture(e,t)}function nW(e){nH&&!nq&&nD.capture("$pageview",{page:e})}function nG(e){nq=e,nH&&(e?nD.opt_out_capturing():nD.opt_in_capturing())}e.s(["initTelemetry",()=>nB,"setOptOut",()=>nG,"track",()=>nV,"trackPageView",()=>nW],9593)}]);
|