@cmmd-center/forge 0.9.3 → 0.9.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/dist/{BunHttpServer-Dc5XijQF.mjs → BunHttpServer-BgNCpQzV.mjs} +2 -2
- package/dist/{BunHttpServer-Cuya1Zon.cjs → BunHttpServer-DOAuw4Iq.cjs} +2 -2
- package/dist/{BunPTY-z9OKvyBo.cjs → BunPTY-2icf7sRj.cjs} +2 -2
- package/dist/{BunPTY-CfS5zDoQ.mjs → BunPTY-D-Klry5N.mjs} +2 -2
- package/dist/{BunServices-eq_c-3x1.mjs → BunServices-ChM4mYH9.mjs} +1 -1
- package/dist/{BunServices-khEuvPaA.cjs → BunServices-CiNXNzHD.cjs} +1 -1
- package/dist/Mime-BITO-E1U.mjs +1395 -0
- package/dist/Mime-CyHbecis.cjs +1400 -0
- package/dist/{Mime-B75_d9aw.mjs → NodeHttpServer-C_wePPV0.mjs} +614 -1456
- package/dist/{Mime-aSilaQX9.cjs → NodeHttpServer-D_ismXpd.cjs} +617 -1466
- package/dist/{NodePTY-ChjVFpUH.mjs → NodePTY-BMUFdM93.mjs} +2 -2
- package/dist/{NodePTY-BOaJi0JA.cjs → NodePTY-cb7HIasY.cjs} +2 -2
- package/dist/{NodeSqliteClient-GlgGqc8V.mjs → NodeSqliteClient-OdI1TawL.mjs} +1 -1
- package/dist/{NodeSqliteClient-Vunn3aFN.cjs → NodeSqliteClient-SsUCk9mA.cjs} +1 -1
- package/dist/{PTY-rn2kGjhB.mjs → PTY-CBkE5akF.mjs} +1 -1
- package/dist/{PTY-D5OpMK9s.cjs → PTY-U3JQnLXS.cjs} +1 -1
- package/dist/{SqliteClient-Bpkno4Ob.cjs → SqliteClient-CdAhI4lb.cjs} +1 -1
- package/dist/{SqliteClient-DYQAvreq.mjs → SqliteClient-aoOb51gB.mjs} +1 -1
- package/dist/bin.cjs +14348 -10877
- package/dist/bin.mjs +14530 -11057
- package/dist/client/apple-touch-icon.png +0 -0
- package/dist/client/apple-touch-icon.png.publish-bak +0 -0
- package/dist/client/assets/CanvasPanel-BIN3OTEQ.js +441 -0
- package/dist/client/assets/CompositeItem-UKxcvvWv.js +2 -0
- package/dist/client/assets/DiffPanel-CeuRaSj1.js +64 -0
- package/dist/client/assets/DiffPanel.logic-D5i9QswQ.js +21 -0
- package/dist/client/assets/DiffPanelShell-W5nEVL52.js +2531 -0
- package/dist/client/assets/DiffWorkerPoolProvider-D87CO5TY.js +73 -0
- package/dist/client/assets/PullRequestCodePanel-DAmHwtY9.js +5 -0
- package/dist/client/assets/Stream-CToP6xzI.js +15 -0
- package/dist/client/assets/Virtualizer-CnwVHiy3.js +2 -0
- package/dist/client/assets/__vite-browser-external-DkEyUtaV.js +2 -0
- package/dist/client/assets/abap-kWSt4ETq.js +2 -0
- package/dist/client/assets/actionscript-3-DUMfZd56.js +2 -0
- package/dist/client/assets/ada-B5ZVVI6u.js +2 -0
- package/dist/client/assets/andromeeda-DXFdNco6.js +2 -0
- package/dist/client/assets/andromeeda-DwmQuk--.js +2 -0
- package/dist/client/assets/angular-html-BHUTdQ2k.js +2 -0
- package/dist/client/assets/angular-ts-BSGCbJ0j.js +2 -0
- package/dist/client/assets/apache-Cu40O3Ol.js +2 -0
- package/dist/client/assets/apex-DMPEjfSG.js +2 -0
- package/dist/client/assets/apl-BoCi4WkG.js +2 -0
- package/dist/client/assets/applescript-mUd3mpyF.js +2 -0
- package/dist/client/assets/ara-LhQXZmm_.js +2 -0
- package/dist/client/assets/asciidoc-BhTPoeH5.js +2 -0
- package/dist/client/assets/asm-BGGwX2ZL.js +2 -0
- package/dist/client/assets/astro-BMi5lGMm.js +2 -0
- package/dist/client/assets/atomRegistry-Bq5Y4LP1.js +3 -0
- package/dist/client/assets/aurora-x-CLgz8jpO.js +2 -0
- package/dist/client/assets/aurora-x-DY4EgSB_.js +2 -0
- package/dist/client/assets/awk-emAjNmqG.js +2 -0
- package/dist/client/assets/ayu-dark-BOsBaLmt.js +2 -0
- package/dist/client/assets/ayu-dark-Dm87GVDE.js +2 -0
- package/dist/client/assets/ayu-light-CVzS2PQZ.js +2 -0
- package/dist/client/assets/ayu-light-nGNJ-WDB.js +2 -0
- package/dist/client/assets/ayu-mirage-CionIqJ2.js +2 -0
- package/dist/client/assets/ayu-mirage-wUDx3klU.js +2 -0
- package/dist/client/assets/ballerina-Zz4P1PCo.js +2 -0
- package/dist/client/assets/bat-CojohPr3.js +2 -0
- package/dist/client/assets/beancount-DIrDFIbZ.js +2 -0
- package/dist/client/assets/berry-BktKISqk.js +2 -0
- package/dist/client/assets/bibtex-QuZiL8vO.js +2 -0
- package/dist/client/assets/bicep-BBqBjbA3.js +2 -0
- package/dist/client/assets/bird2-FrGIamnO.js +2 -0
- package/dist/client/assets/blade-CUGHtpnt.js +2 -0
- package/dist/client/assets/bsl-Dwz0otKA.js +2 -0
- package/dist/client/assets/c-3r97XxSq.js +2 -0
- package/dist/client/assets/c3-D-fgrOzJ.js +2 -0
- package/dist/client/assets/cadence-53eYIqKQ.js +2 -0
- package/dist/client/assets/cairo-Cai_OBhL.js +2 -0
- package/dist/client/assets/canvasStateStore-D3R1Ldk1.js +2 -0
- package/dist/client/assets/catppuccin-frappe-B9ztfCCY.js +2 -0
- package/dist/client/assets/catppuccin-frappe-Dtq86Zt-.js +2 -0
- package/dist/client/assets/catppuccin-latte-D1lF_ULk.js +2 -0
- package/dist/client/assets/catppuccin-latte-jgmNlGoB.js +2 -0
- package/dist/client/assets/catppuccin-macchiato-CcX-f1yB.js +2 -0
- package/dist/client/assets/catppuccin-macchiato-DfuKQKcK.js +2 -0
- package/dist/client/assets/catppuccin-mocha-B3_lpdvM.js +2 -0
- package/dist/client/assets/catppuccin-mocha-DfNnOvvn.js +2 -0
- package/dist/client/assets/clarity-DCS2DMlE.js +2 -0
- package/dist/client/assets/clojure-XwHeeE37.js +2 -0
- package/dist/client/assets/cmake-VIYk9tbe.js +2 -0
- package/dist/client/assets/cmmdAuthRedirect-DLvl7JNi.js +2 -0
- package/dist/client/assets/cobol-IPhylbE9.js +2 -0
- package/dist/client/assets/codeowners-DiTXAskR.js +2 -0
- package/dist/client/assets/codeql-0208dEuz.js +2 -0
- package/dist/client/assets/coffee-BwGUpF4f.js +2 -0
- package/dist/client/assets/common-lisp-Bbk7xLRF.js +2 -0
- package/dist/client/assets/coq-CDDZdGGh.js +2 -0
- package/dist/client/assets/cpp-jFyTvZsm.js +2 -0
- package/dist/client/assets/crystal-DYkQl9zO.js +2 -0
- package/dist/client/assets/csharp-Dausz59m.js +2 -0
- package/dist/client/assets/css-jXIxCbs3.js +2 -0
- package/dist/client/assets/csv-e2HVQau9.js +2 -0
- package/dist/client/assets/cue-BMgE_xju.js +2 -0
- package/dist/client/assets/cypher-CA95tXqi.js +2 -0
- package/dist/client/assets/d-DeO2qMKQ.js +2 -0
- package/dist/client/assets/dark-plus-DaoBxEuI.js +2 -0
- package/dist/client/assets/dark-plus-hlEOAUn6.js +2 -0
- package/dist/client/assets/dart-_9gbW0uG.js +2 -0
- package/dist/client/assets/dax-BMSB_urL.js +2 -0
- package/dist/client/assets/desktop-CFWOIXtS.js +2 -0
- package/dist/client/assets/diff-K3NAzB5h.js +2 -0
- package/dist/client/assets/docker-BHQx5Ff2.js +2 -0
- package/dist/client/assets/dotenv-CkiqXLC8.js +2 -0
- package/dist/client/assets/dracula-C9rp4fWn.js +2 -0
- package/dist/client/assets/dracula-CIJxKfwh.js +2 -0
- package/dist/client/assets/dracula-soft-BN-taJLQ.js +2 -0
- package/dist/client/assets/dracula-soft-De1wWQ_v.js +2 -0
- package/dist/client/assets/dream-maker-BM-H3AID.js +2 -0
- package/dist/client/assets/edge-CVf1J8H7.js +2 -0
- package/dist/client/assets/elixir-DtWV_YYF.js +2 -0
- package/dist/client/assets/elm-BJC2NMzB.js +2 -0
- package/dist/client/assets/emacs-lisp-BBM_ORbk.js +2 -0
- package/dist/client/assets/erb-cwYn0k3w.js +2 -0
- package/dist/client/assets/erlang-QNS0KA0S.js +2 -0
- package/dist/client/assets/everforest-dark-BSYmfNnp.js +2 -0
- package/dist/client/assets/everforest-dark-DUW3cHBn.js +2 -0
- package/dist/client/assets/everforest-light-CXyS_8Pc.js +2 -0
- package/dist/client/assets/everforest-light-DR-OhbXr.js +2 -0
- package/dist/client/assets/fennel-CAUJGoSU.js +2 -0
- package/dist/client/assets/fish-Cgln2BIC.js +2 -0
- package/dist/client/assets/fluent-BFL910sE.js +2 -0
- package/dist/client/assets/fortran-fixed-form-GNS6k7js.js +2 -0
- package/dist/client/assets/fortran-free-form-DB-siuqX.js +2 -0
- package/dist/client/assets/fsharp-BEjSdIee.js +2 -0
- package/dist/client/assets/gdresource-D24f9BeL.js +2 -0
- package/dist/client/assets/gdscript-Bq5ZYHDh.js +2 -0
- package/dist/client/assets/gdshader-BWxXiThj.js +2 -0
- package/dist/client/assets/genie-BOcsPMcn.js +2 -0
- package/dist/client/assets/gherkin-pSvoetjt.js +2 -0
- package/dist/client/assets/git-commit-Ddcy2Rzd.js +2 -0
- package/dist/client/assets/git-rebase-95AHstHI.js +2 -0
- package/dist/client/assets/github-dark-BbHkogeI.js +2 -0
- package/dist/client/assets/github-dark-D1nTcH4E.js +2 -0
- package/dist/client/assets/github-dark-default-Cgu-j31c.js +2 -0
- package/dist/client/assets/github-dark-default-CwMUtNVn.js +2 -0
- package/dist/client/assets/github-dark-dimmed-BmSK4vhs.js +2 -0
- package/dist/client/assets/github-dark-dimmed-CQVfITf-.js +2 -0
- package/dist/client/assets/github-dark-high-contrast-8_9Rbsic.js +2 -0
- package/dist/client/assets/github-dark-high-contrast-BO-0858k.js +2 -0
- package/dist/client/assets/github-light-DWIA8Fx_.js +2 -0
- package/dist/client/assets/github-light-default-CR0FtjVb.js +2 -0
- package/dist/client/assets/github-light-default-LLPbqR-K.js +2 -0
- package/dist/client/assets/github-light-high-contrast-5o8qRjCb.js +2 -0
- package/dist/client/assets/github-light-high-contrast-C8BCDz6a.js +2 -0
- package/dist/client/assets/github-light-lCcn0xRl.js +2 -0
- package/dist/client/assets/gleam-DPm9Zc9U.js +2 -0
- package/dist/client/assets/glimmer-js-Cjwf-Ijv.js +2 -0
- package/dist/client/assets/glimmer-ts-DXnOWlZf.js +2 -0
- package/dist/client/assets/glsl-iXGbnqIU.js +2 -0
- package/dist/client/assets/gn-DEuV1her.js +2 -0
- package/dist/client/assets/gnuplot-CqGlKjK6.js +2 -0
- package/dist/client/assets/go-mptU-yl2.js +2 -0
- package/dist/client/assets/graphql-DJMVZQv3.js +2 -0
- package/dist/client/assets/groovy-CKg5KWq9.js +2 -0
- package/dist/client/assets/gruvbox-dark-hard-Df4rfbxN.js +2 -0
- package/dist/client/assets/gruvbox-dark-hard-DsK6pQOr.js +2 -0
- package/dist/client/assets/gruvbox-dark-medium-nlSbDtaA.js +2 -0
- package/dist/client/assets/gruvbox-dark-medium-zSmEeDKP.js +2 -0
- package/dist/client/assets/gruvbox-dark-soft-BSW4a3D0.js +2 -0
- package/dist/client/assets/gruvbox-dark-soft-DgI1MxVf.js +2 -0
- package/dist/client/assets/gruvbox-light-hard-D144A6HZ.js +2 -0
- package/dist/client/assets/gruvbox-light-hard-DMNoHzNU.js +2 -0
- package/dist/client/assets/gruvbox-light-medium-C0B0NCuj.js +2 -0
- package/dist/client/assets/gruvbox-light-medium-CY2MDbN0.js +2 -0
- package/dist/client/assets/gruvbox-light-soft-CWJ8aP9f.js +2 -0
- package/dist/client/assets/gruvbox-light-soft-CyPlqRD8.js +2 -0
- package/dist/client/assets/hack-CkGKtoya.js +2 -0
- package/dist/client/assets/haml-mV-E4efJ.js +2 -0
- package/dist/client/assets/handlebars-Da6i86YE.js +2 -0
- package/dist/client/assets/haskell-DFWkJmsd.js +2 -0
- package/dist/client/assets/haxe-DoXg9N2w.js +2 -0
- package/dist/client/assets/hcl-VbcvLW6X.js +2 -0
- package/dist/client/assets/hjson-dQ--SYg9.js +2 -0
- package/dist/client/assets/hlsl-DNh8NDKB.js +2 -0
- package/dist/client/assets/horizon-BeufL1QP.js +2 -0
- package/dist/client/assets/horizon-CnOil3H1.js +2 -0
- package/dist/client/assets/horizon-bright-BoFfNO4u.js +2 -0
- package/dist/client/assets/horizon-bright-CJCE-DcQ.js +2 -0
- package/dist/client/assets/houston-C5_OTP91.js +2 -0
- package/dist/client/assets/houston-jaZUvSzs.js +2 -0
- package/dist/client/assets/html-derivative-BOw7yS3Z.js +2 -0
- package/dist/client/assets/html-e1ppUAVa.js +2 -0
- package/dist/client/assets/html2canvas-C_LL7spC.js +6 -0
- package/dist/client/assets/http-DFrMFVWs.js +2 -0
- package/dist/client/assets/hurl-3N2UscjA.js +2 -0
- package/dist/client/assets/hxml-Ip0yb8dg.js +2 -0
- package/dist/client/assets/hy-Bg-RIaMc.js +2 -0
- package/dist/client/assets/imba-BjZ9NRcj.js +2 -0
- package/dist/client/assets/index-Dr7HwjTE.css +1 -0
- package/dist/client/assets/index-DyEYqQdf.js +151 -0
- package/dist/client/assets/index.es-piUKIQw4.js +6 -0
- package/dist/client/assets/ini-CXagdQO9.js +2 -0
- package/dist/client/assets/java-DY6ZSujp.js +2 -0
- package/dist/client/assets/javascript-BfTuFzbs.js +2 -0
- package/dist/client/assets/jinja-C4NVx4X-.js +2 -0
- package/dist/client/assets/jison-BaE4DrvM.js +2 -0
- package/dist/client/assets/json-LL0kLbs_.js +2 -0
- package/dist/client/assets/json5-B1LcXsA8.js +2 -0
- package/dist/client/assets/jsonc-CYSDka7c.js +2 -0
- package/dist/client/assets/jsonl-CwfwQmvE.js +2 -0
- package/dist/client/assets/jsonnet-DG_zYewp.js +2 -0
- package/dist/client/assets/jspdf.es.min-_OjqfV_L.js +80 -0
- package/dist/client/assets/jssm-IkACsEzj.js +2 -0
- package/dist/client/assets/jsx-BOBg7x46.js +2 -0
- package/dist/client/assets/julia-D5dobu9Y.js +2 -0
- package/dist/client/assets/just-D99ddsWv.js +2 -0
- package/dist/client/assets/kanagawa-dragon-BBUl63AF.js +2 -0
- package/dist/client/assets/kanagawa-dragon-CBGy-6ik.js +2 -0
- package/dist/client/assets/kanagawa-lotus-BKY9TlU3.js +2 -0
- package/dist/client/assets/kanagawa-lotus-D93oLQjR.js +2 -0
- package/dist/client/assets/kanagawa-wave-CWf0rFWt.js +2 -0
- package/dist/client/assets/kanagawa-wave-CZBJ3hQh.js +2 -0
- package/dist/client/assets/kdl-DuytcvNV.js +2 -0
- package/dist/client/assets/kotlin-DmtnKz6Z.js +2 -0
- package/dist/client/assets/kusto-DmrVjfae.js +2 -0
- package/dist/client/assets/laserwave-DTzUwFmi.js +2 -0
- package/dist/client/assets/laserwave-NRABVcaO.js +2 -0
- package/dist/client/assets/latex-0e5rhe9m.js +2 -0
- package/dist/client/assets/lean-Bhkhoed1.js +2 -0
- package/dist/client/assets/less-BgyohKqc.js +2 -0
- package/dist/client/assets/light-plus-Cbc9ZUH4.js +2 -0
- package/dist/client/assets/light-plus-SK-KfMAV.js +2 -0
- package/dist/client/assets/liquid-BR35Xk1k.js +2 -0
- package/dist/client/assets/llvm-BtFJuFOJ.js +2 -0
- package/dist/client/assets/log-Df3M8ERB.js +2 -0
- package/dist/client/assets/logo-VfSEjTs6.js +2 -0
- package/dist/client/assets/lua-BMt4EqAw.js +2 -0
- package/dist/client/assets/luau-DIHOVG2A.js +2 -0
- package/dist/client/assets/make-gTMDFaMm.js +2 -0
- package/dist/client/assets/markdown-B_5il8S2.js +2 -0
- package/dist/client/assets/marko-DN4rLggA.js +2 -0
- package/dist/client/assets/material-theme-Pm6m-Kzc.js +2 -0
- package/dist/client/assets/material-theme-darker-BxFgxa9U.js +2 -0
- package/dist/client/assets/material-theme-darker-pKUQPx9-.js +2 -0
- package/dist/client/assets/material-theme-lighter-BLqni5my.js +2 -0
- package/dist/client/assets/material-theme-lighter-D6-26WhM.js +2 -0
- package/dist/client/assets/material-theme-ocean-C2N-nFlu.js +2 -0
- package/dist/client/assets/material-theme-ocean-DCxzET3l.js +2 -0
- package/dist/client/assets/material-theme-palenight-DyQqRTLL.js +2 -0
- package/dist/client/assets/material-theme-palenight-Y14J3SJp.js +2 -0
- package/dist/client/assets/material-theme-zfTX2d95.js +2 -0
- package/dist/client/assets/matlab-B2zVSjQq.js +2 -0
- package/dist/client/assets/mdc-kokCuEO8.js +2 -0
- package/dist/client/assets/mdx-CL7pLDiG.js +2 -0
- package/dist/client/assets/mermaid-Cou83ohU.js +2 -0
- package/dist/client/assets/min-dark-Bg1kQHvJ.js +2 -0
- package/dist/client/assets/min-dark-BhN4iMRs.js +2 -0
- package/dist/client/assets/min-light-BjU80CRL.js +2 -0
- package/dist/client/assets/min-light-Bw9u-P_u.js +2 -0
- package/dist/client/assets/mipsasm-CNFOlV7Y.js +2 -0
- package/dist/client/assets/module-fAFg92om.js +4 -0
- package/dist/client/assets/mojo-DmJMpmxj.js +2 -0
- package/dist/client/assets/monokai-C4NNjw1j.js +2 -0
- package/dist/client/assets/monokai-DIfgn9Q6.js +2 -0
- package/dist/client/assets/moonbit-f-DlcHvh.js +2 -0
- package/dist/client/assets/move-3UEJ-86q.js +2 -0
- package/dist/client/assets/narrat-BSySVkso.js +2 -0
- package/dist/client/assets/nextflow-B6YiVxNF.js +2 -0
- package/dist/client/assets/nextflow-groovy-CJM1tnxB.js +2 -0
- package/dist/client/assets/nginx-yFGqgywB.js +2 -0
- package/dist/client/assets/night-owl-CVqrHJ7c.js +2 -0
- package/dist/client/assets/night-owl-M-9PEzO3.js +2 -0
- package/dist/client/assets/night-owl-light-BFLAfCgh.js +2 -0
- package/dist/client/assets/night-owl-light-CbICj08I.js +2 -0
- package/dist/client/assets/nim-H0r8m4Bj.js +2 -0
- package/dist/client/assets/nix-D01-yy0s.js +2 -0
- package/dist/client/assets/nord-DdQ2eXb7.js +2 -0
- package/dist/client/assets/nord-b31BpoFd.js +2 -0
- package/dist/client/assets/nushell-CHtjMTHK.js +2 -0
- package/dist/client/assets/objective-c-CpnACn2A.js +2 -0
- package/dist/client/assets/objective-cpp-CC37zF8s.js +2 -0
- package/dist/client/assets/ocaml-zEzf7VRa.js +2 -0
- package/dist/client/assets/odin-7LfNaizd.js +2 -0
- package/dist/client/assets/one-dark-pro-D7GXMkD_.js +2 -0
- package/dist/client/assets/one-dark-pro-DZNXQIff.js +2 -0
- package/dist/client/assets/one-light-D0m2woYU.js +2 -0
- package/dist/client/assets/one-light-vpvEwBNE.js +2 -0
- package/dist/client/assets/openscad-alCnkqb3.js +2 -0
- package/dist/client/assets/pascal-BzxE7FG0.js +2 -0
- package/dist/client/assets/perl-DMfQlGhS.js +2 -0
- package/dist/client/assets/php-eC0_nfgu.js +2 -0
- package/dist/client/assets/pierre-dark-C8scyjTE.js +2 -0
- package/dist/client/assets/pierre-dark-protanopia-deuteranopia-DjjI5tLG.js +2 -0
- package/dist/client/assets/pierre-dark-soft-U4k3hSAg.js +2 -0
- package/dist/client/assets/pierre-dark-tritanopia-CwldMLve.js +2 -0
- package/dist/client/assets/pierre-dark-vibrant-CbqW77RL.js +2 -0
- package/dist/client/assets/pierre-light-CRazXHrY.js +2 -0
- package/dist/client/assets/pierre-light-protanopia-deuteranopia-C-0-s32M.js +2 -0
- package/dist/client/assets/pierre-light-soft-CeMgeGD-.js +2 -0
- package/dist/client/assets/pierre-light-tritanopia-CwP7kaEp.js +2 -0
- package/dist/client/assets/pierre-light-vibrant-BRw7kdwa.js +2 -0
- package/dist/client/assets/pkl-B_4Y3aQj.js +2 -0
- package/dist/client/assets/plastic-7ebP7j7m.js +2 -0
- package/dist/client/assets/plastic-BxJ4wlPp.js +2 -0
- package/dist/client/assets/plsql-Vnj6O-p2.js +2 -0
- package/dist/client/assets/po-BDEiW-In.js +2 -0
- package/dist/client/assets/poimandres-CjxvpNV1.js +2 -0
- package/dist/client/assets/poimandres-DaajSABO.js +2 -0
- package/dist/client/assets/polar-DkeS43LD.js +2 -0
- package/dist/client/assets/postcss-BdW9ckpW.js +2 -0
- package/dist/client/assets/powerquery-Ck_tTsxM.js +2 -0
- package/dist/client/assets/powershell-CSE_7mny.js +2 -0
- package/dist/client/assets/preload-helper-2nxZ5jlD.js +1 -0
- package/dist/client/assets/prisma-Bo0mLS5-.js +2 -0
- package/dist/client/assets/prolog-BKKH5B6F.js +2 -0
- package/dist/client/assets/proto-CQGfqf21.js +2 -0
- package/dist/client/assets/pug-CdkPd3m5.js +2 -0
- package/dist/client/assets/puppet-CMQRMMTw.js +2 -0
- package/dist/client/assets/purescript-CCcyGQO2.js +2 -0
- package/dist/client/assets/purify.es-BOhOJYGt.js +3 -0
- package/dist/client/assets/python-DMPOlDIf.js +2 -0
- package/dist/client/assets/qml-CjgSvi7A.js +2 -0
- package/dist/client/assets/qmldir-WCdsq__X.js +2 -0
- package/dist/client/assets/qss-AtgwhOez.js +2 -0
- package/dist/client/assets/r-CyfaTtPo.js +2 -0
- package/dist/client/assets/racket-BChN0yKc.js +2 -0
- package/dist/client/assets/raku-y2whvo3i.js +2 -0
- package/dist/client/assets/razor-xg0jlt5d.js +2 -0
- package/dist/client/assets/red-4ASUbyQz.js +2 -0
- package/dist/client/assets/red-FUTSeuNn.js +2 -0
- package/dist/client/assets/reg-Vw5mc10D.js +2 -0
- package/dist/client/assets/regexp-DNjghFOM.js +2 -0
- package/dist/client/assets/rel-B7yBab0H.js +2 -0
- package/dist/client/assets/riscv-CoVA6mXv.js +2 -0
- package/dist/client/assets/rolldown-runtime-BeQ30c1w.js +1 -0
- package/dist/client/assets/ron-Dncoj8f2.js +2 -0
- package/dist/client/assets/rose-pine-BYqQazSr.js +2 -0
- package/dist/client/assets/rose-pine-DKVJldI6.js +2 -0
- package/dist/client/assets/rose-pine-dawn-BzAj1SA_.js +2 -0
- package/dist/client/assets/rose-pine-dawn-DpMWSJny.js +2 -0
- package/dist/client/assets/rose-pine-moon-BF7RtPma.js +2 -0
- package/dist/client/assets/rose-pine-moon-Buv_ZumG.js +2 -0
- package/dist/client/assets/rosmsg-DMM9gQ6F.js +2 -0
- package/dist/client/assets/rst-DUzGXO8S.js +2 -0
- package/dist/client/assets/ruby-rVw1KmtO.js +2 -0
- package/dist/client/assets/rust-Do9fnzCe.js +2 -0
- package/dist/client/assets/sas-DqCEPep6.js +2 -0
- package/dist/client/assets/sass-C-AYCcFv.js +2 -0
- package/dist/client/assets/scala-g1Tl2-Vx.js +2 -0
- package/dist/client/assets/scheme-DMNTmmtl.js +2 -0
- package/dist/client/assets/scss-DUVpCPFS.js +2 -0
- package/dist/client/assets/sdbl-DN-YwBSp.js +2 -0
- package/dist/client/assets/shaderlab-CU1ngQGv.js +2 -0
- package/dist/client/assets/shellscript-DhExEfAl.js +2 -0
- package/dist/client/assets/shellsession-BRLd459R.js +2 -0
- package/dist/client/assets/slack-dark-CHVebfsv.js +2 -0
- package/dist/client/assets/slack-dark-DsHK2SW9.js +2 -0
- package/dist/client/assets/slack-ochin-DLRnnjq1.js +2 -0
- package/dist/client/assets/slack-ochin-auUeui07.js +2 -0
- package/dist/client/assets/smalltalk-DfTqE6NI.js +2 -0
- package/dist/client/assets/snazzy-light-DYCniS15.js +2 -0
- package/dist/client/assets/snazzy-light-DcJ4c2TI.js +2 -0
- package/dist/client/assets/solarized-dark-C2M3A6iX.js +2 -0
- package/dist/client/assets/solarized-dark-f_BlEcC2.js +2 -0
- package/dist/client/assets/solarized-light-DGdaihLk.js +2 -0
- package/dist/client/assets/solarized-light-p0lk9NUw.js +2 -0
- package/dist/client/assets/solidity-UrsYApv4.js +2 -0
- package/dist/client/assets/soy-B2el7XDq.js +2 -0
- package/dist/client/assets/sparql-Ckg9aAAq.js +2 -0
- package/dist/client/assets/splunk-BbdNC7mF.js +2 -0
- package/dist/client/assets/sql-DiDaRjp9.js +2 -0
- package/dist/client/assets/src-pwcrD9wg.js +3 -0
- package/dist/client/assets/ssh-config-NaDpXiNE.js +2 -0
- package/dist/client/assets/stata-C71yNzqX.js +2 -0
- package/dist/client/assets/stylus-BmDWwNjA.js +2 -0
- package/dist/client/assets/surrealql-Cmypmwl2.js +2 -0
- package/dist/client/assets/svelte-VS6niI_T.js +2 -0
- package/dist/client/assets/swift-C69NyPuQ.js +2 -0
- package/dist/client/assets/synthwave-84-2NxBVDLO.js +2 -0
- package/dist/client/assets/synthwave-84-CVwMZOby.js +2 -0
- package/dist/client/assets/system-verilog-DJk0s1jv.js +2 -0
- package/dist/client/assets/systemd-CcQAXEZ9.js +2 -0
- package/dist/client/assets/talonscript-CUGr7vYM.js +2 -0
- package/dist/client/assets/tasl-BB-YNBB8.js +2 -0
- package/dist/client/assets/tcl-DR8-AcmN.js +2 -0
- package/dist/client/assets/templ-Cr4Do0uA.js +2 -0
- package/dist/client/assets/terraform-DS-GC2Bj.js +2 -0
- package/dist/client/assets/tex-CcZtvqzZ.js +2 -0
- package/dist/client/assets/toggle-BBEoD8mr.js +2 -0
- package/dist/client/assets/tokyo-night-9wJEO1G-.js +2 -0
- package/dist/client/assets/tokyo-night-ZUp4Hulo.js +2 -0
- package/dist/client/assets/toml-ByrHRc5Z.js +2 -0
- package/dist/client/assets/transport-B-82Ada5.js +2 -0
- package/dist/client/assets/ts-tags-Dhe4Ce_p.js +2 -0
- package/dist/client/assets/tsv-2A2hWH8i.js +2 -0
- package/dist/client/assets/tsx-rRP2I03K.js +2 -0
- package/dist/client/assets/turtle-BYbwzkhD.js +2 -0
- package/dist/client/assets/twig-DtN4j4nR.js +2 -0
- package/dist/client/assets/typeof-DOAxNSYQ.js +2 -0
- package/dist/client/assets/typescript-tv4fsI1Q.js +2 -0
- package/dist/client/assets/typespec-DoZVUoUi.js +2 -0
- package/dist/client/assets/typst-BmNF0lss.js +2 -0
- package/dist/client/assets/useTriggerFocusGuards-B2i3DSgR.js +2 -0
- package/dist/client/assets/v-CtCN4vLO.js +2 -0
- package/dist/client/assets/vala-DOsY6Y3z.js +2 -0
- package/dist/client/assets/vb-C1Ff9hOT.js +2 -0
- package/dist/client/assets/verilog-Dt4OfjHN.js +2 -0
- package/dist/client/assets/vesper-5ZmhmIun.js +2 -0
- package/dist/client/assets/vesper-J3W-7eep.js +2 -0
- package/dist/client/assets/vhdl-DkoQ3qnl.js +2 -0
- package/dist/client/assets/viml-C3b4aEDf.js +2 -0
- package/dist/client/assets/vitesse-black-CYOC7ssU.js +2 -0
- package/dist/client/assets/vitesse-black-DWaDDoI3.js +2 -0
- package/dist/client/assets/vitesse-dark-Bxewb9U5.js +2 -0
- package/dist/client/assets/vitesse-dark-CZotVzc8.js +2 -0
- package/dist/client/assets/vitesse-light-Bf_msd9a.js +2 -0
- package/dist/client/assets/vitesse-light-BfrRSjRx.js +2 -0
- package/dist/client/assets/vue-C0rWZC13.js +2 -0
- package/dist/client/assets/vue-html-bxw887C2.js +2 -0
- package/dist/client/assets/vue-vine-DUWGjTI5.js +2 -0
- package/dist/client/assets/vyper-BamdcTqV.js +2 -0
- package/dist/client/assets/wasm-C2MLrNQ1.js +2 -0
- package/dist/client/assets/wasm-CGd31VpO.js +2 -0
- package/dist/client/assets/wenyan-BPZ76iog.js +2 -0
- package/dist/client/assets/wgsl-sH_fVDG_.js +2 -0
- package/dist/client/assets/wikitext-BsPo9Czf.js +2 -0
- package/dist/client/assets/wit-BfBhtJwS.js +2 -0
- package/dist/client/assets/wolfram-GL7CPBRD.js +2 -0
- package/dist/client/assets/worker-Cvq2iJN1.js +162 -0
- package/dist/client/assets/workspaceReadinessAtom-DUP5NKsc.js +2 -0
- package/dist/client/assets/xml-C0zxRzgj.js +2 -0
- package/dist/client/assets/xsl-CC403A_G.js +2 -0
- package/dist/client/assets/yaml-BCnsJrvx.js +2 -0
- package/dist/client/assets/zenscript-CmwVE7RW.js +2 -0
- package/dist/client/assets/zig-GtQXM-vf.js +2 -0
- package/dist/client/favicon-16x16.png +0 -0
- package/dist/client/favicon-16x16.png.publish-bak +0 -0
- package/dist/client/favicon-32x32.png +0 -0
- package/dist/client/favicon-32x32.png.publish-bak +0 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/favicon.ico.publish-bak +0 -0
- package/dist/client/forge-mark.svg +5 -0
- package/dist/client/index.html +131 -0
- package/dist/client/mockServiceWorker.js +336 -0
- package/dist/client/sidebar/forge-ember-field.webp +0 -0
- package/dist/{esm-wLIF-u3N.mjs → esm-Ce1GqbVk.mjs} +1 -1
- package/dist/{esm-BZhXwX5p.cjs → esm-Do7HVhLA.cjs} +1 -1
- package/dist/{execAsync-DWZyWH-_.mjs → execAsync-BNNdR88o.mjs} +1 -1
- package/dist/{execAsync-jnYVB5RZ.cjs → execAsync-BUcaFQ1D.cjs} +1 -1
- package/dist/forge-provision-display.sh +316 -0
- package/dist/{getMachineId-bsd-BLtyMA4j.cjs → getMachineId-bsd-C_qi9crE.cjs} +3 -3
- package/dist/{getMachineId-bsd-CTjiY7jG.mjs → getMachineId-bsd-FI863wjR.mjs} +3 -3
- package/dist/{getMachineId-darwin-DaGS2zUd.cjs → getMachineId-darwin-BOoNuqXn.cjs} +3 -3
- package/dist/{getMachineId-darwin-BrPuyPOo.mjs → getMachineId-darwin-D9VhTaPM.mjs} +3 -3
- package/dist/{getMachineId-linux-BsP3wJaE.cjs → getMachineId-linux-C9L-vW7m.cjs} +2 -2
- package/dist/{getMachineId-linux-D9QEWWF-.mjs → getMachineId-linux-DE2x36Kt.mjs} +2 -2
- package/dist/{getMachineId-unsupported-Cm-2s4Sg.mjs → getMachineId-unsupported-9S6pcxXb.mjs} +2 -2
- package/dist/{getMachineId-unsupported-B_M-gck7.cjs → getMachineId-unsupported-CmbM8LYa.cjs} +2 -2
- package/dist/{getMachineId-win-qtEKaUYj.mjs → getMachineId-win-0EVRuBxU.mjs} +3 -3
- package/dist/{getMachineId-win-3zJ3HQLG.cjs → getMachineId-win-BPaemVew.cjs} +3 -3
- package/dist/{open-CGXZLos4.cjs → open-BAsPVCWX.cjs} +1 -1
- package/dist/{open-Cf0bgbyx.mjs → open-FIgTDosf.mjs} +1 -1
- package/dist/runtimeBootstrap.cjs +8 -0
- package/dist/runtimeBootstrap.mjs +4 -0
- package/dist/runtimeControlAuthority-Dm9z5ziU.mjs +505 -0
- package/dist/runtimeControlAuthority-Dx6Y5LPI.cjs +571 -0
- package/package.json +28 -30
- package/dist/NodeHttpServer-C7YMYP5R.cjs +0 -616
- package/dist/NodeHttpServer-D5-EtRwc.mjs +0 -605
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`forge-web@0.9.4`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`79242e1f-694b-4f2b-a67b-18ca9d2824f1`,e._sentryDebugIdIdentifier=`sentry-dbid-79242e1f-694b-4f2b-a67b-18ca9d2824f1`)}catch{}})();var e=typeof window<`u`?window:void 0,t=typeof globalThis<`u`?globalThis:e,n=t?.navigator,r=t?.document,i=t?.location,a=t?.fetch,o=t!=null&&t.XMLHttpRequest&&`withCredentials`in new t.XMLHttpRequest?t.XMLHttpRequest:void 0,s=t?.AbortController,c=t?.CompressionStream,l=n?.userAgent;function u(){return!(!e||!1===e.navigator.onLine)}var d=typeof globalThis<`u`?globalThis:e;d&&typeof self>`u`&&(d.self=d),d&&typeof File>`u`&&(d.File=function(){});var f=e??{},p={DEBUG:!1,LIB_VERSION:`0.5.0`,LIB_NAME:`browser-common`};function m(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){m(a,r,i,o,s,`next`,e)}function s(e){m(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g.apply(null,arguments)}function _(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var v=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}};function y(e){return typeof e==`string`||e}function b(e){return typeof e==`string`?e:void 0}var x,S=`$feature_flag.$feature_flag_response.$feature_flag_has_experiment.$feature_flag_id.$feature_flag_version.$feature_flag_reason.$feature_flag_request_id.$feature_flag_evaluated_at.$feature_flag_error.locally_evaluated.$groups.$process_person_profile.$geoip_disable.$current_url.$pathname.$referring_domain.utm_source.utm_medium.utm_campaign.utm_content.utm_term.gad_source.mc_cid.gclid.gclsrc.dclid.gbraid.wbraid.fbclid.msclkid.twclid.li_fat_id.igshid.ttclid.rdt_cid.epik.qclid.sccid.irclid._kx.$session_id.$window_id.$lib.$lib_version.$device_id.$is_server`.split(`.`),C=function(e){return e.AnonymousId=`anonymous_id`,e.DistinctId=`distinct_id`,e.Props=`props`,e.EnablePersonProcessing=`enable_person_processing`,e.PersonMode=`person_mode`,e.FeatureFlagDetails=`feature_flag_details`,e.FeatureFlags=`feature_flags`,e.FeatureFlagPayloads=`feature_flag_payloads`,e.BootstrapFeatureFlagDetails=`bootstrap_feature_flag_details`,e.BootstrapFeatureFlags=`bootstrap_feature_flags`,e.BootstrapFeatureFlagPayloads=`bootstrap_feature_flag_payloads`,e.OverrideFeatureFlags=`override_feature_flags`,e.Queue=`queue`,e.AiQueue=`ai_queue`,e.AiCaptureQueue=`ai_capture_queue`,e.LogsQueue=`logs_queue`,e.OptedOut=`opted_out`,e.SessionId=`session_id`,e.SessionStartTimestamp=`session_start_timestamp`,e.SessionLastTimestamp=`session_timestamp`,e.PersonProperties=`person_properties`,e.GroupProperties=`group_properties`,e.InstalledAppBuild=`installed_app_build`,e.InstalledAppVersion=`installed_app_version`,e.SessionReplay=`session_replay`,e.PushRegistered=`push_registered`,e.SessionReplayEventTriggerActivatedSession=`session_replay_event_trigger_activated_session`,e.SurveyLastSeenDate=`survey_last_seen_date`,e.SurveysSeen=`surveys_seen`,e.Surveys=`surveys`,e.RemoteConfig=`remote_config`,e.FlagsEndpointWasHit=`flags_endpoint_was_hit`,e.DeviceId=`device_id`,e}({}),w=function(e){return e.GZipJS=`gzip-js`,e.Base64=`base64`,e}({}),T=[`$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=[`token`],D=`NativeGzipValidationError`,O=e=>e.length>=2&&e[0]===31&&e[1]===139,ee=(e,t)=>e===w.GZipJS||t===w.GZipJS||t===`gzip`,te=e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`,ne=e=>{var t=Error(`Native gzip produced invalid output: `+e);throw t.name=D,t},re=function(){var e=h((function*(e,t){18>e.size&&ne(`too-short`);var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());O(n)&&n[2]===8||ne(`invalid-header`);var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(x)return x;x=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;x[e]=t>>>0}return x})(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0})(t)&&ne(`invalid-crc`);var i=t.length>>>0;r.getUint32(4,!0)!==i&&ne(`invalid-size`)}));return function(t,n){return e.apply(this,arguments)}}();function k(){return k=h((function*(e,t,n){t===void 0&&(t=!0);try{var r=new TextEncoder().encode(e),i=new globalThis.CompressionStream(`gzip`),a=i.writable.getWriter(),o=a.write(r).then((()=>a.close())).catch(function(){var e=h((function*(e){try{yield a.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(i.readable).blob(),c=(yield Promise.all([s,o]))[0];return yield re(c,r),c}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),k.apply(this,arguments)}var ie=`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`.split(`,`),ae=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return ie.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))};function A(e,t){return e.indexOf(t)!==-1}var oe=function(e){return e.trim()},se=function(e){return e.replace(/^\$/,``)};function ce(e){var t=[];return JSON.stringify(e,(function(e,n){if(typeof n==`bigint`)return n.toString();if(typeof n!=`function`&&typeof n!=`symbol`){if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n==`object`){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(t.includes(n))return`[Circular]`;t.push(n)}return n}}))??`null`}var le=Object.prototype,ue=le.hasOwnProperty,de=le.toString,j=Array.isArray||function(e){return de.call(e)===`[object Array]`},M=e=>typeof e==`function`,N=e=>e===Object(e)&&!j(e),fe=e=>{if(N(e)){for(var t in e)if(ue.call(e,t))return!1;return!0}return!1},P=e=>e===void 0,F=e=>de.call(e)==`[object String]`,pe=e=>F(e)&&e.trim().length===0,I=e=>e===null,L=e=>P(e)||I(e),R=e=>de.call(e)==`[object Number]`&&e==e,me=e=>R(e)&&e>0,he=e=>de.call(e)===`[object Boolean]`,ge=e=>e instanceof FormData,_e=e=>A(T,e),ve=e=>A(E,e);function ye(e){return typeof e!=`object`||!e}function be(e,t){return{}.toString.call(e)===`[object `+t+`]`}function xe(e){switch({}.toString.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object DOMError]`:case`[object WebAssembly.Exception]`:return!0;default:return Ce(e,Error)}}function Se(e){return typeof Event<`u`&&Ce(e,Event)}function Ce(e,t){try{return e instanceof t}catch{return!1}}var we=[!0,`true`,1,`1`,`yes`],Te=e=>A(we,e),Ee=[!1,`false`,0,`0`,`no`];function De(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),R(e)?e>n?(r.warn(` cannot be greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),De(i||n,t,n,r))}var Oe=class{constructor(e){this.it={},this.rt=e.rt,this.nt=De(e.bucketSize,0,100,e.st),this.ot=De(e.refillRate,0,this.nt,e.st),this.ut=De(e.refillInterval,0,864e5,e.st)}ht(e,t){var n=Math.floor((t-e.lastAccess)/this.ut);n>0&&(e.tokens=Math.min(e.tokens+n*this.ot,this.nt),e.lastAccess+=n*this.ut)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.it[r];return i?this.ht(i,n):this.it[r]=i={tokens:this.nt,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.rt)==null||t.call(this,e)),i.tokens===0)}stop(){this.it={}}},ke=`Mobile`,Ae=`iOS`,je=`Android`,Me=`Tablet`,Ne=je+` `+Me,Pe=`iPad`,Fe=`Apple`,Ie=Fe+` Watch`,Le=`Safari`,Re=`BlackBerry`,ze=`Samsung`,Be=ze+`Browser`,Ve=ze+` Internet`,He=`Chrome`,Ue=He+` OS`,We=He+` `+Ae,Ge=`Internet Explorer`,Ke=Ge+` `+ke,qe=`Opera`,Je=qe+` Mini`,Ye=`Edge`,Xe=`Microsoft `+Ye,Ze=`Firefox`,Qe=Ze+` `+Ae,$e=`Nintendo`,et=`PlayStation`,tt=`Xbox`,nt=je+` `+ke,rt=ke+` `+Le,it=`Windows`,at=it+` Phone`,ot=`Nokia`,st=`Ouya`,ct=`Generic`,lt=ct+` `+ke.toLowerCase(),ut=ct+` `+Me.toLowerCase(),dt=`Konqueror`,ft=`Oculus Browser`,pt=`Vivaldi`,mt=`Yandex`,ht=`Whale`,gt=`DuckDuckGo`,_t=`Pale Moon`,vt=`Waterfox`,yt=`Brave`,bt=`Google Search App`,z=`(\\d+(\\.\\d+)?)`,xt=RegExp(`Version/`+z),St=new RegExp(tt,`i`),Ct=RegExp(et+` \\w+`,`i`),wt=RegExp($e+` \\w+`,`i`),Tt=RegExp(Re+`|PlayBook|BB10`,`i`),Et={"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`},Dt=function(e,t,n,r){return t||=``,function(e){return e!=null&&e.brave?yt:null}(n)||(r!=null&&r.detectGoogleSearchApp&&A(e,`GSA/`)?bt:A(e,` OPR/`)&&A(e,`Mini`)?Je:A(e,` OPR/`)?qe:Tt.test(e)?Re:A(e,`IE`+ke)||A(e,`WPDesktop`)?Ke:A(e,`OculusBrowser`)?ft:A(e,Be)?Ve:A(e,Ye)||A(e,`Edg/`)?Xe:A(e,pt+`/`)?pt:A(e,`YaBrowser/`)?mt:A(e,ht+`/`)?ht:A(e,gt+`/`)||A(e,`Ddg/`)?gt:A(e,`FBIOS`)?`Facebook `+ke:A(e,`UCWEB`)||A(e,`UCBrowser`)?`UC Browser`:A(e,`CriOS`)?We:A(e,`CrMo`)||A(e,He)?He:A(e,je)&&A(e,Le)?nt:A(e,`FxiOS`)?Qe:A(e.toLowerCase(),dt.toLowerCase())?dt:A(e,yt+`/`)?yt:((e,t)=>t&&A(t,Fe)||function(e){return A(e,Le)&&!A(e,He)&&!A(e,je)}(e))(e,t)?A(e,ke)?rt:Le:A(e,`PaleMoon/`)?_t:A(e,vt+`/`)?vt:A(e,Ze)?Ze:A(e,`MSIE`)||A(e,`Trident/`)?Ge:A(e,`Gecko`)?Ze:``)},Ot={[Ke]:[RegExp(`rv:`+z)],[Xe]:[RegExp(Ye+`?\\/`+z)],[He]:[RegExp(`(`+He+`|CrMo)\\/`+z)],[We]:[RegExp(`CriOS\\/`+z)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+z)],[Le]:[xt],[rt]:[xt],[qe]:[RegExp(`(Opera|OPR)\\/`+z)],[Ze]:[RegExp(Ze+`\\/`+z)],[Qe]:[RegExp(`FxiOS\\/`+z)],[dt]:[RegExp(`Konqueror[:/]?`+z,`i`)],[Re]:[RegExp(Re+` `+z),xt],[nt]:[RegExp(`android\\s`+z,`i`)],[Ve]:[RegExp(Be+`\\/`+z)],[ft]:[RegExp(`OculusBrowser\\/`+z)],[pt]:[RegExp(pt+`\\/`+z)],[mt]:[RegExp(`YaBrowser\\/`+z)],[ht]:[RegExp(ht+`\\/`+z)],[yt]:[RegExp(yt+`\\/`+z)],[gt]:[RegExp(`(DuckDuckGo|Ddg)\\/`+z)],[_t]:[RegExp(`PaleMoon\\/`+z)],[vt]:[RegExp(vt+`\\/`+z)],[bt]:[RegExp(`GSA\\/`+z)],[Ge]:[RegExp(`(rv:|MSIE )`+z)],Mozilla:[RegExp(`rv:`+z)]},kt=function(e,t,n,r){var i=Ot[Dt(e,t,n,r)];if(P(i))return null;for(var a=0;i.length>a;a++){var o=e.match(i[a]);if(o)return parseFloat(o[o.length-2])}return null},At=[[RegExp(tt+`; `+tt+` (.*?)[);]`,`i`),e=>[tt,e&&e[1]||``]],[new RegExp($e,`i`),[$e,``]],[new RegExp(et,`i`),[et,``]],[Tt,[Re,``]],[new RegExp(it,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[at,``];if(new RegExp(ke).test(t)&&!/IEMobile\b/.test(t))return[it+` `+ke,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=Et[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[it,r]}return[it,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Ae,[e[3],e[4],e[5]||`0`].join(`.`)]:[Ae,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=P(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+je+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+je+`)`,`i`),e=>e&&e[2]?[je,[e[2],e[3],e[4]||`0`].join(`.`)]:[je,``]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=[`Mac OS X`,``];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||`0`].join(`.`)),t}],[/Mac/i,[`Mac OS X`,``]],[/CrOS/,[Ue,``]],[/Linux|debian/i,[`Linux`,``]]],jt=function(e){return wt.test(e)?$e:Ct.test(e)?et:St.test(e)?tt:new RegExp(st,`i`).test(e)?st:RegExp(`(`+at+`|WPDesktop)`,`i`).test(e)?at:/iPad/.test(e)?Pe:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ie:Tt.test(e)?Re:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(ot,`i`).test(e)?ot:/(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(ke).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)?je:Ne:RegExp(`(pda|`+ke+`)`,`i`).test(e)?lt:new RegExp(Me,`i`).test(e)&&!RegExp(Me+` pc`,`i`).test(e)?ut:``},Mt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Nt(e,t){return typeof(n=e)==`string`&&Mt.test(n)?e:t();var n}function Pt(e){return e&&e.split(`#`)[0]}function Ft(e,t){var n=setTimeout(e,t);return n!=null&&n.unref&&n?.unref(),n}function It(e,t,n){return Lt.apply(this,arguments)}function Lt(){return(Lt=h((function*(e,t,n){var r;try{return yield Promise.race([e,new Promise(((e,i)=>{r=Ft((()=>{try{n?.(),e()}catch(e){i(e)}}),t)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var Rt={trace:{text:`TRACE`,number:1},debug:{text:`DEBUG`,number:5},info:{text:`INFO`,number:9},warn:{text:`WARN`,number:13},error:{text:`ERROR`,number:17},fatal:{text:`FATAL`,number:21}},zt=Rt.info;function Bt(e){if(he(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(j(e))return{arrayValue:{values:e.map((e=>Bt(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function Vt(e){var t=[];for(var n in e){var r=e[n];I(r)||P(r)||t.push({key:n,value:Bt(r)})}return t}function Ht(e,t){var n=Rt[e.level||`info`]||zt,r=n.text,i=n.number,a=String(Date.now())+`000000`,o={};t.distinctId&&(o.posthogDistinctId=t.distinctId),t.sessionId&&(o.sessionId=t.sessionId),t.windowId&&(o[`window.id`]=t.windowId),L(t.sessionStartTimestamp)||(o.sessionStartTimestamp=String(t.sessionStartTimestamp)),L(t.lastActivityTimestamp)||(o.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(o[`url.full`]=t.currentUrl),t.screenName&&(o[`screen.name`]=t.screenName),t.appState&&(o[`app.state`]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(o.feature_flags=t.activeFeatureFlags);var s=g({},o,e.attributes||{}),c={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:i,severityText:r,body:{stringValue:e.body},attributes:Vt(s)};return e.trace_id&&(c.traceId=e.trace_id),e.span_id&&(c.spanId=e.span_id),P(e.trace_flags)||(c.flags=e.trace_flags),c}function Ut(e,t,n){return g({},e.resourceAttributes,{"service.name":e.serviceName||`unknown_service`},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}function Wt(e,t,n,r){return{resourceLogs:[{resource:{attributes:Vt(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var Gt=class{constructor(e,t,n,r,i,a,o){a===void 0&&(a=()=>Promise.resolve()),this._instance=e,this.qe=t,this.st=n,this.dt=r,this.vt=i,this.ct=a,this.ft=o,this.yt=null,this.bt=0,this._t=0,this.wt=0,this.kt=0,this.xt=!1,this.St=t.maxBufferSize,this.Ct=Math.max(t.maxQueueSize??t.maxBufferSize,t.maxBufferSize),this.Mt=t.flushIntervalMs,this.Tt=t.maxBatchRecordsPerPost,this.Et=t.rateCapWindowMs,this.It=t.maxLogsPerInterval}reset(){this.Pt(),this.yt=null,this.wt=0,this.kt=0,this.xt=!1,this.bt=0,this._t=0,this.Tt=this.qe.maxBatchRecordsPerPost}onReconnect(){this._t=0,this.Rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&e!=null&&e.body){var t=this.At(e);if(t!==null)if(t.body){if(this.Ft()){var n={record:Ht(t,this.dt())};this.vt((()=>this.Ot(n)))}}else this.st.info(`Log was rejected in beforeSend function`)}}At(e){var t=this.qe.beforeSend;if(!t)return e;var n=j(t)?t:[t],r=e;for(var i of n)try{var a=i(r);if(!a)return this.st.info(`Log was rejected in beforeSend function`),null;r=a}catch(e){return this.st.error(`Error in beforeSend function for log:`,e),null}return r}Ft(){if(this.It===void 0)return!0;var e=Date.now(),t=e-this.wt;return this.Et>t&&t>=0||(this.wt=e,this.kt=0,this.xt=!1),this.It>this.kt?(this.kt++,!0):(this.xt||=(this.st.warn(`captureLog dropping logs: exceeded `+this.It+` logs per `+this.Et+`ms`),!0),!1)}flush(){var e=this;return h((function*(){if(!e._instance.isDisabled)return e.yt||=e.Lt().finally((()=>{e.yt=null})),e.yt}))()}Lt(){var e=this;return h((function*(){e.Pt();var t=e._instance.getPersistedProperty(C.LogsQueue)??[];if(t.length!==0)for(var n=t.length,r=0;t.length>0&&n>r;){e.bt=0;var i=Math.min(t.length,e.Tt),a=t.slice(0,i),o=Wt(a.map((e=>e.record)),e.Dt(),e.ft??e._instance.getLibraryId(),e._instance.getLibraryVersion()),s=yield e._instance.$t(o);if(s.kind===`too-large`&&a.length>1)e.Tt=Math.max(1,Math.floor(a.length/2)),e.st.warn(`Received 413 when sending logs batch of size `+a.length+`, reducing batch size to `+e.Tt);else if(s.kind===`retry-later`||(s.kind===`too-large`?e.st.warn(`Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further.`):s.kind===`ok`&&e.qe.maxBatchRecordsPerPost>e.Tt&&(e.Tt=Math.min(e.qe.maxBatchRecordsPerPost,e.Tt+1)),yield e.Nt(a.length),t=e._instance.getPersistedProperty(C.LogsQueue)??[],r+=a.length,s.kind===`fatal`))throw s.error}}))()}Nt(e){var t=this;return h((function*(){var n=Math.max(0,e-t.bt),r=t._instance.getPersistedProperty(C.LogsQueue)??[];t._instance.setPersistedProperty(C.LogsQueue,r.slice(n)),yield t.ct()}))()}Dt(){return Ut(this.qe,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(e){if(!this._instance.optedOut){var t=this._instance.getPersistedProperty(C.LogsQueue)??[];this.Ct>t.length||(t.shift(),this.bt++,this.st.info(`Logs queue is full, dropping oldest record.`)),t.push(e),this._instance.setPersistedProperty(C.LogsQueue,t),this.St>t.length?this.qt():this.Rt()}}qt(e){e===void 0&&(e=this.Mt),this.jt||=Ft((()=>{this.jt=void 0,this.Rt()}),e)}Bt(){var e=Math.min(Math.max(0,this._t-1),6);return this.Mt*2**e}Ht(){var e=this._instance.getPersistedProperty(C.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return h((function*(){t.Pt();var n=t.flush().catch((()=>{}));e===void 0?yield n:yield It(n,e)}))()}flushWithTimeout(e){var t=this;return h((function*(){var n=t.flush();yield It(n,e,(()=>{n.catch((()=>{}))}))}))()}Rt(){this.flush().then((()=>{this._t=0}),(e=>{this._t++,this.st.error(`PostHog logs flush failed:`,e)})).finally((()=>{!this._instance.isDisabled&&this.Ht()&&this.qt(this.Bt())}))}Pt(){this.jt&&=(clearTimeout(this.jt),void 0)}},Kt=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function qt(e){return String(e)+`000000`}function Jt(e,t,n,r){var i=``;return r&&(i=Object.keys(r).sort().map((e=>JSON.stringify(e)+`:`+JSON.stringify(r[e]))).join(`,`)),e+`\0`+t+`\0`+(n??``)+`\0`+i}var Yt=class{constructor(e,t,n){this._instance=e,this.qe=t,this.st=n,this.Ut=new Map,this.yt=null,this.zt=!1,this.Wt=new Map,this.Vt=new Set,this.Zt=0}count(e,t,n){t===void 0&&(t=1),this.Gt({name:e,type:`count`,value:t,unit:n?.unit,attributes:n?.attributes})}gauge(e,t,n){this.Gt({name:e,type:`gauge`,value:t,unit:n?.unit,attributes:n?.attributes})}histogram(e,t,n){this.Gt({name:e,type:`histogram`,value:t,unit:n?.unit,attributes:n?.attributes})}flush(){var e=this,t=this.yt,n=function(){var n=h((function*(){t&&(yield t.catch((()=>{}))),yield e.Qt()}));return function(){return n.apply(this,arguments)}}()().finally((()=>{this.yt===n&&(this.yt=null)}));return this.yt=n,n}drainWindow(){if(this.Ut.size===0)return null;var e=this.Ut;return this.Ut=new Map,this.zt=!1,this.Wt=new Map,this.Vt=new Set,this.Jt(e)}reset(){this.Zt++,this.Pt(),this.Ut=new Map,this.yt=null,this.zt=!1,this.Wt=new Map,this.Vt=new Set}Gt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.At(e);if(t!==null)if(t.name&&typeof t.name==`string`)if(typeof t.value==`number`&&Number.isFinite(t.value))if(t.type===`count`&&0>t.value)this.st.warn(`Dropping count '`+t.name+`': counters are monotonic, value must be >= 0`);else{var n,r;try{n=t.attributes?g({},t.attributes):void 0,r=Jt(t.type,t.name,t.unit,n)}catch(e){this.st.warn(`Dropping metric '`+t.name+`': attributes could not be serialized`,e);return}var i=this.Ut.get(r);if(!i){if(!this.Kt())return;i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this.Ut.set(r,i)}var a=this.Wt.get(t.name);a===void 0?this.Wt.set(t.name,t.type):a===t.type||this.Vt.has(t.name)||(this.Vt.add(t.name),this.st.warn(`Metric name '`+t.name+`' is already used as a `+a+`; recording it as a `+t.type+` too will blend both series in charts. Use a distinct name.`)),this.Yt(i,t.value),this.qt()}else this.st.warn(`Dropping metric '`+t.name+`': value must be a finite number`);else this.st.warn(`Dropping metric with empty name`)}}Kt(){return this.qe.maxSeriesPerFlush>this.Ut.size||(this.zt||(this.zt=!0,this.st.warn(`Metric series cap reached (`+this.qe.maxSeriesPerFlush+` per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Yt(e,t){switch(e.type){case`count`:e.total=(e.total??0)+t;break;case`gauge`:e.last=t;break;case`histogram`:e.hist||={count:0,sum:0,min:t,max:t,bucketCounts:Array(Kt.length+1).fill(0)};var n=e.hist;n.count+=1,n.sum+=t,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.bucketCounts[function(e,t){for(var n=0;t.length>n;n++)if(t[n]>=e)return n;return t.length}(t,Kt)]+=1}}At(e){var t=this.qe.beforeSend;if(!t)return e;var n=j(t)?t:[t],r=e;for(var i of n)try{var a=i(r);if(!a)return this.st.info(`Metric was rejected in beforeSend function`),null;r=a}catch(e){return this.st.error(`Error in beforeSend function for metric:`,e),null}return r}qt(){this.jt||=Ft((()=>{this.jt=void 0,this.flush().catch((e=>{this.st.error(`Metrics flush failed:`,e)}))}),this.qe.flushIntervalMs)}Pt(){this.jt&&=(clearTimeout(this.jt),void 0)}Qt(){var e=this;return h((function*(){if(e.Ut.size!==0){var t=e.Ut;e.Ut=new Map,e.zt=!1,e.Wt=new Map,e.Vt=new Set;var n=e.Zt,r=yield e._instance.Xt(e.Jt(t));if(n===e.Zt)switch(r.kind){case`ok`:return;case`retry-later`:e.ti(t),e.qt();return;case`too-large`:e.st.warn(`Metrics batch exceeded the server size limit and was dropped`);return;case`fatal`:e.st.error(`Failed to send metrics batch:`,r.error);return}}}))()}Jt(e){return t=this.ei(e),n=function(e,t,n){return g({},e.resourceAttributes,{"service.name":e.serviceName||`unknown_service`},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}(this.qe,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Vt(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i}ei(e){var t=qt(Date.now()),n=new Map;for(var r of e.values()){var i=Jt(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=g({name:r.name},r.unit&&{unit:r.unit}),r.type===`count`?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type===`gauge`?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var o=Vt(r.attributes??{}),s=qt(r.windowStartMs);if(r.type===`count`){var c={attributes:o,startTimeUnixNano:s,timeUnixNano:t,asDouble:r.total??0};a.sum.dataPoints.push(c)}else if(r.type===`gauge`){var l={attributes:o,timeUnixNano:t,asDouble:r.last??0};a.gauge.dataPoints.push(l)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:s,timeUnixNano:t,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Kt})}return Array.from(n.values())}ti(e){for(var t of e){var n=t[0],r=t[1],i=this.Ut.get(n);if(i)switch(i.windowStartMs=Math.min(i.windowStartMs,r.windowStartMs),i.type){case`count`:i.total=(i.total??0)+(r.total??0);break;case`gauge`:break;case`histogram`:if(r.hist)if(i.hist){i.hist.count+=r.hist.count,i.hist.sum+=r.hist.sum,i.hist.min=Math.min(i.hist.min,r.hist.min),i.hist.max=Math.max(i.hist.max,r.hist.max);for(var a=0;i.hist.bucketCounts.length>a;a++)i.hist.bucketCounts[a]+=r.hist.bucketCounts[a]}else i.hist=r.hist}else this.Kt()&&this.Ut.set(n,r)}}},Xt,Zt,Qt;function $t(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return Qt&&n.length===Zt||(Zt=n.length,Qt=n.reduce(((n,r)=>{Xt||={};var i=Xt[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,Xt[r]=[s,c];break}}return n}),{})),Qt}}var en=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return h((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&j(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),g({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return h((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,g({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:$t(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return g({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},tn=`?`;function nn(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?tn:n,in_app:!(t!=null&&t.startsWith(`webkit-masked-url://`))};return P(r)||(a.lineno=r),P(i)||(a.colno=i),a}var rn=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?tn:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},an=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,on=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,sn=/\((\S*)(?::(\d+))(?::(\d+))\)/,cn=(e,t)=>{var n=an.exec(e);if(n)return nn(t,n[1],tn,+n[2],+n[3]);var r=on.exec(e);if(r){if(r[2]&&r[2].indexOf(`eval`)===0){var i=sn.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var a=rn(r[1]||tn,r[2]);return nn(t,a[1],a[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},ln=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,un=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,dn=(e,t)=>{var n=ln.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=un.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||tn,o=rn(a,i);return nn(t,i=o[1],a=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},fn=/\(error: (.*)\)/,pn=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=F(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?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 be(e,`DOMException`)}isDOMError(e){return be(e,`DOMError`)}},mn=class{match(e){return xe(e)}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 n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},hn=class{constructor(){}match(e){return!!be(e,`ErrorEvent`)&&(e.error!=null||this.fe(e))}coerce(e,t){if(e.error!=null)return t.apply(e.error);var n=t.apply(e.message);return g({},n,{stack:this.pe(e)??n.stack,synthetic:!0})}fe(e){return F(e.message)&&e.message.length>0}pe(e){var t=e;if(F(t.filename)&&t.filename.length>0){var n=t.lineno??0,r=t.colno??0;return`Error
|
|
2
|
+
at `+t.filename+`:`+n+`:`+r}}},gn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,_n=class{match(e){return typeof e==`string`}coerce(e,t){var n=this.getInfos(e),r=n[0],i=n[1];return{type:r??`Error`,value:i??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(gn);return r&&(t=r[1],n=r[2]),[t,n]}},vn=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function yn(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var bn=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:this.getStack(e)??t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:`error`,synthetic:!0}}getType(e){if(Se(e))return e.constructor.name;var t=`name`in e?e.name:void 0;return F(t)&&!pe(t)?t:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+yn(e)}isSeverityLevel(e){return F(e)&&!pe(e)&&vn.indexOf(e)>=0}getStack(e){try{return F(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:F(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(xe(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},xn=class{match(e){return Se(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+yn(e),stack:t.syntheticException?.stack,synthetic:!0}}},Sn=class{match(e){return ye(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},Cn=class{match(e){return be(e,`PromiseRejectionEvent`)||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Se(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return ye(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},wn=`$message`,Tn=`$timestamp`,En=new Set([wn,Tn]),Dn={enabled:!0,max_bytes:32768};function On(e){return e?{enabled:e.enabled??Dn.enabled,max_bytes:An(e.max_bytes,Dn.max_bytes)}:g({},Dn)}var kn=class{constructor(e){this.ii=[],this.ri=0,this.qe=On(e)}setConfig(e){this.qe=On(e),this.ni()}add(e){var t=function(e){var t;try{t=ce(e)}catch{return}try{var n=JSON.parse(t);if(!N(n))return;var r=n,i=r[wn],a=r[Tn];return!F(i)||i.trim().length===0||!F(a)&&!R(a)?void 0:{step:r,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.qe.max_bytes||(this.ii.push({step:t.step,bytes:n}),this.ri+=n,this.ni())}}getAttachable(){return this.ii.map((e=>e.step))}clear(){this.ii=[],this.ri=0}size(){return this.ii.length}ni(){for(;this.ri>this.qe.max_bytes&&this.ii.length>0;){var e=this.ii.shift();e&&(this.ri-=e.bytes)}}};function An(e,t){if(!R(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var jn=function(t,n){var r=(n===void 0?{}:n).debugEnabled,i={k(n){if(e&&(p.DEBUG||e.POSTHOG_DEBUG||r)&&!P(e.console)&&e.console){for(var i=(`__rrweb_original__`in e.console[n])?e.console[n].__rrweb_original__:e.console[n],a=arguments.length,o=Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];i(t,...o)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`error`,...t)},critical(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];console.error(t,...n)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling `+e)},createLogger:(e,n)=>jn(t+` `+e,n)};return i},B=jn(`[PostHog.js]`),V=B.createLogger,Mn=V(`[ExternalScriptsLoader]`),Nn=e=>{var t=r?.querySelectorAll(`script`);if(t){for(var n=0;t.length>n;n++)if(t[n].src===e)return t[n]}},Pn=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Mn.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var i=Nn(t);if(i){if(i.__posthog_loading_callback_fired)return n();var a=i.__posthog_loading_error;return a?n(a):(i.addEventListener(`load`,(e=>{i.__posthog_loading_callback_fired=!0,n(void 0,e)})),void i.addEventListener(`error`,(e=>{i.__posthog_loading_error=e,n(e)})))}var o=()=>{if(!r)return n(`document not found`);if(Nn(t))return Pn(e,t,n);var i=r.createElement(`script`);if(i.type=`text/javascript`,i.crossOrigin=`anonymous`,i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,n(void 0,e)},i.onerror=e=>{i.__posthog_loading_error=e,n(e)},e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)r.head.appendChild(i);else{var a,o=r.querySelectorAll(`body > script`);o.length>0?(a=o[0].parentNode)==null||a.insertBefore(i,o[0]):r.body.appendChild(i)}};r!=null&&r.body?o():r?.addEventListener(`DOMContentLoaded`,o)},Fn={},In=(e,t)=>{var n=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var r=3e5;n=n+`&t=`+Math.floor(Date.now()/r)*r}return e.requestRouter.endpointFor(`assets`,n)};f.__PosthogExtensions__=f.__PosthogExtensions__||{},f.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r=e.config.strict_script_versioning;if(r){var i=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`),a=Fn[i];if(r===`fallback`&&a){if(Nn(a))return void Pn(e,a,n);delete Fn[i]}Pn(e,i,r===`fallback`?(r,a)=>{if(r)if(typeof r==`string`)n(r);else{var o,s=In(e,t);Fn[i]=s;var c=Nn(i);c==null||(o=c.parentNode)==null||o.removeChild(c),Pn(e,s,n)}else n(void 0,a)}:n)}else Pn(e,In(e,t),n)}else Pn(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},f.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{Pn(e,e.requestRouter.endpointFor(`api`,t),n)},p.DEBUG=!1,p.LIB_VERSION=`1.418.1`,p.LIB_NAME=`web`;var Ln=`$people_distinct_id`,H=`distinct_id`,Rn=`$device_id`,zn=`$device_model`,Bn=`__alias`,Vn=`__timers`,Hn=`$autocapture_disabled_server_side`,Un=`$heatmaps_enabled_server_side`,Wn=`$exception_capture_enabled_server_side`,Gn=`$error_tracking_suppression_rules`,Kn=`$error_tracking_capture_extension_exceptions`,qn=`$web_vitals_enabled_server_side`,Jn=`$dead_clicks_enabled_server_side`,Yn=`$product_tours_enabled_server_side`,Xn=`$web_vitals_allowed_metrics`,Zn=`$session_recording_remote_config`,Qn=`$replay_sample_rate`,$n=`$replay_override_sampling`,er=`$replay_override_linked_flag`,tr=`$replay_override_url_trigger`,nr=`$replay_override_event_trigger`,rr=`$sesid`,ir=`$session_is_sampled`,ar=`$enabled_feature_flags`,or=`$active_feature_flags`,sr=`$early_access_features`,cr=`$feature_flag_details`,lr=`$feature_flag_payloads`,ur=`$feature_flag_request_id`,dr=`$minimal_flag_called_events`,fr=`$override_feature_flags`,pr=`$override_feature_flag_payloads`,mr=`$stored_person_properties`,hr=`$stored_group_properties`,gr=`$groups`,_r=`$surveys`,vr=`$surveys_loaded_at`,yr=`$surveys_activated`,br=`$surveys_activated_session`,xr=`$surveys_activated_timestamps`,Sr=`ph_product_tours`,Cr=`$flag_call_reported`,wr=`$flag_call_reported_session_id`,Tr=`$feature_flag_errors`,Er=`$feature_flag_evaluated_at`,U=`$user_state`,Dr=`$client_session_props`,Or=`$capture_rate_limit`,kr=`$initial_campaign_params`,Ar=`$initial_referrer_info`,jr=`$initial_person_info`,Mr=`$epp`,Nr=`$posthog_cookieless`,Pr=`$cookieless_mode`,Fr=`$sdk_debug_extensions_init_method`,Ir=`$sdk_debug_extensions_init_time_ms`,Lr=`$sdk_debug_recording_script_not_loaded`,Rr=`PostHog loadExternalDependency extension not found.`,zr=`on_reject`,Br=`always`,W=`anonymous`,G=`identified`,Vr=`identified_only`,Hr=`visibilitychange`,Ur=`beforeunload`,Wr=`$pageview`,Gr=`$pageleave`,Kr=`$identify`,qr=`$groupidentify`;function Jr(e,t){j(e)&&e.forEach(t)}function K(e,t){if(!L(e))if(j(e))e.forEach(t);else if(ge(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)ue.call(e,n)&&t(e[n],n)}var q=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function Yr(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Xr=function(e){try{return e()}catch{return}},Zr=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){B.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),B.critical(e)}}},Qr=function(e){var t={};return K(e,(function(e,n){(F(e)&&e.length>0||R(e))&&(t[n]=e)})),t},$r=[`herokuapp.com`,`vercel.app`,`netlify.app`];function ei(e){var t=e?.hostname;if(!F(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of $r)if(n===r)return!1;return!0}function J(e,t,n,r){var i=r??{},a=i.capture,o=i.passive;e?.addEventListener(t,n,{capture:a!==void 0&&a,passive:o===void 0||o})}function ti(e){return e.name===`ph_toolbar_internal`}var ni=e=>{if(r){try{for(var t=e+`=`,n=r.cookie.split(`;`).filter((e=>e.length)),i=0;n.length>i;i++){for(var a=n[i];a.charAt(0)==` `;)a=a.substring(1,a.length);if(a.indexOf(t)===0)return decodeURIComponent(a.substring(t.length,a.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return R(e)&&isFinite(e)&&Math.floor(e)===e});var ri=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/256,a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}toString(){for(var e=``,t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},ii=class{generate(){var e=this.generateOrAbort();if(!P(e))return e;this.S=0;var t=this.generateOrAbort();if(P(t))throw Error(`Could not generate UUID after timestamp reset`);return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return ri.fromFieldsV7(this.S,Math.trunc(this.I/2**30),this.I&2**30-1,this.A.nextUint32())}C(){this.I=1024*this.A.nextUint32()+(1023&this.A.nextUint32())}constructor(){this.S=0,this.I=0,this.A=new si}},ai,oi=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!P(e.crypto)&&crypto.getRandomValues&&(oi=e=>crypto.getRandomValues(e));var si=class{nextUint32(){return this.R.length>this.O||(oi(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}},ci=()=>li().toString(),li=()=>(ai||=new ii).generate(),ui=``,di=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Y={N:()=>!!r,j(e){B.error(`cookieStore error: `+e)},P:ni,H(e){var t;try{t=JSON.parse(Y.P(e))||{}}catch{}return t},F(e,t,n,i,a){if(!r)return!1;try{var o=``,s=``,c=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=r),ui)return ui;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),i=Math.min(n.length,8),a=`dmn_chk_`+ci();!ui&&i--;){var o=n.slice(i).join(`.`),s=a+`=1;domain=.`+o+`;path=/`;t.cookie=s+`;max-age=3`,t.cookie.includes(a)&&(t.cookie=s+`;max-age=0`,ui=o)}return ui}(e);if(!n){var i=(e=>{var t=e.match(di);return t?t[0]:``})(e);i!==n&&B.info(`Warning: cookie subdomain discovery mismatch`,i,n),n=i}return n?`; domain=.`+n:``}return``}(r.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),o=`; expires=`+l.toUTCString()}a&&(s=`; secure`);var u=e+`=`+encodeURIComponent(JSON.stringify(t))+o+`; SameSite=Lax; path=/`+c+s;return u.length>3686.4&&B.warn(`cookieStore warning: large cookie, len=`+u.length),r.cookie=u,!0}catch{return!1}},q(e,t){if(r!=null&&r.cookie)try{Y.F(e,``,-1,t)}catch{return}}},fi=null,X={N(){if(!I(fi))return fi;var t=!0;if(P(e))t=!1;else try{var n=`__mplssupport__`;X.F(n,`xyz`),X.P(n)!==`"xyz"`&&(t=!1),X.q(n)}catch{t=!1}return t||B.error(`localStorage unsupported; falling back to cookie store`),fi=t,t},j(e){B.error(`localStorage error: `+e)},P(t){try{return e?.localStorage.getItem(t)}catch(e){X.j(e)}return null},H(e){try{return JSON.parse(X.P(e))||{}}catch{}return null},F(t,n){try{return e?.localStorage.setItem(t,JSON.stringify(n)),!0}catch(e){X.j(e)}return!1},q(t){try{e?.localStorage.removeItem(t)}catch(e){X.j(e)}}},pi=[mr,or,ar,cr,lr,ur,Er,Tr,Cr],mi=[Rn,H,rr,ir,Mr,jr,U],hi=e=>e+`_cpm`,gi=[`__proto__`,`constructor`,`prototype`],_i=e=>{if(!N(e))return{};var t={};return Object.keys(e).forEach((n=>{gi.indexOf(n)===-1&&(t[n]=e[n])})),t},vi=function(e,t){t===void 0&&(t=[]);var n={};return[...mi,...t].forEach((t=>{var r=e[t];P(r)||I(r)||r===``||(n[t]=r)})),n},yi=e=>{for(var t=5381,n=2166136261,r=0;e.length>r;r++){var i=e.charCodeAt(r);t=33*t^i,n=Math.imul(n^i,16777619)}return e.length.toString(36)+`.`+(t>>>0).toString(36)+`.`+(n>>>0).toString(36)},bi=(e,t)=>({p:t,f:yi(JSON.stringify(e))}),xi=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var n=Y.H(hi(e)),r=n?.f===yi(t)&&j(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},Si=(e,t)=>t+`|`+(Y.P(hi(e))||``),Ci={},wi={N:()=>!0,j(e){B.error(`memoryStorage error: `+e)},P:e=>Ci[e]||null,H:e=>Ci[e]||null,F:(e,t)=>(Ci[e]=t,!0),q(e){delete Ci[e]}},Ti=null,Z={N(){if(!I(Ti))return Ti;if(Ti=!0,P(e))Ti=!1;else try{var t=`__support__`;Z.F(t,`xyz`),Z.P(t)!==`"xyz"`&&(Ti=!1),Z.q(t)}catch{Ti=!1}return Ti},j(e){B.error(`sessionStorage error: `,e)},P(t){try{return e?.sessionStorage.getItem(t)}catch(e){Z.j(e)}return null},H(e){try{return JSON.parse(Z.P(e))||null}catch{}return null},F(t,n){try{return e?.sessionStorage.setItem(t,JSON.stringify(n)),!0}catch(e){Z.j(e)}return!1},q(t){try{e?.sessionStorage.removeItem(t)}catch(e){Z.j(e)}}},Ei=class{constructor(e){this._instance=e}get qe(){return this._instance.config}get consent(){return this.si()?0:this.ai}isOptedOut(){return this.qe.cookieless_mode===Br||this.isRejected()||this.consent===-1&&this.qe.cookieless_mode===zr}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qe.opt_out_capturing_by_default}optInOut(e){this.oi.F(this.li,+!!e,this.qe.cookie_expiration,this.qe.cross_subdomain_cookie,this.qe.secure_cookie)}reset(){this.oi.q(this.li,this.qe.cross_subdomain_cookie)}get li(){var e=this._instance.config,t=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+t:`__ph_opt_in_out_`+t)}get ai(){var e=this.oi.P(this.li);return Te(e)?1:A(Ee,e)?0:-1}get oi(){var e=this.qe.opt_out_capturing_persistence_type,t=e===`localStorage`?X:Y;if(!this.ui||this.ui!==t){this.ui=t;var n=e===`localStorage`?Y:X;n.P(this.li)&&(this.ui.P(this.li)||this.optInOut(Te(n.P(this.li))),n.q(this.li,this.qe.cross_subdomain_cookie))}return this.ui}si(){return!!this.qe.respect_dnt&&[n?.doNotTrack,n?.msDoNotTrack,f.doNotTrack].some((e=>Te(e)))}};function Di(e,t){var n,r=e==null||(n=e.config)==null?void 0:n.get_current_url;if(!M(r))return t;try{var i=r(t);return F(i)&&i?i:t}catch(e){return B.error(`Error in get_current_url, falling back to window.location.href`,e),t}}var Oi=`__POSTHOG_TOOLBAR__`,ki=1,Ai=3,ji=11;function Mi(e){return e instanceof Element&&(e.id===Oi||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function Ni(e){return!!e&&e.nodeType===ki}function Pi(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Fi(e){return!!e&&e.nodeType===Ai}function Ii(e){return!!e&&e.nodeType===ji&&Ni(e.host)}var Li=1e3;function Ri(e){return e?oe(e).split(/\s+/):[]}function zi(t,n){var r=function(t){var n,r=e==null||(n=e.location)==null?void 0:n.href;return P(r)?void 0:Di(t,r)}(n);return!!(r&&t&&t.some((e=>r.match(e))))}function Bi(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 Ri(t)}function Vi(e){return L(e)?null:oe(e).split(/(\s+)/).filter((e=>da(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function Hi(e){var t=``;return na(e)&&!ra(e)&&e.childNodes&&e.childNodes.length&&K(e.childNodes,(function(e){Fi(e)&&e.textContent&&(t+=Vi(e.textContent)??``)})),oe(t)}function Ui(e){var t;return P(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var Wi=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function Gi(e,t){if(P(t))return!0;var n,r=function(e){if(t.some((t=>function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch{return!1}}(e,t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function Ki(e){var t=e.parentNode;return!(!t||!Ni(t))&&t}var qi=[`.ph-no-autocapture`,`[data-ph-no-autocapture]`],Ji=[`next`,`previous`,`prev`,`>`,`<`],Yi=[...Ji,`+`,`-`,`−`,`–`],Xi=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,Zi=[`.ph-no-rageclick`,`.ph-no-capture`],Qi=[``,`text`,`search`,`email`,`password`,`url`,`tel`,`number`];function $i(t,n){if(!e||ea(t))return!1;var r,i,a,o;if(he(n)?(r=!!n&&Zi,i=void 0,a=!1):(r=n?.css_selector_ignorelist??Zi,i=n?.content_ignorelist,a=(o=n?.ignore_text_selection)!=null&&o),!1===r||a&&function(e){return!(!e||!Ni(e))&&(!!Pi(e,`textarea`)||(Pi(e,`input`)?A(Qi,(e.getAttribute(`type`)||``).toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=e.getAttribute==null?void 0:e.getAttribute(`contenteditable`);return t===`true`||t===``}(e)))}(t))return!1;var s=ta(t,!1).targetElementList;return!function(e,t){if(!1===e||P(e))return!1;var n;if(!0===e)n=Ji;else{if(!j(e))return!1;if(e.length>10)return B.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var t=e.safeText,r=e.ariaLabel;return n.some((e=>Xi(t,e)||Xi(r,e)))}))}(i,s.map((e=>({safeText:Hi(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!Gi(s,r)}var ea=e=>!e||Pi(e,`html`)||!Ni(e),ta=(t,n)=>{if(!e||ea(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],a=t;a.parentNode&&!Pi(a,`body`);)if(Ii(a.parentNode))i.push(a.parentNode.host),a=a.parentNode.host;else{var o=Ki(a);if(!o)break;if(n||Wi.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{var s=e.getComputedStyle(o);s&&s.getPropertyValue(`cursor`)===`pointer`&&(r=!0)}catch{}i.push(o),a=o}return{parentIsUsefulElement:r,targetElementList:i}};function na(e){for(var t=new Set,n=0,r=e;r.parentNode&&!Pi(r,`body`);r=r.parentNode){if(n++>=Li||t.has(r))return!1;t.add(r);var i=Bi(r);if(A(i,`ph-sensitive`)||A(i,`ph-no-capture`))return!1}if(A(Bi(e),`ph-include`))return!0;var a=e.type||``;if(F(a))switch(a.toLowerCase()){case`hidden`:case`password`:return!1}var o=e.name||e.id||``;return!F(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,``))}function ra(e){return!!(Pi(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||Pi(e,`select`)||Pi(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var ia=RegExp(`^(?:(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}))$`),aa=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,oa=[16,15,14,13],sa=RegExp(`^(\\d{3}-?\\d{2}-?\\d{4})$`),ca=RegExp(`(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))`,`g`),la=/[0-9A-Za-z_]/;function ua(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function da(e,t){return t===void 0&&(t=!0),!(L(e)||F(e)&&(e=oe(e),(t?ia.test((e||``).replace(/[- ]/g,``)):function(e){var t;for(aa.lastIndex=0;t=aa.exec(e);){var n=t[2];if(n)for(var r=n.replace(/[- ]/g,``),i=0;r.length>i;i++)for(var a of oa){var o=i+a;if(r.length>=o){var s=r.slice(i,o);if(ia.test(s)&&ua(s))return!0}}}return!1}(e))||(t?sa.test(e):function(e){var t;for(ca.lastIndex=0;t=ca.exec(e);){var n=t[1],r=t[3];if(!(n&&r&&la.test(n)&&la.test(r)))return!0}return!1}(e))))}function fa(e){var t=Hi(e);return da(t=(t+` `+pa(e)).trim())?t:``}function pa(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&K(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=Hi(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+pa(e)).trim())}catch(e){B.error(`[AutoCapture]`,e)}})),t}function ma(e){return e.replace(/"|\\"/g,`\\"`)}function ha(e){var t=e.attr__class;if(t)return j(t)?t:Ri(t)}var ga=V(`[Dead Clicks]`),_a=()=>!0,va=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(Jn)),r=e.instance.config.capture_dead_clicks;return he(r)?r:!!N(r)||n},ya=class{get lazyLoadedDeadClicksAutocapture(){return this.hi}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;`captureDeadClicks`in t&&(this.instance.persistence&&this.instance.persistence.register({[Jn]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.di((()=>{this.vi()})):this.stop()}di(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture?e():(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?ga.error(`failed to load script`,t):e()}))}vi(){var e;if(r){if(!this.hi&&(e=f.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=N(this.instance.config.capture_dead_clicks)?g({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.hi=f.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.hi.start(r),ga.info(`starting...`)}}else ga.error("`document` not found. Cannot start.")}stop(){this.hi&&(this.hi.stop(),this.hi=void 0,ga.info(`stopping...`))}},ba=V(`[SegmentIntegration]`),xa=`posthog-js`;function Sa(e,t){var n=t===void 0?{}:t,r=n.organization,i=n.projectId,a=n.prefix,o=n.severityAllowList,s=o===void 0?[`error`]:o,c=n.sendExceptionsToPostHog,l=c===void 0||c;return t=>{if(s!==`*`&&!s.includes(t.level)||!e.__loaded)return t;t.tags||={};var n=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=n,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var o,c=t.exception?.values||[],u=c.map((e=>g({},e,{stacktrace:e.stacktrace?g({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>g({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:c[0]?.value||t.message,$exception_type:c[0]?.type,$exception_level:t.level,$exception_list:u,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:c[0]?.value||t.message,$sentry_exception_type:c[0]?.type,$sentry_tags:t.tags};return r&&i&&(d.$sentry_url=(a||`https://sentry.io/organizations/`)+r+`/issues/?project=`+i+`&query=`+t.event_id),l&&((o=e.exceptions)==null||o.sendExceptionEvent(d)),t}}var Ca=class{constructor(e,t,n,r,i,a){this.name=xa,this.setupOnce=function(o){o(Sa(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},wa=class{constructor(e){this.ci=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength||n.crossTabAdoption)&&(B.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.fi=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.pi()}pi(){this.gi=this._instance.sessionManager?.onSessionId(this.ci)}destroy(){var e;(e=this.gi)==null||e.call(this),this.gi=void 0}doPageView(t,n){var r=this.mi(t,n);return this.fi={pathname:e?.location.pathname??``,pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(e){return this.mi(e,this.fi?.pageViewId)}doEvent(){return{$pageview_id:this.fi?.pageViewId}}mi(e,t){var n=this.fi;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var a=i.maxScrollHeight,o=i.lastScrollY,s=i.maxScrollY,c=i.maxContentHeight,l=i.lastContentY,u=i.maxContentY;if(!(P(a)||P(o)||P(s)||P(c)||P(l)||P(u))){a=Math.ceil(a),o=Math.ceil(o),s=Math.ceil(s),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);var d=a>1?De(o/a,0,1,B):1,f=a>1?De(s/a,0,1,B):1,p=c>1?De(l/c,0,1,B):1,m=c>1?De(u/c,0,1,B):1;r=q(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},Ta=[`flags`,`surveys`],Ea={[Ln]:{exposure:`hidden`},[Bn]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[Vn]:{exposure:`hidden`},[Hn]:{exposure:`event`},[Un]:{exposure:`hidden`},[Wn]:{exposure:`event`},[Gn]:{exposure:`hidden`},[Kn]:{exposure:`event`},[qn]:{exposure:`event`},[Jn]:{exposure:`event`},[Yn]:{exposure:`hidden`},[Xn]:{exposure:`event`},[Zn]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[rr]:{exposure:`hidden`},[ir]:{exposure:`event`},[Qn]:{exposure:`event`,shouldSkipFromEventProperties:e=>I(e)},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},$sess_rec_flush_size:{exposure:`hidden`},[ar]:{exposure:`hidden`,storageGroup:`flags`},[or]:{exposure:`hidden`,storageGroup:`flags`},[sr]:{exposure:`hidden`},[cr]:{exposure:`hidden`,storageGroup:`flags`},[lr]:{exposure:`hidden`,storageGroup:`flags`},[ur]:{exposure:`hidden`,storageGroup:`flags`,volatile:!0},[dr]:{exposure:`hidden`,storageGroup:`flags`},[fr]:{exposure:`hidden`},[pr]:{exposure:`hidden`},[mr]:{exposure:`hidden`},[hr]:{exposure:`hidden`},[_r]:{exposure:`hidden`,storageGroup:`surveys`},[vr]:{exposure:`hidden`,storageGroup:`surveys`,volatile:!0},[yr]:{exposure:`event`},[br]:{exposure:`hidden`},[xr]:{exposure:`hidden`},[Sr]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$product_tours_activated_session:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[Cr]:{exposure:`hidden`},[wr]:{exposure:`hidden`},[gr]:{exposure:`event`},[Tr]:{exposure:`hidden`},[Er]:{exposure:`hidden`,storageGroup:`flags`,volatile:!0},[U]:{exposure:`hidden`},[Dr]:{exposure:`hidden`},[Or]:{exposure:`hidden`},[kr]:{exposure:`hidden`},[Ar]:{exposure:`hidden`},[jr]:{exposure:`hidden`},[Mr]:{exposure:`hidden`},[$n]:{exposure:`event`},[er]:{exposure:`event`},[tr]:{exposure:`event`},[nr]:{exposure:`event`},[Fr]:{exposure:`event`},[Ir]:{exposure:`event`},[Lr]:{exposure:`event`},$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},Da=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],Oa=e=>{var t=Ea[e];if(t)return t;for(var n of Da){var r=n[1];if(e.indexOf(n[0])===0)return r}},ka=(e,t)=>{try{return JSON.stringify(e,((e,t)=>typeof t==`bigint`?t.toString():t),t)}catch{return ce(e)}},Aa=e=>{var t=r?.createElement(`a`);return P(t)?null:(t.href=e,t)},ja=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!j(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{B.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},Ma=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);j(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},Na=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},Pa=(e,t)=>e>=t&&u(),Fa=(e,t,n,r)=>{if(e===0){if(u()){var i=t+1;return i===n&&r(),i}return t}return 0},Ia=`https?://(.*)`,La=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],Ra=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...La],za=`<masked>`,Ba=[`li_fat_id`];function Va(e,t,n){if(!r)return{};var i,a=t?[...La,...n||[]]:[],o=Ha(Ma(r.URL,a,za),e);return q((i={},K(Ba,(function(e){var t=ni(e);i[e]=t||null})),i),o)}function Ha(e,t){var n=Ra.concat(t||[]),r={};return K(n,(function(t){r[t]=ja(e,t)||null})),r}function Ua(e){var t=function(e){return e?e.search(Ia+`google.([^/?]*)`)===0?`google`:e.search(Ia+`bing.com`)===0?`bing`:e.search(Ia+`yahoo.com`)===0?`yahoo`:e.search(Ia+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,i={};if(!I(t)){i.$search_engine=t;var a=r?ja(r.referrer,n):``;a.length&&(i.ph_keyword=a)}return i}function Wa(){return navigator.language||navigator.userLanguage}var Ga=`$direct`;function Ka(){return r?.referrer||Ga}function qa(e,t,n){n===void 0&&(n=!1);var r=e?[...La,...t||[]]:[],a=(n?Pt(i?.href):i?.href)?.substring(0,1e3);return{r:Ka().substring(0,1e3),u:a?Ma(a,r,za):void 0}}function Ja(e,t){t===void 0&&(t=!1);var n=e.r,r=e.u,i=t?Pt(r):r,a={$referrer:n,$referring_domain:n==null?void 0:n==Ga?Ga:Aa(n)?.host};if(i){a.$current_url=i;var o=Aa(i);a.$host=o?.host,a.$pathname=o?.pathname,q(a,Ha(i))}return n&&q(a,Ua(n)),a}function Ya(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Xa(){try{return new Date().getTimezoneOffset()}catch{return}}var Za={flags:Er,surveys:vr},Qa=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],$a=e=>e+`_cookie_identity_change_pending`,eo=`main`,to=(e,t)=>{K(e,((n,r)=>{var i=Oa(r);i&&i.exposure!==`event`||{}.hasOwnProperty.call(t,r)||delete e[r]}))},no=class{constructor(t,n,r){if(r===void 0&&(r=!0),this.yi={},this.bi=!1,this.wi=!1,this.ki=!1,this.xi=!1,this.qe=t,this.Si=r,this.props={},this.Ci=void 0,this.Mi=(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`})(t),this.oi=this.Ti(t),this.wi=this.Ei(t),this.load(),t.debug&&B.info(`Persistence loaded`,t.persistence,g({},this.props)),this.update_config(t,t,n),this.save(),e){var i=()=>this.flush();J(e,`beforeunload`,i,{capture:!1}),J(e,`pagehide`,i,{capture:!1})}}Ii(){var e=this.qe?.persistence_save_debounce_ms;return R(e)&&e>0?e:0}Pi(e){if(this.qe.cookieWinsOnConflict&&this.qe.persistence.toLowerCase()===`localstorage+cookie`)if(e)try{var t=vi(e,this.qe.cookie_persisted_properties||[]),n=bi(t,this.qe.cookie_persisted_properties||[]),r=JSON.stringify(t)+`|`+JSON.stringify(n),i=Y.P(this.Mi)||void 0;i&&Si(this.Mi,i)===r&&(this.Ri=r,this.Ai=i)}catch{}else try{var a=Y.P(this.Mi)||void 0;this.Ri=a?Si(this.Mi,a):void 0,this.Ai=a}catch{}}syncCookieProperties(){return this.Fi(this.qe)}Fi(e,t){if(t===void 0&&(t=!1),this.Oi&&!t||this.xi||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!==`localstorage+cookie`)return!1;var n;try{n=Y.P(this.Mi)||void 0}catch{}if(!n||n===this.Ai)return!1;var r,i=Si(this.Mi,n);try{r=_i(JSON.parse(n))}catch{return!1}if((Y.P(this.Mi)||void 0)!==n)return!1;this.Ri=i,this.Ai=n;var a=xi(this.Mi,n),o=[...mi,...a.properties],s={};if(Object.keys(r).forEach((e=>{var t=r[e];(P(t)||I(t)||t===``||e===U&&t!==W&&t!==G)&&(s[e]=!0,delete r[e])})),fe(r))return!1;var c=H in r||r[U]===W||r[U]===G,l=this.props[H],u=this.props[U],d=q({},this.props);[...mi,...e.cookie_persisted_properties||[]].forEach((e=>{if(o.indexOf(e)!==-1&&!(e in r)&&!s[e]&&(c||e!==H&&e!==U)){var t=d[e];!a.isValid&&mi.indexOf(e)!==-1&&(!1===t||t===0)||delete d[e]}})),this.props=q(d,r),!c||U in r||U in this.props||this.Li(U,W);var f=this.props[H],p=this.props[U];return!c||f===l&&p===u||(this.ki=!0,Z.F($a(this.Mi),!0),this.Di(mr),this.Di(or),this.Di(ar),this.Di(cr),this.Di(lr),this.Di(ur),this.Di(Er),this.Di(Tr),this.Di(Cr),p===W&&(u===G||r[U]===W||!P(l)&&f!==l)&&(to(this.props,r),this.Di(hr)),p===G?this.props.$user_id=f:delete this.props.$user_id,this.Di(Bn)),!0}consumeCookieIdentityChange(){var e=$a(this.Mi),t=this.ki||!!Z.P(e);return this.ki=!1,t&&Z.q(e),t}$i(e){return e===void 0&&(e=!1),!(this.xi||this.Oi&&!e||!this.qe.cookieWinsOnConflict||this.qe.persistence.toLowerCase()!==`localstorage+cookie`||(this.xi=!0,0))}Ni(){this.xi&&(P(this.qi)||(clearTimeout(this.qi),this.qi=void 0),delete this.yi[eo],this.ji(!0))}Bi(e){if(e===void 0&&(e=!0),this.xi)try{e?this.Ni():P(this.qi)||(clearTimeout(this.qi),this.qi=void 0)}finally{this.xi=!1}}isDisabled(){return!!this.Oi}Ti(t){Qa.indexOf(t.persistence.toLowerCase())===-1&&(B.critical(`Unknown persistence type `+t.persistence+`; falling back to localStorage+cookie`),t.persistence=`localStorage+cookie`);var n,r=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var r=[...mi,...t];return g({},X,{H(e){try{var t,i={};try{t=Y.P(e)||void 0,i=t?_i(JSON.parse(t)):{}}catch{}var a,o=JSON.parse(X.P(e)||`{}`);if(n){var s=xi(e,t),c=[...mi,...s.properties],l={};Object.keys(i).forEach((e=>{var t=i[e];I(t)||t===``||e===U&&t!==W&&t!==G||(l[e]=t)}));var u=H in l||l[U]===W||l[U]===G;if(Object.keys(l).length>0){var d=o[H],f=o[U]??W;r.forEach((e=>{if(c.indexOf(e)!==-1&&!(e in i)&&(u||e!==H&&e!==U)){var t=o[e];!s.isValid&&mi.indexOf(e)!==-1&&(!1===t||t===0)||delete o[e]}})),!u||U in i||U in o||(o[U]=W),!u||(H in l?l[H]:o[H])===d&&(U in l?l[U]:o[U])===f||(pi.forEach((e=>delete o[e])),l[U]===G&&H in l?o.$user_id=l[H]:delete o.$user_id,l[U]!==G&&(delete o[gr],delete o[hr]),delete o.__alias)}a=q(o,l)}else a=q(i,o);return X.F(e,a),a}catch{}return null},F(e,r,i,a,o,s){var c=X.F(e,r,void 0,void 0,s);try{var l=vi(r,t);if(Object.keys(l).length){if(n){var u=hi(e),d=bi(l,t);if(Y.F(u,d,i,a,o,s),Y.P(u)!==JSON.stringify(d)){Y.q(u,a);var f=vi(r);return Y.F(e,f,i,a,o,s),c}}Y.F(e,l,i,a,o,s)}}catch(e){X.j(e)}return c},q(t,n){try{e?.localStorage.removeItem(t),Y.q(t,n),Y.q(hi(t),n)}catch(e){X.j(e)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),i=!1,a=t.persistence.toLowerCase();return a===`localstorage`&&X.N()?(n=X,i=!0):a===`localstorage+cookie`&&r.N()?(n=r,i=!0):a===`sessionstorage`&&Z.N()?n=Z:a===`memory`?n=wi:a===`cookie`?n=Y:r.N()?(n=r,i=!0):n=Y,this.bi=i,n}Hi(e){return this.Mi+`__`+e}Ei(e){return this.bi&&!!e.split_storage}properties(){var e={};return K(this.props,((t,n)=>{var r=Oa(n);if(!r||r.exposure===`event`){if(r!=null&&r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t))return;e[n]=t}})),e}load(){if(!this.Oi){var e=this.qe.cookieWinsOnConflict&&this.qe.persistence.toLowerCase()===`localstorage+cookie`,t=e?X.H(this.Mi):null,n={};if(e)try{K(n=_i(Y.H(this.Mi)),((e,t)=>{(P(e)||I(e)||e===``)&&delete n[t]}))}catch{}var r=this.oi.H(this.Mi);if(r&&(this.props=q({},r)),this.wi&&this.Ui(),e&&r){var i=t?.[H],a=t?.[U]??W,o=r[H],s=r[U]??W;if(o!==i||s!==a){this.ki=!0,Z.F($a(this.Mi),!0);var c=q({},this.props);pi.forEach((e=>delete c[e])),s===W&&(a===G||n[U]===W||!P(i)&&o!==i)&&(to(c,n),delete c[hr]),this.props=c;var l=new Set;pi.forEach((e=>{var t=Oa(e)?.storageGroup;t&&l.add(t)})),l.forEach((e=>{var t={};K(this.props,((n,r)=>{Oa(r)?.storageGroup===e&&(t[r]=n)})),fe(t)?(X.q(this.Hi(e)),this.yi[e]={}):X.F(this.Hi(e),t)&&(this.yi[e]={persisted:!0,fingerprint:this.zi(t,e)})}))}}Z.P($a(this.Mi))&&(this.ki=!0)}}Ui(){for(var e of Ta){var t=X.H(this.Hi(e));if(t&&!fe(t)){var n=this.Wi(e);n.persisted=!0,this.Vi(e)||(n.fingerprint=this.zi(t,e)),this.Zi(e,t)||q(this.props,t)}}}Vi(e){return Object.keys(this.props).some((t=>Oa(t)?.storageGroup===e))}Zi(e,t){var n=Za[e];if(!n)return!1;var r=t[n],i=this.props[n];return R(r)&&R(i)&&i>r}refreshKey(e){if(!this.Oi){var t=this.wi?Oa(e)?.storageGroup:void 0,n=t?X.H(this.Hi(t)):this.oi.H(this.Mi);if(n&&e in n)this.Li(e,n[e]);else{if(t){var r=this.oi.H(this.Mi);if(r&&e in r)return void this.Li(e,r[e])}this.Di(e)}}}save(){if(!this.Oi){var e=this.Ii();e>0?P(this.qi)&&(this.qi=setTimeout((()=>{this.qi=void 0,this.ji()}),e)):this.ji()}}flush(){P(this.qi)||(clearTimeout(this.qi),this.qi=void 0,this.ji())}ji(e){e===void 0&&(e=!1),this.Oi||this.xi&&!e||(e||this.syncCookieProperties(),this.wi?this.Gi():this.Qi(this.oi,this.Mi,this.props,eo)&&this.Pi(this.props))}Gi(){var e=this.Ji(),t=e.main,n=e.groups;for(var r of(this.Qi(this.oi,this.Mi,t,eo)&&this.Pi(t),Ta)){var i,a=n[r];(!fe(a)||(i=this.yi[r])!=null&&i.persisted)&&this.Qi(X,this.Hi(r),a,r)}}Ji(){var e={},t={flags:{},surveys:{}};return K(this.props,((n,r)=>{var i=Oa(r)?.storageGroup;i?t[i][r]=n:e[r]=n})),{main:e,groups:t}}zi(e,t){if(t===eo)return JSON.stringify(e)+`|`+this.Ki+`|`+this.Yi+`|`+this.Xi;var n={};return K(e,((e,t)=>{var r;n[t]=(r=Oa(t))!=null&&r.volatile?`__volatile__`:e})),JSON.stringify(n)}Qi(e,t,n,r){var i,a=this.Wi(r);if(r!==eo&&!a.dirty&&!P(a.fingerprint))return!1;try{if((i=this.zi(n,r))===a.fingerprint)return a.dirty=!1,!1}catch{i=void 0}return e.F(t,n,this.Ki,this.Yi,this.Xi,this.qe.debug)?(a.dirty=!1,r!==eo&&(a.persisted=!0),P(i)||(a.fingerprint=i),!0):(this.qe.debug&&B.warn(`failed to persist storage entry "`+t+`"; will retry on next save`),!1)}remove(e){var t=(e===void 0?{}:e).keepGroupEntries,n=t!==void 0&&t;if(P(this.qi)||(clearTimeout(this.qi),this.qi=void 0),this.oi.q(this.Mi,!1),this.oi.q(this.Mi,!0),!n&&this.Si)for(var r of Ta)X.q(this.Hi(r));n?delete this.yi[eo]:this.yi={},this.Ri=void 0,this.Ai=void 0}clear(){this.remove(),this.props={}}register_once(e,t,n){if(N(e)){this.syncCookieProperties(),P(t)&&(t=`None`),this.Ki=P(n)?this.tr:n;var r=!1;if(K(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Li(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(N(e)){this.syncCookieProperties(),this.Ki=P(t)?this.tr:t;var n=!1;if(K(e,((t,r)=>{e.hasOwnProperty(r)&&(this.props[r]!==t||N(t)||j(t))&&(this.Li(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t=typeof e==`string`?[e]:e,n=!1;for(var r of t)r in this.props&&(this.Di(r),n=!0);n&&this.save()}update_campaign_params(){var e=r?.URL;if(e!==this.Ci){var t=Va(this.qe.custom_campaign_params,this.qe.mask_personal_data_properties,this.qe.custom_personal_data_properties);fe(Qr(t))||this.register(t),this.Ci=e}}update_search_keyword(){var e;this.register((e=r?.referrer)?Ua(e):{})}update_referrer_info(){this.register_once({$referrer:Ka(),$referring_domain:r!=null&&r.referrer&&Aa(r.referrer)?.host||Ga},void 0)}set_initial_person_info(){this.props[kr]||this.props[Ar]||this.register_once({[jr]:qa(this.qe.mask_personal_data_properties,this.qe.custom_personal_data_properties,this.qe.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};K([Ar,kr],(t=>{var n=this.props[t];n&&K(n,(function(t,n){e[`$initial_`+se(n)]=t}))}));var t=this.props[jr];return t&&q(e,function(e,t){t===void 0&&(t=!1);var n=Ja(e,t),r={};return K(n,(function(e,t){r[`$initial_`+se(t)]=e})),r}(t,this.qe.disable_capture_url_hashes)),e}safe_merge(e){return K(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){var r=e.persistence!==t.persistence,i=!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),a=r||i,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,s=e.disable_persistence||!!n,c=!!this.Oi&&!s;s||this.Fi(t,c),this.qe=e,!s&&(r||i||o)&&(this.Ri=void 0,this.Ai=void 0,this.Fi(g({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),c));var l=a||o?this.Ti(e):this.oi,u=this.Ei(e),d=a||u!==this.wi,f=!s&&(d||e.cross_subdomain_cookie!==this.Yi||e.secure_cookie!==this.Xi)&&this.$i(c);try{if(this.tr=this.Ki=e.cookie_expiration,this.set_disabled(s),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),d){var p=this.props;this.clear(),this.oi=l,this.wi=u,this.props=p,this.save()}else o&&(this.oi=l,s||(delete this.yi[eo],this.ji()))}finally{f&&this.Bi()}}set_disabled(e){this.Oi=e,this.Oi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Yi&&(this.Yi=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Xi&&(this.Xi=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var n=this.props[Vn]||{};n[e]=t,this.Li(Vn,n),this.save()}remove_event_timer(e){var t=this.props[Vn]||{},n=t[e];return P(n)||(delete t[e],this.Li(Vn,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Li(e,t),this.save()}Li(e,t){var n;this.props[e]=t,(n=Oa(e))!=null&&n.volatile||this.er(e)}Di(e){delete this.props[e],this.er(e)}er(e){var t=Oa(e)?.storageGroup;t&&(this.Wi(t).dirty=!0)}Wi(e){return this.yi[e]||(this.yi[e]={})}};function ro(e){var t=!0;return{dispose(){if(t){t=!1;var n=e();n&&M(n.then)&&n.then(void 0,(()=>{}))}}}}var io={GZipJS:`gzip-js`,Base64:`base64`},ao={Activation:`events`,Cancellation:`cancelEvents`},oo={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},so={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},co={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,SURVEY_ITERATION:`$survey_iteration`,SURVEY_ITERATION_START_DATE:`$survey_iteration_start_date`,SURVEY_PARTIALLY_COMPLETED:`$survey_partially_completed`,SURVEY_SUBMISSION_ID:`$survey_submission_id`,SURVEY_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},lo={Popover:`popover`,Inline:`inline`},uo={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},fo={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},po=V(`[RateLimiter]`),mo=class{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=>{po.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){po.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var n=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,i=new Date().getTime(),a=this.instance.persistence?.get_property(Or)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;if(o||e||(a.tokens=Math.max(0,a.tokens-1)),o&&!e){var s=(R(a.dropped)?a.dropped:0)+1;a.dropped=s,!this.lastEventRateLimited&&this.ir(s)&&(a.dropped=0)}return this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(Or,a),{isRateLimited:o,remainingTokens:a.tokens}}rr(e){var t=this.instance.config.property_denylist;return!j(t)||!t.includes(e)}nr(){if(this.rr(`$current_url`)&&this.rr(`$pathname`)&&i!=null&&i.pathname)return``+(i.origin??``)+i.pathname}ir(e){var t,n=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,i=this.nr(),a=this.rr(`$session_id`)?(t=this.instance).get_session_id?.call(t):void 0,o=[e+` event(s) dropped since the last warning`,i?`triggered on `+i:void 0,a?`session `+a:void 0].filter(Boolean).join(`, `);return!!this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited: `+o+`. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},ho=V(`[RemoteConfig]`),go=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=f._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}sr(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}ar(e){this._instance._send_request({method:`GET`,url:this._instance.requestRouter.endpointFor(`assets`,`/array/`+this._instance.config.token+`/config`),callback:e})}load(){try{if(this.remoteConfig)return ho.info(`Using preloaded remote config`,this.remoteConfig),this.lr(this.remoteConfig),void this.ur();if(this._instance.hr())return void ho.warn(`Remote config is disabled. Falling back to local config.`);this.sr((e=>{if(!e)return ho.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.ar((e=>{this.lr(e.json,e),this.ur()}));this.lr(e),this.ur()}))}catch(e){ho.error(`Error loading remote config`,e),this.lr()}}stop(){this.dr&&=(clearInterval(this.dr),void 0)}refresh(){!this._instance.hr()&&r&&r.visibilityState!==`hidden`&&this._instance.reloadFeatureFlags()}ur(){if(!this.dr){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.dr=setInterval((()=>{this.refresh()}),e))}}lr(e,t){!e&&t&&(t.statusCode===0?t.error||ho.warn(`Failed to fetch remote config from PostHog.`):ho.error(`Failed to fetch remote config from PostHog.`));try{this._instance.lr(e?{ok:!0,config:e}:{ok:!1})}catch(e){ho.error(`Error applying remote config`,e)}if(!1!==e?.hasFeatureFlags&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded()}catch(e){ho.error(`Error loading feature flags`,e)}}},_o=Uint8Array,vo=Uint16Array,yo=Uint32Array,bo=new _o([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]),xo=new _o([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),So=new _o([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Co=function(e,t){for(var n=new vo(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new yo(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},wo=Co(bo,2),To=wo[1];wo[0][28]=258,To[258]=28;for(var Eo=Co(xo,0)[1],Do=new vo(32768),Q=0;32768>Q;++Q){var Oo=(43690&Q)>>>1|(21845&Q)<<1;Do[Q]=((65280&(Oo=(61680&(Oo=(52428&Oo)>>>2|(13107&Oo)<<2))>>>4|(3855&Oo)<<4))>>>8|(255&Oo)<<8)>>>1}var ko=function(e,t,n){for(var r=e.length,i=0,a=new vo(t);r>i;++i)++a[e[i]-1];var o,s=new vo(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new vo(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[Do[d]>>>c]=l}else for(o=new vo(r),i=0;r>i;++i)o[i]=Do[s[e[i]-1]++]>>>15-e[i];return o},Ao=new _o(288);for(Q=0;144>Q;++Q)Ao[Q]=8;for(Q=144;256>Q;++Q)Ao[Q]=9;for(Q=256;280>Q;++Q)Ao[Q]=7;for(Q=280;288>Q;++Q)Ao[Q]=8;var jo=new _o(32);for(Q=0;32>Q;++Q)jo[Q]=5;var Mo=ko(Ao,9,0),No=ko(jo,5,0),Po=function(e){return(e/8>>0)+(7&e&&1)},Fo=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof vo?vo:e instanceof yo?yo:_o)(n-t);return r.set(e.subarray(t,n)),r},Io=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Lo=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Ro=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new _o(0),0];if(i==1){var o=new _o(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new vo(f+1),m=zo(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;t>p[y]?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new _o(p),m]},zo=function(e,t,n){return e.s==-1?Math.max(zo(e.l,t,n+1),zo(e.r,t,n+1)):t[e.s]=n},Bo=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new vo(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Vo=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Ho=function(e,t,n){var r=n.length,i=Po(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Uo=function(e,t,n,r,i,a,o,s,c,l,u){Io(t,u++,n),++i[256];for(var d=Ro(i,15),f=d[0],p=d[1],m=Ro(a,15),h=m[0],g=m[1],_=Bo(f),v=_[0],y=_[1],b=Bo(h),x=b[0],S=b[1],C=new vo(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var T=Ro(C,7),E=T[0],D=T[1],O=19;O>4&&!E[So[O-1]];--O);var ee,te,ne,re,k=l+5<<3,ie=Vo(i,Ao)+Vo(a,jo)+o,ae=Vo(i,f)+Vo(a,h)+o+14+3*O+Vo(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(ie>=k&&ae>=k)return Ho(t,u,e.subarray(c,c+l));if(Io(t,u,1+(ie>ae)),u+=2,ie>ae){ee=ko(f,p,0),te=f,ne=ko(h,g,0),re=h;var A=ko(E,D,0);for(Io(t,u,y-257),Io(t,u+5,S-1),Io(t,u+10,O-4),u+=14,w=0;O>w;++w)Io(t,u+3*w,E[So[w]]);u+=3*O;for(var oe=[v,x],se=0;2>se;++se){var ce=oe[se];for(w=0;ce.length>w;++w)Io(t,u,A[le=31&ce[w]]),u+=E[le],le>15&&(Io(t,u,ce[w]>>>5&127),u+=ce[w]>>>12)}}else ee=Mo,te=Ao,ne=No,re=jo;for(w=0;s>w;++w)if(r[w]>255){var le;Lo(t,u,ee[257+(le=r[w]>>>18&31)]),u+=te[le+257],le>7&&(Io(t,u,r[w]>>>23&31),u+=bo[le]);var ue=31&r[w];Lo(t,u,ne[ue]),u+=re[ue],ue>3&&(Lo(t,u,r[w]>>>5&8191),u+=xo[ue])}else Lo(t,u,ee[r[w]]),u+=te[r[w]];return Lo(t,u,ee[256]),u+te[256]},Wo=new yo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Go=function(){for(var e=new yo(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Ko=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function qo(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=Go[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new _o(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=Ho(c,l,e.subarray(u,d)):(c[u]=!0,l=Ho(c,l,e.subarray(u,o)))}else{for(var f=Wo[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new vo(32768),_=new vo(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new yo(25e3),S=new vo(288),C=new vo(32),w=0,T=0,E=(u=0,0),D=0,O=0;o>u;++u){var ee=b(u),te=32767&u,ne=_[ee];if(g[te]=ne,_[ee]=te,u>=D){var re=o-u;if((w>7e3||E>24576)&&re>423){l=Uo(e,c,0,x,S,C,T,E,O,u-O,l),E=w=T=0,O=u;for(var k=0;286>k;++k)S[k]=0;for(k=0;30>k;++k)C[k]=0}var ie=2,ae=0,A=m,oe=te-ne&32767;if(re>2&&ee==b(u-oe))for(var se=Math.min(p,re)-1,ce=Math.min(32767,u),le=Math.min(258,re);ce>=oe&&--A&&te!=ne;){if(e[u+ie]==e[u+ie-oe]){for(var ue=0;le>ue&&e[u+ue]==e[u+ue-oe];++ue);if(ue>ie){if(ie=ue,ae=oe,ue>se)break;var de=Math.min(oe,ue-2),j=0;for(k=0;de>k;++k){var M=u-oe+k+32768&32767,N=M-g[M]+32768&32767;N>j&&(j=N,ne=M)}}}oe+=(te=ne)-(ne=g[te])+32768&32767}if(ae){x[E++]=268435456|To[ie]<<18|Eo[ae];var fe=31&To[ie],P=31&Eo[ae];T+=bo[fe]+xo[P],++S[257+fe],++C[P],D=u+ie,++w}else x[E++]=e[u],++S[e[u]]}}l=Uo(e,c,!0,x,S,C,T,E,O,u-O,l)}return Fo(s,0,r+Po(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Ko(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),Ko(l,u-8,n.d()),Ko(l,u-4,r),l}var Jo=!!o||!!a,Yo=`text/plain`,Xo=!1,Zo=(e,t)=>{var n=e.split(`#`),r=n[1],i=n[0].split(`?`),a=i[0],o=i[1];if(!o)return e;var s=o.split(`&`).filter((e=>e.split(`=`)[0]!==t)).join(`&`);return a+(s?`?`+s:``)+(r?`#`+r:``)},Qo=function(e,t,n){n===void 0&&(n=!0);var r=e.split(`?`),i=r[0],a=r[1],o=g({},t),s=a?.split(`&`).map((e=>{var t,r=e.split(`=`),i=r[0],a=n&&(t=o[i])!=null?t:r[1];return delete o[i],i+`=`+a}))??[],c=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return K(e,(function(e,t){P(e)||P(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(o);return c&&s.push(c),s.length>0?i+`?`+s.join(`&`):i},$o=e=>{if(e.vr)return e.vr;var t=e.data,n=e.compression;if(t){if(n===io.GZipJS){var r=qo(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new _o(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new _o(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return Fo(r,0,i)}(ka(t)),{mtime:0});return{contentType:Yo,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===io.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:ka(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(ka(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=ka(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},es=e=>{var t,n,r=()=>e.transport===`sendBeacon`?{url:Qo(e.url,{compression:io.Base64}),encodedBody:$o(g({},e,{compression:io.Base64,vr:void 0}))}:{url:Zo(e.url,`compression`),encodedBody:$o(g({},e,{compression:void 0,vr:void 0}))};try{t=$o(e)}catch(t){if(ee(e.compression,ja(e.url,`compression`)))return B.error(`Failed to gzip request body, sending uncompressed payload`,t),r();throw t}return t&&ee(e.compression,ja(e.url,`compression`))&&!((n=t.body)instanceof ArrayBuffer?O(new Uint8Array(n)):ArrayBuffer.isView(n)&&O(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Xo=!0,r()):{url:e.url,encodedBody:t}},ts=e=>{try{return es(e)}catch(t){B.error(t),e.callback==null||e.callback({statusCode:0,error:t});return}},ns=function(){var e=h((function*(e){var t=yield function(e,t,n){return k.apply(this,arguments)}(ka(e.data),p.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return g({},e,{vr:{contentType:Yo,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),rs=/Failed to fetch|NetworkError|Load failed/i,is=e=>e?.name===`TypeError`&&rs.test(e?.message||``),as=e=>{var t=ts(e);if(t){var n=t.url,r=t.encodedBody??{},i=r.contentType,o=r.body,c=r.estimatedSize,l=new Headers;K(e.headers,(function(e,t){l.append(t,e)})),i&&l.append(`Content-Type`,i);var u=null,d=!1;if(s){var f=new s;u={signal:f.signal,timeout:setTimeout((()=>{var t,n;d=!0,f.abort((t=e.timeout,(n=Error(`PostHog request timed out`+(t?` after `+t+`ms`:``))).name=`AbortError`,n))}),e.timeout)}}var p=t=>{d&&t?.name===`AbortError`||is(t)?B.warn(t):B.error(t),e.callback==null||e.callback({statusCode:0,error:t})};try{a(n,g({method:e?.method||`GET`,headers:l,keepalive:e.method===`POST`&&!e.cr&&52428.8>(c||0),body:o,signal:u?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){B.error(e)}e.callback==null||e.callback(r)})))).catch(p).finally((()=>u?clearTimeout(u.timeout):null))}catch(e){u&&clearTimeout(u.timeout),p(e)}}},os=e=>{try{var t=es(e),r=t.url,i=t.encodedBody??{},a=i.body,o=i.estimatedSize;if(!a)return;var s=a instanceof Blob?a:new Blob([a],{type:i.contentType});if(n.sendBeacon(r,s))return;var c=j(e.data)?e.data:e.data?.batch;if(j(c)&&c.length>1&&(o??0)>16384){var l=Math.ceil(c.length/2),u=t=>j(e.data)?t:g({},e.data,{batch:t});os(g({},e,{data:u(c.slice(0,l))})),os(g({},e,{data:u(c.slice(l))}));return}B.warn(`Beacon of ~`+(o??0)+` bytes was rejected by the browser, falling back to fetch`),as(g({},e,{cr:!0}))}catch(e){B.warn(`Beacon send failed`,e)}},ss=(e,t,n,r)=>{var i=r===`query`?t===`POST`?`sent_at`:`_`:void 0;return Qo(n===io.GZipJS?Zo(e,`compression`):e,g({},i?{[i]:Date.now().toString()}:{},n===io.GZipJS?{}:{compression:n}))},cs=[];a&&cs.push({transport:`fetch`,method:as}),o&&cs.push({transport:`XHR`,method(e){var t=ts(e);if(t){var n=new o,r=t.encodedBody;n.open(e.method||`GET`,t.url,!0);var i=r??{},a=i.contentType,s=i.body;K(e.headers,(function(e,t){n.setRequestHeader(t,e)})),a&&n.setRequestHeader(`Content-Type`,a),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var t={statusCode:n.status,text:n.responseText};if(n.status===200)try{t.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(t)}},n.send(s)}}}),n!=null&&n.sendBeacon&&cs.push({transport:`sendBeacon`,method:os});var ls=3e3,us=class{constructor(e,t){this.pr=!0,this.gr=[],this.mr=De(t?.flush_interval_ms||ls,250,5e3,B.createLogger(`flush interval`),ls),this.yr=e}enqueue(e){this.gr.push(e),this.br||this._r()}unload(){this.wr();var e=this.gr.length>0?this.kr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.Sr(g({},e,{transport:`sendBeacon`}))}))}enable(){this.pr=!1,this._r()}_r(){var e=this;this.pr||(this.br=setTimeout((()=>{if(this.wr(),this.gr.length>0){var t=this.kr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&j(n.data)&&K(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.Sr(n)};for(var r in t)n()}}),this.mr))}Sr(e){try{this.yr(e)}catch(e){B.error(e)}}wr(){clearTimeout(this.br),this.br=void 0}kr(){var e={};return K(this.gr,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;P(e[i])&&(e[i]=g({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.gr=[],e}},ds=[`retriesPerformedSoFar`],fs=class{constructor(t){this.Cr=!1,this.Mr=3e3,this.gr=[],this._instance=t,this.gr=[],this.Tr=!0,!P(e)&&`onLine`in e.navigator&&(this.Tr=e.navigator.onLine,this.Er=()=>{this.Tr=!0,this.Ir()},this.Pr=()=>{this.Tr=!1},J(e,`online`,this.Er),J(e,`offline`,this.Pr))}get length(){return this.gr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,n=_(e,ds);me(t)&&(n.url=Qo(n.url,{retry_count:t})),this._instance._send_request(g({},n,{callback:e=>{if(e.statusCode!==200&&(400>e.statusCode||e.statusCode>=500)){if((e.statusCode===0?3:10)>(t??0))return void this.Ot(g({retriesPerformedSoFar:t},n));e.statusCode===0&&B.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after `+(t??0)+` retries.`)}n.callback==null||n.callback(e)}}))}Ot(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this.gr.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),B.warn(i),this.Cr||(this.Cr=!0,this.Rr())}Rr(){if(this.Ar&&clearTimeout(this.Ar),this.gr.length===0)return this.Cr=!1,void(this.Ar=void 0);this.Ar=setTimeout((()=>{this.Tr&&this.gr.length>0&&this.Ir(),this.Rr()}),this.Mr)}Ir(){var e=Date.now(),t=[],n=this.gr.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this.gr=t,n.length>0)for(var r of n)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Ar&&=(clearTimeout(this.Ar),void 0),this.Cr=!1,P(e)||(this.Er&&=(e.removeEventListener(`online`,this.Er),void 0),this.Pr&&=(e.removeEventListener(`offline`,this.Pr),void 0)),this.gr)){var n=t.requestOptions;try{this._instance._send_request(g({},n,{transport:`sendBeacon`}))}catch(e){B.error(e)}}this.gr=[]}},ps=class{constructor(e){this.Fr=()=>{this.Or||={};var e=this.scrollElement(),t=this.scrollY(),n=e?Math.max(0,e.scrollHeight-e.clientHeight):0,r=t+(e?.clientHeight||0),i=e?.scrollHeight||0;this.Or.lastScrollY=Math.ceil(t),this.Or.maxScrollY=Math.max(t,this.Or.maxScrollY??0),this.Or.maxScrollHeight=Math.max(n,this.Or.maxScrollHeight??0),this.Or.lastContentY=r,this.Or.maxContentY=Math.max(r,this.Or.maxContentY??0),this.Or.maxContentHeight=Math.max(i,this.Or.maxContentHeight??0)},this._instance=e}get Lr(){return this._instance.config.scroll_root_selector}getContext(){return this.Or}resetContext(){var e=this.Or;return setTimeout(this.Fr,0),e}startMeasuringScrollPosition(){J(e,`scroll`,this.Fr,{capture:!0}),J(e,`scrollend`,this.Fr,{capture:!0}),J(e,`resize`,this.Fr)}scrollElement(){if(!this.Lr)return e?.document.documentElement;for(var t of j(this.Lr)?this.Lr:[this.Lr]){var n=e?.document.querySelector(t);if(n)return n}}Dr(t){var n=t===`y`?`scrollTop`:`scrollLeft`;if(this.Lr){var r=this.scrollElement();return r&&r[n]||0}return e?t===`y`?e.scrollY||e.pageYOffset||e.document.documentElement.scrollTop||0:e.scrollX||e.pageXOffset||e.document.documentElement.scrollLeft||0:0}scrollY(){return this.Dr(`y`)}scrollX(){return this.Dr(`x`)}},ms=e=>qa(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties,e?.config.disable_capture_url_hashes),hs=class{constructor(e,t,n,r){this.$r=e=>{var t=this.Nr();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.qr(this._instance)};this.jr.register({[Dr]:n})}},this._instance=e,this.Br=t,this.jr=n,this.qr=r||ms,this.Br.onSessionId(this.$r)}Nr(){return this.jr.props[Dr]}getSetOnceProps(){var e=this.Nr()?.props;return e?`r`in e?Ja(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var e={};return K(Qr(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+se(n)]=t})),e}},gs=class{on(e,t){return this.Hr[e]||(this.Hr[e]=[]),this.Hr[e].push(t),()=>{this.Hr[e]=this.Hr[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.Hr[e]||[])n(t);for(var r of this.Hr[`*`]||[])r(e,t)}constructor(){this.Hr={}}},_s=V(`[SessionId]`),vs=864e5,ys=class{on(e,t){return this.Ur.on(e,t)}constructor(e,t,n){var r;if(this.zr=null,this.Wr=null,this.Vr=[],this.Zr=void 0,this.Gr=!1,this.Ur=new gs,this.Qr=(e,t)=>!(!me(e)||!me(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===Br)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.qe=e.config,this.jr=e.persistence,this.Jr=void 0,this.Kr=void 0,this._sessionStartTimestamp=null,this.Yr=void 0,this._sessionActivityTimestamp=null,this.Xr=t||ci,this.tn=n||ci;var i=this.qe.persistence_name||this.qe.token;if(this._sessionTimeoutMs=1e3*De(this.qe.session_idle_timeout_seconds||1800,60,36e3,_s.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.en(),this.rn=`ph_`+i+`_window_id`,this.nn=`ph_`+i+`_primary_window_exists`,this.sn()){var a=Z.H(this.rn),o=Z.H(this.nn);a&&!o?this.Jr=a:Z.q(this.rn),Z.F(this.nn,!0)}(r=this.qe.bootstrap)!=null&&r.sessionID&&this.setBootstrapSessionId(this.qe.bootstrap.sessionID),this.an()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return P(this.Vr)&&(this.Vr=[]),this.Vr.push(e),this.Kr&&e(this.Kr,this.Jr),()=>{this.Vr=this.Vr.filter((t=>t!==e))}}sn(){return this.qe.persistence!==`memory`&&!this.jr.Oi&&Z.N()}ln(e){e!==this.Jr&&(this.Jr=e,this.sn()&&Z.F(this.rn,e))}un(){return this.Jr?this.Jr:this.sn()?Z.H(this.rn):null}hn(e){var t=this.zr;return!I(t)&&!I(e)&&5e3>Math.abs(e-t)}dn(e,t,n){var r=t!==this._sessionActivityTimestamp,i=e===this.Kr&&n===this._sessionStartTimestamp;this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Kr=e,i&&!r||i&&this.hn(t)||(this.zr=t,this.jr.register({[rr]:[t,e,n]}))}vn(){var e=this.qe?.persistence_save_debounce_ms;return me(e)&&e>0}cn(){this.vn()?this.jr.refreshKey(rr):(this.jr.flush(),this.jr.load())}fn(){if(!I(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.zr){this.cn();var e=this.pn();e[1]===this.Kr&&e[2]===this._sessionStartTimestamp&&(this.zr=this._sessionActivityTimestamp,this.jr.register({[rr]:[this._sessionActivityTimestamp,this.Kr??null,this._sessionStartTimestamp]}),this.jr.flush())}}gn(){var e=this.pn()[0],t=me(e)?e:0,n=me(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}mn(e){return this.cn(),this.Qr(e,this.gn())}pn(){var e=this.jr.props[rr];return j(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.zr=null,this.Yr=void 0,clearTimeout(this.yn),this.yn=void 0,this.dn(null,null,null)}setBootstrapSessionId(e,t){t===void 0&&(t=!1);var n=function(e,t){t===void 0&&(t=new Date().getTime());try{var n=(e=>{var t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})(e);return n>t+6e4?void _s.error(`Bootstrap sessionID cannot be in the future`):n}catch(e){_s.error(`Invalid sessionID in bootstrap`,e);return}}(e);return!P(n)&&(t?this.Yr={sessionId:e,sessionStartTimestamp:n}:this.dn(e,new Date().getTime(),n),!0)}destroy(){this.Gr=!0,this.fn(),clearTimeout(this.yn),this.yn=void 0,this.Zr&&e&&(e.removeEventListener(Ur,this.Zr,{capture:!1}),this.Zr=void 0),this.Vr=[]}an(){this.Zr=()=>{this.fn(),this.sn()&&Z.q(this.nn)},J(e,Ur,this.Zr,{capture:!1})}checkAndGetSessionAndWindowId(e,t,n){if(e===void 0&&(e=!1),t===void 0&&(t=null),n===void 0&&(n=!1),this.qe.cookieless_mode===Br)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var r=t||new Date().getTime(),i=this.Kr;if(n)this.Wr=r;else if(I(this.Wr)||this.Wr>r||r-this.Wr>=1e3){var a,o;(a=(o=this.jr).syncCookieProperties)==null||a.call(o),this.Wr=r}var s=this.pn(),c=s[1],l=s[2],u=!P(i)&&c!==i,d=this.gn(),f=this.un(),p=this.Yr,m=!!p&&(p.sessionStartTimestamp>r+6e4||r-p.sessionStartTimestamp>vs),h=p?m:me(l)&&Math.abs(r-l)>vs,g=!1,_=u,v=!c||!!p,y=c,b=!v&&!e&&this.Qr(r,d);if(b){(b=this.mn(r))||_s.info(`cross-tab refresh kept the session alive`,{sessionId:c});var x=this.pn();c=x[1],l=x[2]}if(v||b||h){_=!1;var S=p&&!m;c=S?p.sessionId:this.Xr(),f=this.tn(),_s.info(`new session ID assigned`,{sessionId:c,windowId:f,bootstrapped:!!S,changeReason:{noSessionId:v,activityTimeout:b,sessionPastMaximumLength:h}}),l=S?p.sessionStartTimestamp:r,this.Yr=void 0,g=!0}else f||(f=this.tn(),g=!0),(_||=c!==y)&&(_s.info(`adopted cross-tab session id`,{sessionId:c,windowId:f}),g=!0);var C=me(d)&&e&&!h?d:r,w=me(l)?l:new Date().getTime();this.ln(f),this.dn(c,C,w),e||this.en();var T={noSessionId:v,activityTimeout:b,sessionPastMaximumLength:h,crossTabAdoption:_};return g&&this.Vr.forEach((e=>e(c,f,T))),{sessionId:c,windowId:f,sessionStartTimestamp:w,changeReason:g?T:void 0,lastActivityTimestamp:d}}en(){this.Gr||(clearTimeout(this.yn),this.yn=setTimeout((()=>{if(!this.Gr)if(this.mn(new Date().getTime())){var e=this.Kr;this.resetSessionId(),this.Ur.emit(`forcedIdleReset`,{idleSessionId:e})}else this.en()}),1.1*this.sessionTimeoutMs))}},bs=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&ae(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>ae(e?.brand,t))))return!0}catch{}return!!e.webdriver};function xs(){return(xs=h((function*(){var e=n?.userAgentData;if(e!=null&&e.getHighEntropyValues)try{var t=(yield e.getHighEntropyValues([`model`]))?.model;return F(t)&&t.length>0?t:void 0}catch(e){B.info(`Unable to resolve $device_model from userAgentData.getHighEntropyValues`,e);return}}))).apply(this,arguments)}var Ss=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function Cs(e,t,n){return ka({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var ws={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=>Ss(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Ss(t,e))))),icontains:(e,t)=>t.map(Ts).some((t=>e.map(Ts).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Ts).every((t=>e.map(Ts).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},Ts=e=>e.toLowerCase();function Es(e,t){return!e||Object.entries(e).every((e=>{var n=e[1],r=t?.[e[0]];if(P(r)||I(r))return!1;var i=[String(r)],a=ws[n.operator];return!!a&&a(n.values,i)}))}var Ds=`custom`,Os=`i.posthog.com`,ks=/^\/static\//,As=[`/s/`,`/e/`,`/i/`],js=class{constructor(e){this.bn={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`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=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+Os,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.bn[this.apiHost]||(this.bn[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`us`:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`eu`:Ds),this.bn[this.apiHost]}_n(e){if(ks.test(e)){var t=this.instance.config.asset_host;if(typeof t==`string`)return t.trim().replace(/\/$/,``)||void 0}}wn(e){var t=Aa(e);return t?t.protocol+`//`+t.host+t.pathname:void 0}kn(e,t,n){if(e===`ui`)return n;var r=n,i=this.instance.config.rewriteRequestPath;if(i){var a=Aa(n)?.href||n;r=i(new URL(a)).toString()}if(i&&e===`api`&&As.some((e=>t.indexOf(e)===0))){var o=this.wn(r);if(o){var s=this.apiHost,c=this.xn;c?.apiHost===s&&c.rewriteRequestPath===i||(c={apiHost:s,rewriteRequestPath:i,urls:new Set},this.xn=c),c.urls.add(o)}}return r}isIngestionEndpoint(e){var t=this.xn,n=this.wn(e);return t?.apiHost===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&t.urls.has(n)}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.kn(e,t,this.uiHost+t);if(e===`flags`)return this.kn(e,t,this.flagsApiHost+t);if(e===`assets`){var n=this._n(t);if(n)return this.kn(e,t,``+n+t)}if(this.region===Ds)return this.kn(e,t,this.apiHost+t);var r=Os+t;switch(e){case`assets`:return this.kn(e,t,`https://`+this.region+`-assets.`+r);case`api`:return this.kn(e,t,`https://`+this.region+`.`+r)}}};function Ms(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}var $=V(`[Surveys]`),Ns=`seenSurvey_`,Ps=e=>{try{var t=(e=>((e,t)=>``+Ns+function(e){return e.current_iteration&&e.current_iteration>0?e.id+`_`+e.current_iteration:e.id}(t))(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){$.error(`Failed to persist survey seen state`,e)}},Fs=[oo.Popover,oo.Widget,oo.API],Is={ignoreConditions:!1,ignoreDelay:!1,displayType:lo.Popover},Ls=V(`[PostHog ExternalIntegrations]`),Rs={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},zs=class{constructor(e){this._instance=e}di(e,t){var n;(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return Ls.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(){var t,r,i,a=n[0],o=n[1];!o||(t=f.__PosthogExtensions__)!=null&&(t=t.integrations)!=null&&t[a]||e.di(Rs[a],(()=>{var t;(t=f.__PosthogExtensions__)==null||(t=t.integrations)==null||(t=t[a])==null||t.start(e._instance)})),!o&&(r=f.__PosthogExtensions__)!=null&&(r=r.integrations)!=null&&r[a]&&((i=f.__PosthogExtensions__)==null||(i=i.integrations)==null||(i=i[a])==null||i.stop())};for(var n of Object.entries((r=this._instance.config.integrations)??{})){var r;t()}}},Bs=class{constructor(e,t){this.st=e,this.Sn=t,this.Cn=new Map,this.Mn=!1}add(e){var t=this;return h((function*(){if(t.Mn)throw Error(`Cannot add an extension to a disposed ExtensionRuntime`);if(t.Cn.has(e.name))throw Error(`Browser extension "`+e.name+`" is already registered`);t.Cn.set(e.name,e);try{var n=e.setup(t.Sn);n&&(yield n)}catch(n){var r=t.Cn.get(e.name)===e;r&&t.Cn.delete(e.name),t.st.error(`Failed to set up browser extension "`+e.name+`"`,n),r&&t.Tn(e)}}))()}dispose(){if(!this.Mn){this.Mn=!0;var e=Array.from(this.Cn.values()).reverse();for(var t of(this.Cn.clear(),e))this.Tn(t)}}Tn(e){try{var t=e.dispose==null?void 0:e.dispose();t&&M(t.then)&&t.then(void 0,(t=>{this.st.error(`Failed to dispose browser extension "`+e.name+`"`,t)}))}catch(t){this.st.error(`Failed to dispose browser extension "`+e.name+`"`,t)}}},Vs=class{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if(typeof e==`string`)return t?.get_property(e);var n={};for(var r of e){var i=t?.get_property(r);P(i)||(n[r]=i)}return n}set(e,t){var n;(n=this._instance.persistence)==null||n.register(typeof e==`string`?{[e]:t}:e)}remove(e){var t;(t=this._instance.persistence)==null||t.unregister(e)}},Hs=`extensionsRemoteConfig`,Us=class{constructor(e){this.Mn=!1,this.instance=e,this.st=B,this.En=e.In,this.kv=new Vs(e),this.onEvent=e=>ro(this.instance.on(`eventCaptured`,(t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.st.error(`Browser extension event listener failed`,e)}}))),this.onRemoteConfig=e=>{if(this.Mn)return ro((()=>{}));var t=t=>{try{e(t)}catch(e){this.st.error(`Browser extension remote config listener failed`,e)}},n=this.instance.Pn.on(Hs,t);return this.En&&t(this.En),ro(n)},this.Rn=new Bs(B.createLogger(`[BrowserExtensions]`),this)}get logger(){return this.st}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){return this.instance.get_property(Rn)??this.distinctId}get deviceId(){var e=this.instance.get_property(Rn);return typeof e==`string`?e:void 0}get library(){return{name:p.LIB_NAME,version:p.LIB_VERSION}}get initialPersonProperties(){return this.instance.persistence?.get_initial_props()??{}}get groups(){return this.instance.getGroups()}get session(){try{var e=this.instance.sessionManager?.checkAndGetSessionAndWindowId(!0);return{sessionId:e?.sessionId??``,windowId:e?.windowId??``,sessionStartTimestamp:e?.sessionStartTimestamp??0}}catch{return{sessionId:``,windowId:``,sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.Rn.add(e)}capture(e,t,n){var r=this;return h((function*(){n?r.instance.capture(e,t,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):r.instance.capture(e,t)}))()}registerDynamicEventProperties(e){return ro(this.instance.An(e))}handleRemoteConfig(e){this.Mn||(this.En=e,this.instance.Pn.emit(Hs,e))}sendRequest(e,t){var n=this;return h((function*(){t===void 0&&(t={});var r=n.instance.requestRouter.endpointFor(t.target??`api`,e),i={method:t.method,url:t.query?Qo(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt};return t.transport===`sendBeacon`?(n.instance._send_request(i),{statusCode:202}):new Promise((e=>{i.callback=e,n.instance._send_request(i)}))}))()}dispose(){this.Mn||(this.Mn=!0,this.Rn.dispose())}},Ws={},Gs=0,Ks=()=>{},qs=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,Js=`Surveys module not available`,Ys=`sanitize_properties is deprecated. Use before_send instead`,Xs=`Invalid value for property_denylist config: `,Zs=[`token`,`distinct_id`,Pr],Qs=`posthog`,$s=!Jo&&l?.indexOf(`MSIE`)===-1&&l?.indexOf(`Mozilla`)===-1,ec=t=>{var n;return g({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,asset_host:null,token:``,autocapture:!0,cross_subdomain_cookie:ei(r?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:Ks,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:t??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:i&&F(i?.search)&&i.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:`fallback`,enable_recording_console_log:void 0,secure_cookie:(e==null||(n=e.location)==null?void 0:n.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){B.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Vr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:ls},error_tracking:{},_onCapture:Ks},(e=>({rageclick:e&&e>=`2026-05-30`?{content_ignorelist:Yi,ignore_text_selection:!0}:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2026-06-25`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>=`2026-05-30`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}: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,persistence_save_debounce_ms:e&&e>=`2026-05-30`?250:0,split_storage:!(!e||`2026-05-30`>e),detect_google_search_app:!(!e||`2026-05-30`>e),disable_capture_url_hashes:!(!e||`2026-06-25`>e),cookieWinsOnConflict:!(!e||e===`unset`||`2026-08-29`>e)}))(t))},tc=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`__preview_disable_beacon`,`disable_beacon`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`],[`__preview_cookie_wins_on_conflict`,`cookieWinsOnConflict`]],nc=e=>{var t={};for(var n of tc){var r=n[0],i=n[1];P(e[r])||(t[i]=e[r])}var a=q({},t,e),o=e.__preview_external_dependency_versioned_paths;return P(o)||(P(e.strict_script_versioning)&&(a.strict_script_versioning=!!o),F(o)&&P(e.asset_host)&&(a.asset_host=o)),j(e.property_blacklist)&&(P(e.property_denylist)?a.property_denylist=e.property_blacklist:j(e.property_denylist)?a.property_denylist=[...e.property_blacklist,...e.property_denylist]:B.error(Xs+e.property_denylist)),a},rc=class{constructor(){this.__forceAllowLocalhost=!1}get Fn(){return this.__forceAllowLocalhost}set Fn(e){B.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},ic=class t{On(e,t){if(e){var n=this.Cn.indexOf(e);n!==-1&&this.Cn.splice(n,1)}return this.Cn.push(t),t.initialize==null||t.initialize(),t}Ln(){return this.config.cookieless_mode===Br||this.config.cookieless_mode===zr&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new rc,this.Dn=!1,this.version=p.LIB_VERSION,this.$n=new Set,this.Nn=``,this.Pn=new gs,this.Cn=[],this.qn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ec(),this.SentryIntegration=Ca,this.sentryIntegration=e=>function(e,t){var n=Sa(e,t);return{name:xa,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.jn=!1,this.Bn=null,this.Hn=null,this.Un=null,this.scrollManager=new ps(this),this.pageViewManager=new wa(this),this.rateLimiter=new mo(this),this.requestRouter=new js(this),this.consent=new Ei(this),this.externalIntegrations=new zs(this);var e=t.__defaultExtensionClasses??{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(e,t,n)=>{var r=F(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=F(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>B.info(`send "`+e?.event+`"`,e)))}init(e,n,r){if(r&&r!==Qs){var i=Ws[r]??new t;return i._init(e,n,r),Ws[r]=i,Ws[Qs][r]=i,i}return this._init(e,n,r)}_init(t,n,r){var i;n===void 0&&(n={});var a=F(t)?t.trim():``;if(!a)return B.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 a===this.config?.token?console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`):console.warn(`[PostHog.js]`,`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('`+a+`', { ... }, 'project2')`),this;this.__loaded=!0,this.config=ec(n.defaults),n.debug=this.zn(n.debug),this.Wn=n,this.Vn=[],n.person_profiles?this.Hn=n.person_profiles:n.process_person&&(this.Hn=n.process_person);var o=ec(n.defaults),s=nc(n),c=q({},o,s,{name:r,token:a});N(o.rageclick)&&N(s.rageclick)&&(c.rageclick=q({},o.rageclick,s.rageclick)),N(o.session_recording)&&N(s.session_recording)&&(c.session_recording=q({},o.session_recording,s.session_recording)),this.set_config(c),this.config.on_xhr_error&&B.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=n.disable_compression?void 0:io.GZipJS;var l=this.Zn();if(this.persistence=new no(this.config,l),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new no(g({},this.config,{persistence:`sessionStorage`}),l,!1),this.Nn=`ph_`+(this.config.persistence_name||this.config.token)+`_session_registered_properties`,this.config.persistence!==`memory`&&!l&&Z.N()){var u=Z.H(this.Nn);j(u)&&u.forEach((e=>{F(e)&&this.$n.add(e)}))}else Z.q(this.Nn);var d=g({},this.persistence.props),f=g({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Gn=new us((e=>this.Qn(e)),this.config.request_queue_config),this.Jn=new fs(this),this.__request_queue=[];var m=this.Ln();if(m||(this.sessionManager=new ys(this),this.sessionPropsManager=new hs(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((e,t,n)=>{(n!=null&&n.activityTimeout||n!=null&&n.sessionPastMaximumLength||n!=null&&n.crossTabAdoption)&&this.Kn()}))),this.Yn(),this.config.__preview_deferred_init_extensions?(B.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.Xn(m)}),0)):(B.info(`Initializing extensions synchronously`),this.Xn(m)),p.DEBUG=p.DEBUG||this.config.debug,p.DEBUG&&B.info(`Starting in debug mode`,{this:this,config:n,thisC:g({},this.config),p:d,s:f}),!this.config.identity_distinct_id||(i=n.bootstrap)!=null&&i.distinctID||(n.bootstrap=g({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),n.bootstrap?.distinctID!==void 0){var h=n.bootstrap.distinctID,_=this.get_distinct_id(),v=this.persistence.get_property(U);if(n.bootstrap.isIdentifiedID&&_!=null&&_!==h&&v===W)this.identify(h);else if(n.bootstrap.isIdentifiedID&&_!=null&&_!==h&&v===G)B.warn(`Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.`);else{var y=this.config.get_device_id(ci()),b=n.bootstrap.isIdentifiedID?y:h;this.persistence.set_property(U,n.bootstrap.isIdentifiedID?G:W),this.register({distinct_id:h,$device_id:b})}}if(m)this.register_once({distinct_id:Nr,$device_id:null},``);else if(!this.get_distinct_id()){var x=this.config.get_device_id(ci());this.register_once({distinct_id:x,$device_id:x},``),this.persistence.set_property(U,W)}return J(e,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),n.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||ci();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(U,G)),t()},i=n.user();`then`in i&&M(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{typeof Promise<`u`&&Promise.resolve||ba.warn(`This browser does not have Promise support, and can not use the segment integration`);var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(ba.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ba.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Wr),identify:e=>t(e,Kr),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.ts())):this.ts(),M(this.config._onCapture)&&this.config._onCapture!==Ks&&(B.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&B.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return xs.apply(this,arguments)}().then((e=>{e&&this.register({[zn]:e})})).catch(Ks),this}Yn(){var e,n,r,i=this.config.__extensionClasses?.featureFlags??t.__defaultExtensionClasses?.featureFlags;i&&(this.featureFlags&&this.featureFlags instanceof i||((e=this.es)==null||e.call(this),this.es=void 0,this.featureFlags=new i(this)),M(this.featureFlags.onReloading)&&M(this.featureFlags.setup)?this.es||(this.es=this.featureFlags.onReloading((()=>{this.Pn.emit(`featureFlagsReloading`,!0)})),this.rs().add(this.featureFlags)):(n=(r=this.featureFlags).initialize)==null||n.call(r))}Xn(e){var n=performance.now(),r=g({},t.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.exceptions&&this.Cn.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.Cn.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.Cn.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.Cn.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.Cn.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.Cn.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.Cn.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.Cn.push(this.logs=this.logs??new r.logs(this)),r.metrics&&this.Cn.push(this.metrics=this.metrics??new r.metrics(this)),r.conversations&&this.Cn.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.Cn.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Cn.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Cn.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Cn.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Cn.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,va)),r.toolbar&&this.Cn.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.Cn.push(this.experiments=this.experiments??new r.experiments(this)),this.Cn.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>{if(this.ns){var e=this.ns;this.ns=void 0,this.Cn.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}})),this.ss(i,n)}ss(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.ss(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){B.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Fr]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[Ir]:r}),this.config.__preview_deferred_init_extensions&&B.info(`PostHog extensions initialized (`+r+`ms)`)}lr(e){var t;if(!r||!r.body)return B.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.lr(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.ns=e),this.In=e,this.compression=void 0,e.ok){var n,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=A(i.supportedCompression,io.GZipJS)?io.GZipJS:A(i.supportedCompression,io.Base64)?io.Base64:void 0),(n=i.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.Hn?this.Hn:Vr}),(t=this.os)==null||t.handleRemoteConfig(e),this.Cn.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}ts(){try{this.config.loaded(this)}catch(e){B.critical("`loaded` function failed",e)}if(this.ls(),this.config.internal_or_test_user_hostname&&i!=null&&i.hostname){var e=i.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ln())&&this.us()}),1),this.hs=new go(this),this.hs.load()}ls(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Gn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Jr(this.__request_queue,(e=>this.Qn(e))),this.__request_queue=[],this.ls()}_handle_unload(){var e,t,n,r,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(t=this.metrics)==null||t.flush(`sendBeacon`),this.config.request_batching?(this.ds()&&this.capture(Gr),(n=this.logs)==null||n.flushLogs(`sendBeacon`),(r=this.Gn)==null||r.unload(),(i=this.Jn)==null||i.unload()):this.ds()&&this.capture(Gr,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded?$s?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=g({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,(P(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=g({},e);t.timeout=t.timeout||6e4;var n,r,i,a,o=t.transport??`fetch`;o===`sendBeacon`&&P(t.compression)&&t.data&&(t.compression=io.Base64),t.method===`POST`&&t.data&&(t.timestampMode===`capture-body`?t.data={api_key:((a=(i=(j(n=t.data)?n:[n]).map((e=>g({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{}))))[0])==null||(r=a.properties)==null?void 0:r.token)??a?.token,batch:i,sent_at:new Date().toISOString()}:t.timestampMode===`body`&&(t.data=function(e,t){return t===void 0&&(t=new Date().toISOString()),j(e)?e.map((e=>g({},e,{sent_at:t}))):g({},e,{sent_at:t})}(t.data))),t.url=ss(t.url,t.method,t.compression,t.timestampMode);var s=cs.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),l=function(e,t){for(var n=0;e.length>n;n++)if(e[n].transport===o)return e[n]}(s)?.method??s[0].method;if(!l)throw Error(`No available transport method`);var u=e=>{try{l(e)}catch(e){is(e)?B.warn(e):B.error(e),t.callback==null||t.callback({statusCode:0,error:e})}};o!==`sendBeacon`&&t.data&&t.compression===io.GZipJS&&c&&typeof Promise<`u`&&!Xo?ns(t).then((e=>{u(e)})).catch((n=>{if(te(n))return Xo=!0,void u(g({},t,{compression:void 0,url:ss(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||typeof e!=`object`)return!1;var t=`name`in e?String(e.name):``;return te(e)||t===D})(n)&&(Xo=!0),u(t)})):l(t)})(g({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Qn(e){this.Jn?this.Jn.retriableRequest(e):this._send_request(e)}_execute_array(e){Gs++;try{var t,n=[],r=[],i=[];Jr(e,(e=>{if(e)if(j(t=e[0]))i.push(e);else if(M(e))try{e.call(this)}catch(t){B.error(`Error executing queued PostHog call`,e,t)}else j(e)&&t===`alias`?n.push(e):j(e)&&t.indexOf(`capture`)!==-1&&M(this[t])?i.push(e):r.push(e)}));var a=function(e,t){Jr(e,(function(e){try{if(j(e[0])){var n=t;K(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){B.error(`Error executing queued PostHog call`,e,t)}}))};a(n,this),a(r,this),a(i,this)}finally{Gs--}}push(e){if(Gs>0&&j(e)&&F(e[0])){var n=t.prototype[e[0]];M(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,n){var r,i,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Gn){if(this.is_capturing())if(!P(e)&&F(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!F(t?.$current_url)&&(B.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!==`$exception`||n!=null&&n.vs||B.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 l=new Date,u=n?.timestamp||l,d=Nt(n?.uuid,ci),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===Wr&&this.config.__preview_capture_bot_pageviews&&s&&(f.event=`$bot_pageview`,f.properties.$browser_type=`bot`),c&&(f.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var p=e===`$feature_flag_called`&&!1===f.properties.$feature_flag_has_experiment&&!0===this.get_property(dr);n!=null&&n.$set&&!p&&(f.$set=n?.$set);var m=n?.$unset;m&&(f.$unset=m);var h,_,v,y=p?void 0:this.cs(n?.$set_once,e!==qr,e===Kr);if(y&&(f.$set_once=y),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>F(e)?e.slice(0,r):e,o=new Set,f=function e(t,n){if(t!==Object(t))return a?a(t):t;if(!o.has(t)){var r;if(o.add(t),j(t))r=[],Jr(t,(t=>{r.push(e(t))}));else{var i={};K(t,((t,n)=>{o.has(t)||(i[n]=e(t,n))})),r=i}return r}}(i)),f.timestamp=u,P(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),p&&(f.properties=function(e,t){t===void 0&&(t=[]);var n={},r=t=>{e[t]!==void 0&&(n[t]=e[t])};return S.forEach(r),t.forEach(r),n}(f.properties,Zs)),e===so.DISMISSED||e===so.SENT){var b=t?.[co.SURVEY_ID],x=t?.[co.SURVEY_ITERATION];Ps({id:b,current_iteration:x}),f.$set=g({},f.$set,{[(h={id:b,current_iteration:x},_=e===so.SENT?`responded`:`dismissed`,v=`$survey_`+_+`/`+h.id,h.current_iteration&&h.current_iteration>0&&(v=`$survey_`+_+`/`+h.id+`/`+h.current_iteration),v)]:!0})}else e===so.SHOWN&&(f.$set=g({},f.$set,{[co.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===uo.SHOWN){var C=t?.[fo.TOUR_TYPE];C&&(f.$set=g({},f.$set,{[fo.TOUR_LAST_SEEN_DATE+`/`+C]:new Date().toISOString()}))}var w=g({},f.properties.$set,f.$set);if(fe(w)||this.setPersonPropertiesForFlags(w),!L(this.config.before_send)){var T=this.At(f);if(!T)return;(f=T).uuid=Nt(f.uuid,ci)}this.Pn.emit(`eventCaptured`,f);var E=n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),D={method:`POST`,url:E,data:f,compression:`best-available`,timestampMode:n?._batchKey===`recordings`||/\/s\/(?:\?|$)/.test(E)?`body`:`capture-body`,batchKey:n?._batchKey,transport:n?.transport};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Qn(D):this.Gn.enqueue(D),f}B.critical(`This capture call is ignored due to client rate limiting.`)}}else B.error(`No event name provided to posthog.capture`)}else B.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}rs(){return this.os??=new Us(this)}An(e){this.qn.push(e);var t=!0;return()=>{if(t){t=!1;var n=this.qn.indexOf(e);n!==-1&&this.qn.splice(n,1)}}}fs(e){var t,n,r;return e===void 0&&(e=!0),!((t=this.persistence)==null||!t.consumeCookieIdentityChange())&&(this.Un=null,this.persistence.get_property(U)===W&&((r=this.sessionPersistence)==null||r.clear(),this.$n.clear(),this.ps()),(n=this.featureFlags)==null||n.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,n,a,o,s){if(a||=new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.fs();var c=s?void 0:this.persistence.remove_event_timer(t),u=g({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Ln()&&(u[Pr]=!0),t===`$snapshot`){var d=g({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!F(u.distinct_id)&&!R(u.distinct_id)||pe(u.distinct_id))&&B.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),u}var f,m=function(t,n,r,a){var o,s,c;if(a===void 0&&(a=!1),!l)return{};var u,d=t?[...La,...n||[]]:[],f=function(e){for(var t=0;At.length>t;t++){var n=At[t],r=n[1],i=n[0].exec(e),a=i&&(M(r)?r(i,e):r);if(a)return a}return[``,``]}(l),m=f[0],h=f[1],g=(u=typeof navigator<`u`?navigator:void 0)!=null&&u.brave?{brave:!0}:{},_={};P(r)||(_.detectGoogleSearchApp=r);var v={},y=(o=navigator)==null||(o=o.userAgentData)==null?void 0:o.platform,b=navigator?.maxTouchPoints,x=e==null||(s=e.screen)==null?void 0:s.width,S=e==null||(c=e.screen)==null?void 0:c.height,C=e?.devicePixelRatio;P(y)||(v.userAgentDataPlatform=y),P(b)||(v.maxTouchPoints=b),P(x)||(v.screenWidth=x),P(S)||(v.screenHeight=S),P(C)||(v.devicePixelRatio=C);var w,T,E,D,O=q(Qr({$os:m,$os_version:h,$browser:Dt(l,navigator.vendor,g,_),$device:jt(l),$device_type:(T=l,E=v,D=jt(T),D===Pe||D===Ne||D===`Kobo`||D===`Kindle Fire`||D===ut?Me:D===$e||D===tt||D===et||D===st?`Console`:D===Ie?`Wearable`:D?ke:E?.userAgentDataPlatform===`Android`&&(E?.maxTouchPoints??0)>0?600>Math.min(E?.screenWidth??0,E?.screenHeight??0)/(E?.devicePixelRatio??1)?ke:Me:`Desktop`),$timezone:Ya(),$timezone_offset:Xa()}),{$current_url:Ma(a?Pt(i?.href):i?.href,d,za),$host:i?.host,$pathname:i?.pathname,$raw_user_agent:l.length>1e3?l.substring(0,997)+`...`:l,$browser_version:kt(l,navigator.vendor,g,_),$browser_language:Wa(),$browser_language_prefix:(w=Wa(),typeof w==`string`?w.split(`-`)[0]:void 0),$screen_height:e?.screen.height,$screen_width:e?.screen.width,$viewport_height:e?.innerHeight,$viewport_width:e?.innerWidth,$lib:p.LIB_NAME,$lib_version:p.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return p.SDK_DIST_CHANNEL&&(O.$sdk_dist_channel=p.SDK_DIST_CHANNEL),O}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var h=this.sessionManager.checkAndGetSessionAndWindowId(s,a.getTime(),!0),_=h.windowId;u.$session_id=h.sessionId,u.$window_id=_}this.sessionPropsManager&&q(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&q(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=this.Jn?.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Ds&&(u.$lib_custom_api_host=this.config.api_host),f=t!==Wr||s?t!==Gr||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(a):this.pageViewManager.doPageView(a,o),u=q(u,f),t===Wr&&r&&(u.title=r.title),!P(c)){var v=a.getTime()-c;u.$duration=parseFloat((v/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?`bot`:`browser`);var y=this.persistence.properties(),b=this.sessionPersistence.properties();K([`$referrer`,`$referring_domain`],(e=>{e in y&&delete b[e]}));var x={};if(this.qn.length>0)for(var S of this.qn.slice())try{q(x,S())}catch(e){B.error(`Failed to produce browser extension event properties`,e)}(u=q({},m,y,b,g({},x,u))).$is_identified=this._isIdentified(),j(this.config.property_denylist)?K(this.config.property_denylist,(function(e){delete u[e]})):B.error(Xs+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(B.error(Ys),u=C(u,t));var w=this.gs();return u.$process_person_profile=w,w&&!s&&this.ys(`_calculate_event_properties`),u}cs(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.gs()||this.Dn&&!n)return e;var r=q({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(B.error(Ys),r=i(r,`$set_once`)),t&&(this.Dn=!0),fe(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t,n;(t=this.persistence)==null||t.syncCookieProperties(),this.fs(),(n=this.sessionPersistence)==null||n.register(e),Object.keys(e).forEach((e=>this.$n.add(e))),this.ps()}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e),this.$n.delete(e),this.ps()}bs(e,t){this.register({[e]:t})}Kn(){this.$n.forEach((e=>{var t;(t=this.sessionPersistence)==null||t.unregister(e)})),this.$n.clear(),this.ps()}ps(){var e;if(this.Nn)if(this.config.persistence===`memory`||(e=this.sessionPersistence)!=null&&e.Oi||!Z.N())Z.q(this.Nn);else{var t=[];this.$n.forEach((e=>t.push(e))),t.length>0?Z.F(this.Nn,t):Z.q(this.Nn)}}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)}getAllFeatureFlags(){return this.featureFlags?.getAllFeatureFlags()??[]}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)??t?.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Pn.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Js}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Js})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Js})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=Is),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:Js}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:Js})}_s(e){return!e||pe(e)?(B.critical(`Unique user id has not been set in posthog.identify`),!1):e===Nr?(B.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||(B.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return B.uninitializedWarning(`posthog.identify`);if(R(e)&&(e=e.toString(),B.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this._s(e)&&this.ys(`posthog.identify`)){var r=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,a=this.fs(!1),o=this.persistence.$i(),s=!1;try{var c=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Rn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:c},``),e!==c&&e!==this.get_property(Bn)&&(this.unregister(Bn),this.register({distinct_id:e}));var l,u=(this.persistence.get_property(U)||W)===W,d=e!==c,f=!d&&u;if(d&&u)this.persistence.set_property(U,G),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ni(),this.capture(Kr,{distinct_id:e,$anon_distinct_id:c},{$set:t||{},$set_once:n||{}}),this.Un=Cs(e,t,n),(l=this.featureFlags)==null||l.setAnonymousDistinctId(c);else if(f){this.persistence.set_property(U,G);var p=t||{},m=n||{};this.setPersonPropertiesForFlags({$set:p,$set_once:m},!1),this.config.cookieWinsOnConflict&&this.persistence.Ni(),this.capture(`$set`,{$set:p,$set_once:m}),this.Un=Cs(e,t,n)}else(t||n)&&this.setPersonProperties(t,n);d||i||a?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Cr)):f&&(t||n)&&this.reloadFeatureFlags(),s=!0}finally{o&&this.persistence.Bi(s)}}}setPersonProperties(e,t){if((e||t)&&this.ys(`posthog.setPersonProperties`)){var n=Cs(this.get_distinct_id(),e,t);this.Un===n?B.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Un=n)}}unsetPersonProperties(e){var t,n=(j(e)?e:[e]).filter((e=>F(e)&&e.length>0));n.length!==0&&this.ys(`posthog.unsetPersonProperties`)&&((t=this.featureFlags)==null||t.unsetPersonPropertiesForFlags(n,!0),this.capture(`$set`,{$unset:n}),this.Un=null)}group(e,t,n){var r;if(e&&t){(r=this.persistence)==null||r.syncCookieProperties(),this.fs();var i=this.getGroups(),a=i[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:g({},i,{[e]:t})}),a||n){var o={$group_type:e,$group_key:t};n&&(o.$group_set=n),this.capture(qr,o)}n&&this.setGroupPropertiesForFlags({[e]:n}),a&&!n&&this.reloadFeatureFlags()}else B.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;e===void 0&&(e=!0),(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.ys(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t=he(e)?e:e?.resetDeviceID,n=he(e)||e==null?void 0:e.bootstrap;this.ws(t,!1,n)}ws(e,t,n){var r,i;if(t===void 0&&(t=!1),B.info(`reset`),!this.__loaded)return B.uninitializedWarning(`posthog.reset`);var a=n?.sessionID;this.config.bootstrap=n||this.Wn?.bootstrap||{},(r=this.featureFlags)==null||r.updateConfig==null||r.updateConfig(this.config,this.hr());var o=this.get_property(Rn),s=this.get_property(zn),c=this.get_property(Zn),l=this.is_capturing();this.consent.reset(),t||!l||this.is_capturing()||console.warn(`[PostHog.js]`,"reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var u=(i=this.persistence)==null||i.$i==null?void 0:i.$i(),d=!1;try{var f,p,m,h,_,v,y,b,x,S,C,w,T,E;if((f=this.persistence)==null||f.clear(),(p=this.sessionPersistence)==null||p.clear(),this.$n.clear(),this.ps(),P(c)||(C=this.persistence)==null||C.register({[Zn]:c}),(m=this.surveys)==null||m.reset(),(h=this.hs)==null||h.stop(),(_=this.featureFlags)==null||_.reset(),(v=this.conversations)==null||v.reset(),(y=this.logs)==null||y.reset(),(b=this.metrics)==null||b.reset(),(x=this.persistence)==null||x.set_property(U,W),(S=this.sessionManager)==null||S.resetSessionId(),this.Un=null,this.config.cookieless_mode===Br)this.register_once({distinct_id:Nr,$device_id:null},``);else{var D=this.config.get_device_id(ci());this.register_once({distinct_id:D,$device_id:e?D:o},``),e||P(s)||this.register({[zn]:s})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),n&&(n.distinctID===void 0||this.Ln()||((E=this.persistence)==null||E.set_property(U,n.isIdentifiedID?G:W),this.register({distinct_id:n.distinctID})),(w=this.featureFlags)==null||w.initialize(),!(P(a)||(T=this.sessionManager)!=null&&T.setBootstrapSessionId(a,!0)))){var O=g({},n);delete O.sessionID,this.config.bootstrap=O}delete this.config.identity_distinct_id,delete this.config.identity_hash,d=!0}finally{var ee;u&&((ee=this.persistence)==null||ee.Bi==null||ee.Bi(d))}this.reloadFeatureFlags()}shutdown(e){var t=this;return h((function*(){var e,n,r,i,a,o,s;if(t.__loaded){(e=t.hs)==null||e.stop(),(n=t.os)==null||n.dispose(),(r=t.sessionRecording)==null||r.dispose(),(i=t.logs)==null||i.flushLogs(`sendBeacon`),(a=t.metrics)==null||a.flush(`sendBeacon`),(o=t.Gn)==null||o.unload(),(s=t.Jn)==null||s.unload();try{var c;(c=t.featureFlags)==null||c.destroy()}catch(e){B.error(`Error while destroying feature flags`,e)}}else B.uninitializedWarning(`posthog.shutdown`)}))()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.ks()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.xs()}get_distinct_id(){return this.get_property(`distinct_id`)}getGroups(){return this.get_property(`$groups`)||{}}get_session_id(){return this.sessionManager?.checkAndGetSessionAndWindowId(!0).sessionId??``}get_session_replay_url(e){if(!this.sessionManager)return``;var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionStartTimestamp,r=this.requestRouter.endpointFor(`ui`,`/project/`+this.config.token+`/replay/`+t.sessionId);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(Ln)?(B.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.ys(`posthog.alias`)?(P(t)&&(t=this.get_distinct_id()),e===t?(B.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.bs(Bn,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=g({},this.config);if(N(e)){var n,r,i,a,o,s,c,l,u,d,f,m;q(this.config,nc(e));var h=this.Zn();(n=this.persistence)==null||n.update_config(this.config,t,h),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new no(g({},this.config,{persistence:`sessionStorage`}),h,!1);var _=this.zn(this.config.debug);he(_)&&(this.config.debug=_),he(this.config.debug)&&(this.config.debug?(p.DEBUG=!0,X.N()&&X.F(`ph_debug`,!0),B.info(`set_config`,{config:e,oldConfig:t,newConfig:g({},this.config)})):(p.DEBUG=!1,X.N()&&X.q(`ph_debug`))),(r=this.featureFlags)==null||r.updateConfig==null||r.updateConfig(this.config,this.hr()),(i=this.exceptionObserver)==null||i.onConfigChange(),(a=this.exceptions)==null||a.onConfigChange(),(o=this.sessionRecording)==null||o.startIfEnabledOrStop(),(s=this.tracingHeaders)==null||s.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(l=this.heatmaps)==null||l.startIfEnabled(),(u=this.exceptionObserver)==null||u.startIfEnabledOrStop(),(d=this.deadClicksAutocapture)==null||d.startIfEnabledOrStop(),(f=this.surveys)==null||f.loadIfEnabled(),this.Ss(),(m=this.externalIntegrations)==null||m.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){p.LIB_NAME=e,p.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(g({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??t.Cs}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??Qs;return e!==Qs&&(e=Qs+`.`+e),e}_isIdentified(){return this.persistence?.get_property(U)===G||this.sessionPersistence?.get_property(U)===G}gs(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===Vr&&!this._isIdentified()&&fe(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Bn])&&((t=this.persistence)==null||(t=t.props)==null||!t[Mr]))}ds(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.gs()||this.ys(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ys(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}ys(e){return this.config.person_profiles===`never`?(B.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.bs(Mr,!0),!0)}Zn(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==zr)}Ss(){var e,t,n=this.Zn();return this.persistence?.Oi!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.Oi!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n&&(this.$n.clear(),this.ps()),n}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Br){if(this.Ln()){var r,i;this.ws(!0,!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new ys(this),this.pageViewManager=new wa(this),this.persistence&&(this.sessionPropsManager=new hs(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??t.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.On(this.sessionRecording,new o(this)),this.In&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.In)))}var s;this.consent.optInOut(!0),this.Ss(),this.ls(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==zr&&((s=this.surveys)==null||s.loadIfEnabled()),(P(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture(e?.captureEventName??`$opt_in`,e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.us()}else B.warn(qs)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===Br?B.warn(qs):(this.config.cookieless_mode===zr&&this.consent.isOptedIn()&&this.ws(!0,!0),this.consent.optInOut(!1),this.Ss(),this.config.cookieless_mode===zr&&(this.register({distinct_id:Nr,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.us(),this.ls()))}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===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===Br||(this.config.cookieless_mode===zr?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Ss()}_is_bot(){return n?bs(n,this.config.custom_blocked_useragents):void 0}us(){r&&(r.visibilityState===`visible`?this.jn||(this.jn=!0,this.capture(Wr,{title:r.title},{send_instantly:!0}),this.Bn&&=(r.removeEventListener(Hr,this.Bn),null)):this.Bn||(this.Bn=this.us.bind(this),J(r,Hr,this.Bn)))}debug(t){!1===t?(e?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(e?.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}))}hr(){var e=this.Wn||{};return`advanced_disable_flags`in e?!!e.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(B.warn(`Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version.`),!0):function(e,t,n,r,i){var a=t in e&&!L(e[t]),o=n in e&&!L(e[n]);return a?e[t]:!!o&&(i&&i.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])}(e,`advanced_disable_flags`,`advanced_disable_decide`,0,B):!!this.config.advanced_disable_flags}At(e){if(L(this.config.before_send))return e;var t=Object.keys(e.properties??{}).filter(ve),n=j(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),L(r)){var a=`Event '`+e.event+`' was rejected in beforeSend function`;return _e(e.event)?B.warn(a+`. This can cause unexpected behavior.`):B.info(a),null}r.properties&&!fe(r.properties)||B.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}for(var o of t)if(r.properties&&L(r.properties[o]))return B.warn(`Event '`+e.event+`' had its '`+o+`' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){return this.pageViewManager.fi?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}zn(e){var t=he(e)&&!e,n=X.N()&&X.P(`ph_debug`)===`true`;return!t&&(!!n||e)}};ic.__defaultExtensionClasses={},ic.Cs=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Zr(e.prototype[t[n]])}(ic,[`identify`]);var ac=class{constructor(e){this.disabled=!1===e;var t=N(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,n){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&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},oc=`$copy_autocapture`,sc=V(`[AutoCapture]`);function cc(e,t){return t.length>e?t.slice(0,e)+`...`:t}function lc(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Ni(t));return t}function uc(t,n){var r,i=n.e,a=n.maskAllElementAttributes,o=n.maskAllText,s=n.elementAttributeIgnoreList,c=n.elementsChainAsString,l=n.disableCaptureUrlHashes;if(!Ni(t))return{props:{}};for(var u=[t],d=new Set([t]),f=t;f.parentNode&&!Pi(f,`body`)&&Li>u.length;)if(Ii(f.parentNode)){var p=f.parentNode.host;if(d.has(p))break;d.add(p),u.push(p),f=p}else{if(!Ni(f.parentNode)||d.has(f.parentNode))break;d.add(f.parentNode),u.push(f.parentNode),f=f.parentNode}var m,h,_=[],v={},y=!1,b=!1;if(K(u,(e=>{var t=na(e);if(Pi(e,`a`)){var n=e.getAttribute(`href`);y=!!(t&&n&&da(n))&&(l?Pt(n):n)}A(Bi(e),`ph-no-capture`)&&(b=!0),_.push(function(e,t,n,r,i){i===void 0&&(i=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};Wi.indexOf(a)>-1&&!n&&(o.$el_text=a.toLowerCase()===`a`||a.toLowerCase()===`button`?cc(1024,fa(e)):cc(1024,Hi(e)));var s=Bi(e);s.length>0&&(o.classes=s.filter((function(e){return e!==``}))),K(e.attributes,(function(n){var a;if((!ra(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&da(n.value)&&(!F(a=n.name)||a.substring(0,10)!==`_ngcontent`&&a.substring(0,7)!==`_nghost`)){var s=n.value;n.name===`class`&&(s=Ri(s).join(` `)),o[`attr__`+n.name]=cc(1024,n.name===`href`&&i?Pt(s):s)}}));for(var c=1,l=1,u=e;u=lc(u);)c++,u.tagName===e.tagName&&l++;return o.nth_child=c,o.nth_of_type=l,o}(e,a,o,s,l)),q(v,function(e){if(!na(e))return{};var t={};return K(e.attributes,(function(e){if(e.name&&e.name.indexOf(`data-ph-capture-attribute`)===0){var n=e.name.replace(`data-ph-capture-attribute-`,``),r=e.value;n&&r&&da(r)&&(t[n]=r)}})),t}(e))})),b)return{props:{},explicitNoCapture:b};if(o||(_[0].$el_text=Pi(t,`a`)||Pi(t,`button`)?fa(t):Hi(t)),y){var x;_[0].attr__href=y;var S=Aa(y)?.host,C=e==null||(x=e.location)==null?void 0:x.host;S&&C&&S!==C&&(m=y)}return{props:q({$event_type:i.type,$ce_version:1},c?{}:{$elements:_},{$elements_chain:(h=_,function(e){return e.map((e=>{var t=``;if(e.tag_name&&(t+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))t+=`.`+n.replace(/"/g,``);var r=g({},e.text?{text:e.text}:{},{"nth-child":e.nth_child??0,"nth-of-type":e.nth_of_type??0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return Yr(r).sort(((e,t)=>e[0].localeCompare(t[0]))).forEach((e=>{var t=e[1];return i[ma(e[0].toString())]=ma(t.toString())})),(t+=`:`)+Yr(i).map((e=>e[0]+`="`+e[1]+`"`)).join(``)})).join(`;`)}(function(e){return e.map((e=>{var t={text:e.$el_text?.slice(0,400),tag_name:e.tag_name,href:e.attr__href?.slice(0,2048),attr_class:ha(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Yr(e).filter((e=>e[0].indexOf(`attr__`)===0)).forEach((e=>t.attributes[e[0]]=e[1])),t}))}(h)))},(r=_[0])!=null&&r.$el_text?{$el_text:_[0]?.$el_text}:{},m&&i.type===`click`?{$external_click_url:m}:{},v)}}var dc=V(`[ExceptionAutocapture]`),fc=()=>{},pc=V(`[TracingHeaders]`),mc=V(`[Web Vitals]`),hc=9e5,gc=`disabled`,_c=`lazy_loading`,vc=`awaiting_config`,yc=`missing_config`;V(`[SessionRecording]`),V(`[SessionRecording]`);var bc=`[SessionRecording]`,xc=V(bc),Sc=V(`[Heatmaps]`);function Cc(e){return N(e)&&`clientX`in e&&`clientY`in e&&R(e.clientX)&&R(e.clientY)}var wc=V(`[Product Tours]`),Tc=e=>{var t;return!e.config.disable_product_tours&&!((t=e.persistence)==null||!t.get_property(Yn))},Ec=[`$set_once`,`$set`],Dc=V(`[SiteApps]`),Oc=`Error while initializing PostHog app with config id `;function kc(e,t,n){if(L(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var Ac=class{constructor(e){this.Ms=new gs,this.Ts=(e,t)=>this.Es(e,t)&&this.Is(e,t)&&this.Ps(e,t)&&this.Rs(e,t),this.Es=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.As=new Set,this.Fs=new Set}init(){var e;P(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!P(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.Fs)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.As)==null||t.add(e?.event||``)}))})),(t=this._instance)!=null&&t.autocapture)){var n,r=new Set;e.forEach((e=>{var t;(t=e.steps)==null||t.forEach((e=>{e!=null&&e.selector&&r.add(e?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.As.has(e)||this.As.has(t.event))&&this.Fs&&this.Fs?.size>0&&this.Fs.forEach((e=>{this.Os(t,e)&&this.Ms.emit(`actionCaptured`,e.name)}))}Ls(e){this.onAction(`actionCaptured`,(t=>e(t)))}Os(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.Ts(e,n))return!0;return!1}onAction(e,t){return this.Ms.on(e,t)}Is(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!kc(r,t.url,t.url_matching||`contains`))return!1}return!0}Ps(e,t){return!!this.Ds(e,t)&&!!this.$s(e,t)&&!!this.Ns(e,t)}Ds(e,t){var n;if(t==null||!t.href)return!0;var r=this.qs(e);if(r.length>0)return r.some((e=>kc(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&kc((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}$s(e,t){var n;if(t==null||!t.text)return!0;var r=this.qs(e);if(r.length>0)return r.some((e=>kc(e.text,t.text,t.text_matching||`exact`)||kc(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!L(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>kc(e,a,o))))}Ns(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}qs(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}Rs(e,t){return t==null||!t.properties||t.properties.length===0||Es(t.properties.reduce(((e,t)=>{var n=j(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},jc=class{constructor(e){var t;this.js=[],this._instance=e,this.Bs=new Map,this.Hs=new Map,this.Us=new Map,(t=this._instance)==null||t.onSessionId==null||t.onSessionId((e=>this.zs(e)))}Ws(e){return!1}Vs(){return null}Zs(e){}Gs(){}Qs(e,t){return!!e&&Es(e.propertyFilters,t?.properties)}Js(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}Ks(e,t,n){var r=(n===ao.Activation?this.Bs:this.Hs).get(e),i=[];return this.Ys((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.Qs(a,t)}))}register(e){P(this._instance?._addCaptureHook)||(this.Xs(e),this.ta(e))}ta(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.ea??(this.ea=new Ac(this._instance),this.ea.init(),this.ea.Ls((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.ea)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.Us.get(t.name);n&&n.push(e.id),this.Us.set(t.name,n||[e.id])}})))})))}Xs(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Bs=this.Js(e,ao.Activation),this.Hs=this.Js(e,ao.Cancellation))}onEvent(e,t){var n,r,i=this.ia(),a=(t==null||(n=t.properties)==null?void 0:n.$survey_id)||(t==null||(r=t.properties)==null?void 0:r.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var o=this.ra(e,a);if(o===`consume`)return i.info(`event consumed activated item, removing it`,{event:e,itemId:a}),void this.na([a]);if(o===`persist`)return i.info(`shown item promoted to persisted activation`,{event:e,itemId:a}),this.sa(a),void this.aa([a])}if(this.Hs.has(e)){var s=this.Ks(e,t,ao.Cancellation);s.length>0&&(i.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:s.map((e=>e.id))}),this.na(s.map((e=>e.id))),s.forEach((e=>this.oa(e.id))))}if(this.Bs.has(e)){i.info(`event name matched`,{event:e,eventPayload:t,items:this.Bs.get(e)});var c=this.Ks(e,t,ao.Activation);this.la(c.map((e=>e.id)))}}onAction(e){this.Us.has(e)&&this.la(this.Us.get(e)||[])}la(e){var t;if(e.length!==0){var n=!((t=this._instance)==null||t.get_session_id==null||!t.get_session_id()),r=[];for(var i of e)n&&this.Ws(i)?this.sa(i)&&this.ua(i):r.push(i);r.length>0&&(this.js=[...new Set([...this.js,...r])]),this.ia().info(`updating activated items`,{activatedItems:this.getActivatedIds()})}}sa(e){this.js=this.js.filter((t=>t!==e));var t=this.ha();return!t.includes(e)&&(this.da([...t,e]),this.va(),!0)}na(e){var t=new Set(e);this.js=this.js.filter((e=>!t.has(e)));var n=this.ca(),r=n.filter((e=>!t.has(e)));r.length!==n.length&&(this.da(r),r.length===0&&this.fa()),this.aa(e)}pa(){var e,t=this.Vs();if(!t)return{};var n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t];return n&&typeof n==`object`?n:{}}ua(e){if(this.Vs()){var t=this.pa();this.Zs(g({},t,{[e]:Date.now()}))}}aa(e){if(this.Vs()){var t=this.pa(),n={},r=!1;for(var i of Object.entries(t)){var a=i[0],o=i[1];e.includes(a)?r=!0:n[a]=o}r&&(fe(n)?this.Gs():this.Zs(n))}}ga(){this.Vs()&&this.Gs()}getActivationTimestamp(e){if(this.ha().includes(e)){var t=this.pa()[e];return R(t)?t:void 0}}ca(){var e,t=this.ma();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}ha(){var e,t,n=this.ca();if(n.length===0)return[];var r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.ya()],i=(t=this._instance)==null||t.get_session_id==null?void 0:t.get_session_id();return i&&r===i?n:[]}va(){var e,t=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();t&&this.ba(t)}fa(){this._a()}zs(e){var t,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[this.ya()];if(n&&n!==e){var r=this.ca(),i=this.pa();r.length>0&&(this.da([]),r.filter((e=>R(i[e]))).forEach((e=>this.oa(e)))),this.fa(),this.ga()}}getActivatedIds(){return[...new Set([...this.ha(),...this.js])].filter((e=>!this.wa(e)))}reset(){this.js=[],this.ca().length>0&&this.da([]),this.fa(),this.ga()}getEventToItemsMap(){return this.Bs}ka(){return this.ea}},Mc=class extends jc{constructor(e){super(e)}ma(){return yr}ya(){return br}Vs(){return xr}Zs(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[xr]:e})}Gs(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(xr)}Ws(e){var t,n;this.Ys((t=>{n=t.find((t=>t.id===e))}));var r=(t=n)==null||(t=t.appearance)==null?void 0:t.surveyPopupDelaySeconds;return R(r)&&r>0}xa(){return so.SHOWN}Ys(e){var t;(t=this._instance)==null||t.getSurveys(e)}oa(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}ia(){return $}da(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[yr]:e})}ba(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[br]:e})}_a(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(br)}wa(){return!1}ra(e,t){var n;return this.Ys((e=>{n=e.find((e=>e.id===t))})),!n||function(e){var t;return Ms(e)&&!((t=e.conditions)==null||(t=t.events)==null||!t.repeatedActivation)||e.schedule===`always`}(n)?e===so.SHOWN?`consume`:`ignore`:e===so.SHOWN?`persist`:e===so.DISMISSED||e===so.SENT?`consume`:`ignore`}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Nc=`SDK is not enabled or survey functionality is not yet loaded`,Pc=`Disabled. Not loading surveys.`,Fc=e!=null&&e.location?Na(e.location.hash,`__posthog`)||Na(location.hash,`state`):null,Ic=`_postHogToolbarParams`,Lc=V(`[Toolbar]`),Rc=V(`[FeatureFlags]`),zc=class{constructor(e,t){t===void 0&&(t=!1),this.Sa=!1,this.update(e,t)}update(e,t){this.Ca=((e,t)=>({bootstrap:{featureFlags:e.bootstrap?.featureFlags,featureFlagPayloads:e.bootstrap?.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?`none`:`base64`,evaluationContexts:e.evaluation_contexts??e.evaluation_environments??[],flagKeys:j(e.flag_keys)?e.flag_keys:void 0}))(e,t),!e.evaluation_environments||e.evaluation_contexts||this.Sa||(Rc.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.Sa=!0),P(e.flag_keys)||j(e.flag_keys)||Rc.error(`Invalid flag_keys found:`,e.flag_keys,`Expected array of non-empty strings`)}get(){return this.Ca}},Bc=V(`[FeatureFlags]`),Vc=V(`[FeatureFlags]`,{debugEnabled:!0}),Hc=`" failed. Feature flags didn't load in time.`,Uc=`connection_error`,Wc=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},Gc=e=>{var t={};for(var n of Yr(e||{})){var r=n[1];r&&(t[n[0]]=r)}return t},Kc=V(`[Error tracking]`),qc=[`chrome-extension://`,`moz-extension://`,`safari-extension:`,`safari-web-extension:`],Jc=`Refusing to render web experiment since the viewer is a likely bot`,Yc={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>Ss(t,e),not_regex:(e,t)=>!Ss(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},Xc=class t{get qe(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){e===void 0&&(e=!1),n.getWebExperiments((e=>{t.Ma(`retrieved web experiments from the server`),n.Ta=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;n.Ta&&(t.Ma(`setting flag key `,e.feature_flag_key,` to web experiment `,e),(r=n.Ta)==null||r.set(e.feature_flag_key,e));var i=n._instance.getFeatureFlag(e.feature_flag_key);F(i)&&e.variants[i]&&n.Ea(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var a in e.variants){var o=e.variants[a];t.Ia(o,n._instance)&&n.Ea(e.name,a,o.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())t.Ma(Jc);else if(!this.qe.disable_web_experiments){if(L(this.Ta))return this.Ta=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.Ma(`applying feature flags`,e),e.forEach((e=>{var t;if(this.Ta&&(t=this.Ta)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.Ta?.get(e);n&&r!=null&&r.variants[n]&&this.Ea(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=ja(e?.search,`__experiment_id`),r=ja(e?.search,`__experiment_variant`);n&&r&&(t.Ma(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.Pa(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.qe.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.qe.disable_web_experiments&&!n)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.qe.token),method:`GET`,timestampMode:`query`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}Pa(e,n,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(t.Ma(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.Ea(i[0].name,n,i[0].variants[n].transforms))}static Ia(e,n){return!L(e.conditions)&&t.Ra(e,n)&&t.Aa(e)}static Ra(e,n){if(L(e.conditions)||L(e.conditions?.url))return!0;var r=t.getWindowLocation();if(r){var i,a=Di(n,r.href);return(i=e.conditions)==null||!i.url||Yc[e.conditions?.urlMatchType??`icontains`](e.conditions.url,a)}return!1}static getWindowLocation(){return e?.location}static Aa(e){if(L(e.conditions)||L(e.conditions?.utm))return!0;var t=Va();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static Ma(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];B.info(`[WebExperiments] `+e,n)}Ea(e,n,r){this._is_bot()?t.Ma(Jc):n===`control`?t.Ma(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(t.Ma(`applying transform of variant `+n+` for experiment `+e+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return n&&this._instance?bs(n,this.qe.custom_blocked_useragents):void 0}},Zc=V(`[Conversations]`),Qc=`Conversations not available yet.`,$c=`console`,el=`__posthogHandledLogsRequestError`,tl=(e,t)=>{var n=e instanceof Error?e:Error(t);return n[el]=!0,n},nl=e=>!!e&&typeof e==`object`&&!0===e[el],rl={featureFlags:class{constructor(e){this.name=`featureFlags`,this.Fa=!1,this.featureFlagEventHandlers=[],this.st=Bc,this.Oa={},this.La={},this.Da=[],this.$a=!1,this.Na=!1,this.qa=0,this.ja=!1,this.Ba=!1,this.Ha=!1,this.Ua=!1,this.za=0,this.Wa=()=>{var e=this.Va();this.za=0,e&&this.reloadFeatureFlags()},`get`in e?this.Za=e:(this.Ga=new zc(e.config,e.hr()),this.Za=this.Ga)}updateConfig(e,t){var n;(n=this.Ga)==null||n.update(e,t)}setup(e){return this.Qa=e,this.st=e.logger.createLogger(`[FeatureFlags]`),n=()=>{this.Qa===e&&(this.Qa=void 0,this.Sn=e,this.Ja(e))},(t=e.kv.initialize())!=null&&t.then?t.then(n):n();var t,n}Ja(t){if(this.Sn===t)return e&&J(e,`online`,this.Wa),this.Ka=t.registerDynamicEventProperties((()=>this.Ya()?this.Oa:this.La)),this.Xa(),this.initialize()}destroy(){e?.removeEventListener(`online`,this.Wa)}dispose(){var t;this.qa++,this.Ba=!1,this.Qa=void 0,this.Sn&&=(this.eo(),(t=this.Ka)==null||t.dispose(),this.Ka=void 0,this.Da=[],e?.removeEventListener(`online`,this.Wa),void 0)}get qe(){return this.Za.get()}io(e){return this.Sn?.kv.get(e)}F(e){this.ro((()=>this.Sn?.kv.set(e)))}q(e){this.ro((()=>this.Sn?.kv.remove(e)))}ro(e){try{e()}catch(e){this.st.error(`Failed to update feature flag persistence`,e)}}Xa(){var e={};for(var t of[or,lr,ur,fr]){var n=this.io(t);P(n)||(e[t]=n)}this.Oa=e;var r=g({},e),i=this.io(ar);if(i)for(var a of Object.entries(i))r[`$feature/`+a[0]]=a[1];this.La=r}Ya(){var e=this.qe.cacheTtlMs;if(!e||0>=e)return!1;var t=this.io(Er);return typeof t!=`number`||Date.now()-t>e}no(){return!!this.Ya()&&(this.Ua||this.Na||(this.Ua=!0,this.st.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}so(){var e=this.qe.evaluationContexts;return e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||this.st.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}ao(){var e=this.qe.flagKeys;if(!P(e))return e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||this.st.error(`Invalid flag key found:`,e,`Expected non-empty string`),t}))}initialize(){var e=this.qe,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(e[t]=n[t],e)),{});return this.oo({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r,i,a=n!=null&&n.merge&&(r=this.io(ar))!=null?r:{},o=n!=null&&n.merge&&(i=this.io(lr))!=null?i:{},s=g({},a,e),c=g({},o,t),l={};for(var u of Object.entries(s)){var d=u[0],f=u[1];l[d]={key:d,enabled:y(f),variant:b(f),reason:void 0,metadata:P(c?.[d])?void 0:{id:0,version:void 0,description:void 0,payload:c[d]}}}this.oo({flags:l})}get hasLoadedFlags(){return this.$a}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.io(cr),t=this.io(fr),n=this.io(pr);if(!n&&!t)return e||{};var r=q({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=P(c)?(a=s?.enabled)!=null&&a:!!c,u=P(c)?s?.variant:typeof c==`string`?c:void 0,d=n?.[i],f=g({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=g({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.Fa||=(this.st.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((n=>{var r=e[n];return{key:n,enabled:y(r),variant:b(r),payload:v(t[n])}}))}getFlagVariants(){var e=this.io(ar),t=this.io(fr);if(!t)return e||{};for(var n=q({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Fa||=(this.st.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.io(lr),t=this.io(pr);if(!t)return e||{};for(var n=q({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Fa||=(this.st.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.ja||this.qe.featureFlagsDisabled||this.Va()||this.lo||(this.Da.slice().forEach((e=>{try{e()}catch(e){this.st.error(`Error while running feature flags reloading callback`,e)}})),this.lo=setTimeout((()=>{this.uo()}),5))}eo(){clearTimeout(this.lo),this.lo=void 0}onReloading(e){return this.Da.push(e),()=>{this.Da=this.Da.filter((t=>t!==e))}}ensureFlagsLoaded(){this.$a||this.Na||this.lo||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ja=e}resetFlagCallReported(){this.q(Cr)}uo(e){this.eo();var t=this.Sn;if(t&&!this.qe.remoteRequestsDisabled&&!this.Va())if(this.Na)this.Ba=!0;else{var n={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:g({},t.initialPersonProperties,this.io(mr)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.io(hr),timezone:Ya()};P(t.deviceId)||(n.$device_id=t.deviceId),(e!=null&&e.disableFlags||this.qe.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.so();r.length&&(n.evaluation_contexts=r);var i=this.ao();P(i)||(n.flag_keys=i);var a=this.qe.onlyEvaluateSurveyFeatureFlags,o=`/flags/?v=2`+(a?`&only_evaluate_survey_feature_flags=true`:``),s=this.qa;this.Na=!0;var c=()=>{this.Ba&&(this.Ba=!1,this.uo())},l=e=>{this.Na=!1,s===this.qa?(this.F({[Tr]:[Uc]}),this.st.error(`Feature flag request failed`,e),c()):c()};try{t.sendRequest(o,{target:`flags`,method:`POST`,body:n,compression:this.qe.compression===`base64`?io.Base64:void 0,sentAt:`body`,timeoutMs:this.qe.requestTimeoutMs}).then((e=>{var t,r=e.json??{},i=e.statusCode!==200;if(this.Na=!1,s===this.qa){if(this.ho(e.statusCode),i||this.Ba||(this.$anon_distinct_id=void 0),!n.disable_flags||this.Ba){this.Ha=!i;var o=[];e.error?o.push(e.error instanceof Error&&e.error.name===`AbortError`?`timeout`:e.error instanceof Error?Uc:`unknown_error`):e.statusCode!==200&&o.push(`api_error_`+e.statusCode),r.errorsWhileComputingFlags&&o.push(`errors_while_computing_flags`);var l=!((t=r.quotaLimited)==null||!t.includes(`feature_flags`));l&&o.push(`quota_limited`),this.F({[Tr]:o}),l?this.st.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.`):n.disable_flags||this.oo(r,i,{partialResponse:a}),c()}}else c()})).catch(l)}catch(e){l(e)}}}Va(){return Pa(this.za,3)}ho(e){this.za=Fa(e,this.za,3,(()=>this.st.warn(`Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.`)))}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.Ha)if(this.$a||this.getFlags()&&this.getFlags().length>0){if(!this.no()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else this.st.warn(`getFeatureFlag for key "`+e+Hc)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.Ha)if(this.$a||this.getFlags()&&this.getFlags().length>0){if(!this.no()){var n,r=this.getFlagVariants(),i=e in r,a=r[e],o=this.getFlagPayloads()[e],s=String(a),c=this.io(ur)||void 0,l=this.io(Er)||void 0,u=this.io(Cr)||{};if(this.qe.deduplicateCallsPerSession){var d=this.Sn?.session.sessionId,f=this.io(wr);d&&d!==f&&(u={},n=d)}if(t.send_event||!(`send_event`in t))if(e in u&&u[e].includes(s))n&&this.F({[Cr]:u,[wr]:n});else{var p,m,h,_,y,b,x,S;j(u[e])?u[e].push(s):u[e]=[s],this.F(g({[Cr]:u},n?{[wr]:n}:{}));var C=this.getFeatureFlagDetails(e),w=[...this.io(Tr)??[]];P(a)&&w.push(`flag_missing`);var T={$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:o??null,$feature_flag_request_id:c,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((p=this.qe.bootstrap)==null||(p=p.featureFlags)==null?void 0:p[e])??null,$feature_flag_bootstrapped_payload:((m=this.qe.bootstrap)==null||(m=m.featureFlagPayloads)==null?void 0:m[e])??null,$used_bootstrap_value:!this.Ha};P(C==null||(h=C.metadata)==null?void 0:h.has_experiment)||(T.$feature_flag_has_experiment=C.metadata.has_experiment),P(C==null||(_=C.metadata)==null?void 0:_.version)||(T.$feature_flag_version=C.metadata.version);var E,D=(C==null||(y=C.reason)==null?void 0:y.description)??(C==null||(b=C.reason)==null?void 0:b.code);D&&(T.$feature_flag_reason=D),C!=null&&(x=C.metadata)!=null&&x.id&&(T.$feature_flag_id=C.metadata.id),P(C?.original_variant)&&P(C?.original_enabled)||(T.$feature_flag_original_response=P(C.original_variant)?C.original_enabled:C.original_variant),C!=null&&(S=C.metadata)!=null&&S.original_payload&&(T.$feature_flag_original_payload=C==null||(E=C.metadata)==null?void 0:E.original_payload),w.length&&(T.$feature_flag_error=w.join(`,`)),this.do(T)}else n&&this.F({[Cr]:u,[wr]:n});if(i)return{key:e,enabled:!!a,variant:typeof a==`string`?a:void 0,payload:v(o)}}}else this.st.warn(`getFeatureFlagResult for key "`+e+Hc)}do(e){try{var t;(t=this.Sn)==null||t.capture(`$feature_flag_called`,e).catch((e=>{this.st.error(`Failed to capture feature flag call`,e)}))}catch(e){this.st.error(`Failed to capture feature flag call`,e)}}getRemoteConfigPayload(e,t){this.vo(e,t)}vo(e,t){var n=this;return h((function*(){var r=n.Sn;if(r){var i={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},a=n.so();a.length&&(i.evaluation_contexts=a);var o,s=n.ao();P(s)||(i.flag_keys=s);try{o=(yield r.sendRequest(`/flags/?v=2`,{target:`flags`,method:`POST`,body:i,compression:n.qe.compression===`base64`?io.Base64:void 0,sentAt:`body`,timeoutMs:n.qe.requestTimeoutMs})).json?.featureFlagPayloads?.[e]||void 0}catch(e){n.st.error(`Remote config feature flag request failed`,e);return}try{t(o)}catch(e){n.st.error(`Remote config feature flag callback failed`,e)}}}))()}isFeatureEnabled(e,t){if(t===void 0&&(t={}),t.fresh&&!this.Ha)return t.defaultValue;if(!(this.$a||this.getFlags()&&this.getFlags().length>0))return this.st.warn(`isFeatureEnabled for key "`+e+Hc),t.defaultValue;var n=this.getFeatureFlag(e,t);return P(n)?t.defaultValue:!!n}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){this.oo(e,t,n)}oo(e,t,n){if(this.Sn){this.$a=!0;var r=function(e,t,n,r,i,a){t===void 0&&(t={}),n===void 0&&(n={}),r===void 0&&(r={}),a===void 0&&(a=Bc);var o=((e,t)=>{var n=e.flags;return n?g({},e,{featureFlags:Object.fromEntries(Object.keys(n).map((e=>[e,n[e].variant??n[e].enabled]))),featureFlagPayloads:Object.fromEntries(Object.keys(n).filter((e=>n[e].enabled)).filter((e=>n[e].metadata?.payload)).map((e=>[e,n[e].metadata?.payload])))}):(e.featureFlags&&t.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e)})(e,a),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(j(c)){a.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;return{[or]:c,[ar]:f,[dr]:!1}}var m=c,h=l,_=s;if(i!=null&&i.partialResponse)m=g({},t,m),h=g({},n,h),_=g({},r,_);else if(e.errorsWhileComputingFlags)if(s){var v=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=g({},t,Object.fromEntries(Object.entries(m).filter((e=>v.has(e[0]))))),h=g({},n,Object.fromEntries(Object.entries(h||{}).filter((e=>v.has(e[0]))))),_=g({},r,Object.fromEntries(Object.entries(_||{}).filter((e=>v.has(e[0])))))}else m=g({},t,m),h=g({},n,h),_=g({},r,_);return g({[or]:Object.keys(Gc(m)),[ar]:m||{},[lr]:h||{},[cr]:_||{},[dr]:!0===e.minimalFlagCalledEvents},u?{[ur]:u}:{},d?{[Er]:d}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.st);r&&this.F(r),t||(this.Ua=!1),this.co(t)}}override(e,t){t===void 0&&(t=!1),this.st.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.fo(e)}fo(e){if(this.Sn){if(!1===e)return this.q([fr,pr]),this.co(),void Vc.info(`All overrides cleared`);if(j(e))return this.F({[fr]:Wc(e)}),this.co(),void Vc.info(`Flag overrides set`,{flags:e});if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var t,n=e;this.Fa=!!((t=n.suppressWarning)!=null&&t);var r={},i=n.flags,a=n.payloads;i&&(r[fr]=j(i)?Wc(i):i),a&&(r[pr]=a),Object.keys(r).length&&this.F(r),!1===i&&!1===a?this.q([fr,pr]):!1===i?this.q(fr):!1===a&&this.q(pr),this.co(),!1===i?Vc.info(`Flag overrides cleared`):i&&Vc.info(`Flag overrides set`,{flags:i}),!1===a?Vc.info(`Payload overrides cleared`):a&&Vc.info(`Payload overrides set`,{payloads:a});return}if(e&&typeof e==`object`)return this.F({[fr]:e}),this.co(),void Vc.info(`Flag overrides set`,{flags:e});this.st.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}else this.st.warn(`posthog.featureFlags.overrideFeatureFlags called before feature flags were ready`)}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.$a){var t=this.po(),n=t.flags,r=t.flagVariants;try{e(n,r)}catch(e){this.st.error(`Error while running feature flags callback`,e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r=(this.io(sr)||[]).find((t=>t.flagKey===e)),i={[`$feature_enrollment/`+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:i};r&&(a.$early_access_feature_name=r.name),n&&(a.$feature_enrollment_stage=n);var o=g({},this.getFlagVariants(),{[e]:t});this.F({[or]:Object.keys(Gc(o)),[ar]:o,[mr]:g({},this.io(mr)||{},i)}),this.co();try{var s;(s=this.Sn)==null||s.capture(`$feature_enrollment_update`,a).catch((e=>{this.st.error(`Failed to capture early access feature enrollment`,e)}))}catch(e){this.st.error(`Failed to capture early access feature enrollment`,e)}}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.io(sr);!r||t?this.mo(e,n):e(r)}mo(e,t){var n=this;return h((function*(){var r=n.Sn;if(r){var i,a=t?`&`+t.map((e=>`stage=`+e)).join(`&`):``;try{var o=yield r.sendRequest(`/api/early_access_features/?token=`+r.projectToken+a,{target:`api`,method:`GET`,sentAt:`query`});if(!o.json)return;n.F({[sr]:i=o.json.earlyAccessFeatures})}catch(e){n.st.error(`Early access feature request failed`,e);return}try{e(i)}catch(e){n.st.error(`Early access feature callback failed`,e)}}}))()}po(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}co(e){this.Xa();var t=this.po(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((t=>{try{t(n,r,{errorsLoading:e})}catch(e){this.st.error(`Error while running feature flags callback`,e)}}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.yo(e,t)}yo(e,t){t===void 0&&(t=!0);var n=this.io(mr)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this.F({[mr]:g({},n,a,r)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=g({},this.io(mr)||{});e.forEach((e=>{delete n[e]})),this.F({[mr]:n}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){e===void 0&&(e=!0),this.q(mr),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.io(hr)||{},r=g({},n);for(var i of Object.keys(e))r[i]=g({},n[i],e[i]);this.F({[hr]:r}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.io(hr)||{};this.F({[hr]:g({},t,{[e]:{}})})}else this.q(hr)}reset(){this.qa++,this.Ba=!1,this.Oa={},this.La={},this.$a=!1,this.ja=!1,this.Ha=!1,this.$anon_distinct_id=void 0,this.eo(),this.Fa=!1,this.za=0}}},il={sessionRecording:class{get qe(){return this._instance.config}get jr(){return this._instance.persistence}get started(){var e;return!((e=this.bo)==null||!e.isStarted)}get status(){return this._o===vc||this._o===yc?this._o:this.bo?.status??this._o}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this._o=gc,this.wo=void 0,this.ko=!1,this.xo=(()=>{var t;if(r==null||!r.visibilityState||r.visibilityState===`visible`)return!0;var n=e==null||(t=e.performance)==null||t.getEntriesByType==null?void 0:t.getEntriesByType(`visibility-state`);return!(n!=null&&n.length)||n.some((e=>e.name===`visible`))})(),this.Ee=()=>{var e;r?.visibilityState===`visible`&&(this.xo=!0,(e=this.bo)==null||e.setDocumentWasEverVisible==null||e.setDocumentWasEverVisible(!0))},this._instance=t,!this._instance.sessionManager)throw xc.error(`started without valid sessionManager`),Error(bc+` started without valid sessionManager. This is a bug.`);if(this.qe.cookieless_mode===Br)throw Error(bc+` cannot be used with cookieless_mode="always"`);r!=null&&r.addEventListener&&J(r,`visibilitychange`,this.Ee)}initialize(){this.startIfEnabledOrStop()}dispose(){this.ko=!0,r==null||r.removeEventListener==null||r.removeEventListener(`visibilitychange`,this.Ee),this.stopRecording()}get So(){var t,n=!((t=this._instance.get_property(Zn))==null||!t.enabled),r=!this.qe.disable_session_recording,i=this.qe.disable_session_recording||this._instance.consent.isOptedOut();return e&&n&&r&&!i}startIfEnabledOrStop(e){var t;if(!(this.ko||this.So&&(t=this.bo)!=null&&t.isStarted)){var n=!P(Object.assign)&&!P(Array.from);this.So&&n?(this.Co(e),xc.info(`starting`)):(this._o=gc,this.stopRecording())}}Co(e){var t,n,r;this.So&&(this._o!==vc&&this._o!==yc&&(this._o=_c),f!=null&&(t=f.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=f.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Mo(e):(r=f.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.To,(t=>{if(t)return xc.error(`could not load recorder`,t);this.Mo(e)})))}stopRecording(){var e,t;(e=this.wo)==null||e.call(this),this.wo=void 0,(t=this.bo)==null||t.stop()}Eo(){var e,t;(e=this.wo)==null||e.call(this),this.wo=void 0,(t=this.bo)==null||t.discard()}Io(){var e,t;(e=this.jr)==null||e.unregister(ir),(t=this.jr)==null||t.unregister(Qn)}Po(e,t){if(L(e))return null;var n,r=R(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(xc.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}Ro(e){if(this.jr){var t,n=this.jr,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Po(this.qe.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Po(t?.sampleRate,`remote config sampleRate`),a=r??i;L(a)&&this.Io();var o=t?.minimumDurationMilliseconds;n.register({[Zn]:g({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:g({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:P(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this.wo)==null||t.call(this),this.wo=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;t&&`sessionRecording`in t?!1===t.sessionRecording?(this.Ro(t),this.Eo()):(this.Ro(t),this.startIfEnabledOrStop()):(this._o===vc&&(this._o=yc,xc.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.bo)!=null&&n.log?this.bo.log(e,t):xc.warn(`log called before recorder was ready`)}get To(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Zn);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Ao(){var e,t=this._instance.get_property(Zn);if(!t)return!1;try{e=typeof t==`object`?t:JSON.parse(t)}catch(e){return xc.warn(`persisted remote config for session recording is invalid and will be ignored`,e),!1}return!L(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}Mo(e){var t,n,r;if(!this.ko){if((t=f.__PosthogExtensions__)==null||!t.initSessionRecording)return xc.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[Lr]:!0});if(this.bo||(this.bo=f.__PosthogExtensions__?.initSessionRecording(this._instance,this.xo),this.bo._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ao()){if(this._o===yc||this._o===vc)return;this._o=vc,xc.info(`persisted remote config is stale, requesting fresh config before starting`),new go(this._instance).load();return}this._o=_c,(n=(r=this.bo).setDocumentWasEverVisible)==null||n.call(r,this.xo),this.bo.start(e)}}onRRwebEmit(e){var t;(t=this.bo)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.bo||(t=this.jr)==null||t.register({[er]:!0}),(e=this.bo)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.bo||(t=this.jr)==null||t.register({[$n]:!0}),(e=this.bo)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.bo||(n=this.jr)==null||n.register({[e===`url`?tr:nr]:!0}),(t=this.bo)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.bo?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.bo)==null||!n.tryAddCustomEvent(e,t))}}},al={autocapture:class{constructor(e){this.Fo=!1,this.Oo=null,this.Lo=!1,this.Do=!1,this.instance=e,this.rageclicks=new ac(e.config.rageclick),this.$o=null}initialize(){this.startIfEnabled()}get qe(){var e=N(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=e.url_allowlist?.map((e=>new RegExp(e))),e.url_ignorelist=e.url_ignorelist?.map((e=>new RegExp(e))),e}No(){if(this.isBrowserSupported()){if(e&&r){var t=t=>{t||=e?.event;try{this.qo(t)}catch(e){sc.error(`Failed to capture event`,e)}};if(J(r,`submit`,t,{capture:!0}),J(r,`change`,t,{capture:!0}),J(r,`click`,t,{capture:!0}),this.qe.capture_copied_text){var n=t=>{t||=e?.event;try{this.qo(t,oc)}catch(e){sc.error(`Failed to capture copy/cut event`,e)}};J(r,`copy`,n,{capture:!0}),J(r,`cut`,n,{capture:!0})}}}else sc.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.Fo&&(this.No(),this.Fo=!0)}onRemoteConfig(e){if(this.Lo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.Do=t.elementsChainAsString);var n=t.autocapture_opt_out;he(n)&&(this.instance.persistence&&this.instance.persistence.register({[Hn]:n}),this.Oo=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.$o=e}getElementSelectors(e){var t,n=[];return(t=this.$o)==null||t.forEach((t=>{(r?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[Hn],t=this.Oo,n=this.instance.hr()&&!this.Lo;if(I(t)&&!he(e)&&!n)return!1;var r=this.Oo??!!e;return!!this.instance.config.autocapture&&!r}qo(t,n){if(n===void 0&&(n=`$autocapture`),this.isEnabled){var r,i=Ui(t);Fi(i)&&(i=i.parentNode||null),n===`$autocapture`&&t.type===`click`&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&$i(i,this.instance.config.rageclick)&&this.qo(t,`$rageclick`);var a=n===oc;if(i&&function(t,n,r,i,a,o){if(!e||ea(t)||r!=null&&r.url_allowlist&&!zi(r.url_allowlist,o)||r!=null&&r.url_ignorelist&&zi(r.url_ignorelist,o))return!1;if(r!=null&&r.dom_event_allowlist){var s=r.dom_event_allowlist;if(s&&!s.some((e=>n.type===e)))return!1}var c=ta(t,i),l=c.parentIsUsefulElement,u=c.targetElementList;if(!function(e,t){var n=t?.element_allowlist;if(P(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(u,r)||!Gi(u,r?.css_selector_allowlist)||Gi(u,r?.css_selector_ignorelist??qi))return!1;try{var d=e.getComputedStyle(t);if(d&&d.getPropertyValue(`cursor`)===`pointer`&&n.type===`click`)return!0}catch{}var f=t.tagName.toLowerCase();switch(f){case`html`:return!1;case`form`:return(a||[`submit`]).indexOf(n.type)>=0;case`input`:case`select`:case`textarea`:return(a||[`change`,`click`]).indexOf(n.type)>=0;default:return l?(a||[`click`]).indexOf(n.type)>=0:(a||[`click`]).indexOf(n.type)>=0&&(Wi.indexOf(f)>-1||t.getAttribute(`contenteditable`)===`true`)}}(i,t,this.qe,a,a?[`copy`,`cut`]:void 0,this.instance)){var o=uc(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qe.element_attribute_ignorelist,elementsChainAsString:this.Do,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),s=o.props;if(o.explicitNoCapture)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(s.$element_selectors=c),n===oc){var l,u=Vi(e==null||(l=e.getSelection())==null?void 0:l.toString()),d=t.type||`clipboard`;if(!u)return!1;s.$selected_content=u,s.$copy_type=d}return this.instance.capture(n,s),!0}}}isBrowserSupported(){return M(r?.querySelectorAll)}},historyAutocapture:class{constructor(t){var n;this._instance=t,this.jo=(e==null||(n=e.location)==null?void 0:n.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(B.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.Bo&&this.Bo(),this.Bo=void 0,B.info(`History API monitoring stopped`)}monitorHistoryChanges(){e&&e.history&&(this.Ho(`pushState`),this.Ho(`replaceState`),this.Uo())}Ho(t){var n;if(e&&((n=e.history[t])==null||!n.__posthog_wrapped__)){var r=this;(function(e,t,n){try{if(!(t in e))return fc;var r={next:e[t]},i=n((function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return r.next.apply(this,t)}));return M(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=i,()=>{if(e[t]!==i)for(var n=e[t];M(n)&&n.__posthog_layer__;){var a=n.__posthog_layer__;if(a.next===i)return void(a.next=r.next);n=a.next}else e[t]=r.next}}catch{return fc}})(e.history,t,(e=>function(n,i,a){e.call(this,n,i,a),r.zo(t)}))}}zo(t){try{var n,r=e==null||(n=e.location)==null?void 0:n.pathname;if(!r)return;r!==this.jo&&this.isEnabled&&this._instance.capture(Wr,{navigation_type:t}),this.jo=r}catch(e){B.error(`Error capturing `+t+` pageview`,e)}}Uo(){if(!this.Bo){var t=()=>{this.zo(`popstate`)};J(e,`popstate`,t),this.Bo=()=>{e&&e.removeEventListener(`popstate`,t)}}}},heatmaps:class{get qe(){return this.instance.config}constructor(e){var t;this.Wo=!1,this.Fo=!1,this.Vo=null,this.instance=e,this.Wo=!((t=this.instance.persistence)==null||!t.props[Un]),this.rageclicks=new ac(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return N(this.qe.capture_heatmaps)&&this.qe.capture_heatmaps.flush_interval_milliseconds&&(e=this.qe.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return L(this.qe.capture_heatmaps)?L(this.qe.enable_heatmaps)?this.Wo:this.qe.enable_heatmaps:!1!==this.qe.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Fo)return;Sc.info(`starting...`),this.Zo(),this.Ee()}else clearInterval(this.Vo??void 0),this.Go(),this.getAndClearBuffer()}onRemoteConfig(e){if(e.ok){var t=e.config;if(`heatmaps`in t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Un]:n}),this.Wo=n,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Qo(e){Cc(e.originalEvent)&&this.ke(e.originalEvent,`deadclick`)}Ee(){this.Vo&&clearInterval(this.Vo),this.Vo=r?.visibilityState===`visible`?setInterval(this.Ir.bind(this),this.flushIntervalMilliseconds):null}Zo(){e&&r&&(this.Jo=this.Ir.bind(this),J(e,Ur,this.Jo),this.Ko=t=>this.ke(t||e?.event),J(r,`click`,this.Ko,{capture:!0}),this.Yo=t=>this.Xo(t||e?.event),J(r,`mousemove`,this.Yo,{capture:!0}),this.tl=new ya(this.instance,_a,this.Qo.bind(this)),this.tl.startIfEnabledOrStop(),this.el=this.Ee.bind(this),J(r,Hr,this.el),this.Fo=!0)}Go(){var t;e&&r&&(this.Jo&&e.removeEventListener(Ur,this.Jo),this.Ko&&r.removeEventListener(`click`,this.Ko,{capture:!0}),this.Yo&&r.removeEventListener(`mousemove`,this.Yo,{capture:!0}),this.el&&r.removeEventListener(Hr,this.el),clearTimeout(this.il),(t=this.tl)==null||t.stop(),this.Fo=!1)}rl(t,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),o=function(t,n,r){for(var i=t;i&&Ni(i)&&!Pi(i,`body`);){if(i===r)return!1;var a=void 0;try{a=(i.ownerDocument?.defaultView??e)?.getComputedStyle(i).position}catch{return!1}if(A(n,a))return!0;i=Ki(i)}return!1}(Ui(t),[`fixed`,`sticky`],a);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:n}}ke(e,t){var n;if(t===void 0&&(t=`click`),!Mi(e.target)&&Cc(e)){var r=this.rl(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&$i(Ui(e),this.instance.config.rageclick)&&this.Gt(g({},r,{type:`rageclick`})),this.Gt(r)}}Xo(e){!Mi(e.target)&&Cc(e)&&(clearTimeout(this.il),this.il=setTimeout((()=>{this.Gt(this.rl(e,`mousemove`))}),500))}Gt(t){if(e){var n=this.qe.disable_capture_url_hashes?Pt(e.location.href):e.location.href,r=this.qe.custom_personal_data_properties,i=Ma(n,this.qe.mask_personal_data_properties?[...La,...r||[]]:[],za);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(t)}}Ir(){this.R&&!fe(this.R)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ya,webVitalsAutocapture:class{constructor(e){var t;this.Wo=!1,this.Fo=!1,this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.nl=()=>{clearTimeout(this.sl),this.sl=void 0,this.R.metrics.length!==0&&(this._instance.capture(`$web_vitals`,g({$current_url:this.R.url},this.R.metrics.reduce(((e,t)=>g({},e,{[`$web_vitals_`+t.name+`_event`]:g({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{}))),this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.al=e=>{if(this.R=this.R||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},L(e?.name)||L(e?.value))mc.error(`Invalid metric received`,e);else{var t=typeof e.navigationURL==`string`?e.navigationURL:void 0,n=this.ol(t);if(!P(n)){var r=R(e.navigationId)||typeof e.navigationId==`string`?`navigation:`+e.navigationId:`url:`+n;if(!this.ll||this.ll>e.value){this.R.navigationKey!==r&&(this.nl(),this.sl=setTimeout(this.nl,this.flushToCaptureTimeoutMs)),P(this.R.navigationKey)&&(this.R.navigationKey=r,this.R.url=n),this.R.firstMetricTimestamp=P(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var i=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0),a=g({},e,t?{navigationURL:n}:{},{$current_url:n,timestamp:Date.now()});P(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.nl()}else mc.error(`Ignoring metric with value >= `+this.ll,e)}}},this.ul=()=>{if(!this.Fo){var e,t,n,r,i=f.__PosthogExtensions__,a=i?.postHogWebVitalsCallbacksByFlavor,o=a?.[this.hl]||(this.hl===`web-vitals`&&P(a)?i?.postHogWebVitalsCallbacks:void 0);if(P(o)||(e=o.onLCP,t=o.onCLS,n=o.onFCP,r=o.onINP),e&&t&&n&&r){var s={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.al.bind(this),s),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.al.bind(this),s),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.al.bind(this),s),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.al.bind(this),s),this.Fo=!0}else mc.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.Wo=!((t=this._instance.persistence)==null||!t.props[qn]),this.startIfEnabled()}get dl(){return this._instance.config.capture_performance}get allowedMetrics(){var e=N(this.dl)?this.dl?.web_vitals_allowed_metrics:void 0;return L(e)?this._instance.persistence?.props[Xn]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(N(this.dl)?this.dl.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=N(this.dl)?this.dl.web_vitals_attribution:void 0;return e!=null&&e}get useSoftNavs(){var e=N(this.dl)?this.dl.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get ll(){var e=N(this.dl)&&R(this.dl.__web_vitals_max_value)?this.dl.__web_vitals_max_value:hc;return e>0&&6e4>=e?hc:e}get isEnabled(){var e=i?.protocol;if(e!==`http:`&&e!==`https:`)return mc.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=N(this.dl)?this.dl.web_vitals:he(this.dl)?this.dl:void 0;return he(t)?t:this.Wo}startIfEnabled(){this.isEnabled&&!this.Fo&&(mc.info(`enabled, starting...`),this.di(this.ul))}onRemoteConfig(e){if(e.ok){var t=e.config;if(`capturePerformance`in t){var n=N(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=N(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[qn]:n}),this._instance.persistence.register({[Xn]:r})),this.Wo=n,this.startIfEnabled()}}}get hl(){return this.useSoftNavs?this.useAttribution?`web-vitals-with-attribution-soft-navs`:`web-vitals-soft-navs`:this.useAttribution?`web-vitals-with-attribution`:`web-vitals`}di(e){var t=f.__PosthogExtensions__,n=this.hl,r=t?.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n===`web-vitals`&&P(r)&&t!=null&&t.postHogWebVitalsCallbacks?e():t==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,n,(t=>{t?mc.error(`failed to load script`,t):e()}))}ol(t){var n=t||e?.location.href;if(n){var r=this._instance.config.disable_capture_url_hashes?Pt(n):n,i=this._instance.config.custom_personal_data_properties;return Ma(r,this._instance.config.mask_personal_data_properties?[...La,...i||[]]:[],za)}mc.error(`Could not determine current URL`)}}},ol={exceptionObserver:class{constructor(t){var n;this.ul=()=>{var t;if(e&&this.isEnabled&&(t=f.__PosthogExtensions__)!=null&&t.errorWrappingFunctions){var n=f.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=f.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=f.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.vl&&this.qe.capture_unhandled_errors&&(this.vl=n(this.captureException.bind(this))),!this.cl&&this.qe.capture_unhandled_rejections&&(this.cl=r(this.captureException.bind(this))),!this.fl&&this.qe.capture_console_errors&&(this.fl=i(this.captureException.bind(this)))}catch(e){dc.error(`failed to start`,e),this.pl()}}},this._instance=t,this.gl=!((n=this._instance.persistence)==null||!n.props[Wn]),this.ml=new Oe(g({},function(e){return e===void 0&&(e={}),{refillRate:e.exceptionRateLimiterRefillRate??e.__exceptionRateLimiterRefillRate??1,bucketSize:e.exceptionRateLimiterBucketSize??e.__exceptionRateLimiterBucketSize??10}}(this._instance.config.error_tracking),{refillInterval:1e4,st:dc})),this.qe=this.yl(),this.startIfEnabledOrStop()}yl(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return N(e)?t=g({},t,e):(P(e)?this.gl:e)&&(t=g({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qe.capture_console_errors||this.qe.capture_unhandled_errors||this.qe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(dc.info(`enabled`),this.pl(),this.di(this.ul)):this.pl()}di(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.errorWrappingFunctions?e():(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return dc.error(`failed to load script`,t);e()}))}pl(){var e,t,n;(e=this.vl)==null||e.call(this),this.vl=void 0,(t=this.cl)==null||t.call(this),this.cl=void 0,(n=this.fl)==null||n.call(this),this.fl=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;`autocaptureExceptions`in t&&(this.gl=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Wn]:this.gl}),this.qe=this.yl(),this.startIfEnabledOrStop())}}onConfigChange(){this.qe=this.yl()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.ml.consumeRateLimit(r)?dc.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.bl=[],this._l=new en([new pn,new Cn,new hn,new mn,new xn,new bn,new _n,new Sn],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(`
|
|
3
|
+
`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=fn.test(s)?s.replace(fn,`$1`):s;if(!c.match(/\S*Error: /)){for(var l of n){var u=l(c,e);if(u){i.push(u);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return g({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||tn});var n}))}(i)}}(`web:javascript`,cn,dn)),this._instance=e,this.bl=this._instance.persistence?.get_property(Gn)??[],this.wl=On(this.kl()),this.xl=new kn(this.wl)}onConfigChange(){this.wl=On(this.kl()),this.xl.setConfig(this.wl)}onRemoteConfig(e){if(e.ok){var t=e.config;if(`errorTracking`in t){var n=t.errorTracking?.suppressionRules??[],r=t.errorTracking?.captureExtensionExceptions;this.bl=n,this._instance.persistence&&this._instance.persistence.register({[Gn]:this.bl,[Kn]:r})}}}get Sl(){var e,t=!!this._instance.get_property(Kn);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this._l.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.wl.enabled)try{if(!F(e)||e.trim().length===0)return void Kc.warn(`Ignoring exception step because message must be a non-empty string`);var n=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((n,r)=>En.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this.Cl(t)),r=n.sanitizedProperties,i=n.droppedKeys;i.length>0&&Kc.warn(`Ignoring reserved exception step fields`,{droppedKeys:i}),this.xl.add(g({[wn]:e,[Tn]:new Date().toISOString()},r))}catch(e){Kc.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Ml(t)){if(this.Tl(t))return this.El(`Exception dropped: matched a suppression rule`),void Kc.info(`Skipping exception capture because a suppression rule matched`);if(!this.Sl&&this.Il(t))return this.El(`Exception dropped: thrown by a browser extension`),void Kc.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Pl(t))return this.El(`Exception dropped: thrown by the PostHog SDK`),void Kc.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.wl.enabled&&L(e.$exception_steps)?this.Rl(e):e,r=typeof(a=globalThis._posthogReleaseId)==`string`&&a.length>0?a:void 0;r&&(n.$release_id=r);try{var i=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,vs:!0});return i&&this.xl.clear(),i}catch(e){Kc.error(`Failed to capture exception event. Dropping this exception.`,e),this.xl.clear();return}}catch(e){Kc.error(`Failed to process exception event. Ignoring this exception.`,e);return}var a}Rl(e){try{var t=this.xl.getAttachable();return t.length===0?e:g({},e,{$exception_steps:t})}catch(t){return Kc.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}El(e){this.wl.enabled&&this.xl.add({[wn]:e,[Tn]:new Date().toISOString()})}Cl(e){return N(e)?g({},e):{}}kl(){return this._instance.config.error_tracking?.exception_steps??{}}Tl(e){if(e.length===0)return!1;try{var t=e.reduce(((e,t)=>{var n=t.type,r=t.value;return F(n)&&n.length>0&&e.$exception_types.push(n),F(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.bl.some((e=>{var n=e.values.map((e=>{var n=ws[e.operator],r=t[e.key];if(!n||!r)return!1;var i=j(e.value)?e.value:[e.value];return i.length>0&&n(i,r)}));return e.type===`OR`?n.some(Boolean):n.every(Boolean)}))}catch(e){return Kc.warn(`Failed to evaluate suppression rules. Capturing the exception.`,e),!1}}Il(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>{var t=e.filename;return!!t&&qc.some((e=>t.startsWith(e)))}))}Pl(e){if(e.length>0){var t,n,r=e[0].stacktrace?.frames??[],i=r[r.length-1];return(t=i==null||(n=i.filename)==null?void 0:n.includes(`posthog.com/static`))!=null&&t}return!1}Ml(e){return!L(e)&&j(e)}}},sl=g({productTours:class{get jr(){return this._instance.persistence}constructor(e){this.Al=null,this.Fl=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if(`productTours`in t){var n;if(this.jr&&this.jr.register({[Yn]:!!t.productTours}),!Tc(this._instance))return!this.Al&&L(this.jr?.props[Sr])||wc.info(`product tours disabled; stopping and clearing cached tours`),(n=this.Al)==null||n.stop(),this.Al=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Al&&Tc(this._instance)&&this.di((()=>this.Ol()))}di(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?wc.error(`Could not load product tours script`,t):e()}))}Ol(){var e;!this.Al&&(e=f.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Al=f.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!j(this.Fl)||t){var n=this.jr;if(n){var r=n.props[Sr];if(j(r)&&!t)return this.Fl=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`,timestampMode:`query`,callback:t=>{if(Tc(this._instance)){var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;r===0?t.error||wc.warn(i):wc.error(i),e([],{isLoaded:!1,error:i});return}var a=j(t.json.product_tours)?t.json.product_tours:[];this.Fl=a,n&&n.register({[Sr]:a}),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Fl,{isLoaded:!0})}getActiveProductTours(e){L(this.Al)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Al.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Al)==null||t.showTourById(e)}previewTour(e){this.Al?this.Al.previewTour(e):this.di((()=>{var t;this.Ol(),(t=this.Al)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Al)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Al)==null||e.nextStep()}previousStep(){var e;(e=this.Al)==null||e.previousStep()}clearCache(){var e;this.Fl=null,(e=this.jr)==null||e.unregister(Sr)}resetTour(e){var t;(t=this.Al)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Al)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Al)==null||t.cancelPendingTour(e)}}},rl),cl={siteApps:class{constructor(e){this.Ll=0,this._instance=e,this.Dl=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}$l(e,t){if(t){var n=this.globalsForEvent(t);this.Dl.push(n),this.Dl.length>1e3&&(this.Dl=this.Dl.slice(10))}}get siteAppLoaders(){var e;return(e=f._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.$l.bind(this));this.Nl=()=>{e(),this.Dl=[],this.Nl=void 0}}}globalsForEvent(e){if(!e)throw Error(`Event payload is required`);var t={},n=this._instance.get_property(`$groups`)||[],r=this._instance.get_property(`$stored_group_properties`)||{};for(var i of Object.entries(r)){var a=i[0];t[a]={id:n[a],type:a,properties:i[1]}}var o=e.$set_once,s=e.$set;return{event:g({},_(e,Ec),{properties:g({},e.properties,s?{$set:g({},e.properties?.$set??{},s)}:{},o?{$set_once:g({},e.properties?.$set_once??{},o)}:{}),elements_chain:e.properties?.$elements_chain??``,distinct_id:e.properties?.distinct_id}),person:{properties:this._instance.get_property(`$stored_person_properties`)},groups:t}}ql(e){var t=e.tagName?.toLowerCase();return t===`style`&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Dc.error(`prepare_external_dependency_stylesheet returned null`),null):t===`script`&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Dc.error(`prepare_external_dependency_script returned null`),null):e}jl(){var e;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var t=r?.defaultView,n=t==null||(e=t.Node)==null?void 0:e.prototype;if(!t||!n)return()=>{};if(this.Ll++,this.Bl)return this.Hl();var i=[],a=this,o=new WeakSet,s=(e,t,n)=>{if(e!=null&&e[t]){var r=e[t];e[t]=n(r),i.push((()=>{e[t]=r}))}},c=e=>{if(o.has(e))return e;var t=a.ql(e);return t&&o.add(t),t},l=e=>e.map((e=>typeof e==`string`?e:c(e))).filter((e=>!I(e)));return s(n,`appendChild`,(e=>function(t){var n=c(t);return n?e.call(this,n):t})),s(n,`insertBefore`,(e=>function(t,n){var r=c(t);return r?e.call(this,r,n):t})),s(n,`replaceChild`,(e=>function(t,n){var r=c(t);return r?e.call(this,r,n):n})),[t.Element?.prototype,t.Document?.prototype,t.DocumentFragment?.prototype].forEach((e=>{s(e,`append`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,l(n))})),s(e,`prepend`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,l(n))}))})),[t.Element?.prototype,t.CharacterData?.prototype,t.DocumentType?.prototype].forEach((e=>{s(e,`before`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,l(n))})),s(e,`after`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,l(n))})),s(e,`replaceWith`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=l(n);return n.length&&!i.length?void 0:e.apply(this,i)}))})),s(t.Element?.prototype,`insertAdjacentElement`,(e=>function(t,n){var r=c(n);return r?e.call(this,t,r):null})),this.Bl=()=>{i.forEach((e=>e())),this.Bl=void 0},this.Hl()}Hl(){var e=!1;return()=>{var t;e||(e=!0,this.Ll--,this.Ll===0&&((t=this.Bl)==null||t.call(this)))}}Ul(e,t){t===void 0&&(t=!0);var n=this.jl();try{var r=e(n);return t&&n(),r}catch(e){throw n(),e}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.Dl.length&&(Dc.info(`Processing `+this.Dl.length+` events for site app with id `+e.id),this.Dl.forEach((e=>this.Ul((()=>t.processEvent==null?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.Nl)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,Dc.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var a=this.Ul((t=>e.init({posthog:this._instance,callback(e){t(),i(e)}})),!1).processEvent;a&&(t.processEvent=a),r=!0}catch(t){Dc.error(Oc+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){Dc.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}zl(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Wl(e){var t=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e),r=function(r){try{t.Ul((()=>r.processEvent==null?void 0:r.processEvent(n)))}catch(t){Dc.error(`Error while processing event `+e.event+` for site app `+r.id,t)}};for(var i of Object.values(this.apps))r(i)}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.zl(),void this._instance.on(`eventCaptured`,(e=>this.Wl(e)))):void Dc.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.Nl)==null||n.call(this),e.ok){var a=e.config;if((r=a.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(){var e,t=s.id,n=s.url;f[`__$$ph_site_app_`+t]=i._instance,(e=f.__PosthogExtensions__)==null||e.loadSiteApp==null||e.loadSiteApp(i._instance,n,(e=>{if(e)return Dc.error(Oc+t,e)}))};for(var s of a.siteApps)o()}else Dc.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}}},ll={tracingHeaders:class{constructor(e){this.Vl=void 0,this.Zl=void 0,this.Gl=void 0,this.ul=()=>{var e,t,n=this.Ql();n?(P(this.Vl)&&(this.Vl=(e=f.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),P(this.Zl)&&(this.Zl=(t=f.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.pl()},this._instance=e}initialize(){this.startIfEnabledOrStop()}di(e){var t,n;(t=f.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=f.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return pc.error(`failed to load script`,t);e()}))}Jl(){return this._instance.config.tracing_headers??this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}Ql(){var e=this.Jl();return j(e)?(j(this.Gl)?this.Gl.splice(0,this.Gl.length,...e):this.Gl=[...e],e.length>0?this.Gl:void 0):(j(this.Gl)&&this.Gl.splice(0),this.Gl=e||void 0,this.Gl)}pl(){var e,t;(e=this.Vl)==null||e.call(this),(t=this.Zl)==null||t.call(this),this.Vl=void 0,this.Zl=void 0}startIfEnabledOrStop(){this.Ql()?this.di(this.ul):this.pl()}}},ul=g({surveys:class{get qe(){return this._instance.config}constructor(e){this.Kl=void 0,this._surveyManager=null,this.Yl=!1,this.Xl=[],this.tu=null,this.eu=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qe.disable_surveys){if(!e.ok)return $.warn(`Remote config unavailable. Not loading surveys.`);var t=e.config.surveys;if(L(t))return $.warn(`Flags not loaded yet. Not loading surveys.`);var n=j(t);this.Kl=n?t.length>0:t,$.info(`flags response received, isSurveysEnabled: `+this.Kl),this.loadIfEnabled()}}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem(`lastSeenSurveyDate`);for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Ns)||r!=null&&r.startsWith(`inProgressSurvey_`))&&t.push(r)}t.forEach((e=>localStorage.removeItem(e)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Yl)$.info(`Already initializing surveys, skipping...`);else if(this.qe.disable_surveys)$.info(Pc);else if(this.qe.cookieless_mode&&this._instance.consent.isOptedOut())$.info(`Not loading surveys in cookieless mode without consent.`);else{var e=f?.__PosthogExtensions__;if(e){if(!P(this.Kl)||this.qe.advanced_enable_surveys){var t=this.Kl||this.qe.advanced_enable_surveys;this.Yl=!0;try{var n=e.generateSurveys;if(n)return void this.iu(n,t);var r=e.loadExternalDependency;if(!r)return void this.ru(Rr);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.ru(`Could not load surveys script`,n):this.iu(e.generateSurveys,t)}))}catch(e){throw this.ru(`Error initializing surveys`,e),e}finally{this.Yl=!1}}}else $.error(`PostHog Extensions not found.`)}}iu(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Mc(this._instance),$.info(`Surveys loaded successfully`),this.nu({isLoaded:!0})}ru(e,t){$.error(e,t),this.nu({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Xl.push(e),this._surveyManager&&this.nu({isLoaded:!0}),()=>{this.Xl=this.Xl.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.qe.disable_surveys)return $.info(Pc),e([]);var n,r=this._instance.get_property(_r);if(r&&!t)return e(r,{isLoaded:!0}),void(this.su()&&this.getSurveys((()=>{}),!0));typeof Promise<`u`&&this.tu?this.tu.then((t=>e(t.surveys,t.context))):(typeof Promise<`u`&&(this.tu=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.qe.token),method:`GET`,timestampMode:`query`,timeout:this.qe.surveys_request_timeout_ms,callback:t=>{var r;this.tu=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;i===0?t.error||$.warn(a):$.error(a),this.eu=Date.now();var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}this.eu=null;var s,c=t.json.surveys||[],l=c.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(Ms(e)||function(e){var t;return!((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null||!t.length)}(e))));l.length>0&&((s=this._surveyEventReceiver)==null||s.register(l)),(r=this._instance.persistence)==null||r.register({[_r]:c,[vr]:Date.now()});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}su(){return this.au()&&!this.tu&&!this.ou()}au(){var e=this._instance.get_property(vr);return R(e)&&Date.now()-e>3e5}ou(){return R(this.eu)&&3e5>Date.now()-this.eu}markSurveyAsSeen(e,t){Ps({id:e,current_iteration:t?.iteration??null});try{localStorage.setItem(`lastSeenSurveyDate`,new Date().toISOString())}catch{}}nu(e){for(var t of this.Xl)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){$.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!L(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);$.warn(`init was not called`)}lu(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}uu(e){if(L(this._surveyManager))return{eligible:!1,reason:Nc};var t=typeof e==`string`?this.lu(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}hu(e){if(L(this._surveyManager))return{eligible:!1,reason:Nc};var t=typeof e==`string`?this.lu(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(L(this._surveyManager))return $.warn(`init was not called`),{visible:!1,disabledReason:Nc};var t=this.hu(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return L(this._surveyManager)?($.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:Nc})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.hu(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var i;if(L(this._surveyManager))$.warn(`init was not called`);else{var a=typeof e==`string`?this.lu(e):e;if(a!=null&&a.id)if(Fs.includes(a.type)){var o=r?.querySelector(t);if(o)return(i=a.appearance)!=null&&i.surveyPopupDelaySeconds?($.info(`Rendering survey `+a.id+` with delay of `+a.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;$.info(`Rendering survey `+a.id+` with delay of `+a.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(a,o,n),$.info(`Survey `+a.id+` rendered`)}),1e3*a.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(a,o,n);$.warn(`Survey element not found`)}else $.warn(`Surveys of type `+a.type+` cannot be rendered in the app`);else $.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(L(this._surveyManager))$.warn(`init was not called`);else{var r=this.lu(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=g({},r,{appearance:g({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==lo.Popover&&t.initialResponses&&$.warn(`initialResponses is only supported for popover surveys. prefill will not be applied.`),!1===t.ignoreConditions){var a=this.uu(r);if(!a.eligible)return void $.warn(`Survey is not eligible to be displayed: `,a.reason)}t.displayType===lo.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else $.warn(`Survey not found`)}}cancelPendingSurvey(e){L(this._surveyManager)?$.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload==null||e.handlePageUnload()}}},rl),dl={toolbar:class{constructor(e){this.instance=e}du(e){f.ph_toolbar_state=e}vu(){return f.ph_toolbar_state??0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,n,i){if(t===void 0&&(t=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),ti(this.instance.config)||!e||!r)return!1;t??=e.location,i??=e.history;try{if(!n){try{e.localStorage.setItem(`test`,`test`),e.localStorage.removeItem(`test`)}catch{return!1}n=e?.localStorage}var a,o=Fc||Na(t.hash,`__posthog`)||Na(t.hash,`state`),s=o?Xr((()=>JSON.parse(atob(decodeURIComponent(o)))))||Xr((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action===`ph_authorize`?((a=s).source=`url`,a&&Object.keys(a).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,``,t.pathname+t.search):t.hash=``)):((a=JSON.parse(n.getItem(Ic)||`{}`)).source=`localstorage`,delete a.userIntent),!(!a.token||this.instance.config.token!==a.token||(this.loadToolbar(a),0))}catch{return!1}}cu(e){var t=f.ph_load_toolbar||f.ph_load_editor;!L(t)&&M(t)?t(e,this.instance):Lc.warn(`No toolbar load function found`)}loadToolbar(t){var n=!(r==null||!r.getElementById(Oi));if(!e||n)return!1;var i=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,a=g({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},i?{instrument:!1}:{});if(e.localStorage.setItem(Ic,JSON.stringify(g({},a,{source:void 0}))),this.vu()===2)this.cu(a);else if(this.vu()===0){var o;this.du(1),(o=f.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return Lc.error(`[Toolbar] Failed to load`,e),void this.du(0);this.du(2),this.cu(a)})),J(e,`turbolinks:load`,(()=>{this.du(0),this.loadToolbar(a)}))}return!0}fu(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},fl=g({experiments:Xc},rl),pl=g({},rl,il,al,ol,sl,cl,ul,ll,dl,fl,{conversations:class{constructor(e){this.pu=void 0,this._conversationsManager=null,this.gu=!1,this.mu=null,this.yu=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.bu=e.ok,e.ok)){var t=e.config.conversations;L(t)||(he(t)?this.pu=t:(this.pu=t.enabled,this.mu=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.pu=void 0,this.mu=null,this.bu=void 0,this.yu=!1}loadIfEnabled(){if(!(this._conversationsManager||this.gu||this._instance.config.disable_conversations||ti(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=f?.__PosthogExtensions__;if(e&&!P(this.pu)&&this.pu)if(this.mu&&this.mu.token){this.gu=!0;try{var t=e.initConversations;if(t)return this._u(t),void(this.gu=!1);var n=e.loadExternalDependency;if(!n)return void this.wu(Rr);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.wu(`Could not load conversations script`,t):this._u(e.initConversations),this.gu=!1}))}catch(e){this.wu(`Error initializing conversations`,e),this.gu=!1}}else Zc.error(`Conversations enabled but missing token in remote config.`)}}_u(e){if(this.mu)try{this._conversationsManager=e(this.mu,this._instance),this.yu=!1,Zc.info(`Conversations loaded successfully`)}catch(e){this.wu(`Error completing conversations initialization`,e)}else Zc.error(`Cannot complete initialization: remote config is null`)}wu(e,t){Zc.error(e,t),this._conversationsManager=null,this.gu=!1,this.yu=!0}show(){this._conversationsManager?this._conversationsManager.show():Zc.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.pu&&!I(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?`disabled_by_config`:ti(this._instance.config)?`disabled_for_toolbar`:this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?`consent_opted_out`:!1===this.bu?`remote_config_failed`:P(this.pu)?this.bu?`disabled_in_project`:`remote_config_pending`:this.pu?L(this.mu)||!this.mu.token?`missing_token`:f!=null&&f.__PosthogExtensions__?this.gu?`initializing`:this.yu?`load_failed`:`not_loaded`:`extensions_unavailable`:`disabled_in_project`}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return h((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(Zc.warn(Qc),null)}))()}getMessages(e,t){var n=this;return h((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(Zc.warn(Qc),null)}))()}markAsRead(e){var t=this;return h((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Zc.warn(Qc),null)}))()}getTickets(e){var t=this;return h((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Zc.warn(Qc),null)}))()}requestRestoreLink(e){var t=this;return h((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Zc.warn(Qc),null)}))()}restoreFromToken(e){var t=this;return h((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Zc.warn(Qc),null)}))()}restoreFromUrlToken(){var e=this;return h((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Zc.warn(Qc),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}ks(){var e;(e=this._conversationsManager)==null||e.setIdentity()}xs(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(t){var n,r=this;this.ku=!1,this.xu=!1,this.st=V(`[logs]`),this.Su=g({},this.st,{error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];t.some(nl)||r.st.error(...t)}}),this.gr=[],this.Cu=[],this.za=0,this.Mu=()=>{var e,t;this.za=0,(e=this.Tu)==null||e.onReconnect(),(t=this.Eu)==null||t.onReconnect()},this._instance=t,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.ku=!0),e&&J(e,`online`,this.Mu)}Iu(e,t,n,r){var i,a=function(e,t){var n=e?.flushIntervalMs??3e3,r=e?.maxBufferSize??100,i=t!=null&&t.consoleCapture?void 0:e?.maxLogsPerInterval??1e3,a=P(i)?Math.max(r,2048):Math.max(r,i),o=e?.resourceAttributes;return{serviceName:o?.[`service.name`]??e?.serviceName??t?.serviceNameDefault,serviceVersion:o?.[`service.version`]??e?.serviceVersion,environment:o?.[`deployment.environment`]??e?.environment,resourceAttributes:o,beforeSend:e?.beforeSend,flushIntervalMs:n,maxBufferSize:r,maxQueueSize:a,maxBatchRecordsPerPost:100,rateCapWindowMs:n,maxLogsPerInterval:i,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,n);return[new Gt(this.Pu(e,t),a,this.Su,(()=>this.Ru()),(e=>e()),void 0,r),a]}Au(){var e,t=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;if(!this.Tu||this.Fu!==t){var n;(n=this.Tu)==null||n.reset(),this.Fu=t;var r=this.Iu((()=>this.gr),(e=>{this.gr=e}));this.Tu=r[0],this.Ou=r[1]}return this.Tu}Lu(){var e,t=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;if(!this.Eu||this.Du!==t){var n;(n=this.Eu)==null||n.reset(),this.Du=t;var r=this.Iu((()=>this.Cu),(e=>{this.Cu=e}),{serviceNameDefault:`posthog-browser-logs`,consoleCapture:!0},$c);this.Eu=r[0],this.$u=r[1]}return this.Eu}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config.logs?.captureConsoleLogs;!L(t)&&t&&(this.ku=!0,this.loadIfEnabled())}}reset(){var e,t;this.gr=[],(e=this.Tu)==null||e.reset(),this.Cu=[],(t=this.Eu)==null||t.reset(),this.za=0}captureLog(e){this.Au().captureLog(e)}he(e){this.Lu().captureLog(e)}get logger(){return this.Nu||={trace:(e,t)=>this.captureLog({body:e,level:`trace`,attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:`debug`,attributes:t}),info:(e,t)=>this.captureLog({body:e,level:`info`,attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:`warn`,attributes:t}),error:(e,t)=>this.captureLog({body:e,level:`error`,attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:`fatal`,attributes:t})},this.Nu}flushLogs(e){e?this.qu(e):(this.Tu&&this.Tu.flush().catch((e=>this.ju(e))),this.Eu&&this.Eu.flush().catch((e=>this.ju(e))))}ju(e){nl(e)||this.st.error(`PostHog logs flush failed:`,e)}loadIfEnabled(){if(this.ku&&!this.xu){var e=f?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.st.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.xu=!0)})):this.st.error(Rr)}else this.st.error(`PostHog Extensions not found.`)}}Pu(e,t){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:t=>t===C.LogsQueue?e():void 0,setPersistedProperty(e,n){e===C.LogsQueue&&t(n??[])},$t:e=>this.$t(e),getLibraryId:()=>p.LIB_NAME,getLibraryVersion:()=>p.LIB_VERSION}}$t(e){return new Promise((t=>{if(Pa(this.za,3))t({kind:`fatal`,error:tl(void 0,`logs endpoint is unreachable, dropping batch`)});else{var n=!1,r=e=>{n||(n=!0,clearTimeout(i),t(e))},i=setTimeout((()=>{this.st.warn(`Logs request timed out before receiving a response`),r({kind:`retry-later`,error:tl(void 0,`logs request timed out`)})}),9e4);this._instance._send_request({method:`POST`,url:this.Bu(),data:e,compression:`best-available`,batchKey:`logs`,fireCallbackOnDrop:!0,callback:e=>{var t=e.statusCode;this.Hu(t),t>=200&&300>t?r({kind:`ok`}):t===413?r({kind:`too-large`}):t!==0&&t!==429&&500>t?r({kind:`fatal`,error:Error(`logs request failed with status `+t)}):t===0?(e.error||this.st.warn(`Logs request failed before receiving an HTTP response`),r({kind:`retry-later`,error:tl(e.error,`logs request failed before receiving an HTTP response`)})):r({kind:`retry-later`,error:e.error??Error(`logs request failed with status `+t)})}})}}))}Hu(e){(e!==0||this._instance.__loaded)&&(this.za=Fa(e,this.za,3,(()=>this.st.warn(`Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.`))))}qu(e){this.gr.length>0&&this.Uu(e,this.gr,this.Ou,p.LIB_NAME,(e=>{this.gr=e})),this.Cu.length>0&&this.Uu(e,this.Cu,this.$u,$c,(e=>{this.Cu=e}))}Uu(e,t,n,r,i){if(t.length!==0){var a=t.map((e=>e.record));i([]);var o=Wt(a,Ut(n,p.LIB_NAME,p.LIB_VERSION),r,p.LIB_VERSION);this._instance._send_request({method:`POST`,url:this.Bu(),data:o,compression:`best-available`,batchKey:`logs`,transport:e})}}Bu(){return this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token)}Ru(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,i=n.sessionStartTimestamp,a=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=r,L(i)||(t.sessionStartTimestamp=i),L(a)||(t.lastActivityTimestamp=a)}if(f!=null&&(e=f.location)!=null&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?Pt(f.location.href):f.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},{metrics:class{constructor(e){this.st=V(`[metrics]`),this._instance=e}initialize(){}Au(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.metrics;return this.Tu&&this.Fu===n||((t=this.Tu)==null||t.reset(),this.Fu=n,this.Tu=new Yt(this.Pu(),function(e){var t=e?.resourceAttributes;return{serviceName:t?.[`service.name`]??e?.serviceName,serviceVersion:t?.[`service.version`]??e?.serviceVersion,environment:t?.[`deployment.environment`]??e?.environment,resourceAttributes:t,beforeSend:e?.beforeSend,flushIntervalMs:e?.flushIntervalMs??1e4,maxSeriesPerFlush:e?.maxSeriesPerFlush??1e3}}(n),this.st)),this.Tu}count(e,t,n){t===void 0&&(t=1),this.Au().count(e,t,n)}gauge(e,t,n){this.Au().gauge(e,t,n)}histogram(e,t,n){this.Au().histogram(e,t,n)}flush(e){if(!this.Tu)return Promise.resolve();if(e){var t=this.Tu.drainWindow();return t&&this.Xt(t,e),Promise.resolve()}return this.Tu.flush().catch((e=>this.st.error(`PostHog metrics flush failed:`,e)))}reset(){var e;(e=this.Tu)==null||e.reset()}Pu(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Xt:e=>t.Xt(e),getLibraryId:()=>p.LIB_NAME,getLibraryVersion:()=>p.LIB_VERSION}}Xt(e,t){return new Promise((n=>{var r=!1,i=e=>{r||(r=!0,clearTimeout(a),n(e))},a=setTimeout((()=>i({kind:`retry-later`,error:Error(`metrics request timed out`)})),9e4);this._instance._send_request(g({method:`POST`,url:this.zu(),data:e,compression:`best-available`,batchKey:`metrics`},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;i(t>=200&&300>t?{kind:`ok`}:t===413?{kind:`too-large`}:t!==0&&t!==429&&500>t?{kind:`fatal`,error:Error(`metrics request failed with status `+t)}:{kind:`retry-later`,error:e.error??Error(`metrics request failed with status `+t)})}}))}))}zu(){return this._instance.requestRouter.endpointFor(`api`,`/i/v1/metrics`)+`?token=`+encodeURIComponent(this._instance.config.token)}}});ic.__defaultExtensionClasses=g({},pl);var ml=function(){p.SDK_DIST_CHANNEL=`npm`;var t=Ws[Qs]=new ic;return function(){function t(){t.done||(t.done=!0,$s=!1,K(Ws,(function(e){e._dom_loaded()})))}r!=null&&r.addEventListener?r.readyState===`complete`?t():J(r,`DOMContentLoaded`,t,{capture:!1}):e&&B.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{ml as default,ml as posthog};
|
|
4
|
+
//# sourceMappingURL=module-fAFg92om.js.map
|