@noxsoft/anima 5.1.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +2 -2
- package/dist/{APEv2Parser-DV7AH14P.js → APEv2Parser-Dvsbp_2R.js} +3 -3
- package/dist/{AbstractID3Parser-C3RlCr-Y.js → AbstractID3Parser-IB9gxozg.js} +5 -5
- package/dist/{AiffParser-DaFyNU8n.js → AiffParser-R2IhrBzL.js} +4 -4
- package/dist/{AsfParser-CDCRfCXr.js → AsfParser-DJEueUMg.js} +4 -4
- package/dist/{DsdiffParser-BX31LICZ.js → DsdiffParser-DXLYn9tT.js} +4 -4
- package/dist/{DsfParser-C3JBjE-C.js → DsfParser-D2--NF0i.js} +5 -5
- package/dist/{FlacParser-DY4m-7v1.js → FlacParser-8cDAjrth.js} +5 -5
- package/dist/{ID3v1Parser-DL9AGlNt.js → ID3v1Parser-B494XuP9.js} +3 -3
- package/dist/{ID3v2Parser-Mr8o-5GJ.js → ID3v2Parser-DlxcNqv5.js} +4 -4
- package/dist/{ID3v2Token-DQqGh8AB.js → ID3v2Token-CSLSVrSQ.js} +2 -2
- package/dist/{MP4Parser-DkunlEqI.js → MP4Parser-COql2J-w.js} +6 -6
- package/dist/{MatroskaParser-IKjHx0h7.js → MatroskaParser-bNP5wC2F.js} +3 -3
- package/dist/{MpegParser-EecSeRWJ.js → MpegParser-C1gjfYqq.js} +4 -4
- package/dist/{MusepackParser-CkfsAeuE.js → MusepackParser-DBdYf7kV.js} +5 -5
- package/dist/{OggParser-z3QlSd8U.js → OggParser-CxajqbK3.js} +5 -5
- package/dist/{Util-DDVY6AaC.js → Util-BRZxoY1Q.js} +1 -1
- package/dist/{WavPackParser-PimUUBRx.js → WavPackParser-CtH9QFia.js} +4 -4
- package/dist/{WaveParser-B539YtoQ.js → WaveParser-yufLki1G.js} +5 -5
- package/dist/{accounts-CL0JV_xk.js → accounts-B_2nt5Cd.js} +2 -2
- package/dist/{accounts-CYEa4ttU.js → accounts-COxGcLGB.js} +1 -1
- package/dist/{accounts-Bj5MvaDs.js → accounts-DIES085e.js} +11 -11
- package/dist/{accounts-DZsqyow2.js → accounts-TUsfghIW.js} +38 -38
- package/dist/{acp-cli-ynoZZhYQ.js → acp-cli-CWgqDQQH.js} +6 -6
- package/dist/{acp-cli-BFAoKBvs.js → acp-cli-D0wfP8-l.js} +16 -16
- package/dist/{active-listener-BWPgtTZp.js → active-listener-BKtsWhsb.js} +4 -4
- package/dist/{active-listener-GJR3nLhX.js → active-listener-D2r8IO7g.js} +5 -5
- package/dist/{agent-DUAarfNl.js → agent-CnS0SRpT.js} +93 -236
- package/dist/{agent-CaaEZsXl.js → agent-VRQM14Xp.js} +98 -229
- package/dist/{agent-scope-C9CiVcmh.js → agent-scope-ByIGrCTT.js} +2 -2
- package/dist/{agent-scope-D3HZp64M.js → agent-scope-CXxC8FFX.js} +2 -2
- package/dist/{agent-scope-BZ8hjIt_.js → agent-scope-CxBzAozu.js} +3 -3
- package/dist/{agents-t54YcbvK.js → agents-CvMRplDx.js} +15 -13
- package/dist/{agents.config-J7iEgdW_.js → agents.config-BR5JLtud.js} +1 -1
- package/dist/{anthropic-direct-runner-B12V2Q5H.js → anthropic-direct-runner-BeYCnvZ8.js} +37 -15
- package/dist/{anthropic-direct-runner-CzQb7QkD.js → anthropic-direct-runner-C2Kwju-r.js} +29 -7
- package/dist/{audit-ByHmjh-G.js → audit-B05W5ckN.js} +23 -34
- package/dist/{audit-HJOpXfgY.js → audit-DDz7UOIx.js} +18 -15
- package/dist/{auth-DXrALxdm.js → auth-DsC5pZ_0.js} +2 -2
- package/dist/{prompts-CneQ6SeF.js → auth-choice-DY1saszS.js} +12 -107
- package/dist/{auth-choice-DPWnLV_w.js → auth-choice-Dc5TAJwT.js} +10 -9
- package/dist/{auth-health-DmrnGklu.js → auth-health-Cc8-vy8y.js} +1 -1
- package/dist/auth-health-Dhr8p2SD.js +149 -0
- package/dist/{auth-profiles-BF5x9Ej0.js → auth-profiles-Brxz2ojJ.js} +193 -42
- package/dist/{auth-profiles-DjCH4kWT.js → auth-profiles-C-LuhW6c.js} +195 -44
- package/dist/{auth-profiles-PJVsRqf4.js → auth-profiles-DKu7ZUzl.js} +189 -29
- package/dist/{auth-profiles-eZzmaeR3.js → auth-profiles-DtWUl1-k.js} +198 -38
- package/dist/{auth-store-CnRrUELz.js → auth-store-Bd0GoqEL.js} +13 -13
- package/dist/{auth-store-KnWGteIV.js → auth-store-BpYI9t_y.js} +3 -3
- package/dist/{auth-store-DjcQlyze.js → auth-store-Jvgz2_l1.js} +2 -2
- package/dist/{banner-D9JyV5SF.js → banner-DAMtSjUF.js} +1 -1
- package/dist/{bonjour-discovery-QsoaZ8Pr.js → bonjour-discovery-Co-b97Dz.js} +2 -2
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +222 -151
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +24 -24
- package/dist/{call-DHZ76BNg.js → call-B4lhqS6H.js} +3 -3
- package/dist/{call-DQjoz63V.js → call-CDPbPDAr.js} +4 -4
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{catalog-AZNRamJ4.js → catalog-CsXv59Tq.js} +2 -2
- package/dist/{channel-web-CQIbtfme.js → channel-web-B8mzTSaY.js} +15 -15
- package/dist/{channels-status-issues-DdjvFHx9.js → channels-status-issues-WkG3Tmxk.js} +4 -4
- package/dist/{chrome-HTuFjVWW.js → chrome-B8EnYGj1.js} +9 -9
- package/dist/{chrome-BNggURXT.js → chrome-BaU-H9m7.js} +3 -3
- package/dist/{chrome-Cfak4A3i.js → chrome-DLUBPBPz.js} +12 -12
- package/dist/{chunk-CyT-_QsQ.js → chunk-B4Kx-ocg.js} +11 -9
- package/dist/{chunk-Dffz_QIs.js → chunk-CFSle8n5.js} +1 -1
- package/dist/{chunk-D3vyM2EQ.js → chunk-Cy0Bj0F3.js} +1 -1
- package/dist/{chunk-DFqo_u5A.js → chunk-DJXDX69U.js} +11 -9
- package/dist/{clack-prompter-QbDK4ABC.js → clack-prompter-0JW5kry0.js} +3 -3
- package/dist/{clack-prompter-rXuqdPbx.js → clack-prompter-fZSmnHda.js} +5 -5
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-kT9Mb3dT.js → cli-D8exVpuI.js} +30 -29
- package/dist/cli-hcHk5KuP.js +102 -0
- package/dist/{cli-utils-BdkJVXjy.js → cli-utils-D2X_bDLt.js} +9 -1
- package/dist/{cli-utils-DGnL8raH.js → cli-utils-DcDBK4C5.js} +9 -1
- package/dist/{client-D9E5Wwb_.js → client-BWkoTfOH.js} +3 -2
- package/dist/{client-DzIcZx4J.js → client-CfLiulzK.js} +2 -1
- package/dist/{command-registry-vEVxxxzI.js → command-registry-D3VhxpWx.js} +21 -12
- package/dist/{commands-NIY0IDXe.js → commands-DE8FNH0v.js} +92 -20
- package/dist/{commands-eY0Ao0wt.js → commands-Mekaw9WG.js} +92 -20
- package/dist/{common-C2wAYEWA.js → common-BCW6hLGI.js} +2 -2
- package/dist/{common-BzPvZcxT.js → common-Bf_TG87Y.js} +2 -2
- package/dist/{common-6Fcbzr42.js → common-DT_obM-k.js} +2 -2
- package/dist/{completion-cli-BBKG6buM.js → completion-cli-B3BqQJq9.js} +3 -3
- package/dist/{completion-cli-C84I5l8a.js → completion-cli-CepDzeW1.js} +2 -2
- package/dist/{config-Ofh9gKvs.js → config-BrVuTQ8R.js} +14 -2
- package/dist/{config-6FVC8hW0.js → config-CweTwOtr.js} +40 -28
- package/dist/{config-DqwH4y-D.js → config-DaD4FsAn.js} +19 -7
- package/dist/{config-D2kCn7yR.js → config-ZYN8tezd.js} +18 -6
- package/dist/{config-cli-CQzq5yWB.js → config-cli-3CaIxSKo.js} +4 -4
- package/dist/config-cli-B6Np85rk.js +15 -0
- package/dist/{config-guard-B1plY6aQ.js → config-guard-C4b2dksv.js} +2 -2
- package/dist/{config-guard-CYlpjNN7.js → config-guard-CWhoBtB3.js} +20 -20
- package/dist/{config-sync-CYX9Tzyr.js → config-sync-CCVp-tVX.js} +2 -2
- package/dist/{config-sync-CDUhjDom.js → config-sync-CMO_5lyl.js} +2 -2
- package/dist/{configure-G6h2Ppk0.js → configure-D882Bg7c.js} +39 -15
- package/dist/{configure-Bv6mqD0j.js → configure-D88dg6mE.js} +79 -77
- package/dist/{configure-DxQqSUJs.js → configure-xpjwedvJ.js} +50 -49
- package/dist/{configure-B-dfdPKX.js → configure-zXK6UZ51.js} +49 -24
- package/dist/{context-CpsnZLOp.js → context-B5X720Bs.js} +1 -1
- package/dist/{control-service-D1oxSXVg.js → control-service-3CI4vt1h.js} +2 -2
- package/dist/{control-service-CzAfyR4e.js → control-service-5YtMvm7D.js} +5 -5
- package/dist/control-ui/assets/index-C4ejMN5U.js +72 -0
- package/dist/control-ui/assets/index-C4ejMN5U.js.map +1 -0
- package/dist/control-ui/assets/index-CcPNqN3R.css +1 -0
- package/dist/control-ui/assets/index-D7Bf6Say.js +3 -0
- package/dist/control-ui/assets/index-D7Bf6Say.js.map +1 -0
- package/dist/control-ui/assets/index-yhFuaOnc.js +2 -0
- package/dist/control-ui/assets/index-yhFuaOnc.js.map +1 -0
- package/dist/control-ui/assets/observers-V7q9lNYt.js +2 -0
- package/dist/control-ui/assets/observers-V7q9lNYt.js.map +1 -0
- package/dist/control-ui/assets/rrweb-plugin-console-record-sPdhR0i8.js +138 -0
- package/dist/control-ui/assets/rrweb-plugin-console-record-sPdhR0i8.js.map +1 -0
- package/dist/control-ui/assets/rrweb-record-CMVXB7aO.js +129 -0
- package/dist/control-ui/assets/rrweb-record-CMVXB7aO.js.map +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/{cron-cli-C4qZZo4e.js → cron-cli-Cht6Itx6.js} +18 -18
- package/dist/{cron-cli-CSivg2i9.js → cron-cli-D9XrF-Gx.js} +8 -8
- package/dist/{daemon-cli-DfxT-pQ4.js → daemon-cli-9zrnYRjh.js} +8 -8
- package/dist/{daemon-cli-KMzjJH_D.js → daemon-cli-CrdPhSxr.js} +15 -15
- package/dist/daemon-cli.js +34 -6
- package/dist/{daemon-runtime-CIE27usH.js → daemon-runtime-BrUj88ZO.js} +2 -2
- package/dist/{daemon-runtime-BfgstLVI.js → daemon-runtime-DCqwraWR.js} +1 -1
- package/dist/{deliver-8r6UbXnC.js → deliver-B-dPbUIs.js} +18 -28
- package/dist/{deliver-ahx1N11n.js → deliver-BKzX3YoN.js} +7 -7
- package/dist/{deliver-DVt8TbK9.js → deliver-C1L5nO0K.js} +3 -3
- package/dist/{deliver-D2hQZ9X0.js → deliver-d-CaN0uL.js} +59 -69
- package/dist/deps-DyT32VfN.js +23 -0
- package/dist/{diagnostics-DXeDqA_-.js → diagnostics-Cu9pZAFn.js} +1 -1
- package/dist/{dispatcher-DpSnqIL0.js → dispatcher-BQQugU-7.js} +1 -1
- package/dist/{dispatcher-DzT6jltc.js → dispatcher-DzwzLQRk.js} +2 -2
- package/dist/{dns-cli-D9ka2fZD.js → dns-cli-C8KIX4P3.js} +12 -12
- package/dist/{dns-cli-D2Orvc8E.js → dns-cli-V2bo6vSt.js} +3 -3
- package/dist/{docs-cli-CKfzGqYM.js → docs-cli-Bt-YV3xs.js} +2 -2
- package/dist/{docs-cli-DWYXJd-j.js → docs-cli-D2cVJxjP.js} +7 -7
- package/dist/{doctor-vXt5qjNJ.js → doctor-DEnSKgHu.js} +21 -21
- package/dist/{doctor-DumyG85t.js → doctor-WpKCNZeO.js} +36 -181
- package/dist/{doctor-completion-lAyxyd7X.js → doctor-completion-CPff9UlF.js} +2 -2
- package/dist/{doctor-completion-C8JSWfqN.js → doctor-completion-CypXc1Uo.js} +2 -2
- package/dist/{doctor-config-flow-DA50eWp5.js → doctor-config-flow-Bgl0Cc20.js} +6 -6
- package/dist/{doctor-config-flow-BjfGQ1Br.js → doctor-config-flow-Dxy7RIm0.js} +4 -4
- package/dist/{engine-BVchKo5_.js → engine-DpbYPop7.js} +9 -9
- package/dist/{engine-CKqNpVwE.js → engine-zmn3SOYa.js} +10 -9
- package/dist/entry.js +19 -28
- package/dist/{env-DVJCc7dM.js → env-DlTia1B4.js} +1 -1
- package/dist/{exec-cazBMA02.js → exec-BylR5qWS.js} +1 -1
- package/dist/{exec-gKbUce2p.js → exec-C6tXfeqA.js} +1 -1
- package/dist/{exec-Bfd4ztFZ.js → exec-DUzVF5_D.js} +7 -7
- package/dist/{exec-approvals-cli-BPwW6GIK.js → exec-approvals-cli-CN2WeH7y.js} +20 -20
- package/dist/{exec-approvals-cli-6HndodnP.js → exec-approvals-cli-DYZVBnqS.js} +8 -8
- package/dist/extensionAPI.js +22 -22
- package/dist/format-BCAtE7cT.js +20 -0
- package/dist/{frontmatter-BP4GSt5L.js → frontmatter-Dsa7N963.js} +2 -2
- package/dist/{gateway-cli-CHhTweWb.js → gateway-cli-B_xsx5Nv.js} +104 -101
- package/dist/{gateway-cli-B60L2z4a.js → gateway-cli-D3VBOA_i.js} +69 -66
- package/dist/{gateway-rpc-CrSglZPE.js → gateway-rpc-Cj_h2sVM.js} +3 -3
- package/dist/{gateway-rpc-BtOX_e53.js → gateway-rpc-CnXMGsxp.js} +3 -3
- package/dist/{gmail-setup-utils-D2uUKNlF.js → gmail-setup-utils-DaJoXV_3.js} +3 -3
- package/dist/{health-BttJ1Qeh.js → health-C8KCBhuo.js} +8 -8
- package/dist/{health-D8fJ6U_k.js → health-CabOEPQ0.js} +13 -13
- package/dist/{health-format-CH6JWH45.js → health-format-D-JJ5_S4.js} +2 -2
- package/dist/{heartbeat-visibility-DcGQOTXe.js → heartbeat-visibility-BjYY-mKG.js} +1 -1
- package/dist/{heartbeat-visibility-B2MDtPTL.js → heartbeat-visibility-ZfNSbFcq.js} +1 -1
- package/dist/{help-format-7YidDC5Z.js → help-format-Dt-I_Mls.js} +1 -1
- package/dist/{hooks-cli-DRUryj5H.js → hooks-cli-Cs7GUa7G.js} +34 -33
- package/dist/{hooks-cli-BMZF6RF3.js → hooks-cli-DOs9WZ3K.js} +56 -55
- package/dist/{hooks-status-VvwKn90L.js → hooks-status-DdweuSIj.js} +4 -4
- package/dist/{image-ops-BUy__GHL.js → image-ops-Ct3GueyT.js} +1 -1
- package/dist/index.js +79 -71
- package/dist/{init-B8PBeUpi.js → init-CFndGgTJ.js} +1 -1
- package/dist/{init-DxkAVKP0.js → init-DkBwXNme.js} +1 -1
- package/dist/{installs-sayrGjx1.js → installs-Bi6UipiE.js} +6 -6
- package/dist/{installs-BcnNDR54.js → installs-a4Vz_J08.js} +3 -3
- package/dist/ipv4-DfMwLQ0d.js +14 -0
- package/dist/{lib-D4dE4_XZ.js → lib-6xd5SQjU.js} +20 -20
- package/dist/{lifecycle-core-BerWWP7p.js → lifecycle-core-B8PI1NZJ.js} +3 -3
- package/dist/{links-OhvsEkVw.js → links-DcilUrqq.js} +1 -1
- package/dist/llm-slug-generator.js +25 -25
- package/dist/{loader-CLNb0v_s.js → loader-Bw2wdN4l.js} +159 -3
- package/dist/{loader-Bww_qb65.js → loader-C87TLS4J.js} +159 -3
- package/dist/{logging-DhXRGHWg.js → logging-Chc1Sj6N.js} +1 -1
- package/dist/{login-BovU8kno.js → login-BHnvW9HA.js} +6 -6
- package/dist/{login-BPtmlRRv.js → login-BTOKtSQN.js} +5 -5
- package/dist/{login-C54B66KM.js → login-CrMpAZ0n.js} +4 -4
- package/dist/{login-C4mptULi.js → login-DKkQ3Czu.js} +5 -5
- package/dist/{login-qr-bim3Nkyu.js → login-qr-BGbHImRb.js} +8 -8
- package/dist/{login-qr-pFbvowe5.js → login-qr-CsAVGp00.js} +12 -12
- package/dist/{login-qr-657mh7cI.js → login-qr-DILcBA_q.js} +6 -6
- package/dist/{login-qr-BxNKHxcf.js → login-qr-OUAGpDsU.js} +10 -10
- package/dist/{logs-cli-CQStwrGd.js → logs-cli-Bc6IOyHA.js} +8 -8
- package/dist/{logs-cli-De79vyiP.js → logs-cli-BiAJbjnq.js} +15 -15
- package/dist/{manager-B043uMPT.js → manager-BYu34CX3.js} +12 -12
- package/dist/{manager-Cvmm95Pf.js → manager-C6L_DH0O.js} +2 -2
- package/dist/{manager-BtrVJ8Ve.js → manager-D8VCuzru.js} +9 -9
- package/dist/{manager-A3pC-CW-.js → manager-b_aZwo00.js} +16 -16
- package/dist/{manifest-registry-D-DOtLzo.js → manifest-registry-qF960vMH.js} +1 -1
- package/dist/{memory-cli-COl5xoIl.js → memory-cli-B0kKl-9T.js} +7 -7
- package/dist/{memory-cli-691NgCXx.js → memory-cli-DLtBA6r5.js} +11 -11
- package/dist/{message-channel-DZYYDt1_.js → message-channel-CMsexA3K.js} +9 -7
- package/dist/{message-channel-DdOBO6Qm.js → message-channel-DIHHKJhk.js} +8 -6
- package/dist/{migrate-DkBWjPPs.js → migrate-DuohB_ur.js} +3 -3
- package/dist/{migrate-BLjwxe9X.js → migrate-bgeTT_GR.js} +3 -3
- package/dist/{model-auth-DKhjNVHc.js → model-auth-CHB3EySM.js} +10 -5
- package/dist/{model-auth-CxAB4iZ0.js → model-auth-KpsOXKDc.js} +3 -3
- package/dist/model-param-b-C1QDqzQp.js +16 -0
- package/dist/{model-selection-BPkpXepz.js → model-selection-CLcoOT3e.js} +25 -7
- package/dist/{model-selection-wCaVeFbb.js → model-selection-CY6r_3wt.js} +25 -7
- package/dist/{model-selection-DFbDH9o2.js → model-selection-DcO3qJOu.js} +24 -6
- package/dist/{model-selection-BI8CKPwQ.js → model-selection-DjsJGv1R.js} +67 -8
- package/dist/models-BM2_NkMu.js +2707 -0
- package/dist/models-cli-BjY8wA-C.js +272 -0
- package/dist/models-cli-BpjeKsUz.js +2946 -0
- package/dist/{node-cli-Ajhng-5p.js → node-cli-BmuVEJ1C.js} +12 -12
- package/dist/{node-cli-t3N6HE9R.js → node-cli-DU_oREff.js} +27 -27
- package/dist/{node-service-4B-0AjmA.js → node-service-qZXF7T7A.js} +1 -1
- package/dist/{note-De2zPKl3.js → note-iMYVGjpA.js} +2 -2
- package/dist/noxsoft-bootstrap-C4dSx7K_.js +77 -0
- package/dist/noxsoft-bootstrap-CrlkSFzd.js +77 -0
- package/dist/{npm-registry-spec-CFp4OEe4.js → npm-registry-spec-Br4B4I_3.js} +2 -2
- package/dist/{npm-registry-spec-DVDcgWxm.js → npm-registry-spec-jf7Mowdn.js} +1 -1
- package/dist/{onboard-xSPFmM29.js → onboard-DM9gULJN.js} +24 -19
- package/dist/{onboard-i4CJtSb9.js → onboard-_-D81kAy.js} +19 -15
- package/dist/{onboard-channels-RsbA6EaD.js → onboard-channels-CtT-RN60.js} +8 -8
- package/dist/{onboard-channels-D6Gt3CsX.js → onboard-channels-UkphAdCy.js} +4 -4
- package/dist/{onboard-helpers-IeOtcIME.js → onboard-helpers-CFudIoX4.js} +3 -3
- package/dist/{onboard-helpers-DPqXrhma.js → onboard-helpers-CJ3HzoUO.js} +7 -7
- package/dist/{onboarding-CZBVMwFn.js → onboarding-BB9PteK8.js} +20 -17
- package/dist/{onboarding-Cao0a_Z1.js → onboarding-Djmm0PEM.js} +27 -23
- package/dist/{orchestrator-COMX8CF2.js → orchestrator-C1nWKIJS.js} +7 -3
- package/dist/{orchestrator-BLXpTTgr.js → orchestrator-C2ypFiPL.js} +6 -3
- package/dist/{outbound-DWfSyfZC.js → outbound-Bmft-5um.js} +4 -4
- package/dist/{outbound-Rs0fFC2g.js → outbound-C577aWZp.js} +1 -1
- package/dist/{outbound-DLCmFGfJ.js → outbound-DW2eod1S.js} +4 -4
- package/dist/{outbound-uxBpmALx.js → outbound-fPqdCDR4.js} +4 -4
- package/dist/outbound-send-deps-DVfWC4E8.js +14 -0
- package/dist/outbound-send-deps-T_FgdfgW.js +36 -0
- package/dist/{parse-timeout-DkOL1T_l.js → parse-timeout-C4WLf3Qy.js} +3 -3
- package/dist/{parse-timeout-DlU4ymhF.js → parse-timeout-D4UO8pY_.js} +1 -1
- package/dist/{path-env-CjpH-KWH.js → path-env-DLQPf9qj.js} +2 -2
- package/dist/{paths-D2eokayo.js → paths-B-AkG5FD.js} +3 -3
- package/dist/{paths-DQMKfv60.js → paths-CAQJvbeZ.js} +2 -2
- package/dist/{paths-Cwszsz1I.js → paths-Q6h5HODL.js} +2 -2
- package/dist/{pi-auth-json-BLdaEAx2.js → pi-auth-json-B_lKNFK6.js} +5 -5
- package/dist/{pi-auth-json-BH7uvkKr.js → pi-auth-json-BmdBnmlZ.js} +8 -9
- package/dist/{pi-auth-json-DjxzPUt3.js → pi-auth-json-DkYqdjrV.js} +2 -2
- package/dist/{pi-auth-json-smxh_Xud.js → pi-auth-json-WTvcP2gz.js} +9 -8
- package/dist/{pi-embedded-D4eEfxIU.js → pi-embedded-BMbtgOzv.js} +825 -319
- package/dist/{pi-embedded-DifnZvKk.js → pi-embedded-DfbM3fAT.js} +888 -382
- package/dist/{pi-embedded-helpers-B6wVA0hU.js → pi-embedded-helpers-BZ9GspxK.js} +1 -1
- package/dist/{pi-tools.policy-CDgjN_3f.js → pi-tools.policy-D2FusuQa.js} +3 -3
- package/dist/{pi-tools.policy-ox141hP6.js → pi-tools.policy-WdTAfqbV.js} +6 -6
- package/dist/{plugin-auto-enable-Mj7AnofW.js → plugin-auto-enable-CtYcdTju.js} +5 -5
- package/dist/{plugin-auto-enable-OqDAK-ap.js → plugin-auto-enable-DhuD30Je.js} +2 -2
- package/dist/{plugin-registry-CpXm8ADp.js → plugin-registry-DePMxn4z.js} +4 -4
- package/dist/{plugin-registry-CkZnT8Fb.js → plugin-registry-QTkplP4s.js} +2 -2
- package/dist/plugin-sdk/agents/cli-backends.d.ts +4 -1
- package/dist/plugin-sdk/agents/cli-credentials.d.ts +0 -10
- package/dist/plugin-sdk/agents/cli-runner.d.ts +2 -0
- package/dist/plugin-sdk/agents/defaults.d.ts +2 -2
- package/dist/plugin-sdk/agents/model-auto.d.ts +43 -0
- package/dist/plugin-sdk/agents/model-fallback.d.ts +5 -0
- package/dist/plugin-sdk/agents/model-preference.d.ts +25 -0
- package/dist/plugin-sdk/agents/noxsoft-runner.d.ts +94 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +6 -3
- package/dist/plugin-sdk/agents/pi-embedded.d.ts +6 -50
- package/dist/plugin-sdk/agents/runner-capabilities.d.ts +2 -0
- package/dist/plugin-sdk/agents/sandbox/constants.d.ts +1 -1
- package/dist/plugin-sdk/auth/noxsoft-auth.d.ts +55 -0
- package/dist/plugin-sdk/channels/registry.d.ts +2 -2
- package/dist/plugin-sdk/cli/deps.d.ts +2 -1
- package/dist/plugin-sdk/cli/outbound-send-deps.d.ts +10 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +14 -0
- package/dist/plugin-sdk/config/types.models.d.ts +1 -1
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +13 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +13 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +13 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +1 -0
- package/dist/plugin-sdk/identity/loader.d.ts +1 -0
- package/dist/plugin-sdk/identity/trust-graph.d.ts +32 -0
- package/dist/plugin-sdk/index.js +57 -47
- package/dist/plugin-sdk/utils/message-channel.d.ts +2 -1
- package/dist/{plugins-DnJgmFJR.js → plugins-DYcg0qBW.js} +1 -1
- package/dist/{plugins-cli-CrrkMAYM.js → plugins-cli-Bc9oU1ld.js} +58 -57
- package/dist/{plugins-cli-D4VxQKaJ.js → plugins-cli-Dv0KQTWo.js} +36 -35
- package/dist/{polls-DuwPgAV7.js → polls-DFISjV7H.js} +5 -5
- package/dist/{ports-B1b1r9Dz.js → ports-DaVrZDUq.js} +2 -2
- package/dist/{ports-BX00e96t.js → ports-q535r1PZ.js} +2 -2
- package/dist/{program-CTDFmZNx.js → program-CuwbF8YO.js} +48 -40
- package/dist/{program-context-Hl6bnPfB.js → program-context-CxPfy-Wr.js} +51 -35
- package/dist/{progress-B-VBLfHr.js → progress-CVLvQV_t.js} +1 -1
- package/dist/{prompt-style-DU9Vjqe5.js → prompt-style-BI53UVgE.js} +1 -1
- package/dist/{prompts-D6b3zLVO.js → prompts-BmgT_kkv.js} +33 -2
- package/dist/prompts-Bq4QGFQM.js +158 -0
- package/dist/{pw-ai-BV57RRmp.js → pw-ai-CB-zeR7h.js} +5 -5
- package/dist/{pw-ai-CY-VcqJp.js → pw-ai-C_1-7IgH.js} +4 -4
- package/dist/{pw-ai-CTHtrCEC.js → pw-ai-DxNrJcCA.js} +3 -3
- package/dist/{qmd-manager-DJeQYS-r.js → qmd-manager-C_XBZ_bT.js} +5 -5
- package/dist/{qmd-manager-CwbYv6nJ.js → qmd-manager-CpNYgSrx.js} +7 -7
- package/dist/{qmd-manager-Cbm03z8H.js → qmd-manager-Q0OSDQ-e.js} +5 -5
- package/dist/{register.agent-CMoYTJqj.js → register.agent-DFQmkIEH.js} +53 -50
- package/dist/{register.agent-BKINbWbs.js → register.agent-DUjwGw9d.js} +77 -73
- package/dist/{register.anima-BHrZ90Sv.js → register.anima-CRFHJu2J.js} +21 -21
- package/dist/{register.anima-CnEy5VFQ.js → register.anima-CtKNrpE8.js} +21 -21
- package/dist/{register.configure-Cv5NkGH2.js → register.configure-CSSN07XN.js} +50 -49
- package/dist/register.configure-CnEKV57N.js +107 -0
- package/dist/register.maintenance-CU1A-90-.js +102 -0
- package/dist/{register.maintenance-DtAw8E_a.js → register.maintenance-fhcCB7ih.js} +48 -47
- package/dist/register.message-C1a0y2ZR.js +661 -0
- package/dist/register.message-fM0jSKB8.js +659 -0
- package/dist/register.onboard-B7Gavmvt.js +128 -0
- package/dist/{register.onboard-U3lIfaw_.js → register.onboard-BhPlqjFi.js} +50 -49
- package/dist/{register.setup-CLkGhR-e.js → register.setup-0jPnMgnz.js} +96 -92
- package/dist/{register.setup-Dyp5L_GQ.js → register.setup-CADdQUEN.js} +72 -69
- package/dist/{register.status-health-sessions-Dx-qZMol.js → register.status-health-sessions-Cu5fDT-z.js} +68 -67
- package/dist/{register.status-health-sessions-Cc2Y5gSj.js → register.status-health-sessions-DdQsABr_.js} +40 -39
- package/dist/{register.subclis-L55mGheS.js → register.subclis-CZ91ufCy.js} +28 -21
- package/dist/{reply-BgPvB-gR.js → reply-DtHlnzOx.js} +6631 -6172
- package/dist/{reply-prefix-37W_P4kH.js → reply-prefix-C8dIgJur.js} +1 -1
- package/dist/{reply-prefix-DBRqtDEq.js → reply-prefix-DmWGtcH-.js} +1 -1
- package/dist/{routes-ZlpnlJFF.js → routes-CWCAc8uJ.js} +2 -2
- package/dist/{routes-DeDgHj5Y.js → routes-FT0Us8Md.js} +6 -6
- package/dist/{run-DEHnKm2x.js → run-Dfz_7j7t.js} +1256 -166
- package/dist/{run-BFPM6M2S.js → run-DqBQ-bGn.js} +1230 -140
- package/dist/{run-main-Cxmjk1SF.js → run-main-DGDW0fhx.js} +51 -50
- package/dist/{runtime-guard-cBL2D5J8.js → runtime-guard-D14Z_QY6.js} +1 -1
- package/dist/{sandbox-DDOFuJU9.js → sandbox-D-N7M7lp.js} +2 -2
- package/dist/{sandbox-cli-GhcxR1Va.js → sandbox-cli-CQKz2I1X.js} +9 -9
- package/dist/{sandbox-cli-CGJvhJ4L.js → sandbox-cli-DHNFlTo-.js} +23 -23
- package/dist/{sandbox-B8Nza4lP.js → sandbox-pBHlfFdB.js} +6 -6
- package/dist/{security-cli-B7VIDDSL.js → security-cli-Bdi7MuP6.js} +14 -22
- package/dist/{security-cli-gsyz4Wrw.js → security-cli-C3aI09uy.js} +27 -35
- package/dist/{semantic-C3Z-zhNi.js → semantic-9rgWUrz3.js} +1 -1
- package/dist/{semantic-CG6X3rBo.js → semantic-C1UN3bb9.js} +1 -1
- package/dist/{semantic-DCd6zBnV.js → semantic-CQApJNO_.js} +1 -1
- package/dist/{server-context-Dkz4Ce8z.js → server-context-Clykq0XU.js} +1 -1
- package/dist/{server-context-BlJi7pjP.js → server-context-Yx4pgBqJ.js} +7 -7
- package/dist/{server-node-events-DBOg36in.js → server-node-events-BR1aXVlu.js} +55 -53
- package/dist/{server-node-events-CmZXzWcd.js → server-node-events-Ca797E1d.js} +34 -31
- package/dist/{service-QlHhVsQf.js → service-Dd1DfPia.js} +1 -1
- package/dist/{service-audit-D4xG05j8.js → service-audit-Bwpoc2LD.js} +1 -1
- package/dist/{service-audit-BaoBb09i.js → service-audit-KzOtcw_V.js} +3 -3
- package/dist/{session-BJ9XCJBg.js → session-5YO_H-Ra.js} +1 -1
- package/dist/{session-3MLbl1-K.js → session-BiA6jrcs.js} +1 -1
- package/dist/session-C7IGnhd1.js +190 -0
- package/dist/{session-KNXzWBht.js → session-CSmfU0D3.js} +1 -1
- package/dist/{session-CqKJvPTq.js → session-DLevr8Vd.js} +5 -5
- package/dist/session-DfsMJNG3.js +190 -0
- package/dist/{session-TAOVpONo.js → session-FmXsucR7.js} +2 -2
- package/dist/{session-cost-usage-BamtB1rn.js → session-cost-usage-BWqR-ik6.js} +1 -1
- package/dist/{sessions-C2th3rm6.js → sessions-BOzeFzuL.js} +12 -22
- package/dist/{sessions-1XK2mH6L.js → sessions-C_3wTmSA.js} +9 -19
- package/dist/{sessions-BrQHxX_o.js → sessions-Dj7_4mkr.js} +4 -4
- package/dist/{settings-cli-CCtkuc1r.js → settings-cli-DxNeu6kx.js} +79 -77
- package/dist/{settings-cli-Ccizggz2.js → settings-cli-Dytfop1H.js} +50 -49
- package/dist/{setup-token-Dqtgnjxw.js → setup-token-B802CZwe.js} +13 -18
- package/dist/{setup-token-Bcer2kX8.js → setup-token-DYh2QzJ-.js} +29 -34
- package/dist/{shared-Hnu5dChj.js → shared-C-rqLtIT.js} +2 -2
- package/dist/{shell-env-KRrv3dPW.js → shell-env-CMI9f7-7.js} +1 -1
- package/dist/{shell-env-B4ae4lFh.js → shell-env-HkVWMh--.js} +1 -1
- package/dist/{shell-env-PnmcBTp4.js → shell-env-iPnSIi-t.js} +1 -1
- package/dist/{skills-CQoUYlGu.js → skills-4v6-kw0C.js} +3 -3
- package/dist/{skills-cli-DQuLxQUM.js → skills-cli-BoasNTpZ.js} +15 -15
- package/dist/{skills-cli-CNNy0FxN.js → skills-cli-TeAq3fRG.js} +3 -3
- package/dist/{skills-install-2DbC1Yo2.js → skills-install-D6_qpRjW.js} +7 -7
- package/dist/{skills-install-CE6djAWL.js → skills-install-Qw2oU8L8.js} +2 -2
- package/dist/{skills-status-ybjSmiHu.js → skills-status-CvH7AUoY.js} +4 -4
- package/dist/{soul-Bt57OdSx.js → soul-BiIdv3Wp.js} +125 -5
- package/dist/{soul-DFeEGG5h.js → soul-Bt8UNmTq.js} +126 -5
- package/dist/{soul-CwWWw7cs.js → soul-D9k5zulC.js} +2 -2
- package/dist/{soul-Bru-rRjk.js → soul-DQSYs-4l.js} +1 -1
- package/dist/{sqlite-BTcAhNls.js → sqlite-BMMt7osH.js} +2 -2
- package/dist/{sqlite-ClLAW1iQ.js → sqlite-CZ1vD4VS.js} +4 -4
- package/dist/{sqlite-CLZ1eR5Q.js → sqlite-CpAJt-JS.js} +1 -1
- package/dist/{start-DfC7PlAH.js → start-BqnPia0t.js} +66 -63
- package/dist/start-C3fuLzX0.js +157 -0
- package/dist/{status-BVAoIQ0V.js → status-CHGNPonc.js} +26 -44
- package/dist/{status-BU6h4wUP.js → status-CxF6k_jr.js} +2 -2
- package/dist/{status-C9B6cEM0.js → status-DfZJJqNs.js} +15 -15
- package/dist/{status-BaEcHPtc.js → status-tLgozFYL.js} +4 -4
- package/dist/{status.update-CbIRaeaV.js → status.update-B6Tdpk07.js} +2 -2
- package/dist/{status.update-CPACVnCc.js → status.update-E9dSFk_b.js} +1 -1
- package/dist/{subagent-registry-MZIxVf8W.js → subagent-registry-CPtElVX0.js} +807 -348
- package/dist/{subsystem-BMsbqSb4.js → subsystem-BAADN1B8.js} +18 -27
- package/dist/{subsystem-CucjNlOk.js → subsystem-D-Xta-sj.js} +17 -26
- package/dist/{subsystem-DA3Cno1i.js → subsystem-D1AJZPgG.js} +38 -47
- package/dist/{system-cli-BKicxULp.js → system-cli-CP7JrhR0.js} +15 -15
- package/dist/{system-cli-Unb-WFAR.js → system-cli-DoLzi2Sn.js} +8 -8
- package/dist/{systemd-5KGZ3NHE.js → systemd-Bx76sJ3M.js} +2 -2
- package/dist/{systemd-linger-B-uyzDap.js → systemd-linger-BVwGXVS0.js} +2 -2
- package/dist/{systemd-linger-CS_pA1-a.js → systemd-linger-CxGmIy_5.js} +1 -1
- package/dist/{table-CdHBo5d1.js → table-Blmz7glr.js} +2 -2
- package/dist/{tokens-DGhK0fpG.js → tokens-SP2Q7i59.js} +1 -1
- package/dist/{tool-images-DK97edts.js → tool-images-2qproko3.js} +2 -2
- package/dist/{tool-images-Dq55i0mz.js → tool-images-C6cKHTbj.js} +2 -2
- package/dist/{tool-images-J0rGmoDV.js → tool-images-CgDT0Xzv.js} +2 -2
- package/dist/{tui-Bm8FEW0b.js → tui-C2eLfbhA.js} +5 -5
- package/dist/{tui-cli-BGjsxGle.js → tui-cli-BgcbCtgc.js} +12 -12
- package/dist/{tui-cli-TwCYv-a7.js → tui-cli-cLSYBQu9.js} +27 -27
- package/dist/{tui-DtGKiHUr.js → tui-r4qpJhNk.js} +10 -10
- package/dist/{update-Dfi92PZJ.js → update-CqKpX3cX.js} +3 -3
- package/dist/{update-Dle5MRUz.js → update-DA91za97.js} +1 -1
- package/dist/{update-cli-QMVW2eiR.js → update-cli-BuCw75tM.js} +87 -85
- package/dist/{update-cli-D1e-DsWy.js → update-cli-C-er5av6.js} +55 -54
- package/dist/{update-runner-DPmSGXS3.js → update-runner-czCqHZCu.js} +5 -5
- package/dist/{update-runner-iLJQF6VA.js → update-runner-kE8AMQt4.js} +1 -1
- package/dist/{utils-B60lF9Wq.js → utils-CLYlhJuc.js} +1 -1
- package/dist/{web-DJRRkHG8.js → web-BHGK5GtV.js} +24 -24
- package/dist/web-CyYunanU.js +65 -0
- package/dist/{web-DDAkSrtZ.js → web-DvTXV-fo.js} +35 -34
- package/dist/{web-DBQRQY6n.js → web-so3pGceM.js} +27 -27
- package/dist/{webhooks-cli-Cg0F2mU6.js → webhooks-cli-k3QMf7Rs.js} +4 -4
- package/dist/{webhooks-cli-BsWx7MgH.js → webhooks-cli-vlEfXEKm.js} +12 -12
- package/dist/{whatsapp-actions-gpz6-vPI.js → whatsapp-actions-6fPRKwPV.js} +11 -11
- package/dist/{whatsapp-actions-DJpQVKnT.js → whatsapp-actions-BJn-z76S.js} +17 -17
- package/dist/{whatsapp-actions-tWRWRZ4X.js → whatsapp-actions-C0tlEdLy.js} +5 -5
- package/dist/{whatsapp-actions-CMEP8v3k.js → whatsapp-actions-Hr-W8vjY.js} +13 -13
- package/dist/{widearea-dns-BDtWuGCY.js → widearea-dns-CHAT20aR.js} +1 -1
- package/dist/{workspace-BQkffCaR.js → workspace-BFIZCnGo.js} +5 -5
- package/dist/{ws-log-Bc4grA6W.js → ws-log-CUobU2tD.js} +1 -1
- package/package.json +1 -1
- package/templates/profiles/nox.profile.json5 +5 -5
- package/dist/cli--Gal7v4I.js +0 -101
- package/dist/config-cli-cyvL43DG.js +0 -15
- package/dist/control-ui/assets/index-B7CJLRZD.css +0 -1
- package/dist/control-ui/assets/index-DLPYIcs0.js +0 -58
- package/dist/control-ui/assets/index-DLPYIcs0.js.map +0 -1
- package/dist/deps-CeyVMZf1.js +0 -13
- package/dist/models-ByeH7ZKb.js +0 -1350
- package/dist/register.configure-3GfqcGLK.js +0 -105
- package/dist/register.maintenance-YZDsMymb.js +0 -100
- package/dist/register.onboard-Dswys-iV.js +0 -126
- package/dist/start-BPye9w5U.js +0 -154
- package/dist/web-DE-hmqXy.js +0 -64
- /package/dist/{BasicParser-BiEpjka-.js → BasicParser-D4BHCxVb.js} +0 -0
- /package/dist/{agents.config-DibGEnBs.js → agents.config-Br4ULmK0.js} +0 -0
- /package/dist/{archive-BIKRyvqD.js → archive-CNqghdwQ.js} +0 -0
- /package/dist/{archive-5e-Ytlq-.js → archive-D-dHRz-v.js} +0 -0
- /package/dist/{argv-B6vsXQtF.js → argv-nNQ109_K.js} +0 -0
- /package/dist/{auth-store-Vfd6oc1G.js → auth-store-BEfSfCbW.js} +0 -0
- /package/dist/{auto-update-BUbllW1X.js → auto-update-Cvd8YJrT.js} +0 -0
- /package/dist/{auto-update-DdH8fo63.js → auto-update-DO4nHkfM.js} +0 -0
- /package/dist/{brew-Bkf_MwX9.js → brew-DHWnVWm3.js} +0 -0
- /package/dist/{budget-CV0a771W.js → budget-DvjICb0t.js} +0 -0
- /package/dist/{budget-GiXjG9eW.js → budget-e0R5xsU3.js} +0 -0
- /package/dist/{command-options-DfPEZwUK.js → command-options-DtJ8-EC7.js} +0 -0
- /package/dist/{command-options-mgpP-XId.js → command-options-eC-m_qJx.js} +0 -0
- /package/dist/{delivery-queue-DGnDKL02.js → delivery-queue-BKQk1j0k.js} +0 -0
- /package/dist/{delivery-queue-DZ_ibFDu.js → delivery-queue-CExaJXRz.js} +0 -0
- /package/dist/{display-BwSYYxVE.js → display-4p3-O9mP.js} +0 -0
- /package/dist/{display-Dck2kudh.js → display-Bo8pBhMp.js} +0 -0
- /package/dist/{exec-approvals-BJikgQkX.js → exec-approvals-DK5-KCUz.js} +0 -0
- /package/dist/{format-wiLVr0D3.js → format-9DMvWYUJ.js} +0 -0
- /package/dist/{format-duration-C5oKCGwB.js → format-duration-CnGkTPRF.js} +0 -0
- /package/dist/{gmail-setup-utils-CR33Gqfc.js → gmail-setup-utils-BIXtKTpT.js} +0 -0
- /package/dist/{help-format-DJx5Rwy2.js → help-format-ZKxl6UCb.js} +0 -0
- /package/dist/{helpers-8O7IVGO-.js → helpers-CWQnEONe.js} +0 -0
- /package/dist/{hooks-status-DiqubDlK.js → hooks-status-DqfJDvYl.js} +0 -0
- /package/dist/{ipv4-BYbwrpG-.js → ipv4-CExV55ho.js} +0 -0
- /package/dist/{is-main-BnikY3ud.js → is-main-H-hpHkdq.js} +0 -0
- /package/dist/{lib-D1DXSMt_.js → lib-D0_kW-B6.js} +0 -0
- /package/dist/{links-3c7gzW-G.js → links-BjjDMNIq.js} +0 -0
- /package/dist/{logging-Bpf6Cepz.js → logging-DWwOqnTW.js} +0 -0
- /package/dist/{logging-DcXIbpwk.js → logging-_rCcBkls.js} +0 -0
- /package/dist/{model-param-b-BcBBSgiD.js → model-param-b-2KmFir_0.js} +0 -0
- /package/dist/{node-service-BDlDNv3t.js → node-service-cOoW5hLa.js} +0 -0
- /package/dist/{note-BaOKDvcy.js → note-CeLGcHqv.js} +0 -0
- /package/dist/{noxsoft-auth-Bmict45b.js → noxsoft-auth-CE75mBXE.js} +0 -0
- /package/dist/{noxsoft-auth-DpwLJIW0.js → noxsoft-auth-CgCk5707.js} +0 -0
- /package/dist/{pi-model-discovery-ClWISQ3j.js → pi-model-discovery-Bu4Zr7nI.js} +0 -0
- /package/dist/{ports-aNJUI3Mi.js → ports-BGLuwt2Z.js} +0 -0
- /package/dist/{progress-Dj2aBWOI.js → progress-glCgu57m.js} +0 -0
- /package/dist/{qmd-manager-DrDX4o7e.js → qmd-manager-CO795NK4.js} +0 -0
- /package/dist/{queue-B77yV52t.js → queue-DDq0uzy5.js} +0 -0
- /package/dist/{queue-wFYwitx0.js → queue-DtQ5sbyD.js} +0 -0
- /package/dist/{registry-gaRST__4.js → registry-BvymIcVf.js} +0 -0
- /package/dist/{registry-Cv8RtADU.js → registry-DwaHkd_j.js} +0 -0
- /package/dist/{requirements-CEowKaVY.js → requirements-Ct4XnMiK.js} +0 -0
- /package/dist/{skill-scanner-DGoUYV22.js → skill-scanner-5_Y3u6SU.js} +0 -0
- /package/dist/{skill-scanner-FO7SyxAD.js → skill-scanner-Dld2ijVw.js} +0 -0
- /package/dist/{templates-D-h5PNIK.js → templates-4_And8I_.js} +0 -0
- /package/dist/{templates-ndPXOyGA.js → templates-5Z-UIDze.js} +0 -0
- /package/dist/{types-DSS9sywz.js → types-BQk_oAin.js} +0 -0
- /package/dist/{usage-format-BtlQ-77V.js → usage-format-BSa7cHyK.js} +0 -0
- /package/dist/{ws-log-BA9w1cJs.js → ws-log-CG6cvCZW.js} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function SO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function jo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wp={exports:{}},Ml={};var YS;function wO(){if(YS)return Ml;YS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var c in a)c!=="key"&&(o[c]=a[c])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Ml.Fragment=t,Ml.jsx=n,Ml.jsxs=n,Ml}var $S;function EO(){return $S||($S=1,Wp.exports=wO()),Wp.exports}var m=EO(),Qp={exports:{}},He={};var XS;function TO(){if(XS)return He;XS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),g=Symbol.iterator;function b(z){return z===null||typeof z!="object"?null:(z=g&&z[g]||z["@@iterator"],typeof z=="function"?z:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function T(z,ee,D){this.props=z,this.context=ee,this.refs=E,this.updater=D||S}T.prototype.isReactComponent={},T.prototype.setState=function(z,ee){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,ee,"setState")},T.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=T.prototype;function k(z,ee,D){this.props=z,this.context=ee,this.refs=E,this.updater=D||S}var j=k.prototype=new C;j.constructor=k,w(j,T.prototype),j.isPureReactComponent=!0;var N=Array.isArray;function R(){}var L={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function G(z,ee,D){var de=D.ref;return{$$typeof:e,type:z,key:ee,ref:de!==void 0?de:null,props:D}}function M(z,ee){return G(z.type,ee,z.props)}function B(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function X(z){var ee={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(D){return ee[D]})}var oe=/\/+/g;function ue(z,ee){return typeof z=="object"&&z!==null&&z.key!=null?X(""+z.key):ee.toString(36)}function Z(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(R,R):(z.status="pending",z.then(function(ee){z.status==="pending"&&(z.status="fulfilled",z.value=ee)},function(ee){z.status==="pending"&&(z.status="rejected",z.reason=ee)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function V(z,ee,D,de,ye){var Se=typeof z;(Se==="undefined"||Se==="boolean")&&(z=null);var we=!1;if(z===null)we=!0;else switch(Se){case"bigint":case"string":case"number":we=!0;break;case"object":switch(z.$$typeof){case e:case t:we=!0;break;case p:return we=z._init,V(we(z._payload),ee,D,de,ye)}}if(we)return ye=ye(z),we=de===""?"."+ue(z,0):de,N(ye)?(D="",we!=null&&(D=we.replace(oe,"$&/")+"/"),V(ye,ee,D,"",function(ge){return ge})):ye!=null&&(B(ye)&&(ye=M(ye,D+(ye.key==null||z&&z.key===ye.key?"":(""+ye.key).replace(oe,"$&/")+"/")+we)),ee.push(ye)),1;we=0;var Le=de===""?".":de+":";if(N(z))for(var je=0;je<z.length;je++)de=z[je],Se=Le+ue(de,je),we+=V(de,ee,D,Se,ye);else if(je=b(z),typeof je=="function")for(z=je.call(z),je=0;!(de=z.next()).done;)de=de.value,Se=Le+ue(de,je++),we+=V(de,ee,D,Se,ye);else if(Se==="object"){if(typeof z.then=="function")return V(Z(z),ee,D,de,ye);throw ee=String(z),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return we}function W(z,ee,D){if(z==null)return z;var de=[],ye=0;return V(z,de,"","",function(Se){return ee.call(D,Se,ye++)}),de}function $(z){if(z._status===-1){var ee=z._result;ee=ee(),ee.then(function(D){(z._status===0||z._status===-1)&&(z._status=1,z._result=D)},function(D){(z._status===0||z._status===-1)&&(z._status=2,z._result=D)}),z._status===-1&&(z._status=0,z._result=ee)}if(z._status===1)return z._result.default;throw z._result}var he=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},I={map:W,forEach:function(z,ee,D){W(z,function(){ee.apply(this,arguments)},D)},count:function(z){var ee=0;return W(z,function(){ee++}),ee},toArray:function(z){return W(z,function(ee){return ee})||[]},only:function(z){if(!B(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return He.Activity=v,He.Children=I,He.Component=T,He.Fragment=n,He.Profiler=a,He.PureComponent=k,He.StrictMode=r,He.Suspense=f,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,He.__COMPILER_RUNTIME={__proto__:null,c:function(z){return L.H.useMemoCache(z)}},He.cache=function(z){return function(){return z.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(z,ee,D){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var de=w({},z.props),ye=z.key;if(ee!=null)for(Se in ee.key!==void 0&&(ye=""+ee.key),ee)!U.call(ee,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&ee.ref===void 0||(de[Se]=ee[Se]);var Se=arguments.length-2;if(Se===1)de.children=D;else if(1<Se){for(var we=Array(Se),Le=0;Le<Se;Le++)we[Le]=arguments[Le+2];de.children=we}return G(z.type,ye,de)},He.createContext=function(z){return z={$$typeof:l,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:o,_context:z},z},He.createElement=function(z,ee,D){var de,ye={},Se=null;if(ee!=null)for(de in ee.key!==void 0&&(Se=""+ee.key),ee)U.call(ee,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(ye[de]=ee[de]);var we=arguments.length-2;if(we===1)ye.children=D;else if(1<we){for(var Le=Array(we),je=0;je<we;je++)Le[je]=arguments[je+2];ye.children=Le}if(z&&z.defaultProps)for(de in we=z.defaultProps,we)ye[de]===void 0&&(ye[de]=we[de]);return G(z,Se,ye)},He.createRef=function(){return{current:null}},He.forwardRef=function(z){return{$$typeof:c,render:z}},He.isValidElement=B,He.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:$}},He.memo=function(z,ee){return{$$typeof:d,type:z,compare:ee===void 0?null:ee}},He.startTransition=function(z){var ee=L.T,D={};L.T=D;try{var de=z(),ye=L.S;ye!==null&&ye(D,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(R,he)}catch(Se){he(Se)}finally{ee!==null&&D.types!==null&&(ee.types=D.types),L.T=ee}},He.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},He.use=function(z){return L.H.use(z)},He.useActionState=function(z,ee,D){return L.H.useActionState(z,ee,D)},He.useCallback=function(z,ee){return L.H.useCallback(z,ee)},He.useContext=function(z){return L.H.useContext(z)},He.useDebugValue=function(){},He.useDeferredValue=function(z,ee){return L.H.useDeferredValue(z,ee)},He.useEffect=function(z,ee){return L.H.useEffect(z,ee)},He.useEffectEvent=function(z){return L.H.useEffectEvent(z)},He.useId=function(){return L.H.useId()},He.useImperativeHandle=function(z,ee,D){return L.H.useImperativeHandle(z,ee,D)},He.useInsertionEffect=function(z,ee){return L.H.useInsertionEffect(z,ee)},He.useLayoutEffect=function(z,ee){return L.H.useLayoutEffect(z,ee)},He.useMemo=function(z,ee){return L.H.useMemo(z,ee)},He.useOptimistic=function(z,ee){return L.H.useOptimistic(z,ee)},He.useReducer=function(z,ee,D){return L.H.useReducer(z,ee,D)},He.useRef=function(z){return L.H.useRef(z)},He.useState=function(z){return L.H.useState(z)},He.useSyncExternalStore=function(z,ee,D){return L.H.useSyncExternalStore(z,ee,D)},He.useTransition=function(){return L.H.useTransition()},He.version="19.2.4",He}var WS;function Dg(){return WS||(WS=1,Qp.exports=TO()),Qp.exports}var _=Dg();const ar=jo(_);var Jp={exports:{}},Dl={},Zp={exports:{}},em={};var QS;function kO(){return QS||(QS=1,(function(e){function t(V,W){var $=V.length;V.push(W);e:for(;0<$;){var he=$-1>>>1,I=V[he];if(0<a(I,W))V[he]=W,V[$]=I,$=he;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var W=V[0],$=V.pop();if($!==W){V[0]=$;e:for(var he=0,I=V.length,z=I>>>1;he<z;){var ee=2*(he+1)-1,D=V[ee],de=ee+1,ye=V[de];if(0>a(D,$))de<I&&0>a(ye,D)?(V[he]=ye,V[de]=$,he=de):(V[he]=D,V[ee]=$,he=ee);else if(de<I&&0>a(ye,$))V[he]=ye,V[de]=$,he=de;else break e}}return W}function a(V,W){var $=V.sortIndex-W.sortIndex;return $!==0?$:V.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],p=1,v=null,g=3,b=!1,S=!1,w=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function j(V){for(var W=n(d);W!==null;){if(W.callback===null)r(d);else if(W.startTime<=V)r(d),W.sortIndex=W.expirationTime,t(f,W);else break;W=n(d)}}function N(V){if(w=!1,j(V),!S)if(n(f)!==null)S=!0,R||(R=!0,X());else{var W=n(d);W!==null&&Z(N,W.startTime-V)}}var R=!1,L=-1,U=5,G=-1;function M(){return E?!0:!(e.unstable_now()-G<U)}function B(){if(E=!1,R){var V=e.unstable_now();G=V;var W=!0;try{e:{S=!1,w&&(w=!1,C(L),L=-1),b=!0;var $=g;try{t:{for(j(V),v=n(f);v!==null&&!(v.expirationTime>V&&M());){var he=v.callback;if(typeof he=="function"){v.callback=null,g=v.priorityLevel;var I=he(v.expirationTime<=V);if(V=e.unstable_now(),typeof I=="function"){v.callback=I,j(V),W=!0;break t}v===n(f)&&r(f),j(V)}else r(f);v=n(f)}if(v!==null)W=!0;else{var z=n(d);z!==null&&Z(N,z.startTime-V),W=!1}}break e}finally{v=null,g=$,b=!1}W=void 0}}finally{W?X():R=!1}}}var X;if(typeof k=="function")X=function(){k(B)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,ue=oe.port2;oe.port1.onmessage=B,X=function(){ue.postMessage(null)}}else X=function(){T(B,0)};function Z(V,W){L=T(function(){V(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(V){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var $=g;g=W;try{return V()}finally{g=$}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(V,W){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var $=g;g=V;try{return W()}finally{g=$}},e.unstable_scheduleCallback=function(V,W,$){var he=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?he+$:he):$=he,V){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=$+I,V={id:p++,callback:W,priorityLevel:V,startTime:$,expirationTime:I,sortIndex:-1},$>he?(V.sortIndex=$,t(d,V),n(f)===null&&V===n(d)&&(w?(C(L),L=-1):w=!0,Z(N,$-he))):(V.sortIndex=I,t(f,V),S||b||(S=!0,R||(R=!0,X()))),V},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(V){var W=g;return function(){var $=g;g=W;try{return V.apply(this,arguments)}finally{g=$}}}})(em)),em}var JS;function CO(){return JS||(JS=1,Zp.exports=kO()),Zp.exports}var tm={exports:{}},Cn={};var ZS;function AO(){if(ZS)return Cn;ZS=1;var e=Dg();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(f,d,p){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:v==null?null:""+v,children:f,containerInfo:d,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cn.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(f,d,null,p)},Cn.flushSync=function(f){var d=l.T,p=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=p,r.d.f()}},Cn.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},Cn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Cn.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,v=c(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:v,integrity:g,fetchPriority:b}):p==="script"&&r.d.X(f,{crossOrigin:v,integrity:g,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Cn.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},Cn.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,v=c(p,d.crossOrigin);r.d.L(f,p,{crossOrigin:v,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Cn.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},Cn.requestFormReset=function(f){r.d.r(f)},Cn.unstable_batchedUpdates=function(f,d){return f(d)},Cn.useFormState=function(f,d,p){return l.H.useFormState(f,d,p)},Cn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Cn.version="19.2.4",Cn}var ew;function NO(){if(ew)return tm.exports;ew=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),tm.exports=AO(),tm.exports}var tw;function jO(){if(tw)return Dl;tw=1;var e=CO(),t=Dg(),n=NO();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function l(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(o(i)!==i)throw Error(r(188))}function d(i){var s=i.alternate;if(!s){if(s=o(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,h=s;;){var y=u.return;if(y===null)break;var x=y.alternate;if(x===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===u)return f(y),i;if(x===h)return f(y),s;x=x.sibling}throw Error(r(188))}if(u.return!==h.return)u=y,h=x;else{for(var A=!1,O=y.child;O;){if(O===u){A=!0,u=y,h=x;break}if(O===h){A=!0,h=y,u=x;break}O=O.sibling}if(!A){for(O=x.child;O;){if(O===u){A=!0,u=x,h=y;break}if(O===h){A=!0,h=x,u=y;break}O=O.sibling}if(!A)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var v=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),k=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function X(i){return i===null||typeof i!="object"?null:(i=B&&i[B]||i["@@iterator"],typeof i=="function"?i:null)}var oe=Symbol.for("react.client.reference");function ue(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===oe?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case T:return"Profiler";case E:return"StrictMode";case N:return"Suspense";case R:return"SuspenseList";case G:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case k:return i.displayName||"Context";case C:return(i._context.displayName||"Context")+".Consumer";case j:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case L:return s=i.displayName||null,s!==null?s:ue(i.type)||"Memo";case U:s=i._payload,i=i._init;try{return ue(i(s))}catch{}}return null}var Z=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},he=[],I=-1;function z(i){return{current:i}}function ee(i){0>I||(i.current=he[I],he[I]=null,I--)}function D(i,s){I++,he[I]=i.current,i.current=s}var de=z(null),ye=z(null),Se=z(null),we=z(null);function Le(i,s){switch(D(Se,s),D(ye,i),D(de,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?vS(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=vS(s),i=gS(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}ee(de),D(de,i)}function je(){ee(de),ee(ye),ee(Se)}function ge(i){i.memoizedState!==null&&D(we,i);var s=de.current,u=gS(s,i.type);s!==u&&(D(ye,i),D(de,u))}function Pe(i){ye.current===i&&(ee(de),ee(ye)),we.current===i&&(ee(we),jl._currentValue=$)}var xt,Ot;function $e(i){if(xt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);xt=s&&s[1]||"",Ot=-1<u.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+xt+i+Ot}var Nt=!1;function ot(i,s){if(!i||Nt)return"";Nt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(le){var ae=le}Reflect.construct(i,[],me)}else{try{me.call()}catch(le){ae=le}i.call(me.prototype)}}else{try{throw Error()}catch(le){ae=le}(me=i())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(le){if(le&&ae&&typeof le.stack=="string")return[le.stack,ae.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=h.DetermineComponentFrameRoot(),A=x[0],O=x[1];if(A&&O){var F=A.split(`
|
|
4
|
+
`),ie=O.split(`
|
|
5
|
+
`);for(y=h=0;h<F.length&&!F[h].includes("DetermineComponentFrameRoot");)h++;for(;y<ie.length&&!ie[y].includes("DetermineComponentFrameRoot");)y++;if(h===F.length||y===ie.length)for(h=F.length-1,y=ie.length-1;1<=h&&0<=y&&F[h]!==ie[y];)y--;for(;1<=h&&0<=y;h--,y--)if(F[h]!==ie[y]){if(h!==1||y!==1)do if(h--,y--,0>y||F[h]!==ie[y]){var fe=`
|
|
6
|
+
`+F[h].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=h&&0<=y);break}}}finally{Nt=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?$e(u):""}function Bt(i,s){switch(i.tag){case 26:case 27:case 5:return $e(i.type);case 16:return $e("Lazy");case 13:return i.child!==s&&s!==null?$e("Suspense Fallback"):$e("Suspense");case 19:return $e("SuspenseList");case 0:case 15:return ot(i.type,!1);case 11:return ot(i.type.render,!1);case 1:return ot(i.type,!0);case 31:return $e("Activity");default:return""}}function Yt(i){try{var s="",u=null;do s+=Bt(i,u),u=i,i=i.return;while(i);return s}catch(h){return`
|
|
7
|
+
Error generating stack: `+h.message+`
|
|
8
|
+
`+h.stack}}var Jt=Object.prototype.hasOwnProperty,mt=e.unstable_scheduleCallback,at=e.unstable_cancelCallback,On=e.unstable_shouldYield,ze=e.unstable_requestPaint,Me=e.unstable_now,Q=e.unstable_getCurrentPriorityLevel,H=e.unstable_ImmediatePriority,se=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,Ee=e.unstable_LowPriority,Be=e.unstable_IdlePriority,lt=e.log,$t=e.unstable_setDisableYieldValue,vt=null,Pt=null;function P(i){if(typeof lt=="function"&&$t(i),Pt&&typeof Pt.setStrictMode=="function")try{Pt.setStrictMode(vt,i)}catch{}}var Y=Math.clz32?Math.clz32:Zt,xe=Math.log,qe=Math.LN2;function Zt(i){return i>>>=0,i===0?32:31-(xe(i)/qe|0)|0}var Mr=256,Ft=262144,hn=4194304;function Yr(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Da(i,s,u){var h=i.pendingLanes;if(h===0)return 0;var y=0,x=i.suspendedLanes,A=i.pingedLanes;i=i.warmLanes;var O=h&134217727;return O!==0?(h=O&~x,h!==0?y=Yr(h):(A&=O,A!==0?y=Yr(A):u||(u=O&~i,u!==0&&(y=Yr(u))))):(O=h&~x,O!==0?y=Yr(O):A!==0?y=Yr(A):u||(u=h&~i,u!==0&&(y=Yr(u)))),y===0?0:s!==0&&s!==y&&(s&x)===0&&(x=y&-y,u=s&-s,x>=u||x===32&&(u&4194048)!==0)?s:y}function $r(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function xs(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Hu(){var i=hn;return hn<<=1,(hn&62914560)===0&&(hn=4194304),i}function Vo(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Ia(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Fd(i,s,u,h,y,x){var A=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var O=i.entanglements,F=i.expirationTimes,ie=i.hiddenUpdates;for(u=A&~u;0<u;){var fe=31-Y(u),me=1<<fe;O[fe]=0,F[fe]=-1;var ae=ie[fe];if(ae!==null)for(ie[fe]=null,fe=0;fe<ae.length;fe++){var le=ae[fe];le!==null&&(le.lane&=-536870913)}u&=~me}h!==0&&Fo(i,h,0),x!==0&&y===0&&i.tag!==0&&(i.suspendedLanes|=x&~(A&~s))}function Fo(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var h=31-Y(s);i.entangledLanes|=s,i.entanglements[h]=i.entanglements[h]|1073741824|u&261930}function qu(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var h=31-Y(u),y=1<<h;y&s|i[h]&s&&(i[h]|=s),u&=~y}}function Gu(i,s){var u=s&-s;return u=(u&42)!==0?1:Ho(u),(u&(i.suspendedLanes|s))!==0?0:u}function Ho(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function qo(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Ku(){var i=W.p;return i!==0?i:(i=window.event,i===void 0?32:BS(i.type))}function Go(i,s){var u=W.p;try{return W.p=i,s()}finally{W.p=u}}var Xr=Math.random().toString(36).slice(2),un="__reactFiber$"+Xr,K="__reactProps$"+Xr,ve="__reactContainer$"+Xr,tt="__reactEvents$"+Xr,gt="__reactListeners$"+Xr,en="__reactHandles$"+Xr,ur="__reactResources$"+Xr,kn="__reactMarker$"+Xr;function cr(i){delete i[un],delete i[K],delete i[tt],delete i[gt],delete i[en]}function pn(i){var s=i[un];if(s)return s;for(var u=i.parentNode;u;){if(s=u[ve]||u[un]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=TS(i);i!==null;){if(u=i[un])return u;i=TS(i)}return s}i=u,u=i.parentNode}return null}function mi(i){if(i=i[un]||i[ve]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Dr(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ve(i){var s=i[ur];return s||(s=i[ur]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Fe(i){i[kn]=!0}var ut=new Set,Mt={};function Xt(i,s){Bn(i,s),Bn(i+"Capture",s)}function Bn(i,s){for(Mt[i]=s,i=0;i<s.length;i++)ut.add(s[i])}var vi=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Wr={},Hi={};function La(i){return Jt.call(Hi,i)?!0:Jt.call(Wr,i)?!1:vi.test(i)?Hi[i]=!0:(Wr[i]=!0,!1)}function gi(i,s,u){if(La(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Pa(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function yi(i,s,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+h)}}function fr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function l0(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function p_(i,s,u){var h=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,x=h.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return y.call(this)},set:function(A){u=""+A,x.call(this,A)}}),Object.defineProperty(i,s,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Hd(i){if(!i._valueTracker){var s=l0(i)?"checked":"value";i._valueTracker=p_(i,s,""+i[s])}}function u0(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return i&&(h=l0(i)?i.checked?"true":"false":i.value),i=h,i!==u?(s.setValue(i),!0):!1}function Yu(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var m_=/[\n"\\]/g;function dr(i){return i.replace(m_,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function qd(i,s,u,h,y,x,A,O){i.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.type=A:i.removeAttribute("type"),s!=null?A==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+fr(s)):i.value!==""+fr(s)&&(i.value=""+fr(s)):A!=="submit"&&A!=="reset"||i.removeAttribute("value"),s!=null?Gd(i,A,fr(s)):u!=null?Gd(i,A,fr(u)):h!=null&&i.removeAttribute("value"),y==null&&x!=null&&(i.defaultChecked=!!x),y!=null&&(i.checked=y&&typeof y!="function"&&typeof y!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?i.name=""+fr(O):i.removeAttribute("name")}function c0(i,s,u,h,y,x,A,O){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),s!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){Hd(i);return}u=u!=null?""+fr(u):"",s=s!=null?""+fr(s):u,O||s===i.value||(i.value=s),i.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=O?i.checked:!!h,i.defaultChecked=!!h,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.name=A),Hd(i)}function Gd(i,s,u){s==="number"&&Yu(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Ss(i,s,u,h){if(i=i.options,s){s={};for(var y=0;y<u.length;y++)s["$"+u[y]]=!0;for(u=0;u<i.length;u++)y=s.hasOwnProperty("$"+i[u].value),i[u].selected!==y&&(i[u].selected=y),y&&h&&(i[u].defaultSelected=!0)}else{for(u=""+fr(u),s=null,y=0;y<i.length;y++){if(i[y].value===u){i[y].selected=!0,h&&(i[y].defaultSelected=!0);return}s!==null||i[y].disabled||(s=i[y])}s!==null&&(s.selected=!0)}}function f0(i,s,u){if(s!=null&&(s=""+fr(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+fr(u):""}function d0(i,s,u,h){if(s==null){if(h!=null){if(u!=null)throw Error(r(92));if(Z(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),s=u}u=fr(s),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h),Hd(i)}function ws(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var v_=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function h0(i,s,u){var h=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":h?i.setProperty(s,u):typeof u!="number"||u===0||v_.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function p0(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var y in s)h=s[y],s.hasOwnProperty(y)&&u[y]!==h&&h0(i,y,h)}else for(var x in s)s.hasOwnProperty(x)&&h0(i,x,s[x])}function Kd(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var g_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),y_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $u(i){return y_.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function bi(){}var Yd=null;function $d(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Es=null,Ts=null;function m0(i){var s=mi(i);if(s&&(i=s.stateNode)){var u=i[K]||null;e:switch(i=s.stateNode,s.type){case"input":if(qd(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+dr(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==i&&h.form===i.form){var y=h[K]||null;if(!y)throw Error(r(90));qd(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<u.length;s++)h=u[s],h.form===i.form&&u0(h)}break e;case"textarea":f0(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Ss(i,!!u.multiple,s,!1)}}}var Xd=!1;function v0(i,s,u){if(Xd)return i(s,u);Xd=!0;try{var h=i(s);return h}finally{if(Xd=!1,(Es!==null||Ts!==null)&&(Ic(),Es&&(s=Es,i=Ts,Ts=Es=null,m0(s),i)))for(s=0;s<i.length;s++)m0(i[s])}}function Ko(i,s){var u=i.stateNode;if(u===null)return null;var h=u[K]||null;if(h===null)return null;u=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wd=!1;if(xi)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){Wd=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{Wd=!1}var qi=null,Qd=null,Xu=null;function g0(){if(Xu)return Xu;var i,s=Qd,u=s.length,h,y="value"in qi?qi.value:qi.textContent,x=y.length;for(i=0;i<u&&s[i]===y[i];i++);var A=u-i;for(h=1;h<=A&&s[u-h]===y[x-h];h++);return Xu=y.slice(i,1<h?1-h:void 0)}function Wu(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Qu(){return!0}function y0(){return!1}function Vn(i){function s(u,h,y,x,A){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=x,this.target=A,this.currentTarget=null;for(var O in i)i.hasOwnProperty(O)&&(u=i[O],this[O]=u?u(x):x[O]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Qu:y0,this.isPropagationStopped=y0,this}return v(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Qu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Qu)},persist:function(){},isPersistent:Qu}),s}var Ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ju=Vn(Ua),$o=v({},Ua,{view:0,detail:0}),b_=Vn($o),Jd,Zd,Xo,Zu=v({},$o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:th,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Xo&&(Xo&&i.type==="mousemove"?(Jd=i.screenX-Xo.screenX,Zd=i.screenY-Xo.screenY):Zd=Jd=0,Xo=i),Jd)},movementY:function(i){return"movementY"in i?i.movementY:Zd}}),b0=Vn(Zu),x_=v({},Zu,{dataTransfer:0}),S_=Vn(x_),w_=v({},$o,{relatedTarget:0}),eh=Vn(w_),E_=v({},Ua,{animationName:0,elapsedTime:0,pseudoElement:0}),T_=Vn(E_),k_=v({},Ua,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),C_=Vn(k_),A_=v({},Ua,{data:0}),x0=Vn(A_),N_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},R_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function __(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=R_[i])?!!s[i]:!1}function th(){return __}var O_=v({},$o,{key:function(i){if(i.key){var s=N_[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Wu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?j_[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:th,charCode:function(i){return i.type==="keypress"?Wu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Wu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),M_=Vn(O_),D_=v({},Zu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S0=Vn(D_),I_=v({},$o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:th}),L_=Vn(I_),P_=v({},Ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),U_=Vn(P_),z_=v({},Zu,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),B_=Vn(z_),V_=v({},Ua,{newState:0,oldState:0}),F_=Vn(V_),H_=[9,13,27,32],nh=xi&&"CompositionEvent"in window,Wo=null;xi&&"documentMode"in document&&(Wo=document.documentMode);var q_=xi&&"TextEvent"in window&&!Wo,w0=xi&&(!nh||Wo&&8<Wo&&11>=Wo),E0=" ",T0=!1;function k0(i,s){switch(i){case"keyup":return H_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ks=!1;function G_(i,s){switch(i){case"compositionend":return C0(s);case"keypress":return s.which!==32?null:(T0=!0,E0);case"textInput":return i=s.data,i===E0&&T0?null:i;default:return null}}function K_(i,s){if(ks)return i==="compositionend"||!nh&&k0(i,s)?(i=g0(),Xu=Qd=qi=null,ks=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return w0&&s.locale!=="ko"?null:s.data;default:return null}}var Y_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function A0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!Y_[i.type]:s==="textarea"}function N0(i,s,u,h){Es?Ts?Ts.push(h):Ts=[h]:Es=h,s=Fc(s,"onChange"),0<s.length&&(u=new Ju("onChange","change",null,u,h),i.push({event:u,listeners:s}))}var Qo=null,Jo=null;function $_(i){cS(i,0)}function ec(i){var s=Dr(i);if(u0(s))return i}function j0(i,s){if(i==="change")return s}var R0=!1;if(xi){var rh;if(xi){var ih="oninput"in document;if(!ih){var _0=document.createElement("div");_0.setAttribute("oninput","return;"),ih=typeof _0.oninput=="function"}rh=ih}else rh=!1;R0=rh&&(!document.documentMode||9<document.documentMode)}function O0(){Qo&&(Qo.detachEvent("onpropertychange",M0),Jo=Qo=null)}function M0(i){if(i.propertyName==="value"&&ec(Jo)){var s=[];N0(s,Jo,i,$d(i)),v0($_,s)}}function X_(i,s,u){i==="focusin"?(O0(),Qo=s,Jo=u,Qo.attachEvent("onpropertychange",M0)):i==="focusout"&&O0()}function W_(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ec(Jo)}function Q_(i,s){if(i==="click")return ec(s)}function J_(i,s){if(i==="input"||i==="change")return ec(s)}function Z_(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Wn=typeof Object.is=="function"?Object.is:Z_;function Zo(i,s){if(Wn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!Jt.call(s,y)||!Wn(i[y],s[y]))return!1}return!0}function D0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function I0(i,s){var u=D0(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=s&&h>=s)return{node:u,offset:s-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=D0(u)}}function L0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?L0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function P0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Yu(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=Yu(i.document)}return s}function ah(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var e2=xi&&"documentMode"in document&&11>=document.documentMode,Cs=null,sh=null,el=null,oh=!1;function U0(i,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;oh||Cs==null||Cs!==Yu(h)||(h=Cs,"selectionStart"in h&&ah(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),el&&Zo(el,h)||(el=h,h=Fc(sh,"onSelect"),0<h.length&&(s=new Ju("onSelect","select",null,s,u),i.push({event:s,listeners:h}),s.target=Cs)))}function za(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var As={animationend:za("Animation","AnimationEnd"),animationiteration:za("Animation","AnimationIteration"),animationstart:za("Animation","AnimationStart"),transitionrun:za("Transition","TransitionRun"),transitionstart:za("Transition","TransitionStart"),transitioncancel:za("Transition","TransitionCancel"),transitionend:za("Transition","TransitionEnd")},lh={},z0={};xi&&(z0=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Ba(i){if(lh[i])return lh[i];if(!As[i])return i;var s=As[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in z0)return lh[i]=s[u];return i}var B0=Ba("animationend"),V0=Ba("animationiteration"),F0=Ba("animationstart"),t2=Ba("transitionrun"),n2=Ba("transitionstart"),r2=Ba("transitioncancel"),H0=Ba("transitionend"),q0=new Map,uh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");uh.push("scrollEnd");function Ir(i,s){q0.set(i,s),Xt(s,[i])}var tc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},hr=[],Ns=0,ch=0;function nc(){for(var i=Ns,s=ch=Ns=0;s<i;){var u=hr[s];hr[s++]=null;var h=hr[s];hr[s++]=null;var y=hr[s];hr[s++]=null;var x=hr[s];if(hr[s++]=null,h!==null&&y!==null){var A=h.pending;A===null?y.next=y:(y.next=A.next,A.next=y),h.pending=y}x!==0&&G0(u,y,x)}}function rc(i,s,u,h){hr[Ns++]=i,hr[Ns++]=s,hr[Ns++]=u,hr[Ns++]=h,ch|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function fh(i,s,u,h){return rc(i,s,u,h),ic(i)}function Va(i,s){return rc(i,null,null,s),ic(i)}function G0(i,s,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var y=!1,x=i.return;x!==null;)x.childLanes|=u,h=x.alternate,h!==null&&(h.childLanes|=u),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(y=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,y&&s!==null&&(y=31-Y(u),i=x.hiddenUpdates,h=i[y],h===null?i[y]=[s]:h.push(s),s.lane=u|536870912),x):null}function ic(i){if(50<wl)throw wl=0,xp=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var js={};function i2(i,s,u,h){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(i,s,u,h){return new i2(i,s,u,h)}function dh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Si(i,s){var u=i.alternate;return u===null?(u=Qn(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function K0(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function ac(i,s,u,h,y,x){var A=0;if(h=i,typeof i=="function")dh(i)&&(A=1);else if(typeof i=="string")A=uO(i,u,de.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case G:return i=Qn(31,u,s,y),i.elementType=G,i.lanes=x,i;case w:return Fa(u.children,y,x,s);case E:A=8,y|=24;break;case T:return i=Qn(12,u,s,y|2),i.elementType=T,i.lanes=x,i;case N:return i=Qn(13,u,s,y),i.elementType=N,i.lanes=x,i;case R:return i=Qn(19,u,s,y),i.elementType=R,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:A=10;break e;case C:A=9;break e;case j:A=11;break e;case L:A=14;break e;case U:A=16,h=null;break e}A=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return s=Qn(A,u,s,y),s.elementType=i,s.type=h,s.lanes=x,s}function Fa(i,s,u,h){return i=Qn(7,i,h,s),i.lanes=u,i}function hh(i,s,u){return i=Qn(6,i,null,s),i.lanes=u,i}function Y0(i){var s=Qn(18,null,null,0);return s.stateNode=i,s}function ph(i,s,u){return s=Qn(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var $0=new WeakMap;function pr(i,s){if(typeof i=="object"&&i!==null){var u=$0.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Yt(s)},$0.set(i,s),s)}return{value:i,source:s,stack:Yt(s)}}var Rs=[],_s=0,sc=null,tl=0,mr=[],vr=0,Gi=null,Qr=1,Jr="";function wi(i,s){Rs[_s++]=tl,Rs[_s++]=sc,sc=i,tl=s}function X0(i,s,u){mr[vr++]=Qr,mr[vr++]=Jr,mr[vr++]=Gi,Gi=i;var h=Qr;i=Jr;var y=32-Y(h)-1;h&=~(1<<y),u+=1;var x=32-Y(s)+y;if(30<x){var A=y-y%5;x=(h&(1<<A)-1).toString(32),h>>=A,y-=A,Qr=1<<32-Y(s)+y|u<<y|h,Jr=x+i}else Qr=1<<x|u<<y|h,Jr=i}function mh(i){i.return!==null&&(wi(i,1),X0(i,1,0))}function vh(i){for(;i===sc;)sc=Rs[--_s],Rs[_s]=null,tl=Rs[--_s],Rs[_s]=null;for(;i===Gi;)Gi=mr[--vr],mr[vr]=null,Jr=mr[--vr],mr[vr]=null,Qr=mr[--vr],mr[vr]=null}function W0(i,s){mr[vr++]=Qr,mr[vr++]=Jr,mr[vr++]=Gi,Qr=s.id,Jr=s.overflow,Gi=i}var vn=null,Dt=null,nt=!1,Ki=null,gr=!1,gh=Error(r(519));function Yi(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nl(pr(s,i)),gh}function Q0(i){var s=i.stateNode,u=i.type,h=i.memoizedProps;switch(s[un]=i,s[K]=h,u){case"dialog":We("cancel",s),We("close",s);break;case"iframe":case"object":case"embed":We("load",s);break;case"video":case"audio":for(u=0;u<Tl.length;u++)We(Tl[u],s);break;case"source":We("error",s);break;case"img":case"image":case"link":We("error",s),We("load",s);break;case"details":We("toggle",s);break;case"input":We("invalid",s),c0(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":We("invalid",s);break;case"textarea":We("invalid",s),d0(s,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||h.suppressHydrationWarning===!0||pS(s.textContent,u)?(h.popover!=null&&(We("beforetoggle",s),We("toggle",s)),h.onScroll!=null&&We("scroll",s),h.onScrollEnd!=null&&We("scrollend",s),h.onClick!=null&&(s.onclick=bi),s=!0):s=!1,s||Yi(i,!0)}function J0(i){for(vn=i.return;vn;)switch(vn.tag){case 5:case 31:case 13:gr=!1;return;case 27:case 3:gr=!0;return;default:vn=vn.return}}function Os(i){if(i!==vn)return!1;if(!nt)return J0(i),nt=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||Ip(i.type,i.memoizedProps)),u=!u),u&&Dt&&Yi(i),J0(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Dt=ES(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Dt=ES(i)}else s===27?(s=Dt,oa(i.type)?(i=Bp,Bp=null,Dt=i):Dt=s):Dt=vn?br(i.stateNode.nextSibling):null;return!0}function Ha(){Dt=vn=null,nt=!1}function yh(){var i=Ki;return i!==null&&(Gn===null?Gn=i:Gn.push.apply(Gn,i),Ki=null),i}function nl(i){Ki===null?Ki=[i]:Ki.push(i)}var bh=z(null),qa=null,Ei=null;function $i(i,s,u){D(bh,s._currentValue),s._currentValue=u}function Ti(i){i._currentValue=bh.current,ee(bh)}function xh(i,s,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),i===u)break;i=i.return}}function Sh(i,s,u,h){var y=i.child;for(y!==null&&(y.return=i);y!==null;){var x=y.dependencies;if(x!==null){var A=y.child;x=x.firstContext;e:for(;x!==null;){var O=x;x=y;for(var F=0;F<s.length;F++)if(O.context===s[F]){x.lanes|=u,O=x.alternate,O!==null&&(O.lanes|=u),xh(x.return,u,i),h||(A=null);break e}x=O.next}}else if(y.tag===18){if(A=y.return,A===null)throw Error(r(341));A.lanes|=u,x=A.alternate,x!==null&&(x.lanes|=u),xh(A,u,i),A=null}else A=y.child;if(A!==null)A.return=y;else for(A=y;A!==null;){if(A===i){A=null;break}if(y=A.sibling,y!==null){y.return=A.return,A=y;break}A=A.return}y=A}}function Ms(i,s,u,h){i=null;for(var y=s,x=!1;y!==null;){if(!x){if((y.flags&524288)!==0)x=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var A=y.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var O=y.type;Wn(y.pendingProps.value,A.value)||(i!==null?i.push(O):i=[O])}}else if(y===we.current){if(A=y.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(i!==null?i.push(jl):i=[jl])}y=y.return}i!==null&&Sh(s,i,u,h),s.flags|=262144}function oc(i){for(i=i.firstContext;i!==null;){if(!Wn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ga(i){qa=i,Ei=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function gn(i){return Z0(qa,i)}function lc(i,s){return qa===null&&Ga(i),Z0(i,s)}function Z0(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Ei===null){if(i===null)throw Error(r(308));Ei=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ei=Ei.next=s;return u}var a2=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},s2=e.unstable_scheduleCallback,o2=e.unstable_NormalPriority,tn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wh(){return{controller:new a2,data:new Map,refCount:0}}function rl(i){i.refCount--,i.refCount===0&&s2(o2,function(){i.controller.abort()})}var il=null,Eh=0,Ds=0,Is=null;function l2(i,s){if(il===null){var u=il=[];Eh=0,Ds=Cp(),Is={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Eh++,s.then(eb,eb),s}function eb(){if(--Eh===0&&il!==null){Is!==null&&(Is.status="fulfilled");var i=il;il=null,Ds=0,Is=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function u2(i,s){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return i.then(function(){h.status="fulfilled",h.value=s;for(var y=0;y<u.length;y++)(0,u[y])(s)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var tb=V.S;V.S=function(i,s){Ux=Me(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&l2(i,s),tb!==null&&tb(i,s)};var Ka=z(null);function Th(){var i=Ka.current;return i!==null?i:Ct.pooledCache}function uc(i,s){s===null?D(Ka,Ka.current):D(Ka,s.pool)}function nb(){var i=Th();return i===null?null:{parent:tn._currentValue,pool:i}}var Ls=Error(r(460)),kh=Error(r(474)),cc=Error(r(542)),fc={then:function(){}};function rb(i){return i=i.status,i==="fulfilled"||i==="rejected"}function ib(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(bi,bi),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,sb(i),i;default:if(typeof s.status=="string")s.then(bi,bi);else{if(i=Ct,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(h){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=h}},function(h){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,sb(i),i}throw $a=s,Ls}}function Ya(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?($a=u,Ls):u}}var $a=null;function ab(){if($a===null)throw Error(r(459));var i=$a;return $a=null,i}function sb(i){if(i===Ls||i===cc)throw Error(r(483))}var Ps=null,al=0;function dc(i){var s=al;return al+=1,Ps===null&&(Ps=[]),ib(Ps,i,s)}function sl(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function hc(i,s){throw s.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function ob(i){function s(J,q){if(i){var re=J.deletions;re===null?(J.deletions=[q],J.flags|=16):re.push(q)}}function u(J,q){if(!i)return null;for(;q!==null;)s(J,q),q=q.sibling;return null}function h(J){for(var q=new Map;J!==null;)J.key!==null?q.set(J.key,J):q.set(J.index,J),J=J.sibling;return q}function y(J,q){return J=Si(J,q),J.index=0,J.sibling=null,J}function x(J,q,re){return J.index=re,i?(re=J.alternate,re!==null?(re=re.index,re<q?(J.flags|=67108866,q):re):(J.flags|=67108866,q)):(J.flags|=1048576,q)}function A(J){return i&&J.alternate===null&&(J.flags|=67108866),J}function O(J,q,re,pe){return q===null||q.tag!==6?(q=hh(re,J.mode,pe),q.return=J,q):(q=y(q,re),q.return=J,q)}function F(J,q,re,pe){var Oe=re.type;return Oe===w?fe(J,q,re.props.children,pe,re.key):q!==null&&(q.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===U&&Ya(Oe)===q.type)?(q=y(q,re.props),sl(q,re),q.return=J,q):(q=ac(re.type,re.key,re.props,null,J.mode,pe),sl(q,re),q.return=J,q)}function ie(J,q,re,pe){return q===null||q.tag!==4||q.stateNode.containerInfo!==re.containerInfo||q.stateNode.implementation!==re.implementation?(q=ph(re,J.mode,pe),q.return=J,q):(q=y(q,re.children||[]),q.return=J,q)}function fe(J,q,re,pe,Oe){return q===null||q.tag!==7?(q=Fa(re,J.mode,pe,Oe),q.return=J,q):(q=y(q,re),q.return=J,q)}function me(J,q,re){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=hh(""+q,J.mode,re),q.return=J,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case b:return re=ac(q.type,q.key,q.props,null,J.mode,re),sl(re,q),re.return=J,re;case S:return q=ph(q,J.mode,re),q.return=J,q;case U:return q=Ya(q),me(J,q,re)}if(Z(q)||X(q))return q=Fa(q,J.mode,re,null),q.return=J,q;if(typeof q.then=="function")return me(J,dc(q),re);if(q.$$typeof===k)return me(J,lc(J,q),re);hc(J,q)}return null}function ae(J,q,re,pe){var Oe=q!==null?q.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Oe!==null?null:O(J,q,""+re,pe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===Oe?F(J,q,re,pe):null;case S:return re.key===Oe?ie(J,q,re,pe):null;case U:return re=Ya(re),ae(J,q,re,pe)}if(Z(re)||X(re))return Oe!==null?null:fe(J,q,re,pe,null);if(typeof re.then=="function")return ae(J,q,dc(re),pe);if(re.$$typeof===k)return ae(J,q,lc(J,re),pe);hc(J,re)}return null}function le(J,q,re,pe,Oe){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return J=J.get(re)||null,O(q,J,""+pe,Oe);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case b:return J=J.get(pe.key===null?re:pe.key)||null,F(q,J,pe,Oe);case S:return J=J.get(pe.key===null?re:pe.key)||null,ie(q,J,pe,Oe);case U:return pe=Ya(pe),le(J,q,re,pe,Oe)}if(Z(pe)||X(pe))return J=J.get(re)||null,fe(q,J,pe,Oe,null);if(typeof pe.then=="function")return le(J,q,re,dc(pe),Oe);if(pe.$$typeof===k)return le(J,q,re,lc(q,pe),Oe);hc(q,pe)}return null}function ke(J,q,re,pe){for(var Oe=null,ct=null,Ne=q,Ke=q=0,et=null;Ne!==null&&Ke<re.length;Ke++){Ne.index>Ke?(et=Ne,Ne=null):et=Ne.sibling;var ft=ae(J,Ne,re[Ke],pe);if(ft===null){Ne===null&&(Ne=et);break}i&&Ne&&ft.alternate===null&&s(J,Ne),q=x(ft,q,Ke),ct===null?Oe=ft:ct.sibling=ft,ct=ft,Ne=et}if(Ke===re.length)return u(J,Ne),nt&&wi(J,Ke),Oe;if(Ne===null){for(;Ke<re.length;Ke++)Ne=me(J,re[Ke],pe),Ne!==null&&(q=x(Ne,q,Ke),ct===null?Oe=Ne:ct.sibling=Ne,ct=Ne);return nt&&wi(J,Ke),Oe}for(Ne=h(Ne);Ke<re.length;Ke++)et=le(Ne,J,Ke,re[Ke],pe),et!==null&&(i&&et.alternate!==null&&Ne.delete(et.key===null?Ke:et.key),q=x(et,q,Ke),ct===null?Oe=et:ct.sibling=et,ct=et);return i&&Ne.forEach(function(da){return s(J,da)}),nt&&wi(J,Ke),Oe}function Ie(J,q,re,pe){if(re==null)throw Error(r(151));for(var Oe=null,ct=null,Ne=q,Ke=q=0,et=null,ft=re.next();Ne!==null&&!ft.done;Ke++,ft=re.next()){Ne.index>Ke?(et=Ne,Ne=null):et=Ne.sibling;var da=ae(J,Ne,ft.value,pe);if(da===null){Ne===null&&(Ne=et);break}i&&Ne&&da.alternate===null&&s(J,Ne),q=x(da,q,Ke),ct===null?Oe=da:ct.sibling=da,ct=da,Ne=et}if(ft.done)return u(J,Ne),nt&&wi(J,Ke),Oe;if(Ne===null){for(;!ft.done;Ke++,ft=re.next())ft=me(J,ft.value,pe),ft!==null&&(q=x(ft,q,Ke),ct===null?Oe=ft:ct.sibling=ft,ct=ft);return nt&&wi(J,Ke),Oe}for(Ne=h(Ne);!ft.done;Ke++,ft=re.next())ft=le(Ne,J,Ke,ft.value,pe),ft!==null&&(i&&ft.alternate!==null&&Ne.delete(ft.key===null?Ke:ft.key),q=x(ft,q,Ke),ct===null?Oe=ft:ct.sibling=ft,ct=ft);return i&&Ne.forEach(function(xO){return s(J,xO)}),nt&&wi(J,Ke),Oe}function Et(J,q,re,pe){if(typeof re=="object"&&re!==null&&re.type===w&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case b:e:{for(var Oe=re.key;q!==null;){if(q.key===Oe){if(Oe=re.type,Oe===w){if(q.tag===7){u(J,q.sibling),pe=y(q,re.props.children),pe.return=J,J=pe;break e}}else if(q.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===U&&Ya(Oe)===q.type){u(J,q.sibling),pe=y(q,re.props),sl(pe,re),pe.return=J,J=pe;break e}u(J,q);break}else s(J,q);q=q.sibling}re.type===w?(pe=Fa(re.props.children,J.mode,pe,re.key),pe.return=J,J=pe):(pe=ac(re.type,re.key,re.props,null,J.mode,pe),sl(pe,re),pe.return=J,J=pe)}return A(J);case S:e:{for(Oe=re.key;q!==null;){if(q.key===Oe)if(q.tag===4&&q.stateNode.containerInfo===re.containerInfo&&q.stateNode.implementation===re.implementation){u(J,q.sibling),pe=y(q,re.children||[]),pe.return=J,J=pe;break e}else{u(J,q);break}else s(J,q);q=q.sibling}pe=ph(re,J.mode,pe),pe.return=J,J=pe}return A(J);case U:return re=Ya(re),Et(J,q,re,pe)}if(Z(re))return ke(J,q,re,pe);if(X(re)){if(Oe=X(re),typeof Oe!="function")throw Error(r(150));return re=Oe.call(re),Ie(J,q,re,pe)}if(typeof re.then=="function")return Et(J,q,dc(re),pe);if(re.$$typeof===k)return Et(J,q,lc(J,re),pe);hc(J,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,q!==null&&q.tag===6?(u(J,q.sibling),pe=y(q,re),pe.return=J,J=pe):(u(J,q),pe=hh(re,J.mode,pe),pe.return=J,J=pe),A(J)):u(J,q)}return function(J,q,re,pe){try{al=0;var Oe=Et(J,q,re,pe);return Ps=null,Oe}catch(Ne){if(Ne===Ls||Ne===cc)throw Ne;var ct=Qn(29,Ne,null,J.mode);return ct.lanes=pe,ct.return=J,ct}}}var Xa=ob(!0),lb=ob(!1),Xi=!1;function Ch(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ah(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Wi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Qi(i,s,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(ht&2)!==0){var y=h.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),h.pending=s,s=ic(i),G0(i,null,u),s}return rc(i,h,s,u),ic(i)}function ol(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,qu(i,u)}}function Nh(i,s){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?y=x=A:x=x.next=A,u=u.next}while(u!==null);x===null?y=x=s:x=x.next=s}else y=x=s;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var jh=!1;function ll(){if(jh){var i=Is;if(i!==null)throw i}}function ul(i,s,u,h){jh=!1;var y=i.updateQueue;Xi=!1;var x=y.firstBaseUpdate,A=y.lastBaseUpdate,O=y.shared.pending;if(O!==null){y.shared.pending=null;var F=O,ie=F.next;F.next=null,A===null?x=ie:A.next=ie,A=F;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,O=fe.lastBaseUpdate,O!==A&&(O===null?fe.firstBaseUpdate=ie:O.next=ie,fe.lastBaseUpdate=F))}if(x!==null){var me=y.baseState;A=0,fe=ie=F=null,O=x;do{var ae=O.lane&-536870913,le=ae!==O.lane;if(le?(Ze&ae)===ae:(h&ae)===ae){ae!==0&&ae===Ds&&(jh=!0),fe!==null&&(fe=fe.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var ke=i,Ie=O;ae=s;var Et=u;switch(Ie.tag){case 1:if(ke=Ie.payload,typeof ke=="function"){me=ke.call(Et,me,ae);break e}me=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ie.payload,ae=typeof ke=="function"?ke.call(Et,me,ae):ke,ae==null)break e;me=v({},me,ae);break e;case 2:Xi=!0}}ae=O.callback,ae!==null&&(i.flags|=64,le&&(i.flags|=8192),le=y.callbacks,le===null?y.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:O.tag,payload:O.payload,callback:O.callback,next:null},fe===null?(ie=fe=le,F=me):fe=fe.next=le,A|=ae;if(O=O.next,O===null){if(O=y.shared.pending,O===null)break;le=O,O=le.next,le.next=null,y.lastBaseUpdate=le,y.shared.pending=null}}while(!0);fe===null&&(F=me),y.baseState=F,y.firstBaseUpdate=ie,y.lastBaseUpdate=fe,x===null&&(y.shared.lanes=0),na|=A,i.lanes=A,i.memoizedState=me}}function ub(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function cb(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)ub(u[i],s)}var Us=z(null),pc=z(0);function fb(i,s){i=Mi,D(pc,i),D(Us,s),Mi=i|s.baseLanes}function Rh(){D(pc,Mi),D(Us,Us.current)}function _h(){Mi=pc.current,ee(Us),ee(pc)}var Jn=z(null),yr=null;function Ji(i){var s=i.alternate;D(Wt,Wt.current&1),D(Jn,i),yr===null&&(s===null||Us.current!==null||s.memoizedState!==null)&&(yr=i)}function Oh(i){D(Wt,Wt.current),D(Jn,i),yr===null&&(yr=i)}function db(i){i.tag===22?(D(Wt,Wt.current),D(Jn,i),yr===null&&(yr=i)):Zi()}function Zi(){D(Wt,Wt.current),D(Jn,Jn.current)}function Zn(i){ee(Jn),yr===i&&(yr=null),ee(Wt)}var Wt=z(0);function mc(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Up(u)||zp(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ki=0,Ge=null,St=null,nn=null,vc=!1,zs=!1,Wa=!1,gc=0,cl=0,Bs=null,c2=0;function Ht(){throw Error(r(321))}function Mh(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Wn(i[u],s[u]))return!1;return!0}function Dh(i,s,u,h,y,x){return ki=x,Ge=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,V.H=i===null||i.memoizedState===null?Xb:Xh,Wa=!1,x=u(h,y),Wa=!1,zs&&(x=pb(s,u,h,y)),hb(i),x}function hb(i){V.H=hl;var s=St!==null&&St.next!==null;if(ki=0,nn=St=Ge=null,vc=!1,cl=0,Bs=null,s)throw Error(r(300));i===null||rn||(i=i.dependencies,i!==null&&oc(i)&&(rn=!0))}function pb(i,s,u,h){Ge=i;var y=0;do{if(zs&&(Bs=null),cl=0,zs=!1,25<=y)throw Error(r(301));if(y+=1,nn=St=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}V.H=Wb,x=s(u,h)}while(zs);return x}function f2(){var i=V.H,s=i.useState()[0];return s=typeof s.then=="function"?fl(s):s,i=i.useState()[0],(St!==null?St.memoizedState:null)!==i&&(Ge.flags|=1024),s}function Ih(){var i=gc!==0;return gc=0,i}function Lh(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Ph(i){if(vc){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}vc=!1}ki=0,nn=St=Ge=null,zs=!1,cl=gc=0,Bs=null}function Mn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?Ge.memoizedState=nn=i:nn=nn.next=i,nn}function Qt(){if(St===null){var i=Ge.alternate;i=i!==null?i.memoizedState:null}else i=St.next;var s=nn===null?Ge.memoizedState:nn.next;if(s!==null)nn=s,St=i;else{if(i===null)throw Ge.alternate===null?Error(r(467)):Error(r(310));St=i,i={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},nn===null?Ge.memoizedState=nn=i:nn=nn.next=i}return nn}function yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fl(i){var s=cl;return cl+=1,Bs===null&&(Bs=[]),i=ib(Bs,i,s),s=Ge,(nn===null?s.memoizedState:nn.next)===null&&(s=s.alternate,V.H=s===null||s.memoizedState===null?Xb:Xh),i}function bc(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return fl(i);if(i.$$typeof===k)return gn(i)}throw Error(r(438,String(i)))}function Uh(i){var s=null,u=Ge.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var h=Ge.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=yc(),Ge.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),h=0;h<i;h++)u[h]=M;return s.index++,u}function Ci(i,s){return typeof s=="function"?s(i):s}function xc(i){var s=Qt();return zh(s,St,i)}function zh(i,s,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var y=i.baseQueue,x=h.pending;if(x!==null){if(y!==null){var A=y.next;y.next=x.next,x.next=A}s.baseQueue=y=x,h.pending=null}if(x=i.baseState,y===null)i.memoizedState=x;else{s=y.next;var O=A=null,F=null,ie=s,fe=!1;do{var me=ie.lane&-536870913;if(me!==ie.lane?(Ze&me)===me:(ki&me)===me){var ae=ie.revertLane;if(ae===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),me===Ds&&(fe=!0);else if((ki&ae)===ae){ie=ie.next,ae===Ds&&(fe=!0);continue}else me={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},F===null?(O=F=me,A=x):F=F.next=me,Ge.lanes|=ae,na|=ae;me=ie.action,Wa&&u(x,me),x=ie.hasEagerState?ie.eagerState:u(x,me)}else ae={lane:me,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},F===null?(O=F=ae,A=x):F=F.next=ae,Ge.lanes|=me,na|=me;ie=ie.next}while(ie!==null&&ie!==s);if(F===null?A=x:F.next=O,!Wn(x,i.memoizedState)&&(rn=!0,fe&&(u=Is,u!==null)))throw u;i.memoizedState=x,i.baseState=A,i.baseQueue=F,h.lastRenderedState=x}return y===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function Bh(i){var s=Qt(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,y=u.pending,x=s.memoizedState;if(y!==null){u.pending=null;var A=y=y.next;do x=i(x,A.action),A=A.next;while(A!==y);Wn(x,s.memoizedState)||(rn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,h]}function mb(i,s,u){var h=Ge,y=Qt(),x=nt;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var A=!Wn((St||y).memoizedState,u);if(A&&(y.memoizedState=u,rn=!0),y=y.queue,Hh(yb.bind(null,h,y,i),[i]),y.getSnapshot!==s||A||nn!==null&&nn.memoizedState.tag&1){if(h.flags|=2048,Vs(9,{destroy:void 0},gb.bind(null,h,y,u,s),null),Ct===null)throw Error(r(349));x||(ki&127)!==0||vb(h,s,u)}return u}function vb(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=Ge.updateQueue,s===null?(s=yc(),Ge.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function gb(i,s,u,h){s.value=u,s.getSnapshot=h,bb(s)&&xb(i)}function yb(i,s,u){return u(function(){bb(s)&&xb(i)})}function bb(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Wn(i,u)}catch{return!0}}function xb(i){var s=Va(i,2);s!==null&&Kn(s,i,2)}function Vh(i){var s=Mn();if(typeof i=="function"){var u=i;if(i=u(),Wa){P(!0);try{u()}finally{P(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:i},s}function Sb(i,s,u,h){return i.baseState=u,zh(i,St,typeof h=="function"?h:Ci)}function d2(i,s,u,h,y){if(Ec(i))throw Error(r(485));if(i=s.action,i!==null){var x={payload:y,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){x.listeners.push(A)}};V.T!==null?u(!0):x.isTransition=!1,h(x),u=s.pending,u===null?(x.next=s.pending=x,wb(s,x)):(x.next=u.next,s.pending=u.next=x)}}function wb(i,s){var u=s.action,h=s.payload,y=i.state;if(s.isTransition){var x=V.T,A={};V.T=A;try{var O=u(y,h),F=V.S;F!==null&&F(A,O),Eb(i,s,O)}catch(ie){Fh(i,s,ie)}finally{x!==null&&A.types!==null&&(x.types=A.types),V.T=x}}else try{x=u(y,h),Eb(i,s,x)}catch(ie){Fh(i,s,ie)}}function Eb(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){Tb(i,s,h)},function(h){return Fh(i,s,h)}):Tb(i,s,u)}function Tb(i,s,u){s.status="fulfilled",s.value=u,kb(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,wb(i,u)))}function Fh(i,s,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=u,kb(s),s=s.next;while(s!==h)}i.action=null}function kb(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Cb(i,s){return s}function Ab(i,s){if(nt){var u=Ct.formState;if(u!==null){e:{var h=Ge;if(nt){if(Dt){t:{for(var y=Dt,x=gr;y.nodeType!==8;){if(!x){y=null;break t}if(y=br(y.nextSibling),y===null){y=null;break t}}x=y.data,y=x==="F!"||x==="F"?y:null}if(y){Dt=br(y.nextSibling),h=y.data==="F!";break e}}Yi(h)}h=!1}h&&(s=u[0])}}return u=Mn(),u.memoizedState=u.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cb,lastRenderedState:s},u.queue=h,u=Kb.bind(null,Ge,h),h.dispatch=u,h=Vh(!1),x=$h.bind(null,Ge,!1,h.queue),h=Mn(),y={state:s,dispatch:null,action:i,pending:null},h.queue=y,u=d2.bind(null,Ge,y,x,u),y.dispatch=u,h.memoizedState=i,[s,u,!1]}function Nb(i){var s=Qt();return jb(s,St,i)}function jb(i,s,u){if(s=zh(i,s,Cb)[0],i=xc(Ci)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=fl(s)}catch(A){throw A===Ls?cc:A}else h=s;s=Qt();var y=s.queue,x=y.dispatch;return u!==s.memoizedState&&(Ge.flags|=2048,Vs(9,{destroy:void 0},h2.bind(null,y,u),null)),[h,x,i]}function h2(i,s){i.action=s}function Rb(i){var s=Qt(),u=St;if(u!==null)return jb(s,u,i);Qt(),s=s.memoizedState,u=Qt();var h=u.queue.dispatch;return u.memoizedState=i,[s,h,!1]}function Vs(i,s,u,h){return i={tag:i,create:u,deps:h,inst:s,next:null},s=Ge.updateQueue,s===null&&(s=yc(),Ge.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,s.lastEffect=i),i}function _b(){return Qt().memoizedState}function Sc(i,s,u,h){var y=Mn();Ge.flags|=i,y.memoizedState=Vs(1|s,{destroy:void 0},u,h===void 0?null:h)}function wc(i,s,u,h){var y=Qt();h=h===void 0?null:h;var x=y.memoizedState.inst;St!==null&&h!==null&&Mh(h,St.memoizedState.deps)?y.memoizedState=Vs(s,x,u,h):(Ge.flags|=i,y.memoizedState=Vs(1|s,x,u,h))}function Ob(i,s){Sc(8390656,8,i,s)}function Hh(i,s){wc(2048,8,i,s)}function p2(i){Ge.flags|=4;var s=Ge.updateQueue;if(s===null)s=yc(),Ge.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function Mb(i){var s=Qt().memoizedState;return p2({ref:s,nextImpl:i}),function(){if((ht&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Db(i,s){return wc(4,2,i,s)}function Ib(i,s){return wc(4,4,i,s)}function Lb(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function Pb(i,s,u){u=u!=null?u.concat([i]):null,wc(4,4,Lb.bind(null,s,i),u)}function qh(){}function Ub(i,s){var u=Qt();s=s===void 0?null:s;var h=u.memoizedState;return s!==null&&Mh(s,h[1])?h[0]:(u.memoizedState=[i,s],i)}function zb(i,s){var u=Qt();s=s===void 0?null:s;var h=u.memoizedState;if(s!==null&&Mh(s,h[1]))return h[0];if(h=i(),Wa){P(!0);try{i()}finally{P(!1)}}return u.memoizedState=[h,s],h}function Gh(i,s,u){return u===void 0||(ki&1073741824)!==0&&(Ze&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=Bx(),Ge.lanes|=i,na|=i,u)}function Bb(i,s,u,h){return Wn(u,s)?u:Us.current!==null?(i=Gh(i,u,h),Wn(i,s)||(rn=!0),i):(ki&42)===0||(ki&1073741824)!==0&&(Ze&261930)===0?(rn=!0,i.memoizedState=u):(i=Bx(),Ge.lanes|=i,na|=i,s)}function Vb(i,s,u,h,y){var x=W.p;W.p=x!==0&&8>x?x:8;var A=V.T,O={};V.T=O,$h(i,!1,s,u);try{var F=y(),ie=V.S;if(ie!==null&&ie(O,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var fe=u2(F,h);dl(i,s,fe,nr(i))}else dl(i,s,h,nr(i))}catch(me){dl(i,s,{then:function(){},status:"rejected",reason:me},nr())}finally{W.p=x,A!==null&&O.types!==null&&(A.types=O.types),V.T=A}}function m2(){}function Kh(i,s,u,h){if(i.tag!==5)throw Error(r(476));var y=Fb(i).queue;Vb(i,y,s,$,u===null?m2:function(){return Hb(i),u(h)})}function Fb(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:$},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function Hb(i){var s=Fb(i);s.next===null&&(s=i.alternate.memoizedState),dl(i,s.next.queue,{},nr())}function Yh(){return gn(jl)}function qb(){return Qt().memoizedState}function Gb(){return Qt().memoizedState}function v2(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=nr();i=Wi(u);var h=Qi(s,i,u);h!==null&&(Kn(h,s,u),ol(h,s,u)),s={cache:wh()},i.payload=s;return}s=s.return}}function g2(i,s,u){var h=nr();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ec(i)?Yb(s,u):(u=fh(i,s,u,h),u!==null&&(Kn(u,i,h),$b(u,s,h)))}function Kb(i,s,u){var h=nr();dl(i,s,u,h)}function dl(i,s,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Ec(i))Yb(s,y);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var A=s.lastRenderedState,O=x(A,u);if(y.hasEagerState=!0,y.eagerState=O,Wn(O,A))return rc(i,s,y,0),Ct===null&&nc(),!1}catch{}if(u=fh(i,s,y,h),u!==null)return Kn(u,i,h),$b(u,s,h),!0}return!1}function $h(i,s,u,h){if(h={lane:2,revertLane:Cp(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Ec(i)){if(s)throw Error(r(479))}else s=fh(i,u,h,2),s!==null&&Kn(s,i,2)}function Ec(i){var s=i.alternate;return i===Ge||s!==null&&s===Ge}function Yb(i,s){zs=vc=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function $b(i,s,u){if((u&4194048)!==0){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,qu(i,u)}}var hl={readContext:gn,use:bc,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};hl.useEffectEvent=Ht;var Xb={readContext:gn,use:bc,useCallback:function(i,s){return Mn().memoizedState=[i,s===void 0?null:s],i},useContext:gn,useEffect:Ob,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,Sc(4194308,4,Lb.bind(null,s,i),u)},useLayoutEffect:function(i,s){return Sc(4194308,4,i,s)},useInsertionEffect:function(i,s){Sc(4,2,i,s)},useMemo:function(i,s){var u=Mn();s=s===void 0?null:s;var h=i();if(Wa){P(!0);try{i()}finally{P(!1)}}return u.memoizedState=[h,s],h},useReducer:function(i,s,u){var h=Mn();if(u!==void 0){var y=u(s);if(Wa){P(!0);try{u(s)}finally{P(!1)}}}else y=s;return h.memoizedState=h.baseState=y,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:y},h.queue=i,i=i.dispatch=g2.bind(null,Ge,i),[h.memoizedState,i]},useRef:function(i){var s=Mn();return i={current:i},s.memoizedState=i},useState:function(i){i=Vh(i);var s=i.queue,u=Kb.bind(null,Ge,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:qh,useDeferredValue:function(i,s){var u=Mn();return Gh(u,i,s)},useTransition:function(){var i=Vh(!1);return i=Vb.bind(null,Ge,i.queue,!0,!1),Mn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var h=Ge,y=Mn();if(nt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),Ct===null)throw Error(r(349));(Ze&127)!==0||vb(h,s,u)}y.memoizedState=u;var x={value:u,getSnapshot:s};return y.queue=x,Ob(yb.bind(null,h,x,i),[i]),h.flags|=2048,Vs(9,{destroy:void 0},gb.bind(null,h,x,u,s),null),u},useId:function(){var i=Mn(),s=Ct.identifierPrefix;if(nt){var u=Jr,h=Qr;u=(h&~(1<<32-Y(h)-1)).toString(32)+u,s="_"+s+"R_"+u,u=gc++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=c2++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Yh,useFormState:Ab,useActionState:Ab,useOptimistic:function(i){var s=Mn();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=$h.bind(null,Ge,!0,u),u.dispatch=s,[i,s]},useMemoCache:Uh,useCacheRefresh:function(){return Mn().memoizedState=v2.bind(null,Ge)},useEffectEvent:function(i){var s=Mn(),u={impl:i};return s.memoizedState=u,function(){if((ht&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Xh={readContext:gn,use:bc,useCallback:Ub,useContext:gn,useEffect:Hh,useImperativeHandle:Pb,useInsertionEffect:Db,useLayoutEffect:Ib,useMemo:zb,useReducer:xc,useRef:_b,useState:function(){return xc(Ci)},useDebugValue:qh,useDeferredValue:function(i,s){var u=Qt();return Bb(u,St.memoizedState,i,s)},useTransition:function(){var i=xc(Ci)[0],s=Qt().memoizedState;return[typeof i=="boolean"?i:fl(i),s]},useSyncExternalStore:mb,useId:qb,useHostTransitionStatus:Yh,useFormState:Nb,useActionState:Nb,useOptimistic:function(i,s){var u=Qt();return Sb(u,St,i,s)},useMemoCache:Uh,useCacheRefresh:Gb};Xh.useEffectEvent=Mb;var Wb={readContext:gn,use:bc,useCallback:Ub,useContext:gn,useEffect:Hh,useImperativeHandle:Pb,useInsertionEffect:Db,useLayoutEffect:Ib,useMemo:zb,useReducer:Bh,useRef:_b,useState:function(){return Bh(Ci)},useDebugValue:qh,useDeferredValue:function(i,s){var u=Qt();return St===null?Gh(u,i,s):Bb(u,St.memoizedState,i,s)},useTransition:function(){var i=Bh(Ci)[0],s=Qt().memoizedState;return[typeof i=="boolean"?i:fl(i),s]},useSyncExternalStore:mb,useId:qb,useHostTransitionStatus:Yh,useFormState:Rb,useActionState:Rb,useOptimistic:function(i,s){var u=Qt();return St!==null?Sb(u,St,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Uh,useCacheRefresh:Gb};Wb.useEffectEvent=Mb;function Wh(i,s,u,h){s=i.memoizedState,u=u(h,s),u=u==null?s:v({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Qh={enqueueSetState:function(i,s,u){i=i._reactInternals;var h=nr(),y=Wi(h);y.payload=s,u!=null&&(y.callback=u),s=Qi(i,y,h),s!==null&&(Kn(s,i,h),ol(s,i,h))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var h=nr(),y=Wi(h);y.tag=1,y.payload=s,u!=null&&(y.callback=u),s=Qi(i,y,h),s!==null&&(Kn(s,i,h),ol(s,i,h))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=nr(),h=Wi(u);h.tag=2,s!=null&&(h.callback=s),s=Qi(i,h,u),s!==null&&(Kn(s,i,u),ol(s,i,u))}};function Qb(i,s,u,h,y,x,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,x,A):s.prototype&&s.prototype.isPureReactComponent?!Zo(u,h)||!Zo(y,x):!0}function Jb(i,s,u,h){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==i&&Qh.enqueueReplaceState(s,s.state,null)}function Qa(i,s){var u=s;if("ref"in s){u={};for(var h in s)h!=="ref"&&(u[h]=s[h])}if(i=i.defaultProps){u===s&&(u=v({},u));for(var y in i)u[y]===void 0&&(u[y]=i[y])}return u}function Zb(i){tc(i)}function ex(i){console.error(i)}function tx(i){tc(i)}function Tc(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function nx(i,s,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Jh(i,s,u){return u=Wi(u),u.tag=3,u.payload={element:null},u.callback=function(){Tc(i,s)},u}function rx(i){return i=Wi(i),i.tag=3,i}function ix(i,s,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var x=h.value;i.payload=function(){return y(x)},i.callback=function(){nx(s,u,h)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(i.callback=function(){nx(s,u,h),typeof y!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var O=h.stack;this.componentDidCatch(h.value,{componentStack:O!==null?O:""})})}function y2(i,s,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=u.alternate,s!==null&&Ms(s,u,y,!0),u=Jn.current,u!==null){switch(u.tag){case 31:case 13:return yr===null?Lc():u.alternate===null&&qt===0&&(qt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===fc?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([h]):s.add(h),Ep(i,h,y)),!1;case 22:return u.flags|=65536,h===fc?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([h]):u.add(h)),Ep(i,h,y)),!1}throw Error(r(435,u.tag))}return Ep(i,h,y),Lc(),!1}if(nt)return s=Jn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=y,h!==gh&&(i=Error(r(422),{cause:h}),nl(pr(i,u)))):(h!==gh&&(s=Error(r(423),{cause:h}),nl(pr(s,u))),i=i.current.alternate,i.flags|=65536,y&=-y,i.lanes|=y,h=pr(h,u),y=Jh(i.stateNode,h,y),Nh(i,y),qt!==4&&(qt=2)),!1;var x=Error(r(520),{cause:h});if(x=pr(x,u),Sl===null?Sl=[x]:Sl.push(x),qt!==4&&(qt=2),s===null)return!0;h=pr(h,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=y&-y,u.lanes|=i,i=Jh(u.stateNode,h,i),Nh(u,i),!1;case 1:if(s=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ra===null||!ra.has(x))))return u.flags|=65536,y&=-y,u.lanes|=y,y=rx(y),ix(y,i,u,h),Nh(u,y),!1}u=u.return}while(u!==null);return!1}var Zh=Error(r(461)),rn=!1;function yn(i,s,u,h){s.child=i===null?lb(s,null,u,h):Xa(s,i.child,u,h)}function ax(i,s,u,h,y){u=u.render;var x=s.ref;if("ref"in h){var A={};for(var O in h)O!=="ref"&&(A[O]=h[O])}else A=h;return Ga(s),h=Dh(i,s,u,A,x,y),O=Ih(),i!==null&&!rn?(Lh(i,s,y),Ai(i,s,y)):(nt&&O&&mh(s),s.flags|=1,yn(i,s,h,y),s.child)}function sx(i,s,u,h,y){if(i===null){var x=u.type;return typeof x=="function"&&!dh(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,ox(i,s,x,h,y)):(i=ac(u.type,null,h,s,s.mode,y),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,!op(i,y)){var A=x.memoizedProps;if(u=u.compare,u=u!==null?u:Zo,u(A,h)&&i.ref===s.ref)return Ai(i,s,y)}return s.flags|=1,i=Si(x,h),i.ref=s.ref,i.return=s,s.child=i}function ox(i,s,u,h,y){if(i!==null){var x=i.memoizedProps;if(Zo(x,h)&&i.ref===s.ref)if(rn=!1,s.pendingProps=h=x,op(i,y))(i.flags&131072)!==0&&(rn=!0);else return s.lanes=i.lanes,Ai(i,s,y)}return ep(i,s,u,h,y)}function lx(i,s,u,h){var y=h.children,x=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,i!==null){for(h=s.child=i.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~x}else h=0,s.child=null;return ux(i,s,x,u,h)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&uc(s,x!==null?x.cachePool:null),x!==null?fb(s,x):Rh(),db(s);else return h=s.lanes=536870912,ux(i,s,x!==null?x.baseLanes|u:u,u,h)}else x!==null?(uc(s,x.cachePool),fb(s,x),Zi(),s.memoizedState=null):(i!==null&&uc(s,null),Rh(),Zi());return yn(i,s,y,u),s.child}function pl(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function ux(i,s,u,h,y){var x=Th();return x=x===null?null:{parent:tn._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},i!==null&&uc(s,null),Rh(),db(s),i!==null&&Ms(i,s,h,!0),s.childLanes=y,null}function kc(i,s){return s=Ac({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function cx(i,s,u){return Xa(s,i.child,null,u),i=kc(s,s.pendingProps),i.flags|=2,Zn(s),s.memoizedState=null,i}function b2(i,s,u){var h=s.pendingProps,y=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(nt){if(h.mode==="hidden")return i=kc(s,h),s.lanes=536870912,pl(null,i);if(Oh(s),(i=Dt)?(i=wS(i,gr),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Gi!==null?{id:Qr,overflow:Jr}:null,retryLane:536870912,hydrationErrors:null},u=Y0(i),u.return=s,s.child=u,vn=s,Dt=null)):i=null,i===null)throw Yi(s);return s.lanes=536870912,null}return kc(s,h)}var x=i.memoizedState;if(x!==null){var A=x.dehydrated;if(Oh(s),y)if(s.flags&256)s.flags&=-257,s=cx(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(rn||Ms(i,s,u,!1),y=(u&i.childLanes)!==0,rn||y){if(h=Ct,h!==null&&(A=Gu(h,u),A!==0&&A!==x.retryLane))throw x.retryLane=A,Va(i,A),Kn(h,i,A),Zh;Lc(),s=cx(i,s,u)}else i=x.treeContext,Dt=br(A.nextSibling),vn=s,nt=!0,Ki=null,gr=!1,i!==null&&W0(s,i),s=kc(s,h),s.flags|=4096;return s}return i=Si(i.child,{mode:h.mode,children:h.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Cc(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function ep(i,s,u,h,y){return Ga(s),u=Dh(i,s,u,h,void 0,y),h=Ih(),i!==null&&!rn?(Lh(i,s,y),Ai(i,s,y)):(nt&&h&&mh(s),s.flags|=1,yn(i,s,u,y),s.child)}function fx(i,s,u,h,y,x){return Ga(s),s.updateQueue=null,u=pb(s,h,u,y),hb(i),h=Ih(),i!==null&&!rn?(Lh(i,s,x),Ai(i,s,x)):(nt&&h&&mh(s),s.flags|=1,yn(i,s,u,x),s.child)}function dx(i,s,u,h,y){if(Ga(s),s.stateNode===null){var x=js,A=u.contextType;typeof A=="object"&&A!==null&&(x=gn(A)),x=new u(h,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Qh,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=h,x.state=s.memoizedState,x.refs={},Ch(s),A=u.contextType,x.context=typeof A=="object"&&A!==null?gn(A):js,x.state=s.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(Wh(s,u,A,h),x.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(A=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),A!==x.state&&Qh.enqueueReplaceState(x,x.state,null),ul(s,h,x,y),ll(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(i===null){x=s.stateNode;var O=s.memoizedProps,F=Qa(u,O);x.props=F;var ie=x.context,fe=u.contextType;A=js,typeof fe=="object"&&fe!==null&&(A=gn(fe));var me=u.getDerivedStateFromProps;fe=typeof me=="function"||typeof x.getSnapshotBeforeUpdate=="function",O=s.pendingProps!==O,fe||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O||ie!==A)&&Jb(s,x,h,A),Xi=!1;var ae=s.memoizedState;x.state=ae,ul(s,h,x,y),ll(),ie=s.memoizedState,O||ae!==ie||Xi?(typeof me=="function"&&(Wh(s,u,me,h),ie=s.memoizedState),(F=Xi||Qb(s,u,F,h,ae,ie,A))?(fe||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=ie),x.props=h,x.state=ie,x.context=A,h=F):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{x=s.stateNode,Ah(i,s),A=s.memoizedProps,fe=Qa(u,A),x.props=fe,me=s.pendingProps,ae=x.context,ie=u.contextType,F=js,typeof ie=="object"&&ie!==null&&(F=gn(ie)),O=u.getDerivedStateFromProps,(ie=typeof O=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A!==me||ae!==F)&&Jb(s,x,h,F),Xi=!1,ae=s.memoizedState,x.state=ae,ul(s,h,x,y),ll();var le=s.memoizedState;A!==me||ae!==le||Xi||i!==null&&i.dependencies!==null&&oc(i.dependencies)?(typeof O=="function"&&(Wh(s,u,O,h),le=s.memoizedState),(fe=Xi||Qb(s,u,fe,h,ae,le,F)||i!==null&&i.dependencies!==null&&oc(i.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,le,F),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,le,F)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=le),x.props=h,x.state=le,x.context=F,h=fe):(typeof x.componentDidUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&ae===i.memoizedState||(s.flags|=1024),h=!1)}return x=h,Cc(i,s),h=(s.flags&128)!==0,x||h?(x=s.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,i!==null&&h?(s.child=Xa(s,i.child,null,y),s.child=Xa(s,null,u,y)):yn(i,s,u,y),s.memoizedState=x.state,i=s.child):i=Ai(i,s,y),i}function hx(i,s,u,h){return Ha(),s.flags|=256,yn(i,s,u,h),s.child}var tp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function np(i){return{baseLanes:i,cachePool:nb()}}function rp(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=tr),i}function px(i,s,u){var h=s.pendingProps,y=!1,x=(s.flags&128)!==0,A;if((A=x)||(A=i!==null&&i.memoizedState===null?!1:(Wt.current&2)!==0),A&&(y=!0,s.flags&=-129),A=(s.flags&32)!==0,s.flags&=-33,i===null){if(nt){if(y?Ji(s):Zi(),(i=Dt)?(i=wS(i,gr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Gi!==null?{id:Qr,overflow:Jr}:null,retryLane:536870912,hydrationErrors:null},u=Y0(i),u.return=s,s.child=u,vn=s,Dt=null)):i=null,i===null)throw Yi(s);return zp(i)?s.lanes=32:s.lanes=536870912,null}var O=h.children;return h=h.fallback,y?(Zi(),y=s.mode,O=Ac({mode:"hidden",children:O},y),h=Fa(h,y,u,null),O.return=s,h.return=s,O.sibling=h,s.child=O,h=s.child,h.memoizedState=np(u),h.childLanes=rp(i,A,u),s.memoizedState=tp,pl(null,h)):(Ji(s),ip(s,O))}var F=i.memoizedState;if(F!==null&&(O=F.dehydrated,O!==null)){if(x)s.flags&256?(Ji(s),s.flags&=-257,s=ap(i,s,u)):s.memoizedState!==null?(Zi(),s.child=i.child,s.flags|=128,s=null):(Zi(),O=h.fallback,y=s.mode,h=Ac({mode:"visible",children:h.children},y),O=Fa(O,y,u,null),O.flags|=2,h.return=s,O.return=s,h.sibling=O,s.child=h,Xa(s,i.child,null,u),h=s.child,h.memoizedState=np(u),h.childLanes=rp(i,A,u),s.memoizedState=tp,s=pl(null,h));else if(Ji(s),zp(O)){if(A=O.nextSibling&&O.nextSibling.dataset,A)var ie=A.dgst;A=ie,h=Error(r(419)),h.stack="",h.digest=A,nl({value:h,source:null,stack:null}),s=ap(i,s,u)}else if(rn||Ms(i,s,u,!1),A=(u&i.childLanes)!==0,rn||A){if(A=Ct,A!==null&&(h=Gu(A,u),h!==0&&h!==F.retryLane))throw F.retryLane=h,Va(i,h),Kn(A,i,h),Zh;Up(O)||Lc(),s=ap(i,s,u)}else Up(O)?(s.flags|=192,s.child=i.child,s=null):(i=F.treeContext,Dt=br(O.nextSibling),vn=s,nt=!0,Ki=null,gr=!1,i!==null&&W0(s,i),s=ip(s,h.children),s.flags|=4096);return s}return y?(Zi(),O=h.fallback,y=s.mode,F=i.child,ie=F.sibling,h=Si(F,{mode:"hidden",children:h.children}),h.subtreeFlags=F.subtreeFlags&65011712,ie!==null?O=Si(ie,O):(O=Fa(O,y,u,null),O.flags|=2),O.return=s,h.return=s,h.sibling=O,s.child=h,pl(null,h),h=s.child,O=i.child.memoizedState,O===null?O=np(u):(y=O.cachePool,y!==null?(F=tn._currentValue,y=y.parent!==F?{parent:F,pool:F}:y):y=nb(),O={baseLanes:O.baseLanes|u,cachePool:y}),h.memoizedState=O,h.childLanes=rp(i,A,u),s.memoizedState=tp,pl(i.child,h)):(Ji(s),u=i.child,i=u.sibling,u=Si(u,{mode:"visible",children:h.children}),u.return=s,u.sibling=null,i!==null&&(A=s.deletions,A===null?(s.deletions=[i],s.flags|=16):A.push(i)),s.child=u,s.memoizedState=null,u)}function ip(i,s){return s=Ac({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Ac(i,s){return i=Qn(22,i,null,s),i.lanes=0,i}function ap(i,s,u){return Xa(s,i.child,null,u),i=ip(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function mx(i,s,u){i.lanes|=s;var h=i.alternate;h!==null&&(h.lanes|=s),xh(i.return,s,u)}function sp(i,s,u,h,y,x){var A=i.memoizedState;A===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y,treeForkCount:x}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=h,A.tail=u,A.tailMode=y,A.treeForkCount=x)}function vx(i,s,u){var h=s.pendingProps,y=h.revealOrder,x=h.tail;h=h.children;var A=Wt.current,O=(A&2)!==0;if(O?(A=A&1|2,s.flags|=128):A&=1,D(Wt,A),yn(i,s,h,u),h=nt?tl:0,!O&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&mx(i,u,s);else if(i.tag===19)mx(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(y){case"forwards":for(u=s.child,y=null;u!==null;)i=u.alternate,i!==null&&mc(i)===null&&(y=u),u=u.sibling;u=y,u===null?(y=s.child,s.child=null):(y=u.sibling,u.sibling=null),sp(s,!1,y,u,x,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=s.child,s.child=null;y!==null;){if(i=y.alternate,i!==null&&mc(i)===null){s.child=y;break}i=y.sibling,y.sibling=u,u=y,y=i}sp(s,!0,u,null,x,h);break;case"together":sp(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Ai(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),na|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(Ms(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=Si(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=Si(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function op(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&oc(i)))}function x2(i,s,u){switch(s.tag){case 3:Le(s,s.stateNode.containerInfo),$i(s,tn,i.memoizedState.cache),Ha();break;case 27:case 5:ge(s);break;case 4:Le(s,s.stateNode.containerInfo);break;case 10:$i(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Oh(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(Ji(s),s.flags|=128,null):(u&s.child.childLanes)!==0?px(i,s,u):(Ji(s),i=Ai(i,s,u),i!==null?i.sibling:null);Ji(s);break;case 19:var y=(i.flags&128)!==0;if(h=(u&s.childLanes)!==0,h||(Ms(i,s,u,!1),h=(u&s.childLanes)!==0),y){if(h)return vx(i,s,u);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),D(Wt,Wt.current),h)break;return null;case 22:return s.lanes=0,lx(i,s,u,s.pendingProps);case 24:$i(s,tn,i.memoizedState.cache)}return Ai(i,s,u)}function gx(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)rn=!0;else{if(!op(i,u)&&(s.flags&128)===0)return rn=!1,x2(i,s,u);rn=(i.flags&131072)!==0}else rn=!1,nt&&(s.flags&1048576)!==0&&X0(s,tl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(i=Ya(s.elementType),s.type=i,typeof i=="function")dh(i)?(h=Qa(i,h),s.tag=1,s=dx(null,s,i,h,u)):(s.tag=0,s=ep(null,s,i,h,u));else{if(i!=null){var y=i.$$typeof;if(y===j){s.tag=11,s=ax(null,s,i,h,u);break e}else if(y===L){s.tag=14,s=sx(null,s,i,h,u);break e}}throw s=ue(i)||i,Error(r(306,s,""))}}return s;case 0:return ep(i,s,s.type,s.pendingProps,u);case 1:return h=s.type,y=Qa(h,s.pendingProps),dx(i,s,h,y,u);case 3:e:{if(Le(s,s.stateNode.containerInfo),i===null)throw Error(r(387));h=s.pendingProps;var x=s.memoizedState;y=x.element,Ah(i,s),ul(s,h,null,u);var A=s.memoizedState;if(h=A.cache,$i(s,tn,h),h!==x.cache&&Sh(s,[tn],u,!0),ll(),h=A.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=hx(i,s,h,u);break e}else if(h!==y){y=pr(Error(r(424)),s),nl(y),s=hx(i,s,h,u);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Dt=br(i.firstChild),vn=s,nt=!0,Ki=null,gr=!0,u=lb(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ha(),h===y){s=Ai(i,s,u);break e}yn(i,s,h,u)}s=s.child}return s;case 26:return Cc(i,s),i===null?(u=NS(s.type,null,s.pendingProps,null))?s.memoizedState=u:nt||(u=s.type,i=s.pendingProps,h=Hc(Se.current).createElement(u),h[un]=s,h[K]=i,bn(h,u,i),Fe(h),s.stateNode=h):s.memoizedState=NS(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ge(s),i===null&&nt&&(h=s.stateNode=kS(s.type,s.pendingProps,Se.current),vn=s,gr=!0,y=Dt,oa(s.type)?(Bp=y,Dt=br(h.firstChild)):Dt=y),yn(i,s,s.pendingProps.children,u),Cc(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&nt&&((y=h=Dt)&&(h=W2(h,s.type,s.pendingProps,gr),h!==null?(s.stateNode=h,vn=s,Dt=br(h.firstChild),gr=!1,y=!0):y=!1),y||Yi(s)),ge(s),y=s.type,x=s.pendingProps,A=i!==null?i.memoizedProps:null,h=x.children,Ip(y,x)?h=null:A!==null&&Ip(y,A)&&(s.flags|=32),s.memoizedState!==null&&(y=Dh(i,s,f2,null,null,u),jl._currentValue=y),Cc(i,s),yn(i,s,h,u),s.child;case 6:return i===null&&nt&&((i=u=Dt)&&(u=Q2(u,s.pendingProps,gr),u!==null?(s.stateNode=u,vn=s,Dt=null,i=!0):i=!1),i||Yi(s)),null;case 13:return px(i,s,u);case 4:return Le(s,s.stateNode.containerInfo),h=s.pendingProps,i===null?s.child=Xa(s,null,h,u):yn(i,s,h,u),s.child;case 11:return ax(i,s,s.type,s.pendingProps,u);case 7:return yn(i,s,s.pendingProps,u),s.child;case 8:return yn(i,s,s.pendingProps.children,u),s.child;case 12:return yn(i,s,s.pendingProps.children,u),s.child;case 10:return h=s.pendingProps,$i(s,s.type,h.value),yn(i,s,h.children,u),s.child;case 9:return y=s.type._context,h=s.pendingProps.children,Ga(s),y=gn(y),h=h(y),s.flags|=1,yn(i,s,h,u),s.child;case 14:return sx(i,s,s.type,s.pendingProps,u);case 15:return ox(i,s,s.type,s.pendingProps,u);case 19:return vx(i,s,u);case 31:return b2(i,s,u);case 22:return lx(i,s,u,s.pendingProps);case 24:return Ga(s),h=gn(tn),i===null?(y=Th(),y===null&&(y=Ct,x=wh(),y.pooledCache=x,x.refCount++,x!==null&&(y.pooledCacheLanes|=u),y=x),s.memoizedState={parent:h,cache:y},Ch(s),$i(s,tn,y)):((i.lanes&u)!==0&&(Ah(i,s),ul(s,null,null,u),ll()),y=i.memoizedState,x=s.memoizedState,y.parent!==h?(y={parent:h,cache:h},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),$i(s,tn,h)):(h=x.cache,$i(s,tn,h),h!==y.cache&&Sh(s,[tn],u,!0))),yn(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ni(i){i.flags|=4}function lp(i,s,u,h,y){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(y&335544128)===y)if(i.stateNode.complete)i.flags|=8192;else if(qx())i.flags|=8192;else throw $a=fc,kh}else i.flags&=-16777217}function yx(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!MS(s))if(qx())i.flags|=8192;else throw $a=fc,kh}function Nc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Hu():536870912,i.lanes|=s,Gs|=s)}function ml(i,s){if(!nt)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function It(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(s)for(var y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=i,y=y.sibling;else for(y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=i,y=y.sibling;return i.subtreeFlags|=h,i.childLanes=u,s}function S2(i,s,u){var h=s.pendingProps;switch(vh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(s),null;case 1:return It(s),null;case 3:return u=s.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ti(tn),je(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Os(s)?Ni(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,yh())),It(s),null;case 26:var y=s.type,x=s.memoizedState;return i===null?(Ni(s),x!==null?(It(s),yx(s,x)):(It(s),lp(s,y,null,h,u))):x?x!==i.memoizedState?(Ni(s),It(s),yx(s,x)):(It(s),s.flags&=-16777217):(i=i.memoizedProps,i!==h&&Ni(s),It(s),lp(s,y,i,h,u)),null;case 27:if(Pe(s),u=Se.current,y=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==h&&Ni(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return It(s),null}i=de.current,Os(s)?Q0(s):(i=kS(y,h,u),s.stateNode=i,Ni(s))}return It(s),null;case 5:if(Pe(s),y=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==h&&Ni(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return It(s),null}if(x=de.current,Os(s))Q0(s);else{var A=Hc(Se.current);switch(x){case 1:x=A.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:x=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":x=A.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":x=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":x=A.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof h.is=="string"?A.createElement("select",{is:h.is}):A.createElement("select"),h.multiple?x.multiple=!0:h.size&&(x.size=h.size);break;default:x=typeof h.is=="string"?A.createElement(y,{is:h.is}):A.createElement(y)}}x[un]=s,x[K]=h;e:for(A=s.child;A!==null;){if(A.tag===5||A.tag===6)x.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===s)break e;for(;A.sibling===null;){if(A.return===null||A.return===s)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}s.stateNode=x;e:switch(bn(x,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Ni(s)}}return It(s),lp(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==h&&Ni(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(i=Se.current,Os(s)){if(i=s.stateNode,u=s.memoizedProps,h=null,y=vn,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}i[un]=s,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||pS(i.nodeValue,u)),i||Yi(s,!0)}else i=Hc(i).createTextNode(h),i[un]=s,s.stateNode=i}return It(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(h=Os(s),u!==null){if(i===null){if(!h)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[un]=s}else Ha(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;It(s),i=!1}else u=yh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(Zn(s),s):(Zn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return It(s),null;case 13:if(h=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(y=Os(s),h!==null&&h.dehydrated!==null){if(i===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[un]=s}else Ha(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;It(s),y=!1}else y=yh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(Zn(s),s):(Zn(s),null)}return Zn(s),(s.flags&128)!==0?(s.lanes=u,s):(u=h!==null,i=i!==null&&i.memoizedState!==null,u&&(h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==y&&(h.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),Nc(s,s.updateQueue),It(s),null);case 4:return je(),i===null&&Rp(s.stateNode.containerInfo),It(s),null;case 10:return Ti(s.type),It(s),null;case 19:if(ee(Wt),h=s.memoizedState,h===null)return It(s),null;if(y=(s.flags&128)!==0,x=h.rendering,x===null)if(y)ml(h,!1);else{if(qt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(x=mc(i),x!==null){for(s.flags|=128,ml(h,!1),i=x.updateQueue,s.updateQueue=i,Nc(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)K0(u,i),u=u.sibling;return D(Wt,Wt.current&1|2),nt&&wi(s,h.treeForkCount),s.child}i=i.sibling}h.tail!==null&&Me()>Mc&&(s.flags|=128,y=!0,ml(h,!1),s.lanes=4194304)}else{if(!y)if(i=mc(x),i!==null){if(s.flags|=128,y=!0,i=i.updateQueue,s.updateQueue=i,Nc(s,i),ml(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!nt)return It(s),null}else 2*Me()-h.renderingStartTime>Mc&&u!==536870912&&(s.flags|=128,y=!0,ml(h,!1),s.lanes=4194304);h.isBackwards?(x.sibling=s.child,s.child=x):(i=h.last,i!==null?i.sibling=x:s.child=x,h.last=x)}return h.tail!==null?(i=h.tail,h.rendering=i,h.tail=i.sibling,h.renderingStartTime=Me(),i.sibling=null,u=Wt.current,D(Wt,y?u&1|2:u&1),nt&&wi(s,h.treeForkCount),i):(It(s),null);case 22:case 23:return Zn(s),_h(),h=s.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(u&536870912)!==0&&(s.flags&128)===0&&(It(s),s.subtreeFlags&6&&(s.flags|=8192)):It(s),u=s.updateQueue,u!==null&&Nc(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==u&&(s.flags|=2048),i!==null&&ee(Ka),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Ti(tn),It(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function w2(i,s){switch(vh(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ti(tn),je(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Pe(s),null;case 31:if(s.memoizedState!==null){if(Zn(s),s.alternate===null)throw Error(r(340));Ha()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(Zn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ha()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return ee(Wt),null;case 4:return je(),null;case 10:return Ti(s.type),null;case 22:case 23:return Zn(s),_h(),i!==null&&ee(Ka),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ti(tn),null;case 25:return null;default:return null}}function bx(i,s){switch(vh(s),s.tag){case 3:Ti(tn),je();break;case 26:case 27:case 5:Pe(s);break;case 4:je();break;case 31:s.memoizedState!==null&&Zn(s);break;case 13:Zn(s);break;case 19:ee(Wt);break;case 10:Ti(s.type);break;case 22:case 23:Zn(s),_h(),i!==null&&ee(Ka);break;case 24:Ti(tn)}}function vl(i,s){try{var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&i)===i){h=void 0;var x=u.create,A=u.inst;h=x(),A.destroy=h}u=u.next}while(u!==y)}}catch(O){bt(s,s.return,O)}}function ea(i,s,u){try{var h=s.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var x=y.next;h=x;do{if((h.tag&i)===i){var A=h.inst,O=A.destroy;if(O!==void 0){A.destroy=void 0,y=s;var F=u,ie=O;try{ie()}catch(fe){bt(y,F,fe)}}}h=h.next}while(h!==x)}}catch(fe){bt(s,s.return,fe)}}function xx(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{cb(s,u)}catch(h){bt(i,i.return,h)}}}function Sx(i,s,u){u.props=Qa(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){bt(i,s,h)}}function gl(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(y){bt(i,s,y)}}function Zr(i,s){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){bt(i,s,y)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){bt(i,s,y)}else u.current=null}function wx(i){var s=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){bt(i,i.return,y)}}function up(i,s,u){try{var h=i.stateNode;q2(h,i.type,u,s),h[K]=s}catch(y){bt(i,i.return,y)}}function Ex(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&oa(i.type)||i.tag===4}function cp(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Ex(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&oa(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function fp(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=bi));else if(h!==4&&(h===27&&oa(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(fp(i,s,u),i=i.sibling;i!==null;)fp(i,s,u),i=i.sibling}function jc(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(h!==4&&(h===27&&oa(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(jc(i,s,u),i=i.sibling;i!==null;)jc(i,s,u),i=i.sibling}function Tx(i){var s=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);bn(s,h,u),s[un]=i,s[K]=u}catch(x){bt(i,i.return,x)}}var ji=!1,an=!1,dp=!1,kx=typeof WeakSet=="function"?WeakSet:Set,mn=null;function E2(i,s){if(i=i.containerInfo,Mp=Wc,i=P0(i),ah(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var A=0,O=-1,F=-1,ie=0,fe=0,me=i,ae=null;t:for(;;){for(var le;me!==u||y!==0&&me.nodeType!==3||(O=A+y),me!==x||h!==0&&me.nodeType!==3||(F=A+h),me.nodeType===3&&(A+=me.nodeValue.length),(le=me.firstChild)!==null;)ae=me,me=le;for(;;){if(me===i)break t;if(ae===u&&++ie===y&&(O=A),ae===x&&++fe===h&&(F=A),(le=me.nextSibling)!==null)break;me=ae,ae=me.parentNode}me=le}u=O===-1||F===-1?null:{start:O,end:F}}else u=null}u=u||{start:0,end:0}}else u=null;for(Dp={focusedElem:i,selectionRange:u},Wc=!1,mn=s;mn!==null;)if(s=mn,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,mn=i;else for(;mn!==null;){switch(s=mn,x=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)y=i[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,u=s,y=x.memoizedProps,x=x.memoizedState,h=u.stateNode;try{var ke=Qa(u.type,y);i=h.getSnapshotBeforeUpdate(ke,x),h.__reactInternalSnapshotBeforeUpdate=i}catch(Ie){bt(u,u.return,Ie)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Pp(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Pp(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,mn=i;break}mn=s.return}}function Cx(i,s,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:_i(i,u),h&4&&vl(5,u);break;case 1:if(_i(i,u),h&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(A){bt(u,u.return,A)}else{var y=Qa(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(y,s,i.__reactInternalSnapshotBeforeUpdate)}catch(A){bt(u,u.return,A)}}h&64&&xx(u),h&512&&gl(u,u.return);break;case 3:if(_i(i,u),h&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{cb(i,s)}catch(A){bt(u,u.return,A)}}break;case 27:s===null&&h&4&&Tx(u);case 26:case 5:_i(i,u),s===null&&h&4&&wx(u),h&512&&gl(u,u.return);break;case 12:_i(i,u);break;case 31:_i(i,u),h&4&&jx(i,u);break;case 13:_i(i,u),h&4&&Rx(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=O2.bind(null,u),J2(i,u))));break;case 22:if(h=u.memoizedState!==null||ji,!h){s=s!==null&&s.memoizedState!==null||an,y=ji;var x=an;ji=h,(an=s)&&!x?Oi(i,u,(u.subtreeFlags&8772)!==0):_i(i,u),ji=y,an=x}break;case 30:break;default:_i(i,u)}}function Ax(i){var s=i.alternate;s!==null&&(i.alternate=null,Ax(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&cr(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Ut=null,Fn=!1;function Ri(i,s,u){for(u=u.child;u!==null;)Nx(i,s,u),u=u.sibling}function Nx(i,s,u){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(vt,u)}catch{}switch(u.tag){case 26:an||Zr(u,s),Ri(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:an||Zr(u,s);var h=Ut,y=Fn;oa(u.type)&&(Ut=u.stateNode,Fn=!1),Ri(i,s,u),Cl(u.stateNode),Ut=h,Fn=y;break;case 5:an||Zr(u,s);case 6:if(h=Ut,y=Fn,Ut=null,Ri(i,s,u),Ut=h,Fn=y,Ut!==null)if(Fn)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(u.stateNode)}catch(x){bt(u,s,x)}else try{Ut.removeChild(u.stateNode)}catch(x){bt(u,s,x)}break;case 18:Ut!==null&&(Fn?(i=Ut,xS(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Zs(i)):xS(Ut,u.stateNode));break;case 4:h=Ut,y=Fn,Ut=u.stateNode.containerInfo,Fn=!0,Ri(i,s,u),Ut=h,Fn=y;break;case 0:case 11:case 14:case 15:ea(2,u,s),an||ea(4,u,s),Ri(i,s,u);break;case 1:an||(Zr(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"&&Sx(u,s,h)),Ri(i,s,u);break;case 21:Ri(i,s,u);break;case 22:an=(h=an)||u.memoizedState!==null,Ri(i,s,u),an=h;break;default:Ri(i,s,u)}}function jx(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Zs(i)}catch(u){bt(s,s.return,u)}}}function Rx(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Zs(i)}catch(u){bt(s,s.return,u)}}function T2(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new kx),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new kx),s;default:throw Error(r(435,i.tag))}}function Rc(i,s){var u=T2(i);s.forEach(function(h){if(!u.has(h)){u.add(h);var y=M2.bind(null,i,h);h.then(y,y)}})}function Hn(i,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],x=i,A=s,O=A;e:for(;O!==null;){switch(O.tag){case 27:if(oa(O.type)){Ut=O.stateNode,Fn=!1;break e}break;case 5:Ut=O.stateNode,Fn=!1;break e;case 3:case 4:Ut=O.stateNode.containerInfo,Fn=!0;break e}O=O.return}if(Ut===null)throw Error(r(160));Nx(x,A,y),Ut=null,Fn=!1,x=y.alternate,x!==null&&(x.return=null),y.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)_x(s,i),s=s.sibling}var Lr=null;function _x(i,s){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Hn(s,i),qn(i),h&4&&(ea(3,i,i.return),vl(3,i),ea(5,i,i.return));break;case 1:Hn(s,i),qn(i),h&512&&(an||u===null||Zr(u,u.return)),h&64&&ji&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=Lr;if(Hn(s,i),qn(i),h&512&&(an||u===null||Zr(u,u.return)),h&4){var x=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":x=y.getElementsByTagName("title")[0],(!x||x[kn]||x[un]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=y.createElement(h),y.head.insertBefore(x,y.querySelector("head > title"))),bn(x,h,u),x[un]=i,Fe(x),h=x;break e;case"link":var A=_S("link","href",y).get(h+(u.href||""));if(A){for(var O=0;O<A.length;O++)if(x=A[O],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(O,1);break t}}x=y.createElement(h),bn(x,h,u),y.head.appendChild(x);break;case"meta":if(A=_S("meta","content",y).get(h+(u.content||""))){for(O=0;O<A.length;O++)if(x=A[O],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(O,1);break t}}x=y.createElement(h),bn(x,h,u),y.head.appendChild(x);break;default:throw Error(r(468,h))}x[un]=i,Fe(x),h=x}i.stateNode=h}else OS(y,i.type,i.stateNode);else i.stateNode=RS(y,h,i.memoizedProps);else x!==h?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,h===null?OS(y,i.type,i.stateNode):RS(y,h,i.memoizedProps)):h===null&&i.stateNode!==null&&up(i,i.memoizedProps,u.memoizedProps)}break;case 27:Hn(s,i),qn(i),h&512&&(an||u===null||Zr(u,u.return)),u!==null&&h&4&&up(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Hn(s,i),qn(i),h&512&&(an||u===null||Zr(u,u.return)),i.flags&32){y=i.stateNode;try{ws(y,"")}catch(ke){bt(i,i.return,ke)}}h&4&&i.stateNode!=null&&(y=i.memoizedProps,up(i,y,u!==null?u.memoizedProps:y)),h&1024&&(dp=!0);break;case 6:if(Hn(s,i),qn(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(ke){bt(i,i.return,ke)}}break;case 3:if(Kc=null,y=Lr,Lr=qc(s.containerInfo),Hn(s,i),Lr=y,qn(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Zs(s.containerInfo)}catch(ke){bt(i,i.return,ke)}dp&&(dp=!1,Ox(i));break;case 4:h=Lr,Lr=qc(i.stateNode.containerInfo),Hn(s,i),qn(i),Lr=h;break;case 12:Hn(s,i),qn(i);break;case 31:Hn(s,i),qn(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Rc(i,h)));break;case 13:Hn(s,i),qn(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Oc=Me()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Rc(i,h)));break;case 22:y=i.memoizedState!==null;var F=u!==null&&u.memoizedState!==null,ie=ji,fe=an;if(ji=ie||y,an=fe||F,Hn(s,i),an=fe,ji=ie,qn(i),h&8192)e:for(s=i.stateNode,s._visibility=y?s._visibility&-2:s._visibility|1,y&&(u===null||F||ji||an||Ja(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){F=u=s;try{if(x=F.stateNode,y)A=x.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{O=F.stateNode;var me=F.memoizedProps.style,ae=me!=null&&me.hasOwnProperty("display")?me.display:null;O.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(ke){bt(F,F.return,ke)}}}else if(s.tag===6){if(u===null){F=s;try{F.stateNode.nodeValue=y?"":F.memoizedProps}catch(ke){bt(F,F.return,ke)}}}else if(s.tag===18){if(u===null){F=s;try{var le=F.stateNode;y?SS(le,!0):SS(F.stateNode,!1)}catch(ke){bt(F,F.return,ke)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Rc(i,u))));break;case 19:Hn(s,i),qn(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Rc(i,h)));break;case 30:break;case 21:break;default:Hn(s,i),qn(i)}}function qn(i){var s=i.flags;if(s&2){try{for(var u,h=i.return;h!==null;){if(Ex(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,x=cp(i);jc(i,x,y);break;case 5:var A=u.stateNode;u.flags&32&&(ws(A,""),u.flags&=-33);var O=cp(i);jc(i,O,A);break;case 3:case 4:var F=u.stateNode.containerInfo,ie=cp(i);fp(i,ie,F);break;default:throw Error(r(161))}}catch(fe){bt(i,i.return,fe)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Ox(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Ox(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function _i(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Cx(i,s.alternate,s),s=s.sibling}function Ja(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:ea(4,s,s.return),Ja(s);break;case 1:Zr(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&Sx(s,s.return,u),Ja(s);break;case 27:Cl(s.stateNode);case 26:case 5:Zr(s,s.return),Ja(s);break;case 22:s.memoizedState===null&&Ja(s);break;case 30:Ja(s);break;default:Ja(s)}i=i.sibling}}function Oi(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,y=i,x=s,A=x.flags;switch(x.tag){case 0:case 11:case 15:Oi(y,x,u),vl(4,x);break;case 1:if(Oi(y,x,u),h=x,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ie){bt(h,h.return,ie)}if(h=x,y=h.updateQueue,y!==null){var O=h.stateNode;try{var F=y.shared.hiddenCallbacks;if(F!==null)for(y.shared.hiddenCallbacks=null,y=0;y<F.length;y++)ub(F[y],O)}catch(ie){bt(h,h.return,ie)}}u&&A&64&&xx(x),gl(x,x.return);break;case 27:Tx(x);case 26:case 5:Oi(y,x,u),u&&h===null&&A&4&&wx(x),gl(x,x.return);break;case 12:Oi(y,x,u);break;case 31:Oi(y,x,u),u&&A&4&&jx(y,x);break;case 13:Oi(y,x,u),u&&A&4&&Rx(y,x);break;case 22:x.memoizedState===null&&Oi(y,x,u),gl(x,x.return);break;case 30:break;default:Oi(y,x,u)}s=s.sibling}}function hp(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&rl(u))}function pp(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&rl(i))}function Pr(i,s,u,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Mx(i,s,u,h),s=s.sibling}function Mx(i,s,u,h){var y=s.flags;switch(s.tag){case 0:case 11:case 15:Pr(i,s,u,h),y&2048&&vl(9,s);break;case 1:Pr(i,s,u,h);break;case 3:Pr(i,s,u,h),y&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&rl(i)));break;case 12:if(y&2048){Pr(i,s,u,h),i=s.stateNode;try{var x=s.memoizedProps,A=x.id,O=x.onPostCommit;typeof O=="function"&&O(A,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(F){bt(s,s.return,F)}}else Pr(i,s,u,h);break;case 31:Pr(i,s,u,h);break;case 13:Pr(i,s,u,h);break;case 23:break;case 22:x=s.stateNode,A=s.alternate,s.memoizedState!==null?x._visibility&2?Pr(i,s,u,h):yl(i,s):x._visibility&2?Pr(i,s,u,h):(x._visibility|=2,Fs(i,s,u,h,(s.subtreeFlags&10256)!==0||!1)),y&2048&&hp(A,s);break;case 24:Pr(i,s,u,h),y&2048&&pp(s.alternate,s);break;default:Pr(i,s,u,h)}}function Fs(i,s,u,h,y){for(y=y&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=i,A=s,O=u,F=h,ie=A.flags;switch(A.tag){case 0:case 11:case 15:Fs(x,A,O,F,y),vl(8,A);break;case 23:break;case 22:var fe=A.stateNode;A.memoizedState!==null?fe._visibility&2?Fs(x,A,O,F,y):yl(x,A):(fe._visibility|=2,Fs(x,A,O,F,y)),y&&ie&2048&&hp(A.alternate,A);break;case 24:Fs(x,A,O,F,y),y&&ie&2048&&pp(A.alternate,A);break;default:Fs(x,A,O,F,y)}s=s.sibling}}function yl(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,h=s,y=h.flags;switch(h.tag){case 22:yl(u,h),y&2048&&hp(h.alternate,h);break;case 24:yl(u,h),y&2048&&pp(h.alternate,h);break;default:yl(u,h)}s=s.sibling}}var bl=8192;function Hs(i,s,u){if(i.subtreeFlags&bl)for(i=i.child;i!==null;)Dx(i,s,u),i=i.sibling}function Dx(i,s,u){switch(i.tag){case 26:Hs(i,s,u),i.flags&bl&&i.memoizedState!==null&&cO(u,Lr,i.memoizedState,i.memoizedProps);break;case 5:Hs(i,s,u);break;case 3:case 4:var h=Lr;Lr=qc(i.stateNode.containerInfo),Hs(i,s,u),Lr=h;break;case 22:i.memoizedState===null&&(h=i.alternate,h!==null&&h.memoizedState!==null?(h=bl,bl=16777216,Hs(i,s,u),bl=h):Hs(i,s,u));break;default:Hs(i,s,u)}}function Ix(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function xl(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];mn=h,Px(h,i)}Ix(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Lx(i),i=i.sibling}function Lx(i){switch(i.tag){case 0:case 11:case 15:xl(i),i.flags&2048&&ea(9,i,i.return);break;case 3:xl(i);break;case 12:xl(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,_c(i)):xl(i);break;default:xl(i)}}function _c(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];mn=h,Px(h,i)}Ix(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:ea(8,s,s.return),_c(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,_c(s));break;default:_c(s)}i=i.sibling}}function Px(i,s){for(;mn!==null;){var u=mn;switch(u.tag){case 0:case 11:case 15:ea(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:rl(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,mn=h;else e:for(u=i;mn!==null;){h=mn;var y=h.sibling,x=h.return;if(Ax(h),h===u){mn=null;break e}if(y!==null){y.return=x,mn=y;break e}mn=x}}}var k2={getCacheForType:function(i){var s=gn(tn),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return gn(tn).controller.signal}},C2=typeof WeakMap=="function"?WeakMap:Map,ht=0,Ct=null,Xe=null,Ze=0,yt=0,er=null,ta=!1,qs=!1,mp=!1,Mi=0,qt=0,na=0,Za=0,vp=0,tr=0,Gs=0,Sl=null,Gn=null,gp=!1,Oc=0,Ux=0,Mc=1/0,Dc=null,ra=null,cn=0,ia=null,Ks=null,Di=0,yp=0,bp=null,zx=null,wl=0,xp=null;function nr(){return(ht&2)!==0&&Ze!==0?Ze&-Ze:V.T!==null?Cp():Ku()}function Bx(){if(tr===0)if((Ze&536870912)===0||nt){var i=Ft;Ft<<=1,(Ft&3932160)===0&&(Ft=262144),tr=i}else tr=536870912;return i=Jn.current,i!==null&&(i.flags|=32),tr}function Kn(i,s,u){(i===Ct&&(yt===2||yt===9)||i.cancelPendingCommit!==null)&&(Ys(i,0),aa(i,Ze,tr,!1)),Ia(i,u),((ht&2)===0||i!==Ct)&&(i===Ct&&((ht&2)===0&&(Za|=u),qt===4&&aa(i,Ze,tr,!1)),ei(i))}function Vx(i,s,u){if((ht&6)!==0)throw Error(r(327));var h=!u&&(s&127)===0&&(s&i.expiredLanes)===0||$r(i,s),y=h?j2(i,s):wp(i,s,!0),x=h;do{if(y===0){qs&&!h&&aa(i,s,0,!1);break}else{if(u=i.current.alternate,x&&!A2(u)){y=wp(i,s,!1),x=!1;continue}if(y===2){if(x=s,i.errorRecoveryDisabledLanes&x)var A=0;else A=i.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){s=A;e:{var O=i;y=Sl;var F=O.current.memoizedState.isDehydrated;if(F&&(Ys(O,A).flags|=256),A=wp(O,A,!1),A!==2){if(mp&&!F){O.errorRecoveryDisabledLanes|=x,Za|=x,y=4;break e}x=Gn,Gn=y,x!==null&&(Gn===null?Gn=x:Gn.push.apply(Gn,x))}y=A}if(x=!1,y!==2)continue}}if(y===1){Ys(i,0),aa(i,s,0,!0);break}e:{switch(h=i,x=y,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:aa(h,s,tr,!ta);break e;case 2:Gn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(y=Oc+300-Me(),10<y)){if(aa(h,s,tr,!ta),Da(h,0,!0)!==0)break e;Di=s,h.timeoutHandle=yS(Fx.bind(null,h,u,Gn,Dc,gp,s,tr,Za,Gs,ta,x,"Throttled",-0,0),y);break e}Fx(h,u,Gn,Dc,gp,s,tr,Za,Gs,ta,x,null,-0,0)}}break}while(!0);ei(i)}function Fx(i,s,u,h,y,x,A,O,F,ie,fe,me,ae,le){if(i.timeoutHandle=-1,me=s.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bi},Dx(s,x,me);var ke=(x&62914560)===x?Oc-Me():(x&4194048)===x?Ux-Me():0;if(ke=fO(me,ke),ke!==null){Di=x,i.cancelPendingCommit=ke(Wx.bind(null,i,s,x,u,h,y,A,O,F,fe,me,null,ae,le)),aa(i,x,A,!ie);return}}Wx(i,s,x,u,h,y,A,O,F)}function A2(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],x=y.getSnapshot;y=y.value;try{if(!Wn(x(),y))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function aa(i,s,u,h){s&=~vp,s&=~Za,i.suspendedLanes|=s,i.pingedLanes&=~s,h&&(i.warmLanes|=s),h=i.expirationTimes;for(var y=s;0<y;){var x=31-Y(y),A=1<<x;h[x]=-1,y&=~A}u!==0&&Fo(i,u,s)}function Ic(){return(ht&6)===0?(El(0),!1):!0}function Sp(){if(Xe!==null){if(yt===0)var i=Xe.return;else i=Xe,Ei=qa=null,Ph(i),Ps=null,al=0,i=Xe;for(;i!==null;)bx(i.alternate,i),i=i.return;Xe=null}}function Ys(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,Y2(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Di=0,Sp(),Ct=i,Xe=u=Si(i.current,null),Ze=s,yt=0,er=null,ta=!1,qs=$r(i,s),mp=!1,Gs=tr=vp=Za=na=qt=0,Gn=Sl=null,gp=!1,(s&8)!==0&&(s|=s&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=s;0<h;){var y=31-Y(h),x=1<<y;s|=i[y],h&=~x}return Mi=s,nc(),u}function Hx(i,s){Ge=null,V.H=hl,s===Ls||s===cc?(s=ab(),yt=3):s===kh?(s=ab(),yt=4):yt=s===Zh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,er=s,Xe===null&&(qt=1,Tc(i,pr(s,i.current)))}function qx(){var i=Jn.current;return i===null?!0:(Ze&4194048)===Ze?yr===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?i===yr:!1}function Gx(){var i=V.H;return V.H=hl,i===null?hl:i}function Kx(){var i=V.A;return V.A=k2,i}function Lc(){qt=4,ta||(Ze&4194048)!==Ze&&Jn.current!==null||(qs=!0),(na&134217727)===0&&(Za&134217727)===0||Ct===null||aa(Ct,Ze,tr,!1)}function wp(i,s,u){var h=ht;ht|=2;var y=Gx(),x=Kx();(Ct!==i||Ze!==s)&&(Dc=null,Ys(i,s)),s=!1;var A=qt;e:do try{if(yt!==0&&Xe!==null){var O=Xe,F=er;switch(yt){case 8:Sp(),A=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(s=!0);var ie=yt;if(yt=0,er=null,$s(i,O,F,ie),u&&qs){A=0;break e}break;default:ie=yt,yt=0,er=null,$s(i,O,F,ie)}}N2(),A=qt;break}catch(fe){Hx(i,fe)}while(!0);return s&&i.shellSuspendCounter++,Ei=qa=null,ht=h,V.H=y,V.A=x,Xe===null&&(Ct=null,Ze=0,nc()),A}function N2(){for(;Xe!==null;)Yx(Xe)}function j2(i,s){var u=ht;ht|=2;var h=Gx(),y=Kx();Ct!==i||Ze!==s?(Dc=null,Mc=Me()+500,Ys(i,s)):qs=$r(i,s);e:do try{if(yt!==0&&Xe!==null){s=Xe;var x=er;t:switch(yt){case 1:yt=0,er=null,$s(i,s,x,1);break;case 2:case 9:if(rb(x)){yt=0,er=null,$x(s);break}s=function(){yt!==2&&yt!==9||Ct!==i||(yt=7),ei(i)},x.then(s,s);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:rb(x)?(yt=0,er=null,$x(s)):(yt=0,er=null,$s(i,s,x,7));break;case 5:var A=null;switch(Xe.tag){case 26:A=Xe.memoizedState;case 5:case 27:var O=Xe;if(A?MS(A):O.stateNode.complete){yt=0,er=null;var F=O.sibling;if(F!==null)Xe=F;else{var ie=O.return;ie!==null?(Xe=ie,Pc(ie)):Xe=null}break t}}yt=0,er=null,$s(i,s,x,5);break;case 6:yt=0,er=null,$s(i,s,x,6);break;case 8:Sp(),qt=6;break e;default:throw Error(r(462))}}R2();break}catch(fe){Hx(i,fe)}while(!0);return Ei=qa=null,V.H=h,V.A=y,ht=u,Xe!==null?0:(Ct=null,Ze=0,nc(),qt)}function R2(){for(;Xe!==null&&!On();)Yx(Xe)}function Yx(i){var s=gx(i.alternate,i,Mi);i.memoizedProps=i.pendingProps,s===null?Pc(i):Xe=s}function $x(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=fx(u,s,s.pendingProps,s.type,void 0,Ze);break;case 11:s=fx(u,s,s.pendingProps,s.type.render,s.ref,Ze);break;case 5:Ph(s);default:bx(u,s),s=Xe=K0(s,Mi),s=gx(u,s,Mi)}i.memoizedProps=i.pendingProps,s===null?Pc(i):Xe=s}function $s(i,s,u,h){Ei=qa=null,Ph(s),Ps=null,al=0;var y=s.return;try{if(y2(i,y,s,u,Ze)){qt=1,Tc(i,pr(u,i.current)),Xe=null;return}}catch(x){if(y!==null)throw Xe=y,x;qt=1,Tc(i,pr(u,i.current)),Xe=null;return}s.flags&32768?(nt||h===1?i=!0:qs||(Ze&536870912)!==0?i=!1:(ta=i=!0,(h===2||h===9||h===3||h===6)&&(h=Jn.current,h!==null&&h.tag===13&&(h.flags|=16384))),Xx(s,i)):Pc(s)}function Pc(i){var s=i;do{if((s.flags&32768)!==0){Xx(s,ta);return}i=s.return;var u=S2(s.alternate,s,Mi);if(u!==null){Xe=u;return}if(s=s.sibling,s!==null){Xe=s;return}Xe=s=i}while(s!==null);qt===0&&(qt=5)}function Xx(i,s){do{var u=w2(i.alternate,i);if(u!==null){u.flags&=32767,Xe=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Xe=i;return}Xe=i=u}while(i!==null);qt=6,Xe=null}function Wx(i,s,u,h,y,x,A,O,F){i.cancelPendingCommit=null;do Uc();while(cn!==0);if((ht&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=ch,Fd(i,u,x,A,O,F),i===Ct&&(Xe=Ct=null,Ze=0),Ks=s,ia=i,Di=u,yp=x,bp=y,zx=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,D2(Te,function(){return tS(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=V.T,V.T=null,y=W.p,W.p=2,A=ht,ht|=4;try{E2(i,s,u)}finally{ht=A,W.p=y,V.T=h}}cn=1,Qx(),Jx(),Zx()}}function Qx(){if(cn===1){cn=0;var i=ia,s=Ks,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=V.T,V.T=null;var h=W.p;W.p=2;var y=ht;ht|=4;try{_x(s,i);var x=Dp,A=P0(i.containerInfo),O=x.focusedElem,F=x.selectionRange;if(A!==O&&O&&O.ownerDocument&&L0(O.ownerDocument.documentElement,O)){if(F!==null&&ah(O)){var ie=F.start,fe=F.end;if(fe===void 0&&(fe=ie),"selectionStart"in O)O.selectionStart=ie,O.selectionEnd=Math.min(fe,O.value.length);else{var me=O.ownerDocument||document,ae=me&&me.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),ke=O.textContent.length,Ie=Math.min(F.start,ke),Et=F.end===void 0?Ie:Math.min(F.end,ke);!le.extend&&Ie>Et&&(A=Et,Et=Ie,Ie=A);var J=I0(O,Ie),q=I0(O,Et);if(J&&q&&(le.rangeCount!==1||le.anchorNode!==J.node||le.anchorOffset!==J.offset||le.focusNode!==q.node||le.focusOffset!==q.offset)){var re=me.createRange();re.setStart(J.node,J.offset),le.removeAllRanges(),Ie>Et?(le.addRange(re),le.extend(q.node,q.offset)):(re.setEnd(q.node,q.offset),le.addRange(re))}}}}for(me=[],le=O;le=le.parentNode;)le.nodeType===1&&me.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<me.length;O++){var pe=me[O];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Wc=!!Mp,Dp=Mp=null}finally{ht=y,W.p=h,V.T=u}}i.current=s,cn=2}}function Jx(){if(cn===2){cn=0;var i=ia,s=Ks,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=V.T,V.T=null;var h=W.p;W.p=2;var y=ht;ht|=4;try{Cx(i,s.alternate,s)}finally{ht=y,W.p=h,V.T=u}}cn=3}}function Zx(){if(cn===4||cn===3){cn=0,ze();var i=ia,s=Ks,u=Di,h=zx;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?cn=5:(cn=0,Ks=ia=null,eS(i,i.pendingLanes));var y=i.pendingLanes;if(y===0&&(ra=null),qo(u),s=s.stateNode,Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(vt,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=V.T,y=W.p,W.p=2,V.T=null;try{for(var x=i.onRecoverableError,A=0;A<h.length;A++){var O=h[A];x(O.value,{componentStack:O.stack})}}finally{V.T=s,W.p=y}}(Di&3)!==0&&Uc(),ei(i),y=i.pendingLanes,(u&261930)!==0&&(y&42)!==0?i===xp?wl++:(wl=0,xp=i):wl=0,El(0)}}function eS(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,rl(s)))}function Uc(){return Qx(),Jx(),Zx(),tS()}function tS(){if(cn!==5)return!1;var i=ia,s=yp;yp=0;var u=qo(Di),h=V.T,y=W.p;try{W.p=32>u?32:u,V.T=null,u=bp,bp=null;var x=ia,A=Di;if(cn=0,Ks=ia=null,Di=0,(ht&6)!==0)throw Error(r(331));var O=ht;if(ht|=4,Lx(x.current),Mx(x,x.current,A,u),ht=O,El(0,!1),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(vt,x)}catch{}return!0}finally{W.p=y,V.T=h,eS(i,s)}}function nS(i,s,u){s=pr(u,s),s=Jh(i.stateNode,s,2),i=Qi(i,s,2),i!==null&&(Ia(i,2),ei(i))}function bt(i,s,u){if(i.tag===3)nS(i,i,u);else for(;s!==null;){if(s.tag===3){nS(s,i,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ra===null||!ra.has(h))){i=pr(u,i),u=rx(2),h=Qi(s,u,2),h!==null&&(ix(u,h,s,i),Ia(h,2),ei(h));break}}s=s.return}}function Ep(i,s,u){var h=i.pingCache;if(h===null){h=i.pingCache=new C2;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(u)||(mp=!0,y.add(u),i=_2.bind(null,i,s,u),s.then(i,i))}function _2(i,s,u){var h=i.pingCache;h!==null&&h.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Ct===i&&(Ze&u)===u&&(qt===4||qt===3&&(Ze&62914560)===Ze&&300>Me()-Oc?(ht&2)===0&&Ys(i,0):vp|=u,Gs===Ze&&(Gs=0)),ei(i)}function rS(i,s){s===0&&(s=Hu()),i=Va(i,s),i!==null&&(Ia(i,s),ei(i))}function O2(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),rS(i,u)}function M2(i,s){var u=0;switch(i.tag){case 31:case 13:var h=i.stateNode,y=i.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),rS(i,u)}function D2(i,s){return mt(i,s)}var zc=null,Xs=null,Tp=!1,Bc=!1,kp=!1,sa=0;function ei(i){i!==Xs&&i.next===null&&(Xs===null?zc=Xs=i:Xs=Xs.next=i),Bc=!0,Tp||(Tp=!0,L2())}function El(i,s){if(!kp&&Bc){kp=!0;do for(var u=!1,h=zc;h!==null;){if(i!==0){var y=h.pendingLanes;if(y===0)var x=0;else{var A=h.suspendedLanes,O=h.pingedLanes;x=(1<<31-Y(42|i)+1)-1,x&=y&~(A&~O),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,oS(h,x))}else x=Ze,x=Da(h,h===Ct?x:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(x&3)===0||$r(h,x)||(u=!0,oS(h,x));h=h.next}while(u);kp=!1}}function I2(){iS()}function iS(){Bc=Tp=!1;var i=0;sa!==0&&K2()&&(i=sa);for(var s=Me(),u=null,h=zc;h!==null;){var y=h.next,x=aS(h,s);x===0?(h.next=null,u===null?zc=y:u.next=y,y===null&&(Xs=u)):(u=h,(i!==0||(x&3)!==0)&&(Bc=!0)),h=y}cn!==0&&cn!==5||El(i),sa!==0&&(sa=0)}function aS(i,s){for(var u=i.suspendedLanes,h=i.pingedLanes,y=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var A=31-Y(x),O=1<<A,F=y[A];F===-1?((O&u)===0||(O&h)!==0)&&(y[A]=xs(O,s)):F<=s&&(i.expiredLanes|=O),x&=~O}if(s=Ct,u=Ze,u=Da(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===s&&(yt===2||yt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&at(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||$r(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(h!==null&&at(h),qo(u)){case 2:case 8:u=se;break;case 32:u=Te;break;case 268435456:u=Be;break;default:u=Te}return h=sS.bind(null,i),u=mt(u,h),i.callbackPriority=s,i.callbackNode=u,s}return h!==null&&h!==null&&at(h),i.callbackPriority=2,i.callbackNode=null,2}function sS(i,s){if(cn!==0&&cn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Uc()&&i.callbackNode!==u)return null;var h=Ze;return h=Da(i,i===Ct?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(Vx(i,h,s),aS(i,Me()),i.callbackNode!=null&&i.callbackNode===u?sS.bind(null,i):null)}function oS(i,s){if(Uc())return null;Vx(i,s,!0)}function L2(){$2(function(){(ht&6)!==0?mt(H,I2):iS()})}function Cp(){if(sa===0){var i=Ds;i===0&&(i=Mr,Mr<<=1,(Mr&261888)===0&&(Mr=256)),sa=i}return sa}function lS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:$u(""+i)}function uS(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function P2(i,s,u,h,y){if(s==="submit"&&u&&u.stateNode===y){var x=lS((y[K]||null).action),A=h.submitter;A&&(s=(s=A[K]||null)?lS(s.formAction):A.getAttribute("formAction"),s!==null&&(x=s,A=null));var O=new Ju("action","action",null,h,y);i.push({event:O,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(sa!==0){var F=A?uS(y,A):new FormData(y);Kh(u,{pending:!0,data:F,method:y.method,action:x},null,F)}}else typeof x=="function"&&(O.preventDefault(),F=A?uS(y,A):new FormData(y),Kh(u,{pending:!0,data:F,method:y.method,action:x},x,F))},currentTarget:y}]})}}for(var Ap=0;Ap<uh.length;Ap++){var Np=uh[Ap],U2=Np.toLowerCase(),z2=Np[0].toUpperCase()+Np.slice(1);Ir(U2,"on"+z2)}Ir(B0,"onAnimationEnd"),Ir(V0,"onAnimationIteration"),Ir(F0,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(t2,"onTransitionRun"),Ir(n2,"onTransitionStart"),Ir(r2,"onTransitionCancel"),Ir(H0,"onTransitionEnd"),Bn("onMouseEnter",["mouseout","mouseover"]),Bn("onMouseLeave",["mouseout","mouseover"]),Bn("onPointerEnter",["pointerout","pointerover"]),Bn("onPointerLeave",["pointerout","pointerover"]),Xt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),B2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tl));function cS(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],y=h.event;h=h.listeners;e:{var x=void 0;if(s)for(var A=h.length-1;0<=A;A--){var O=h[A],F=O.instance,ie=O.currentTarget;if(O=O.listener,F!==x&&y.isPropagationStopped())break e;x=O,y.currentTarget=ie;try{x(y)}catch(fe){tc(fe)}y.currentTarget=null,x=F}else for(A=0;A<h.length;A++){if(O=h[A],F=O.instance,ie=O.currentTarget,O=O.listener,F!==x&&y.isPropagationStopped())break e;x=O,y.currentTarget=ie;try{x(y)}catch(fe){tc(fe)}y.currentTarget=null,x=F}}}}function We(i,s){var u=s[tt];u===void 0&&(u=s[tt]=new Set);var h=i+"__bubble";u.has(h)||(fS(s,i,2,!1),u.add(h))}function jp(i,s,u){var h=0;s&&(h|=4),fS(u,i,h,s)}var Vc="_reactListening"+Math.random().toString(36).slice(2);function Rp(i){if(!i[Vc]){i[Vc]=!0,ut.forEach(function(u){u!=="selectionchange"&&(B2.has(u)||jp(u,!1,i),jp(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Vc]||(s[Vc]=!0,jp("selectionchange",!1,s))}}function fS(i,s,u,h){switch(BS(s)){case 2:var y=pO;break;case 8:y=mO;break;default:y=Gp}u=y.bind(null,s,u,i),y=void 0,!Wd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),h?y!==void 0?i.addEventListener(s,u,{capture:!0,passive:y}):i.addEventListener(s,u,!0):y!==void 0?i.addEventListener(s,u,{passive:y}):i.addEventListener(s,u,!1)}function _p(i,s,u,h,y){var x=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var A=h.tag;if(A===3||A===4){var O=h.stateNode.containerInfo;if(O===y)break;if(A===4)for(A=h.return;A!==null;){var F=A.tag;if((F===3||F===4)&&A.stateNode.containerInfo===y)return;A=A.return}for(;O!==null;){if(A=pn(O),A===null)return;if(F=A.tag,F===5||F===6||F===26||F===27){h=x=A;continue e}O=O.parentNode}}h=h.return}v0(function(){var ie=x,fe=$d(u),me=[];e:{var ae=q0.get(i);if(ae!==void 0){var le=Ju,ke=i;switch(i){case"keypress":if(Wu(u)===0)break e;case"keydown":case"keyup":le=M_;break;case"focusin":ke="focus",le=eh;break;case"focusout":ke="blur",le=eh;break;case"beforeblur":case"afterblur":le=eh;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=b0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=S_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=L_;break;case B0:case V0:case F0:le=T_;break;case H0:le=U_;break;case"scroll":case"scrollend":le=b_;break;case"wheel":le=B_;break;case"copy":case"cut":case"paste":le=C_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=S0;break;case"toggle":case"beforetoggle":le=F_}var Ie=(s&4)!==0,Et=!Ie&&(i==="scroll"||i==="scrollend"),J=Ie?ae!==null?ae+"Capture":null:ae;Ie=[];for(var q=ie,re;q!==null;){var pe=q;if(re=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||re===null||J===null||(pe=Ko(q,J),pe!=null&&Ie.push(kl(q,pe,re))),Et)break;q=q.return}0<Ie.length&&(ae=new le(ae,ke,null,u,fe),me.push({event:ae,listeners:Ie}))}}if((s&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",le=i==="mouseout"||i==="pointerout",ae&&u!==Yd&&(ke=u.relatedTarget||u.fromElement)&&(pn(ke)||ke[ve]))break e;if((le||ae)&&(ae=fe.window===fe?fe:(ae=fe.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(ke=u.relatedTarget||u.toElement,le=ie,ke=ke?pn(ke):null,ke!==null&&(Et=o(ke),Ie=ke.tag,ke!==Et||Ie!==5&&Ie!==27&&Ie!==6)&&(ke=null)):(le=null,ke=ie),le!==ke)){if(Ie=b0,pe="onMouseLeave",J="onMouseEnter",q="mouse",(i==="pointerout"||i==="pointerover")&&(Ie=S0,pe="onPointerLeave",J="onPointerEnter",q="pointer"),Et=le==null?ae:Dr(le),re=ke==null?ae:Dr(ke),ae=new Ie(pe,q+"leave",le,u,fe),ae.target=Et,ae.relatedTarget=re,pe=null,pn(fe)===ie&&(Ie=new Ie(J,q+"enter",ke,u,fe),Ie.target=re,Ie.relatedTarget=Et,pe=Ie),Et=pe,le&&ke)t:{for(Ie=V2,J=le,q=ke,re=0,pe=J;pe;pe=Ie(pe))re++;pe=0;for(var Oe=q;Oe;Oe=Ie(Oe))pe++;for(;0<re-pe;)J=Ie(J),re--;for(;0<pe-re;)q=Ie(q),pe--;for(;re--;){if(J===q||q!==null&&J===q.alternate){Ie=J;break t}J=Ie(J),q=Ie(q)}Ie=null}else Ie=null;le!==null&&dS(me,ae,le,Ie,!1),ke!==null&&Et!==null&&dS(me,Et,ke,Ie,!0)}}e:{if(ae=ie?Dr(ie):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var ct=j0;else if(A0(ae))if(R0)ct=J_;else{ct=W_;var Ne=X_}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ie&&Kd(ie.elementType)&&(ct=j0):ct=Q_;if(ct&&(ct=ct(i,ie))){N0(me,ct,u,fe);break e}Ne&&Ne(i,ae,ie),i==="focusout"&&ie&&ae.type==="number"&&ie.memoizedProps.value!=null&&Gd(ae,"number",ae.value)}switch(Ne=ie?Dr(ie):window,i){case"focusin":(A0(Ne)||Ne.contentEditable==="true")&&(Cs=Ne,sh=ie,el=null);break;case"focusout":el=sh=Cs=null;break;case"mousedown":oh=!0;break;case"contextmenu":case"mouseup":case"dragend":oh=!1,U0(me,u,fe);break;case"selectionchange":if(e2)break;case"keydown":case"keyup":U0(me,u,fe)}var Ke;if(nh)e:{switch(i){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else ks?k0(i,u)&&(et="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(et="onCompositionStart");et&&(w0&&u.locale!=="ko"&&(ks||et!=="onCompositionStart"?et==="onCompositionEnd"&&ks&&(Ke=g0()):(qi=fe,Qd="value"in qi?qi.value:qi.textContent,ks=!0)),Ne=Fc(ie,et),0<Ne.length&&(et=new x0(et,i,null,u,fe),me.push({event:et,listeners:Ne}),Ke?et.data=Ke:(Ke=C0(u),Ke!==null&&(et.data=Ke)))),(Ke=q_?G_(i,u):K_(i,u))&&(et=Fc(ie,"onBeforeInput"),0<et.length&&(Ne=new x0("onBeforeInput","beforeinput",null,u,fe),me.push({event:Ne,listeners:et}),Ne.data=Ke)),P2(me,i,ie,u,fe)}cS(me,s)})}function kl(i,s,u){return{instance:i,listener:s,currentTarget:u}}function Fc(i,s){for(var u=s+"Capture",h=[];i!==null;){var y=i,x=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||x===null||(y=Ko(i,u),y!=null&&h.unshift(kl(i,y,x)),y=Ko(i,s),y!=null&&h.push(kl(i,y,x))),i.tag===3)return h;i=i.return}return[]}function V2(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function dS(i,s,u,h,y){for(var x=s._reactName,A=[];u!==null&&u!==h;){var O=u,F=O.alternate,ie=O.stateNode;if(O=O.tag,F!==null&&F===h)break;O!==5&&O!==26&&O!==27||ie===null||(F=ie,y?(ie=Ko(u,x),ie!=null&&A.unshift(kl(u,ie,F))):y||(ie=Ko(u,x),ie!=null&&A.push(kl(u,ie,F)))),u=u.return}A.length!==0&&i.push({event:s,listeners:A})}var F2=/\r\n?/g,H2=/\u0000|\uFFFD/g;function hS(i){return(typeof i=="string"?i:""+i).replace(F2,`
|
|
9
|
+
`).replace(H2,"")}function pS(i,s){return s=hS(s),hS(i)===s}function wt(i,s,u,h,y,x){switch(u){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||ws(i,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&ws(i,""+h);break;case"className":Pa(i,"class",h);break;case"tabIndex":Pa(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Pa(i,u,h);break;case"style":p0(i,h,x);break;case"data":if(s!=="object"){Pa(i,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=$u(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(u==="formAction"?(s!=="input"&&wt(i,s,"name",y.name,y,null),wt(i,s,"formEncType",y.formEncType,y,null),wt(i,s,"formMethod",y.formMethod,y,null),wt(i,s,"formTarget",y.formTarget,y,null)):(wt(i,s,"encType",y.encType,y,null),wt(i,s,"method",y.method,y,null),wt(i,s,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=$u(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=bi);break;case"onScroll":h!=null&&We("scroll",i);break;case"onScrollEnd":h!=null&&We("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}u=$u(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""+h):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":We("beforetoggle",i),We("toggle",i),gi(i,"popover",h);break;case"xlinkActuate":yi(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":yi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":yi(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":yi(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":yi(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":yi(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":yi(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":yi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":yi(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":gi(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=g_.get(u)||u,gi(i,u,h))}}function Op(i,s,u,h,y,x){switch(u){case"style":p0(i,h,x);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof h=="string"?ws(i,h):(typeof h=="number"||typeof h=="bigint")&&ws(i,""+h);break;case"onScroll":h!=null&&We("scroll",i);break;case"onScrollEnd":h!=null&&We("scrollend",i);break;case"onClick":h!=null&&(i.onclick=bi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mt.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),s=u.slice(2,y?u.length-7:void 0),x=i[K]||null,x=x!=null?x[u]:null,typeof x=="function"&&i.removeEventListener(s,x,y),typeof h=="function")){typeof x!="function"&&x!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,h,y);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):gi(i,u,h)}}}function bn(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",i),We("load",i);var h=!1,y=!1,x;for(x in u)if(u.hasOwnProperty(x)){var A=u[x];if(A!=null)switch(x){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:wt(i,s,x,A,u,null)}}y&&wt(i,s,"srcSet",u.srcSet,u,null),h&&wt(i,s,"src",u.src,u,null);return;case"input":We("invalid",i);var O=x=A=y=null,F=null,ie=null;for(h in u)if(u.hasOwnProperty(h)){var fe=u[h];if(fe!=null)switch(h){case"name":y=fe;break;case"type":A=fe;break;case"checked":F=fe;break;case"defaultChecked":ie=fe;break;case"value":x=fe;break;case"defaultValue":O=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,s));break;default:wt(i,s,h,fe,u,null)}}c0(i,x,O,F,ie,A,y,!1);return;case"select":We("invalid",i),h=A=x=null;for(y in u)if(u.hasOwnProperty(y)&&(O=u[y],O!=null))switch(y){case"value":x=O;break;case"defaultValue":A=O;break;case"multiple":h=O;default:wt(i,s,y,O,u,null)}s=x,u=A,i.multiple=!!h,s!=null?Ss(i,!!h,s,!1):u!=null&&Ss(i,!!h,u,!0);return;case"textarea":We("invalid",i),x=y=h=null;for(A in u)if(u.hasOwnProperty(A)&&(O=u[A],O!=null))switch(A){case"value":h=O;break;case"defaultValue":y=O;break;case"children":x=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:wt(i,s,A,O,u,null)}d0(i,h,y,x);return;case"option":for(F in u)u.hasOwnProperty(F)&&(h=u[F],h!=null)&&(F==="selected"?i.selected=h&&typeof h!="function"&&typeof h!="symbol":wt(i,s,F,h,u,null));return;case"dialog":We("beforetoggle",i),We("toggle",i),We("cancel",i),We("close",i);break;case"iframe":case"object":We("load",i);break;case"video":case"audio":for(h=0;h<Tl.length;h++)We(Tl[h],i);break;case"image":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"embed":case"source":case"link":We("error",i),We("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in u)if(u.hasOwnProperty(ie)&&(h=u[ie],h!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:wt(i,s,ie,h,u,null)}return;default:if(Kd(s)){for(fe in u)u.hasOwnProperty(fe)&&(h=u[fe],h!==void 0&&Op(i,s,fe,h,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(h=u[O],h!=null&&wt(i,s,O,h,u,null))}function q2(i,s,u,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,x=null,A=null,O=null,F=null,ie=null,fe=null;for(le in u){var me=u[le];if(u.hasOwnProperty(le)&&me!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":F=me;default:h.hasOwnProperty(le)||wt(i,s,le,null,h,me)}}for(var ae in h){var le=h[ae];if(me=u[ae],h.hasOwnProperty(ae)&&(le!=null||me!=null))switch(ae){case"type":x=le;break;case"name":y=le;break;case"checked":ie=le;break;case"defaultChecked":fe=le;break;case"value":A=le;break;case"defaultValue":O=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,s));break;default:le!==me&&wt(i,s,ae,le,h,me)}}qd(i,A,O,F,ie,fe,x,y);return;case"select":le=A=O=ae=null;for(x in u)if(F=u[x],u.hasOwnProperty(x)&&F!=null)switch(x){case"value":break;case"multiple":le=F;default:h.hasOwnProperty(x)||wt(i,s,x,null,h,F)}for(y in h)if(x=h[y],F=u[y],h.hasOwnProperty(y)&&(x!=null||F!=null))switch(y){case"value":ae=x;break;case"defaultValue":O=x;break;case"multiple":A=x;default:x!==F&&wt(i,s,y,x,h,F)}s=O,u=A,h=le,ae!=null?Ss(i,!!u,ae,!1):!!h!=!!u&&(s!=null?Ss(i,!!u,s,!0):Ss(i,!!u,u?[]:"",!1));return;case"textarea":le=ae=null;for(O in u)if(y=u[O],u.hasOwnProperty(O)&&y!=null&&!h.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:wt(i,s,O,null,h,y)}for(A in h)if(y=h[A],x=u[A],h.hasOwnProperty(A)&&(y!=null||x!=null))switch(A){case"value":ae=y;break;case"defaultValue":le=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==x&&wt(i,s,A,y,h,x)}f0(i,ae,le);return;case"option":for(var ke in u)ae=u[ke],u.hasOwnProperty(ke)&&ae!=null&&!h.hasOwnProperty(ke)&&(ke==="selected"?i.selected=!1:wt(i,s,ke,null,h,ae));for(F in h)ae=h[F],le=u[F],h.hasOwnProperty(F)&&ae!==le&&(ae!=null||le!=null)&&(F==="selected"?i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":wt(i,s,F,ae,h,le));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in u)ae=u[Ie],u.hasOwnProperty(Ie)&&ae!=null&&!h.hasOwnProperty(Ie)&&wt(i,s,Ie,null,h,ae);for(ie in h)if(ae=h[ie],le=u[ie],h.hasOwnProperty(ie)&&ae!==le&&(ae!=null||le!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,s));break;default:wt(i,s,ie,ae,h,le)}return;default:if(Kd(s)){for(var Et in u)ae=u[Et],u.hasOwnProperty(Et)&&ae!==void 0&&!h.hasOwnProperty(Et)&&Op(i,s,Et,void 0,h,ae);for(fe in h)ae=h[fe],le=u[fe],!h.hasOwnProperty(fe)||ae===le||ae===void 0&&le===void 0||Op(i,s,fe,ae,h,le);return}}for(var J in u)ae=u[J],u.hasOwnProperty(J)&&ae!=null&&!h.hasOwnProperty(J)&&wt(i,s,J,null,h,ae);for(me in h)ae=h[me],le=u[me],!h.hasOwnProperty(me)||ae===le||ae==null&&le==null||wt(i,s,me,ae,h,le)}function mS(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function G2(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var y=u[h],x=y.transferSize,A=y.initiatorType,O=y.duration;if(x&&O&&mS(A)){for(A=0,O=y.responseEnd,h+=1;h<u.length;h++){var F=u[h],ie=F.startTime;if(ie>O)break;var fe=F.transferSize,me=F.initiatorType;fe&&mS(me)&&(F=F.responseEnd,A+=fe*(F<O?1:(O-ie)/(F-ie)))}if(--h,s+=8*(x+A)/(y.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Mp=null,Dp=null;function Hc(i){return i.nodeType===9?i:i.ownerDocument}function vS(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gS(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Ip(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Lp=null;function K2(){var i=window.event;return i&&i.type==="popstate"?i===Lp?!1:(Lp=i,!0):(Lp=null,!1)}var yS=typeof setTimeout=="function"?setTimeout:void 0,Y2=typeof clearTimeout=="function"?clearTimeout:void 0,bS=typeof Promise=="function"?Promise:void 0,$2=typeof queueMicrotask=="function"?queueMicrotask:typeof bS<"u"?function(i){return bS.resolve(null).then(i).catch(X2)}:yS;function X2(i){setTimeout(function(){throw i})}function oa(i){return i==="head"}function xS(i,s){var u=s,h=0;do{var y=u.nextSibling;if(i.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(h===0){i.removeChild(y),Zs(s);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Cl(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Cl(u);for(var x=u.firstChild;x;){var A=x.nextSibling,O=x.nodeName;x[kn]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=A}}else u==="body"&&Cl(i.ownerDocument.body);u=y}while(u);Zs(s)}function SS(i,s){var u=i;i=0;do{var h=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=h}while(u)}function Pp(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Pp(u),cr(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function W2(i,s,u,h){for(;i.nodeType===1;){var y=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[kn])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==y.rel||i.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||i.getAttribute("title")!==(y.title==null?null:y.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(y.src==null?null:y.src)||i.getAttribute("type")!==(y.type==null?null:y.type)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var x=y.name==null?null:""+y.name;if(y.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=br(i.nextSibling),i===null)break}return null}function Q2(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=br(i.nextSibling),i===null))return null;return i}function wS(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=br(i.nextSibling),i===null))return null;return i}function Up(i){return i.data==="$?"||i.data==="$~"}function zp(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function J2(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var h=function(){s(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function br(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Bp=null;function ES(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return br(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function TS(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function kS(i,s,u){switch(s=Hc(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Cl(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);cr(i)}var xr=new Map,CS=new Set;function qc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ii=W.d;W.d={f:Z2,r:eO,D:tO,C:nO,L:rO,m:iO,X:sO,S:aO,M:oO};function Z2(){var i=Ii.f(),s=Ic();return i||s}function eO(i){var s=mi(i);s!==null&&s.tag===5&&s.type==="form"?Hb(s):Ii.r(i)}var Ws=typeof document>"u"?null:document;function AS(i,s,u){var h=Ws;if(h&&typeof s=="string"&&s){var y=dr(s);y='link[rel="'+i+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),CS.has(y)||(CS.add(y),i={rel:i,crossOrigin:u,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),bn(s,"link",i),Fe(s),h.head.appendChild(s)))}}function tO(i){Ii.D(i),AS("dns-prefetch",i,null)}function nO(i,s){Ii.C(i,s),AS("preconnect",i,s)}function rO(i,s,u){Ii.L(i,s,u);var h=Ws;if(h&&i&&s){var y='link[rel="preload"][as="'+dr(s)+'"]';s==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+dr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+dr(u.imageSizes)+'"]')):y+='[href="'+dr(i)+'"]';var x=y;switch(s){case"style":x=Qs(i);break;case"script":x=Js(i)}xr.has(x)||(i=v({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),xr.set(x,i),h.querySelector(y)!==null||s==="style"&&h.querySelector(Al(x))||s==="script"&&h.querySelector(Nl(x))||(s=h.createElement("link"),bn(s,"link",i),Fe(s),h.head.appendChild(s)))}}function iO(i,s){Ii.m(i,s);var u=Ws;if(u&&i){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+dr(h)+'"][href="'+dr(i)+'"]',x=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Js(i)}if(!xr.has(x)&&(i=v({rel:"modulepreload",href:i},s),xr.set(x,i),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Nl(x)))return}h=u.createElement("link"),bn(h,"link",i),Fe(h),u.head.appendChild(h)}}}function aO(i,s,u){Ii.S(i,s,u);var h=Ws;if(h&&i){var y=Ve(h).hoistableStyles,x=Qs(i);s=s||"default";var A=y.get(x);if(!A){var O={loading:0,preload:null};if(A=h.querySelector(Al(x)))O.loading=5;else{i=v({rel:"stylesheet",href:i,"data-precedence":s},u),(u=xr.get(x))&&Vp(i,u);var F=A=h.createElement("link");Fe(F),bn(F,"link",i),F._p=new Promise(function(ie,fe){F.onload=ie,F.onerror=fe}),F.addEventListener("load",function(){O.loading|=1}),F.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Gc(A,s,h)}A={type:"stylesheet",instance:A,count:1,state:O},y.set(x,A)}}}function sO(i,s){Ii.X(i,s);var u=Ws;if(u&&i){var h=Ve(u).hoistableScripts,y=Js(i),x=h.get(y);x||(x=u.querySelector(Nl(y)),x||(i=v({src:i,async:!0},s),(s=xr.get(y))&&Fp(i,s),x=u.createElement("script"),Fe(x),bn(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(y,x))}}function oO(i,s){Ii.M(i,s);var u=Ws;if(u&&i){var h=Ve(u).hoistableScripts,y=Js(i),x=h.get(y);x||(x=u.querySelector(Nl(y)),x||(i=v({src:i,async:!0,type:"module"},s),(s=xr.get(y))&&Fp(i,s),x=u.createElement("script"),Fe(x),bn(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(y,x))}}function NS(i,s,u,h){var y=(y=Se.current)?qc(y):null;if(!y)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=Qs(u.href),u=Ve(y).hoistableStyles,h=u.get(s),h||(h={type:"style",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Qs(u.href);var x=Ve(y).hoistableStyles,A=x.get(i);if(A||(y=y.ownerDocument||y,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,A),(x=y.querySelector(Al(i)))&&!x._p&&(A.instance=x,A.state.loading=5),xr.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},xr.set(i,u),x||lO(y,i,u,A.state))),s&&h===null)throw Error(r(528,""));return A}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Js(u),u=Ve(y).hoistableScripts,h=u.get(s),h||(h={type:"script",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Qs(i){return'href="'+dr(i)+'"'}function Al(i){return'link[rel="stylesheet"]['+i+"]"}function jS(i){return v({},i,{"data-precedence":i.precedence,precedence:null})}function lO(i,s,u,h){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=i.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),bn(s,"link",u),Fe(s),i.head.appendChild(s))}function Js(i){return'[src="'+dr(i)+'"]'}function Nl(i){return"script[async]"+i}function RS(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var h=i.querySelector('style[data-href~="'+dr(u.href)+'"]');if(h)return s.instance=h,Fe(h),h;var y=v({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),Fe(h),bn(h,"style",y),Gc(h,u.precedence,i),s.instance=h;case"stylesheet":y=Qs(u.href);var x=i.querySelector(Al(y));if(x)return s.state.loading|=4,s.instance=x,Fe(x),x;h=jS(u),(y=xr.get(y))&&Vp(h,y),x=(i.ownerDocument||i).createElement("link"),Fe(x);var A=x;return A._p=new Promise(function(O,F){A.onload=O,A.onerror=F}),bn(x,"link",h),s.state.loading|=4,Gc(x,u.precedence,i),s.instance=x;case"script":return x=Js(u.src),(y=i.querySelector(Nl(x)))?(s.instance=y,Fe(y),y):(h=u,(y=xr.get(x))&&(h=v({},u),Fp(h,y)),i=i.ownerDocument||i,y=i.createElement("script"),Fe(y),bn(y,"link",h),i.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,Gc(h,u.precedence,i));return s.instance}function Gc(i,s,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,x=y,A=0;A<h.length;A++){var O=h[A];if(O.dataset.precedence===s)x=O;else if(x!==y)break}x?x.parentNode.insertBefore(i,x.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function Vp(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Fp(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Kc=null;function _S(i,s,u){if(Kc===null){var h=new Map,y=Kc=new Map;y.set(u,h)}else y=Kc,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),y=0;y<u.length;y++){var x=u[y];if(!(x[kn]||x[un]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var A=x.getAttribute(s)||"";A=i+A;var O=h.get(A);O?O.push(x):h.set(A,[x])}}return h}function OS(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function uO(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(i=s.disabled,typeof s.precedence=="string"&&i==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function MS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function cO(i,s,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Qs(h.href),x=s.querySelector(Al(y));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Yc.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=x,Fe(x);return}x=s.ownerDocument||s,h=jS(h),(y=xr.get(y))&&Vp(h,y),x=x.createElement("link"),Fe(x);var A=x;A._p=new Promise(function(O,F){A.onload=O,A.onerror=F}),bn(x,"link",h),u.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=Yc.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Hp=0;function fO(i,s){return i.stylesheets&&i.count===0&&Xc(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var h=setTimeout(function(){if(i.stylesheets&&Xc(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+s);0<i.imgBytes&&Hp===0&&(Hp=62500*G2());var y=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Xc(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>Hp?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function Yc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var $c=null;function Xc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,$c=new Map,s.forEach(dO,i),$c=null,Yc.call(i))}function dO(i,s){if(!(s.state.loading&4)){var u=$c.get(i);if(u)var h=u.get(null);else{u=new Map,$c.set(i,u);for(var y=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<y.length;x++){var A=y[x];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),h=A)}h&&u.set(null,h)}y=s.instance,A=y.getAttribute("data-precedence"),x=u.get(A)||h,x===h&&u.set(null,y),u.set(A,y),this.count++,h=Yc.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),x?x.parentNode.insertBefore(y,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(y,i.firstChild)),s.state.loading|=4}}var jl={$$typeof:k,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function hO(i,s,u,h,y,x,A,O,F){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vo(0),this.hiddenUpdates=Vo(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=x,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function DS(i,s,u,h,y,x,A,O,F,ie,fe,me){return i=new hO(i,s,u,A,F,ie,fe,me,O),s=1,x===!0&&(s|=24),x=Qn(3,null,null,s),i.current=x,x.stateNode=i,s=wh(),s.refCount++,i.pooledCache=s,s.refCount++,x.memoizedState={element:h,isDehydrated:u,cache:s},Ch(x),i}function IS(i){return i?(i=js,i):js}function LS(i,s,u,h,y,x){y=IS(y),h.context===null?h.context=y:h.pendingContext=y,h=Wi(s),h.payload={element:u},x=x===void 0?null:x,x!==null&&(h.callback=x),u=Qi(i,h,s),u!==null&&(Kn(u,i,s),ol(u,i,s))}function PS(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function qp(i,s){PS(i,s),(i=i.alternate)&&PS(i,s)}function US(i){if(i.tag===13||i.tag===31){var s=Va(i,67108864);s!==null&&Kn(s,i,67108864),qp(i,67108864)}}function zS(i){if(i.tag===13||i.tag===31){var s=nr();s=Ho(s);var u=Va(i,s);u!==null&&Kn(u,i,s),qp(i,s)}}var Wc=!0;function pO(i,s,u,h){var y=V.T;V.T=null;var x=W.p;try{W.p=2,Gp(i,s,u,h)}finally{W.p=x,V.T=y}}function mO(i,s,u,h){var y=V.T;V.T=null;var x=W.p;try{W.p=8,Gp(i,s,u,h)}finally{W.p=x,V.T=y}}function Gp(i,s,u,h){if(Wc){var y=Kp(h);if(y===null)_p(i,s,h,Qc,u),VS(i,h);else if(gO(y,i,s,u,h))h.stopPropagation();else if(VS(i,h),s&4&&-1<vO.indexOf(i)){for(;y!==null;){var x=mi(y);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var A=Yr(x.pendingLanes);if(A!==0){var O=x;for(O.pendingLanes|=2,O.entangledLanes|=2;A;){var F=1<<31-Y(A);O.entanglements[1]|=F,A&=~F}ei(x),(ht&6)===0&&(Mc=Me()+500,El(0))}}break;case 31:case 13:O=Va(x,2),O!==null&&Kn(O,x,2),Ic(),qp(x,2)}if(x=Kp(h),x===null&&_p(i,s,h,Qc,u),x===y)break;y=x}y!==null&&h.stopPropagation()}else _p(i,s,h,null,u)}}function Kp(i){return i=$d(i),Yp(i)}var Qc=null;function Yp(i){if(Qc=null,i=pn(i),i!==null){var s=o(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=l(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Qc=i,null}function BS(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Q()){case H:return 2;case se:return 8;case Te:case Ee:return 32;case Be:return 268435456;default:return 32}default:return 32}}var $p=!1,la=null,ua=null,ca=null,Rl=new Map,_l=new Map,fa=[],vO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function VS(i,s){switch(i){case"focusin":case"focusout":la=null;break;case"dragenter":case"dragleave":ua=null;break;case"mouseover":case"mouseout":ca=null;break;case"pointerover":case"pointerout":Rl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":_l.delete(s.pointerId)}}function Ol(i,s,u,h,y,x){return i===null||i.nativeEvent!==x?(i={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[y]},s!==null&&(s=mi(s),s!==null&&US(s)),i):(i.eventSystemFlags|=h,s=i.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),i)}function gO(i,s,u,h,y){switch(s){case"focusin":return la=Ol(la,i,s,u,h,y),!0;case"dragenter":return ua=Ol(ua,i,s,u,h,y),!0;case"mouseover":return ca=Ol(ca,i,s,u,h,y),!0;case"pointerover":var x=y.pointerId;return Rl.set(x,Ol(Rl.get(x)||null,i,s,u,h,y)),!0;case"gotpointercapture":return x=y.pointerId,_l.set(x,Ol(_l.get(x)||null,i,s,u,h,y)),!0}return!1}function FS(i){var s=pn(i.target);if(s!==null){var u=o(s);if(u!==null){if(s=u.tag,s===13){if(s=l(u),s!==null){i.blockedOn=s,Go(i.priority,function(){zS(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,Go(i.priority,function(){zS(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Jc(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=Kp(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);Yd=h,u.target.dispatchEvent(h),Yd=null}else return s=mi(u),s!==null&&US(s),i.blockedOn=u,!1;s.shift()}return!0}function HS(i,s,u){Jc(i)&&u.delete(s)}function yO(){$p=!1,la!==null&&Jc(la)&&(la=null),ua!==null&&Jc(ua)&&(ua=null),ca!==null&&Jc(ca)&&(ca=null),Rl.forEach(HS),_l.forEach(HS)}function Zc(i,s){i.blockedOn===s&&(i.blockedOn=null,$p||($p=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yO)))}var ef=null;function qS(i){ef!==i&&(ef=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ef===i&&(ef=null);for(var s=0;s<i.length;s+=3){var u=i[s],h=i[s+1],y=i[s+2];if(typeof h!="function"){if(Yp(h||u)===null)continue;break}var x=mi(u);x!==null&&(i.splice(s,3),s-=3,Kh(x,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function Zs(i){function s(F){return Zc(F,i)}la!==null&&Zc(la,i),ua!==null&&Zc(ua,i),ca!==null&&Zc(ca,i),Rl.forEach(s),_l.forEach(s);for(var u=0;u<fa.length;u++){var h=fa[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<fa.length&&(u=fa[0],u.blockedOn===null);)FS(u),u.blockedOn===null&&fa.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],x=u[h+1],A=y[K]||null;if(typeof x=="function")A||qS(u);else if(A){var O=null;if(x&&x.hasAttribute("formAction")){if(y=x,A=x[K]||null)O=A.formAction;else if(Yp(y)!==null)continue}else O=A.action;typeof O=="function"?u[h+1]=O:(u.splice(h,3),h-=3),qS(u)}}}function GS(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(A){return y=A})},focusReset:"manual",scroll:"manual"})}function s(){y!==null&&(y(),y=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),y!==null&&(y(),y=null)}}}function Xp(i){this._internalRoot=i}tf.prototype.render=Xp.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,h=nr();LS(u,h,i,s,null,null)},tf.prototype.unmount=Xp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;LS(i.current,2,null,i,null,null),Ic(),s[ve]=null}};function tf(i){this._internalRoot=i}tf.prototype.unstable_scheduleHydration=function(i){if(i){var s=Ku();i={blockedOn:null,target:i,priority:s};for(var u=0;u<fa.length&&s!==0&&s<fa[u].priority;u++);fa.splice(u,0,i),u===0&&FS(i)}};var KS=t.version;if(KS!=="19.2.4")throw Error(r(527,KS,"19.2.4"));W.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var bO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nf.isDisabled&&nf.supportsFiber)try{vt=nf.inject(bO),Pt=nf}catch{}}return Dl.createRoot=function(i,s){if(!a(i))throw Error(r(299));var u=!1,h="",y=Zb,x=ex,A=tx;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=DS(i,1,!1,null,null,u,h,null,y,x,A,GS),i[ve]=s.current,Rp(i),new Xp(s)},Dl.hydrateRoot=function(i,s,u){if(!a(i))throw Error(r(299));var h=!1,y="",x=Zb,A=ex,O=tx,F=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError),u.formState!==void 0&&(F=u.formState)),s=DS(i,1,!0,s,u??null,h,y,F,x,A,O,GS),s.context=IS(null),u=s.current,h=nr(),h=Ho(h),y=Wi(h),y.callback=null,Qi(u,y,h),u=h,s.current.lanes=u,Ia(s,u),ei(s),i[ve]=s.current,Rp(i),new tf(s)},Dl.version="19.2.4",Dl}var nw;function RO(){if(nw)return Jp.exports;nw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Jp.exports=jO(),Jp.exports}var _O=RO();const OO=jo(_O);var rw="popstate";function iw(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function MO(e={}){function t(r,a){let o=a.state?.masked,{pathname:l,search:c,hash:f}=o||r.location;return dv("",{pathname:l,search:c,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:bu(a)}return IO(t,n,null,e)}function zt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DO(){return Math.random().toString(36).substring(2,10)}function aw(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function dv(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ro(t):t,state:n,key:t&&t.key||r||DO(),unstable_mask:a}}function bu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ro(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function IO(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,c="POP",f=null,d=p();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function p(){return(l.state||{idx:null}).idx}function v(){c="POP";let E=p(),T=E==null?null:E-d;d=E,f&&f({action:c,location:w.location,delta:T})}function g(E,T){c="PUSH";let C=iw(E)?E:dv(w.location,E,T);d=p()+1;let k=aw(C,d),j=w.createHref(C.unstable_mask||C);try{l.pushState(k,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(j)}o&&f&&f({action:c,location:w.location,delta:1})}function b(E,T){c="REPLACE";let C=iw(E)?E:dv(w.location,E,T);d=p();let k=aw(C,d),j=w.createHref(C.unstable_mask||C);l.replaceState(k,"",j),o&&f&&f({action:c,location:w.location,delta:0})}function S(E){return LO(E)}let w={get action(){return c},get location(){return e(a,l)},listen(E){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(rw,v),f=E,()=>{a.removeEventListener(rw,v),f=null}},createHref(E){return t(a,E)},createURL:S,encodeLocation(E){let T=S(E);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:g,replace:b,go(E){return l.go(E)}};return w}function LO(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),zt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:bu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function _k(e,t,n="/"){return PO(e,t,n,!1)}function PO(e,t,n,r){let a=typeof t=="string"?Ro(t):t,o=Bi(a.pathname||"/",n);if(o==null)return null;let l=Ok(e);UO(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let d=XO(o);c=YO(l[f],d,r)}return c}function Ok(e,t=[],n=[],r="",a=!1){let o=(l,c,f=a,d)=>{let p={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&f)return;zt(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let v=oi([r,p.relativePath]),g=n.concat(p);l.children&&l.children.length>0&&(zt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Ok(l.children,t,g,v,f)),!(l.path==null&&!l.index)&&t.push({path:v,score:GO(v,l.index),routesMeta:g})};return e.forEach((l,c)=>{if(l.path===""||!l.path?.includes("?"))o(l,c);else for(let f of Mk(l.path))o(l,c,!0,f)}),t}function Mk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=Mk(r.join("/")),c=[];return c.push(...l.map(f=>f===""?o:[o,f].join("/"))),a&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function UO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:KO(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var zO=/^:[\w-]+$/,BO=3,VO=2,FO=1,HO=10,qO=-2,sw=e=>e==="*";function GO(e,t){let n=e.split("/"),r=n.length;return n.some(sw)&&(r+=qO),t&&(r+=VO),n.filter(a=>!sw(a)).reduce((a,o)=>a+(zO.test(o)?BO:o===""?FO:HO),r)}function KO(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function YO(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",l=[];for(let c=0;c<r.length;++c){let f=r[c],d=c===r.length-1,p=o==="/"?t:t.slice(o.length)||"/",v=Jf({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},p),g=f.route;if(!v&&d&&n&&!r[r.length-1].route.index&&(v=Jf({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},p)),!v)return null;Object.assign(a,v.params),l.push({params:a,pathname:oi([o,v.pathname]),pathnameBase:ZO(oi([o,v.pathnameBase])),route:g}),v.pathnameBase!=="/"&&(o=oi([o,v.pathnameBase]))}return l}function Jf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=$O(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((d,{paramName:p,isOptional:v},g)=>{if(p==="*"){let S=c[g]||"";l=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const b=c[g];return v&&!b?d[p]=void 0:d[p]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:l,pattern:e}}function $O(e,t=!1,n=!0){Gr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f,d,p)=>{if(r.push({paramName:c,isOptional:f!=null}),f){let v=p.charAt(d+l.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function XO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Bi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var WO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function QO(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Ro(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=ow(n.substring(1),"/"):o=ow(n,t)):o=t,{pathname:o,search:eM(r),hash:tM(a)}}function ow(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function nm(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function JO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ig(e){let t=JO(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Sd(e,t,n,r=!1){let a;typeof e=="string"?a=Ro(e):(a={...e},zt(!a.pathname||!a.pathname.includes("?"),nm("?","pathname","search",a)),zt(!a.pathname||!a.pathname.includes("#"),nm("#","pathname","hash",a)),zt(!a.search||!a.search.includes("#"),nm("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,c;if(l==null)c=n;else{let v=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),v-=1;a.pathname=g.join("/")}c=v>=0?t[v]:"/"}let f=QO(a,c),d=l&&l!=="/"&&l.endsWith("/"),p=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||p)&&(f.pathname+="/"),f}var oi=e=>e.join("/").replace(/\/\/+/g,"/"),ZO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),eM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,nM=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function rM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function iM(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Dk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ik(e,t){let n=e;if(typeof n!="string"||!WO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(Dk)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),c=Bi(l.pathname,t);l.origin===o.origin&&c!=null?n=c+l.search+l.hash:a=!0}catch{Gr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Lk=["POST","PUT","PATCH","DELETE"];new Set(Lk);var aM=["GET",...Lk];new Set(aM);var _o=_.createContext(null);_o.displayName="DataRouter";var wd=_.createContext(null);wd.displayName="DataRouterState";var sM=_.createContext(!1),Pk=_.createContext({isTransitioning:!1});Pk.displayName="ViewTransition";var oM=_.createContext(new Map);oM.displayName="Fetchers";var lM=_.createContext(null);lM.displayName="Await";var lr=_.createContext(null);lr.displayName="Navigation";var Ru=_.createContext(null);Ru.displayName="Location";var di=_.createContext({outlet:null,matches:[],isDataRoute:!1});di.displayName="Route";var Lg=_.createContext(null);Lg.displayName="RouteError";var Uk="REACT_ROUTER_ERROR",uM="REDIRECT",cM="ROUTE_ERROR_RESPONSE";function fM(e){if(e.startsWith(`${Uk}:${uM}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function dM(e){if(e.startsWith(`${Uk}:${cM}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new nM(t.status,t.statusText,t.data)}catch{}}function hM(e,{relative:t}={}){zt(Oo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=_.useContext(lr),{hash:a,pathname:o,search:l}=_u(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:oi([n,o])),r.createHref({pathname:c,search:l,hash:a})}function Oo(){return _.useContext(Ru)!=null}function hi(){return zt(Oo(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(Ru).location}var zk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bk(e){_.useContext(lr).static||_.useLayoutEffect(e)}function Vk(){let{isDataRoute:e}=_.useContext(di);return e?CM():pM()}function pM(){zt(Oo(),"useNavigate() may be used only in the context of a <Router> component.");let e=_.useContext(_o),{basename:t,navigator:n}=_.useContext(lr),{matches:r}=_.useContext(di),{pathname:a}=hi(),o=JSON.stringify(Ig(r)),l=_.useRef(!1);return Bk(()=>{l.current=!0}),_.useCallback((f,d={})=>{if(Gr(l.current,zk),!l.current)return;if(typeof f=="number"){n.go(f);return}let p=Sd(f,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:oi([t,p.pathname])),(d.replace?n.replace:n.push)(p,d.state,d)},[t,n,o,a,e])}_.createContext(null);function _u(e,{relative:t}={}){let{matches:n}=_.useContext(di),{pathname:r}=hi(),a=JSON.stringify(Ig(n));return _.useMemo(()=>Sd(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function mM(e,t){return Fk(e,t)}function Fk(e,t,n){zt(Oo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=_.useContext(lr),{matches:a}=_.useContext(di),o=a[a.length-1],l=o?o.params:{},c=o?o.pathname:"/",f=o?o.pathnameBase:"/",d=o&&o.route;{let E=d&&d.path||"";qk(c,!d||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let p=hi(),v;if(t){let E=typeof t=="string"?Ro(t):t;zt(f==="/"||E.pathname?.startsWith(f),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=p;let g=v.pathname||"/",b=g;if(f!=="/"){let E=f.replace(/^\//,"").split("/");b="/"+g.replace(/^\//,"").split("/").slice(E.length).join("/")}let S=_k(e,{pathname:b});Gr(d||S!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Gr(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=xM(S&&S.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:oi([f,r.encodeLocation?r.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:oi([f,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),a,n);return t&&w?_.createElement(Ru.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},w):w}function vM(){let e=kM(),t=rM(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:o},"ErrorBoundary")," or"," ",_.createElement("code",{style:o},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),n?_.createElement("pre",{style:a},n):null,l)}var gM=_.createElement(vM,null),Hk=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=dM(e.digest);n&&(e=n)}let t=e!==void 0?_.createElement(di.Provider,{value:this.props.routeContext},_.createElement(Lg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?_.createElement(yM,{error:e},t):t}};Hk.contextType=sM;var rm=new WeakMap;function yM({children:e,error:t}){let{basename:n}=_.useContext(lr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=fM(t.digest);if(r){let a=rm.get(t);if(a)throw a;let o=Ik(r.location,n);if(Dk&&!rm.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw rm.set(t,l),l}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function bM({routeContext:e,match:t,children:n}){let r=_.useContext(_o);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(di.Provider,{value:e},n)}function xM(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,o=r?.errors;if(o!=null){let p=a.findIndex(v=>v.route.id&&o?.[v.route.id]!==void 0);zt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let l=!1,c=-1;if(n&&r){l=r.renderFallback;for(let p=0;p<a.length;p++){let v=a[p];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(c=p),v.route.id){let{loaderData:g,errors:b}=r,S=v.route.loader&&!g.hasOwnProperty(v.route.id)&&(!b||b[v.route.id]===void 0);if(v.route.lazy||S){n.isStatic&&(l=!0),c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}}let f=n?.onError,d=r&&f?(p,v)=>{f(p,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:iM(r.matches),errorInfo:v})}:void 0;return a.reduceRight((p,v,g)=>{let b,S=!1,w=null,E=null;r&&(b=o&&v.route.id?o[v.route.id]:void 0,w=v.route.errorElement||gM,l&&(c<0&&g===0?(qk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,E=null):c===g&&(S=!0,E=v.route.hydrateFallbackElement||null)));let T=t.concat(a.slice(0,g+1)),C=()=>{let k;return b?k=w:S?k=E:v.route.Component?k=_.createElement(v.route.Component,null):v.route.element?k=v.route.element:k=p,_.createElement(bM,{match:v,routeContext:{outlet:p,matches:T,isDataRoute:r!=null},children:k})};return r&&(v.route.ErrorBoundary||v.route.errorElement||g===0)?_.createElement(Hk,{location:r.location,revalidation:r.revalidation,component:w,error:b,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:d}):C()},null)}function Pg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function SM(e){let t=_.useContext(_o);return zt(t,Pg(e)),t}function wM(e){let t=_.useContext(wd);return zt(t,Pg(e)),t}function EM(e){let t=_.useContext(di);return zt(t,Pg(e)),t}function Ug(e){let t=EM(e),n=t.matches[t.matches.length-1];return zt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function TM(){return Ug("useRouteId")}function kM(){let e=_.useContext(Lg),t=wM("useRouteError"),n=Ug("useRouteError");return e!==void 0?e:t.errors?.[n]}function CM(){let{router:e}=SM("useNavigate"),t=Ug("useNavigate"),n=_.useRef(!1);return Bk(()=>{n.current=!0}),_.useCallback(async(a,o={})=>{Gr(n.current,zk),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var lw={};function qk(e,t,n){!t&&!lw[e]&&(lw[e]=!0,Gr(!1,n))}_.memo(AM);function AM({routes:e,future:t,state:n,isStatic:r,onError:a}){return Fk(e,void 0,{state:n,isStatic:r,onError:a})}function NM({to:e,replace:t,state:n,relative:r}){zt(Oo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=_.useContext(lr);Gr(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=_.useContext(di),{pathname:l}=hi(),c=Vk(),f=Sd(e,Ig(o),l,r==="path"),d=JSON.stringify(f);return _.useEffect(()=>{c(JSON.parse(d),{replace:t,state:n,relative:r})},[c,d,r,t,n]),null}function rr(e){zt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function jM({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){zt(!Oo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=_.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[c,a,o,l]);typeof n=="string"&&(n=Ro(n));let{pathname:d="/",search:p="",hash:v="",state:g=null,key:b="default",unstable_mask:S}=n,w=_.useMemo(()=>{let E=Bi(d,c);return E==null?null:{location:{pathname:E,search:p,hash:v,state:g,key:b,unstable_mask:S},navigationType:r}},[c,d,p,v,g,b,r,S]);return Gr(w!=null,`<Router basename="${c}"> is not able to match the URL "${d}${p}${v}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:_.createElement(lr.Provider,{value:f},_.createElement(Ru.Provider,{children:t,value:w}))}function RM({children:e,location:t}){return mM(hv(e),t)}function hv(e,t=[]){let n=[];return _.Children.forEach(e,(r,a)=>{if(!_.isValidElement(r))return;let o=[...t,a];if(r.type===_.Fragment){n.push.apply(n,hv(r.props.children,o));return}zt(r.type===rr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),zt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=hv(r.props.children,o)),n.push(l)}),n}var Rf="get",_f="application/x-www-form-urlencoded";function Ed(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function _M(e){return Ed(e)&&e.tagName.toLowerCase()==="button"}function OM(e){return Ed(e)&&e.tagName.toLowerCase()==="form"}function MM(e){return Ed(e)&&e.tagName.toLowerCase()==="input"}function DM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function IM(e,t){return e.button===0&&(!t||t==="_self")&&!DM(e)}var rf=null;function LM(){if(rf===null)try{new FormData(document.createElement("form"),0),rf=!1}catch{rf=!0}return rf}var PM=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function im(e){return e!=null&&!PM.has(e)?(Gr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_f}"`),null):e}function UM(e,t){let n,r,a,o,l;if(OM(e)){let c=e.getAttribute("action");r=c?Bi(c,t):null,n=e.getAttribute("method")||Rf,a=im(e.getAttribute("enctype"))||_f,o=new FormData(e)}else if(_M(e)||MM(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?Bi(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Rf,a=im(e.getAttribute("formenctype"))||im(c.getAttribute("enctype"))||_f,o=new FormData(c,e),!LM()){let{name:d,type:p,value:v}=e;if(p==="image"){let g=d?`${d}.`:"";o.append(`${g}x`,"0"),o.append(`${g}y`,"0")}else d&&o.append(d,v)}}else{if(Ed(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Rf,r=null,a=_f,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zM(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Bi(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function BM(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function VM(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function FM(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await BM(o,n);return l.links?l.links():[]}return[]}));return KM(r.flat(1).filter(VM).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function uw(e,t,n,r,a,o){let l=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,c=(f,d)=>n[d].pathname!==f.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==f.params["*"];return o==="assets"?t.filter((f,d)=>l(f,d)||c(f,d)):o==="data"?t.filter((f,d)=>{let p=r.routes[f.route.id];if(!p||!p.hasLoader)return!1;if(l(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function HM(e,t,{includeHydrateFallback:n}={}){return qM(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function qM(e){return[...new Set(e)]}function GM(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function KM(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(GM(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function Gk(){let e=_.useContext(_o);return zg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function YM(){let e=_.useContext(wd);return zg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Bg=_.createContext(void 0);Bg.displayName="FrameworkContext";function Kk(){let e=_.useContext(Bg);return zg(e,"You must render this element inside a <HydratedRouter> element"),e}function $M(e,t){let n=_.useContext(Bg),[r,a]=_.useState(!1),[o,l]=_.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:p,onTouchStart:v}=t,g=_.useRef(null);_.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=T=>{T.forEach(C=>{l(C.isIntersecting)})},E=new IntersectionObserver(w,{threshold:.5});return g.current&&E.observe(g.current),()=>{E.disconnect()}}},[e]),_.useEffect(()=>{if(r){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[r]);let b=()=>{a(!0)},S=()=>{a(!1),l(!1)};return n?e!=="intent"?[o,g,{}]:[o,g,{onFocus:Il(c,b),onBlur:Il(f,S),onMouseEnter:Il(d,b),onMouseLeave:Il(p,S),onTouchStart:Il(v,b)}]:[!1,g,{}]}function Il(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function XM({page:e,...t}){let{router:n}=Gk(),r=_.useMemo(()=>_k(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?_.createElement(QM,{page:e,matches:r,...t}):null}function WM(e){let{manifest:t,routeModules:n}=Kk(),[r,a]=_.useState([]);return _.useEffect(()=>{let o=!1;return FM(e,t,n).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,n]),r}function QM({page:e,matches:t,...n}){let r=hi(),{future:a,manifest:o,routeModules:l}=Kk(),{basename:c}=Gk(),{loaderData:f,matches:d}=YM(),p=_.useMemo(()=>uw(e,t,d,o,r,"data"),[e,t,d,o,r]),v=_.useMemo(()=>uw(e,t,d,o,r,"assets"),[e,t,d,o,r]),g=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,E=!1;if(t.forEach(C=>{let k=o.routes[C.route.id];!k||!k.hasLoader||(!p.some(j=>j.route.id===C.route.id)&&C.route.id in f&&l[C.route.id]?.shouldRevalidate||k.hasClientLoader?E=!0:w.add(C.route.id))}),w.size===0)return[];let T=zM(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return E&&w.size>0&&T.searchParams.set("_routes",t.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[c,a.unstable_trailingSlashAwareDataRequests,f,r,o,p,t,e,l]),b=_.useMemo(()=>HM(v,o),[v,o]),S=WM(v);return _.createElement(_.Fragment,null,g.map(w=>_.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),b.map(w=>_.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:E})=>_.createElement("link",{key:w,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function JM(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var ZM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ZM&&(window.__reactRouterVersion="7.13.1")}catch{}function eD({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=_.useRef();a.current==null&&(a.current=MO({window:r,v5Compat:!0}));let o=a.current,[l,c]=_.useState({action:o.action,location:o.location}),f=_.useCallback(d=>{n===!1?c(d):_.startTransition(()=>c(d))},[n]);return _.useLayoutEffect(()=>o.listen(f),[o,f]),_.createElement(jM,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var Yk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$k=_.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:l,unstable_mask:c,state:f,target:d,to:p,preventScrollReset:v,viewTransition:g,unstable_defaultShouldRevalidate:b,...S},w){let{basename:E,navigator:T,unstable_useTransitions:C}=_.useContext(lr),k=typeof p=="string"&&Yk.test(p),j=Ik(p,E);p=j.to;let N=hM(p,{relative:a}),R=hi(),L=null;if(c){let Z=Sd(c,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);E!=="/"&&(Z.pathname=Z.pathname==="/"?E:oi([E,Z.pathname])),L=T.createHref(Z)}let[U,G,M]=$M(r,S),B=rD(p,{replace:l,unstable_mask:c,state:f,target:d,preventScrollReset:v,relative:a,viewTransition:g,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function X(Z){t&&t(Z),Z.defaultPrevented||B(Z)}let oe=!(j.isExternal||o),ue=_.createElement("a",{...S,...M,href:(oe?L:void 0)||j.absoluteURL||N,onClick:oe?X:t,ref:JM(w,G),target:d,"data-discover":!k&&n==="render"?"true":void 0});return U&&!k?_.createElement(_.Fragment,null,ue,_.createElement(XM,{page:N})):ue});$k.displayName="Link";var Xk=_.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:l,viewTransition:c,children:f,...d},p){let v=_u(l,{relative:d.relative}),g=hi(),b=_.useContext(wd),{navigator:S,basename:w}=_.useContext(lr),E=b!=null&&lD(v)&&c===!0,T=S.encodeLocation?S.encodeLocation(v).pathname:v.pathname,C=g.pathname,k=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(C=C.toLowerCase(),k=k?k.toLowerCase():null,T=T.toLowerCase()),k&&w&&(k=Bi(k,w)||k);const j=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let N=C===T||!a&&C.startsWith(T)&&C.charAt(j)==="/",R=k!=null&&(k===T||!a&&k.startsWith(T)&&k.charAt(T.length)==="/"),L={isActive:N,isPending:R,isTransitioning:E},U=N?t:void 0,G;typeof r=="function"?G=r(L):G=[r,N?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let M=typeof o=="function"?o(L):o;return _.createElement($k,{...d,"aria-current":U,className:G,ref:p,style:M,to:l,viewTransition:c},typeof f=="function"?f(L):f)});Xk.displayName="NavLink";var tD=_.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:l=Rf,action:c,onSubmit:f,relative:d,preventScrollReset:p,viewTransition:v,unstable_defaultShouldRevalidate:g,...b},S)=>{let{unstable_useTransitions:w}=_.useContext(lr),E=sD(),T=oD(c,{relative:d}),C=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&Yk.test(c),j=N=>{if(f&&f(N),N.defaultPrevented)return;N.preventDefault();let R=N.nativeEvent.submitter,L=R?.getAttribute("formmethod")||l,U=()=>E(R||N.currentTarget,{fetcherKey:t,method:L,navigate:n,replace:a,state:o,relative:d,preventScrollReset:p,viewTransition:v,unstable_defaultShouldRevalidate:g});w&&n!==!1?_.startTransition(()=>U()):U()};return _.createElement("form",{ref:S,method:C,action:T,onSubmit:r?f:j,...b,"data-discover":!k&&e==="render"?"true":void 0})});tD.displayName="Form";function nD(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wk(e){let t=_.useContext(_o);return zt(t,nD(e)),t}function rD(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:o,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:d}={}){let p=Vk(),v=hi(),g=_u(e,{relative:l});return _.useCallback(b=>{if(IM(b,t)){b.preventDefault();let S=n!==void 0?n:bu(v)===bu(g),w=()=>p(e,{replace:S,unstable_mask:r,state:a,preventScrollReset:o,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:f});d?_.startTransition(()=>w()):w()}},[v,p,g,n,r,a,t,e,o,l,c,f,d])}var iD=0,aD=()=>`__${String(++iD)}__`;function sD(){let{router:e}=Wk("useSubmit"),{basename:t}=_.useContext(lr),n=TM(),r=e.fetch,a=e.navigate;return _.useCallback(async(o,l={})=>{let{action:c,method:f,encType:d,formData:p,body:v}=UM(o,t);if(l.navigate===!1){let g=l.fetcherKey||aD();await r(g,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:v,formMethod:l.method||f,formEncType:l.encType||d,flushSync:l.flushSync})}else await a(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:v,formMethod:l.method||f,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function oD(e,{relative:t}={}){let{basename:n}=_.useContext(lr),r=_.useContext(di);zt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={..._u(e||".",{relative:t})},l=hi();if(e==null){o.search=l.search;let c=new URLSearchParams(o.search),f=c.getAll("index");if(f.some(p=>p==="")){c.delete("index"),f.filter(v=>v).forEach(v=>c.append("index",v));let p=c.toString();o.search=p?`?${p}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:oi([n,o.pathname])),bu(o)}function lD(e,{relative:t}={}){let n=_.useContext(Pk);zt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Wk("useViewTransitionState"),a=_u(e,{relative:t});if(!n.isTransitioning)return!1;let o=Bi(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Bi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Jf(a.pathname,l)!=null||Jf(a.pathname,o)!=null}var pv=function(e,t){return pv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},pv(e,t)};function Or(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");pv(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ce=function(){return ce=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ce.apply(this,arguments)};function Zf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function ne(e,t,n,r){function a(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function c(p){try{d(r.next(p))}catch(v){l(v)}}function f(p){try{d(r.throw(p))}catch(v){l(v)}}function d(p){p.done?o(p.value):a(p.value).then(c,f)}d((r=r.apply(e,t||[])).next())})}function te(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=c(0),l.throw=c(1),l.return=c(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(d){return function(p){return f([d,p])}}function f(d){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,d[0]&&(n=0)),n;)try{if(r=1,a&&(o=d[0]&2?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,a=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){n.label=d[1];break}if(d[0]===6&&n.label<o[1]){n.label=o[1],o=d;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(d);break}o[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(p){d=[6,p],a=0}finally{r=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function _e(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ae(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}function Qe(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ta;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(Ta||(Ta={}));var sr;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(sr||(sr={}));var cw="-",Td="AMP",uD="".concat(Td,"_unsent"),Qk="$default_instance",Vg="https://api2.amplitude.com/2/httpapi",Jk="https://api.eu.amplitude.com/2/httpapi",Zk="https://api2.amplitude.com/batch",eC="https://api.eu.amplitude.com/batch",cD="utm_campaign",fD="utm_content",dD="utm_id",hD="utm_medium",pD="utm_source",mD="utm_term",fw="dclid",dw="fbclid",hw="gbraid",pw="gclid",mw="ko_click_id",vw="li_fat_id",gw="msclkid",yw="rdt_cid",bw="ttclid",xw="twclid",Sw="wbraid",kd={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},ed=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],vD=["authorization","cookie","set-cookie"],gD=1e3,mv=function(e){if(Object.keys(e).length>gD)return!1;for(var t in e){var n=e[t];if(!tC(t,n))return!1}return!0},tC=function(e,t){var n,r;if(typeof e!="string")return!1;if(Array.isArray(t)){var a=!0;try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;if(Array.isArray(c))return!1;if(typeof c=="object")a=a&&mv(c);else if(!["number","string"].includes(typeof c))return!1;if(!a)return!1}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(t==null)return!1;if(typeof t=="object")return mv(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},nu=(function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return ce({},this._properties)},e.prototype.set=function(t,n){return this._safeSet(Rt.SET,t,n),this},e.prototype.setOnce=function(t,n){return this._safeSet(Rt.SET_ONCE,t,n),this},e.prototype.append=function(t,n){return this._safeSet(Rt.APPEND,t,n),this},e.prototype.prepend=function(t,n){return this._safeSet(Rt.PREPEND,t,n),this},e.prototype.postInsert=function(t,n){return this._safeSet(Rt.POSTINSERT,t,n),this},e.prototype.preInsert=function(t,n){return this._safeSet(Rt.PREINSERT,t,n),this},e.prototype.remove=function(t,n){return this._safeSet(Rt.REMOVE,t,n),this},e.prototype.add=function(t,n){return this._safeSet(Rt.ADD,t,n),this},e.prototype.unset=function(t){return this._safeSet(Rt.UNSET,t,cw),this},e.prototype.clearAll=function(){return this._properties={},this._properties[Rt.CLEAR_ALL]=cw,this},e.prototype._safeSet=function(t,n,r){if(this._validate(t,n,r)){var a=this._properties[t];return a===void 0&&(a={},this._properties[t]=a),a[n]=r,this._propertySet.add(n),!0}return!1},e.prototype._validate=function(t,n,r){return this._properties[Rt.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:t===Rt.ADD?typeof r=="number":t!==Rt.UNSET&&t!==Rt.REMOVE?tC(n,r):!0},e})(),Rt;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(Rt||(Rt={}));var yD=[Rt.CLEAR_ALL,Rt.UNSET,Rt.SET,Rt.SET_ONCE,Rt.ADD,Rt.APPEND,Rt.PREPEND,Rt.PREINSERT,Rt.POSTINSERT,Rt.REMOVE],bD="Event tracked successfully",xD="Unexpected error occurred",SD="Event rejected due to exceeded retry count",wD="Event skipped due to optOut config",ED="Event rejected due to missing API key",TD="Invalid API key",kD="Client not initialized",Gt;(function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"})(Gt||(Gt={}));var go=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Gt.Unknown),{event:e,code:t,message:n}},Ue=function(){var e="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[e]<"u")return globalThis[e];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},CD=function(e){return e?(e^Math.random()*16>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,_a)},ww=Qe([],Ae(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),_a=function(e){var t,n=Ue();if(!(!((t=n?.crypto)===null||t===void 0)&&t.getRandomValues))return CD(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Qe([],Ae(r.entries()),!1).map(function(a){var o=Ae(a,2),l=o[0],c=o[1];return[4,6,8,10].includes(l)?"-".concat(ww[c]):ww[c]}).join("")},AD=(function(){function e(t){this.client=t,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(t,n){var r,a;return ne(this,void 0,void 0,function(){return te(this,function(o){switch(o.label){case 0:return this.plugins.some(function(l){return l.name===t.name})?(this.loggerProvider.warn("Plugin with name ".concat(t.name," already exists, skipping registration")),[2]):(t.name===void 0&&(t.name=_a(),this.loggerProvider.warn(`Plugin name is undefined.
|
|
12
|
+
Generating a random UUID for plugin name: `.concat(t.name,`.
|
|
13
|
+
Set a name for the plugin to prevent it from being added multiple times.`))),t.type=(r=t.type)!==null&&r!==void 0?r:"enrichment",[4,(a=t.setup)===null||a===void 0?void 0:a.call(t,n,this.client)]);case 1:return o.sent(),this.plugins.push(t),[2]}})})},e.prototype.deregister=function(t,n){var r;return ne(this,void 0,void 0,function(){var a,o;return te(this,function(l){switch(l.label){case 0:return a=this.plugins.findIndex(function(c){return c.name===t}),a===-1?(n.loggerProvider.warn("Plugin with name ".concat(t," does not exist, skipping deregistration")),[2]):(o=this.plugins[a],this.plugins.splice(a,1),[4,(r=o.teardown)===null||r===void 0?void 0:r.call(o)]);case 1:return l.sent(),[2]}})})},e.prototype.reset=function(t){this._clearOptOutListeners(),this.applying=!1;var n=this.plugins;n.map(function(r){var a;return(a=r.teardown)===null||a===void 0?void 0:a.call(r)}),this.plugins=[],this.client=t},e.prototype.push=function(t){var n=this;return new Promise(function(r){n.queue.push([t,r]),n.scheduleApply(0)})},e.prototype.scheduleApply=function(t){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},t))},e.prototype.apply=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o,l,c,f,b,S,d,p,v,g,b,S,w,E,T,C,k,j,N;return te(this,function(R){switch(R.label){case 0:if(!t)return[2];n=Ae(t,1),r=n[0],a=Ae(t,2),o=a[1],this.loggerProvider.log("Timeline.apply: Initial event",r),l=this.plugins.filter(function(L){return L.type==="before"}),R.label=1;case 1:R.trys.push([1,6,7,8]),c=_e(l),f=c.next(),R.label=2;case 2:return f.done?[3,5]:(b=f.value,b.execute?[4,b.execute(ce({},r))]:[3,4]);case 3:if(S=R.sent(),S===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(b.name),"', event: ").concat(JSON.stringify(r))),o({event:r,code:0,message:""}),[2];r=S,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(b.name),"', event: ").concat(JSON.stringify(r))),R.label=4;case 4:return f=c.next(),[3,2];case 5:return[3,8];case 6:return d=R.sent(),C={error:d},[3,8];case 7:try{f&&!f.done&&(k=c.return)&&k.call(c)}finally{if(C)throw C.error}return[7];case 8:p=this.plugins.filter(function(L){return L.type==="enrichment"||L.type===void 0}),R.label=9;case 9:R.trys.push([9,14,15,16]),v=_e(p),g=v.next(),R.label=10;case 10:return g.done?[3,13]:(b=g.value,b.execute?[4,b.execute(ce({},r))]:[3,12]);case 11:if(S=R.sent(),S===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(b.name),"', event: ").concat(JSON.stringify(r))),o({event:r,code:0,message:""}),[2];r=S,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(b.name),"', event: ").concat(JSON.stringify(r))),R.label=12;case 12:return g=v.next(),[3,10];case 13:return[3,16];case 14:return w=R.sent(),j={error:w},[3,16];case 15:try{g&&!g.done&&(N=v.return)&&N.call(v)}finally{if(j)throw j.error}return[7];case 16:return E=this.plugins.filter(function(L){return L.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),T=E.map(function(L){var U=ce({},r);return L.execute(U).catch(function(G){return go(U,0,String(G))})}),Promise.all(T).then(function(L){var U=Ae(L,1),G=U[0],M=G||go(r,100,"Event not tracked, no destination plugins on the instance");o(M)}),[2]}})})},e.prototype.flush=function(){return ne(this,void 0,void 0,function(){var t,n,r,a=this;return te(this,function(o){switch(o.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map(function(l){return a.apply(l)}))];case 1:return o.sent(),n=this.plugins.filter(function(l){return l.type==="destination"}),r=n.map(function(l){return l.flush&&l.flush()}),[4,Promise.all(r)];case 2:return o.sent(),[2]}})})},e.prototype.addOptOutListener=function(t){this._optOutListeners.push(t)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onIdentityChanged)===null||r===void 0||r.call(n,t)})},e.prototype.onSessionIdChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onSessionIdChanged)===null||r===void 0||r.call(n,t)})},e.prototype.onOptOutChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onOptOutChanged)===null||r===void 0||r.call(n,t)}),this._callOptOutListeners(t)},e.prototype._callOptOutListeners=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o,l,c,f;return te(this,function(d){switch(d.label){case 0:d.trys.push([0,7,8,9]),n=_e(this._optOutListeners),r=n.next(),d.label=1;case 1:if(r.done)return[3,6];a=r.value,d.label=2;case 2:return d.trys.push([2,4,,5]),[4,a(t)];case 3:return d.sent(),[3,5];case 4:return o=d.sent(),this.loggerProvider.error("Error calling optOut listener",o),[3,5];case 5:return r=n.next(),[3,1];case 6:return[3,9];case 7:return l=d.sent(),c={error:l},[3,9];case 8:try{r&&!r.done&&(f=n.return)&&f.call(n)}finally{if(c)throw c.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(t){var n;(n=t.onReset)===null||n===void 0||n.call(t)})},e})(),ND=function(e,t,n){var r=typeof e=="string"?{event_type:e}:e;return ce(ce(ce({},r),n),t&&{event_properties:t})},Fg=function(e,t){var n=ce(ce({},t),{event_type:sr.IDENTIFY,user_properties:e.getUserProperties()});return n},jD=function(e,t,n,r){var a,o=ce(ce({},r),{event_type:sr.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(a={},a[e]=t,a)});return o},RD=function(e,t,n){var r,a=new nu;a.set(e,t);var o=ce(ce({},n),{event_type:sr.IDENTIFY,user_properties:a.getUserProperties(),groups:(r={},r[e]=t,r)});return o},_D=function(e,t){return ce(ce({},t),{event_type:sr.REVENUE,event_properties:e.getEventProperties()})},Sn=function(e){return{promise:e||Promise.resolve()}},OD=(function(){function e(t){t===void 0&&(t="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new AD(this),this.name=t}return e.prototype._init=function(t){return ne(this,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return this.config=t,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return n.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o,l,c,f,d;return te(this,function(p){switch(p.label){case 0:n=this[t],this[t]=[],p.label=1;case 1:p.trys.push([1,8,9,10]),r=_e(n),a=r.next(),p.label=2;case 2:return a.done?[3,7]:(o=a.value,l=o(),l&&"promise"in l?[4,l.promise]:[3,4]);case 3:return p.sent(),[3,6];case 4:return[4,l];case 5:p.sent(),p.label=6;case 6:return a=r.next(),[3,2];case 7:return[3,10];case 8:return c=p.sent(),f={error:c},[3,10];case 9:try{a&&!a.done&&(d=r.return)&&d.call(r)}finally{if(f)throw f.error}return[7];case 10:return this[t].length?[4,this.runQueuedFunctions(t)]:[3,12];case 11:p.sent(),p.label=12;case 12:return[2]}})})},e.prototype.track=function(t,n,r){var a=ND(t,n,r);return this.userProperties=this.getOperationAppliedUserProperties(a.user_properties),Sn(this.dispatch(a))},e.prototype.identify=function(t,n){var r=Fg(t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Sn(this.dispatch(r))},e.prototype.groupIdentify=function(t,n,r,a){var o=jD(t,n,r,a);return Sn(this.dispatch(o))},e.prototype.setGroup=function(t,n,r){var a=RD(t,n,r);return this.userProperties=this.getOperationAppliedUserProperties(a.user_properties),Sn(this.dispatch(a))},e.prototype.revenue=function(t,n){var r=_D(t,n);return Sn(this.dispatch(r))},e.prototype.add=function(t){return this.isReady?this._addPlugin(t):(this.q.push(this._addPlugin.bind(this,t)),Sn())},e.prototype._addPlugin=function(t){return Sn(this.timeline.register(t,this.config))},e.prototype.remove=function(t){return this.isReady?this._removePlugin(t):(this.q.push(this._removePlugin.bind(this,t)),Sn())},e.prototype._removePlugin=function(t){return Sn(this.timeline.deregister(t,this.config))},e.prototype.dispatchWithCallback=function(t,n){if(!this.isReady)return n(go(t,0,kD));this.process(t).then(n)},e.prototype.dispatch=function(t){return ne(this,void 0,void 0,function(){var n=this;return te(this,function(r){return this.isReady?[2,this.process(t)]:[2,new Promise(function(a){n.dispatchQ.push(n.dispatchWithCallback.bind(n,t,a))})]})})},e.prototype.getOperationAppliedUserProperties=function(t){var n,r=(n=this.userProperties)!==null&&n!==void 0?n:{},a=ce({},r);if(t===void 0)return a;var o={};return Object.keys(t).forEach(function(l){Object.values(Ta).includes(l)||(o[l]=t[l])}),yD.forEach(function(l){if(Object.keys(t).includes(l)){var c=t[l];switch(l){case Ta.CLEAR_ALL:Object.keys(a).forEach(function(f){delete a[f]});break;case Ta.UNSET:Object.keys(c).forEach(function(f){delete a[f]});break;case Ta.SET:Object.assign(a,c);break}}}),Object.assign(a,o),a},e.prototype.process=function(t){return ne(this,void 0,void 0,function(){var a,n,r,a;return te(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,go(t,0,wD)]:(t.event_type===sr.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(t)]);case 1:return a=o.sent(),a.code===200?this.config.loggerProvider.log(a.message):a.code===100?this.config.loggerProvider.warn(a.message):this.config.loggerProvider.error(a.message),[2,a];case 2:return n=o.sent(),r=String(n),this.config.loggerProvider.error(r),a=go(t,0,r),[2,a];case 3:return[2]}})})},e.prototype.setOptOut=function(t){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!t));return}this._setOptOut(t)},e.prototype._setOptOut=function(t){this.config.optOut!==t&&(this.config.optOut=!!t,this.timeline.onOptOutChanged(t))},e.prototype.flush=function(){return Sn(this.timeline.flush())},e.prototype.plugin=function(t){var n=this.timeline.plugins.find(function(r){return r.name===t});if(n===void 0){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(t));return}return n},e.prototype.plugins=function(t){return this.timeline.plugins.filter(function(n){return n instanceof t})},e})(),MD=(function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(t){return this.productId=t,this},e.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},e.prototype.setPrice=function(t){return this.price=t,this},e.prototype.setRevenueType=function(t){return this.revenueType=t,this},e.prototype.setCurrency=function(t){return this.currency=t,this},e.prototype.setRevenue=function(t){return this.revenue=t,this},e.prototype.setReceipt=function(t){return this.receipt=t,this},e.prototype.setReceiptSig=function(t){return this.receiptSig=t,this},e.prototype.setEventProperties=function(t){return mv(t)&&(this.properties=t),this},e.prototype.getEventProperties=function(){var t=this.properties?ce({},this.properties):{};return t[ni.REVENUE_PRODUCT_ID]=this.productId,t[ni.REVENUE_QUANTITY]=this.quantity,t[ni.REVENUE_PRICE]=this.price,t[ni.REVENUE_TYPE]=this.revenueType,t[ni.REVENUE_CURRENCY]=this.currency,t[ni.REVENUE]=this.revenue,t[ni.RECEIPT]=this.receipt,t[ni.RECEIPT_SIG]=this.receiptSig,t},e})(),ni;(function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"})(ni||(ni={}));var DD=function(e,t){var n=Math.max(t,1);return e.reduce(function(r,a,o){var l=Math.floor(o/n);return r[l]||(r[l]=[]),r[l].push(a),r},[])},$n;(function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"})($n||($n={}));var af="Amplitude Logger ",ko=(function(){function e(){this.logLevel=$n.None}return e.prototype.disable=function(){this.logLevel=$n.None},e.prototype.enable=function(t){t===void 0&&(t=$n.Warn),this.logLevel=t},e.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<$n.Verbose||console.log("".concat(af,"[Log]: ").concat(t.join(" ")))},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<$n.Warn||console.warn("".concat(af,"[Warn]: ").concat(t.join(" ")))},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<$n.Error||console.error("".concat(af,"[Error]: ").concat(t.join(" ")))},e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<$n.Debug||console.log("".concat(af,"[Debug]: ").concat(t.join(" ")))},e})(),Of=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Qk,logLevel:$n.Warn,loggerProvider:new ko,offline:!1,optOut:!1,serverUrl:Vg,serverZone:"US",useBatch:!1}},nC=(function(){function e(t){var n,r,a,o;this._optOut=!1;var l=Of();this.apiKey=t.apiKey,this.flushIntervalMillis=(n=t.flushIntervalMillis)!==null&&n!==void 0?n:l.flushIntervalMillis,this.flushMaxRetries=t.flushMaxRetries||l.flushMaxRetries,this.flushQueueSize=t.flushQueueSize||l.flushQueueSize,this.instanceName=t.instanceName||l.instanceName,this.loggerProvider=t.loggerProvider||l.loggerProvider,this.logLevel=(r=t.logLevel)!==null&&r!==void 0?r:l.logLevel,this.minIdLength=t.minIdLength,this.plan=t.plan,this.ingestionMetadata=t.ingestionMetadata,this.offline=t.offline!==void 0?t.offline:l.offline,this.optOut=(a=t.optOut)!==null&&a!==void 0?a:l.optOut,this.serverUrl=t.serverUrl,this.serverZone=t.serverZone||l.serverZone,this.storageProvider=t.storageProvider,this.transportProvider=t.transportProvider,this.useBatch=(o=t.useBatch)!==null&&o!==void 0?o:l.useBatch,this.loggerProvider.enable(this.logLevel);var c=rC(t.serverUrl,t.serverZone,t.useBatch);this.serverZone=c.serverZone,this.serverUrl=c.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(t){this._optOut=t},enumerable:!1,configurable:!0}),e})(),ID=function(e,t){return e==="EU"?t?eC:Jk:t?Zk:Vg},rC=function(e,t,n){if(e===void 0&&(e=""),t===void 0&&(t=Of().serverZone),n===void 0&&(n=Of().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:Of().serverZone;return{serverZone:r,serverUrl:ID(r,n)}},LD=(function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(t,n){this.sdk.metrics.histogram[t]=n},e})();function vv(e){return e>=200&&e<300}var Mf=function(e){e===void 0&&(e=0);var t=new Error().stack||"";return t.split(`
|
|
14
|
+
`).slice(2+e).map(function(n){return n.trim()})},Tt=function(e){return function(){var t=ce({},e.config),n=t.loggerProvider,r=t.logLevel;return{logger:n,logLevel:r}}},PD=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");try{for(var a=_e(t.split(".")),o=a.next();!o.done;o=a.next()){var l=o.value;if(l in e)e=e[l];else return}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return e},kt=function(e,t){return function(){var n,r,a={};try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;a[c]=PD(e,c)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}},rt=function(e,t,n,r,a){return a===void 0&&(a=null),function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];var c=n(),f=c.logger,d=c.logLevel;if(d&&d<$n.Debug||!d||!f)return e.apply(a,o);var p={type:"invoke public method",name:t,args:o,stacktrace:Mf(1),time:{start:new Date().toISOString()},states:{}};r&&p.states&&(p.states.before=r());var v=e.apply(a,o);return v&&v.promise?v.promise.then(function(){r&&p.states&&(p.states.after=r()),p.time&&(p.time.end=new Date().toISOString()),f.debug(JSON.stringify(p,null,2))}):(r&&p.states&&(p.states.after=r()),p.time&&(p.time.end=new Date().toISOString()),f.debug(JSON.stringify(p,null,2))),v}},UD=new Set([Vg,Jk,Zk,eC]),zD=function(e,t){return t===void 0&&(t=!1),UD.has(e)?!0:t};function BD(e){return e instanceof Error?e.message:String(e)}function Ll(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch{}return t}var VD=(function(){function e(t){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=t?.diagnosticsClient}return e.prototype.setup=function(t){var n;return ne(this,void 0,void 0,function(){var r,a=this;return te(this,function(o){switch(o.label){case 0:return this.config=t,this.storageKey="".concat(uD,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=o.sent(),r&&r.length>0&&Promise.all(r.map(function(l){return a.execute(l)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(t){var n=this;return t.insert_id||(t.insert_id=_a()),new Promise(function(r){var a={event:t,attempts:0,callback:function(o){return r(o)},timeout:0};n.queue.push(a),n.schedule(n.config.flushIntervalMillis),n.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(t){var n=this;return t.filter(function(r){return r.attempts+=1,r.attempts<n.config.flushMaxRetries?!0:(n.fulfillRequest([r],500,SD),!1)})},e.prototype.scheduleEvents=function(t){var n=this;t.forEach(function(r){n.schedule(r.timeout===0?n.config.flushIntervalMillis:r.timeout)})},e.prototype.schedule=function(t){var n=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&t>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=t,this.scheduleId=setTimeout(function(){n.queue=n.queue.map(function(r){return r.timeout=0,r}),n.flush(!0)},t);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(t){return t===void 0&&(t=!1),ne(this,void 0,void 0,function(){var n,r,a,o=this;return te(this,function(l){switch(l.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),n=[],r=[],this.queue.forEach(function(c){return c.timeout===0?n.push(c):r.push(c)}),a=DD(n,this.config.flushQueueSize),[4,a.reduce(function(c,f){return ne(o,void 0,void 0,function(){return te(this,function(d){switch(d.label){case 0:return[4,c];case 1:return d.sent(),[4,this.send(f,t)];case 2:return[2,d.sent()]}})})},Promise.resolve())]);case 1:return l.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(t,n){var r;return n===void 0&&(n=!0),ne(this,void 0,void 0,function(){var a,o,l,c,f,d;return te(this,function(p){switch(p.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,ED)];a={api_key:this.config.apiKey,events:t.map(function(v){var g=v.event;g.extra;var b=Zf(g,["extra"]);return b}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new LD,p.label=1;case 1:return p.trys.push([1,3,,4]),o=rC(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,l=zD(o,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(o,a,this.config._enableRequestBodyCompressionExperimental&&l)];case 2:return c=p.sent(),c===null?(this.fulfillRequest(t,0,xD),[2]):n?(this.handleResponse(c,t),[3,4]):("body"in c?this.fulfillRequest(t,c.statusCode,"".concat(c.status,": ").concat(Ll(c))):this.fulfillRequest(t,c.statusCode,c.status),[2]);case 3:return f=p.sent(),d=BD(f),this.config.loggerProvider.error(d),(r=this.diagnosticsClient)===null||r===void 0||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:t.map(function(v){return v.event.event_type}),message:d,stack_trace:Mf()}),this.handleResponse({status:Gt.Failed,statusCode:0},t),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(t,n){var r;vv(t.statusCode)||(r=this.diagnosticsClient)===null||r===void 0||r.recordEvent("analytics.events.unsuccessful",{events:n.map(function(o){return o.event.event_type}),code:t.statusCode,status:t.status,body:Ll(t),stack_trace:Mf()});var a=t.status;switch(a){case Gt.Success:{this.handleSuccessResponse(t,n);break}case Gt.Invalid:{this.handleInvalidResponse(t,n);break}case Gt.PayloadTooLarge:{this.handlePayloadTooLargeResponse(t,n);break}case Gt.RateLimit:{this.handleRateLimitResponse(t,n);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(a,"' provided for ").concat(n.length,' events"}')),this.handleOtherResponse(n);break}}},e.prototype.handleSuccessResponse=function(t,n){this.fulfillRequest(n,t.statusCode,bD)},e.prototype.handleInvalidResponse=function(t,n){var r=this;if(t.body.missingField||t.body.error.startsWith(TD)){this.fulfillRequest(n,t.statusCode,t.body.error);return}var a=Qe(Qe(Qe(Qe([],Ae(Object.values(t.body.eventsWithInvalidFields)),!1),Ae(Object.values(t.body.eventsWithMissingFields)),!1),Ae(Object.values(t.body.eventsWithInvalidIdLengths)),!1),Ae(t.body.silencedEvents),!1).flat(),o=new Set(a),l=n.filter(function(f,d){if(o.has(d)){r.fulfillRequest([f],t.statusCode,t.body.error);return}return!0});l.length>0&&this.config.loggerProvider.warn(Ll(t));var c=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(c)},e.prototype.handlePayloadTooLargeResponse=function(t,n){if(n.length===1){this.fulfillRequest(n,t.statusCode,t.body.error);return}this.config.loggerProvider.warn(Ll(t)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.handleRateLimitResponse=function(t,n){var r=this,a=Object.keys(t.body.exceededDailyQuotaUsers),o=Object.keys(t.body.exceededDailyQuotaDevices),l=t.body.throttledEvents,c=new Set(a),f=new Set(o),d=new Set(l),p=n.filter(function(g,b){if(g.event.user_id&&c.has(g.event.user_id)||g.event.device_id&&f.has(g.event.device_id)){r.fulfillRequest([g],t.statusCode,t.body.error);return}return d.has(b)&&(g.timeout=r.throttleTimeout),!0});p.length>0&&this.config.loggerProvider.warn(Ll(t));var v=this.removeEventsExceedFlushMaxRetries(p);this.scheduleEvents(v)},e.prototype.handleOtherResponse=function(t){var n=this,r=t.map(function(o){return o.timeout=o.attempts*n.retryTimeout,o}),a=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(a)},e.prototype.fulfillRequest=function(t,n,r){var a,o,l;vv(n)?(l=this.diagnosticsClient)===null||l===void 0||l.increment("analytics.events.sent",t.length):((a=this.diagnosticsClient)===null||a===void 0||a.increment("analytics.events.dropped",t.length),(o=this.diagnosticsClient)===null||o===void 0||o.recordEvent("analytics.events.dropped",{events:t.map(function(c){return c.event.event_type}),code:n,message:r,stack_trace:Mf()})),this.removeEvents(t),t.forEach(function(c){return c.callback(go(c.event,n,r))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var t=this.queue.map(function(n){return n.event});this.config.storageProvider.set(this.storageKey,t)}},e.prototype.removeEvents=function(t){this.queue=this.queue.filter(function(n){return!t.some(function(r){return r.event.insert_id===n.event.insert_id})}),this.saveEvents()},e})(),FD=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:HD(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),HD=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},qD=(function(){function e(){this.queue=[]}return e.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},e.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach(function(n){t(n)}),this.queue=[])},e})(),ga=function(){return ga=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ga.apply(this,arguments)};function Df(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ew(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}var If=function(e,t){var n,r,a=["string","number","boolean","undefined"],o=typeof e,l=typeof t;if(o!==l)return!1;try{for(var c=Df(a),f=c.next();!f.done;f=c.next()){var d=f.value;if(d===o)return e===t}}catch(E){n={error:E}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var p=Array.isArray(e),v=Array.isArray(t);if(p!==v)return!1;if(p&&v){for(var g=0;g<e.length;g++)if(!If(e[g],t[g]))return!1}else{var b=Object.keys(e).sort(),S=Object.keys(t).sort();if(!If(b,S))return!1;var w=!0;return Object.keys(e).forEach(function(E){If(e[E],t[E])||(w=!1)}),w}return!0},GD="$set",KD="$unset",YD="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var $D=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,n=ga({},this.identity.userProperties),r=ga(ga({},this.identity),{userProperties:n});return{setUserId:function(a){return r.userId=a,this},setDeviceId:function(a){return r.deviceId=a,this},setUserProperties:function(a){return r.userProperties=a,this},setOptOut:function(a){return r.optOut=a,this},updateUserProperties:function(a){var o,l,c,f,d,p,v=r.userProperties||{};try{for(var g=Df(Object.entries(a)),b=g.next();!b.done;b=g.next()){var S=Ew(b.value,2),w=S[0],E=S[1];switch(w){case GD:try{for(var T=(c=void 0,Df(Object.entries(E))),C=T.next();!C.done;C=T.next()){var k=Ew(C.value,2),j=k[0],N=k[1];v[j]=N}}catch(U){c={error:U}}finally{try{C&&!C.done&&(f=T.return)&&f.call(T)}finally{if(c)throw c.error}}break;case KD:try{for(var R=(d=void 0,Df(Object.keys(E))),L=R.next();!L.done;L=R.next()){var j=L.value;delete v[j]}}catch(U){d={error:U}}finally{try{L&&!L.done&&(p=R.return)&&p.call(R)}finally{if(d)throw d.error}}break;case YD:v={};break}}}catch(U){o={error:U}}finally{try{b&&!b.done&&(l=g.return)&&l.call(g)}finally{if(o)throw o.error}}return r.userProperties=v,this},commit:function(){return t.setIdentity(r),this}}},e.prototype.getIdentity=function(){return ga({},this.identity)},e.prototype.setIdentity=function(t){var n=ga({},this.identity);this.identity=ga({},t),If(n,this.identity)||this.listeners.forEach(function(r){r(t)})},e.prototype.addIdentityListener=function(t){this.listeners.add(t)},e.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},e})(),Pl=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,Hg=(function(){function e(){this.identityStore=new $D,this.eventBridge=new qD,this.applicationContextProvider=new FD}return e.getInstance=function(t){return Pl.analyticsConnectorInstances||(Pl.analyticsConnectorInstances={}),Pl.analyticsConnectorInstances[t]||(Pl.analyticsConnectorInstances[t]=new e),Pl.analyticsConnectorInstances[t]},e})(),Co=function(e){return e===void 0&&(e=Qk),Hg.getInstance(e)},XD=function(e,t){Co(t).identityStore.editIdentity().setUserId(e).commit()},WD=function(e,t){Co(t).identityStore.editIdentity().setDeviceId(e).commit()},QD=(function(){function e(){this.name="identity",this.type="before",this.identityStore=Co().identityStore}return e.prototype.execute=function(t){return ne(this,void 0,void 0,function(){var n;return te(this,function(r){return n=t.user_properties,n&&this.identityStore.editIdentity().updateUserProperties(n).commit(),[2,t]})})},e.prototype.setup=function(t){return ne(this,void 0,void 0,function(){return te(this,function(n){return t.instanceName&&(this.identityStore=Co(t.instanceName).identityStore),[2]})})},e})(),iC=function(e,t){t===void 0&&(t=Date.now());var n=Date.now(),r=n-t;return r>e},aC=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),[Td,t,e.substring(0,n)].filter(Boolean).join("_")},JD=function(e){return"".concat(Td.toLowerCase(),"_").concat(e.substring(0,6))},ZD=function(){var e,t,n,r;if(typeof navigator>"u")return"";var a=navigator.userLanguage;return(r=(n=(t=(e=navigator.languages)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:navigator.language)!==null&&n!==void 0?n:a)!==null&&r!==void 0?r:""},td=function(){var e,t=Ue();if(!(!((e=t?.location)===null||e===void 0)&&e.search))return{};var n=t.location.search.substring(1).split("&").filter(Boolean),r=n.reduce(function(a,o){var l=o.split("=",2),c=Tw(l[0]),f=Tw(l[1]);return f&&(a[c]=f),a},{});return r},Tw=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},gv=function(e,t){return!t||!t.length?!0:t.some(function(n){return typeof n=="string"?e===n:e.match(n)})},ka=function(e,t){var n=e;try{n=decodeURI(e)}catch(r){t?.error("Malformed URI sequence: ",r)}return n},nd=function(e){var t=0;if(e.length===0)return t;for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t},eI=function(e,t){var n=nd(e.toString()),r=Math.abs(n),a=r*31,o=a%1e6;return o/1e6<t},kw=function(e,t){var n=nd(e.toString()),r=Math.abs(n),a=r*31,o=a%1e5;return o/1e5<t},qg=(function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return ne(this,void 0,void 0,function(){return te(this,function(t){return[2,!0]})})},e.prototype.get=function(t){return ne(this,void 0,void 0,function(){return te(this,function(n){return[2,this.memoryStorage.get(t)]})})},e.prototype.getRaw=function(t){return ne(this,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return[4,this.get(t)];case 1:return n=r.sent(),[2,n?JSON.stringify(n):void 0]}})})},e.prototype.set=function(t,n){return ne(this,void 0,void 0,function(){return te(this,function(r){return this.memoryStorage.set(t,n),[2]})})},e.prototype.remove=function(t){return ne(this,void 0,void 0,function(){return te(this,function(n){return this.memoryStorage.delete(t),[2]})})},e.prototype.reset=function(){return ne(this,void 0,void 0,function(){return te(this,function(t){return this.memoryStorage.clear(),[2]})})},e})(),tI=function(){var e,t=Ue();return(e=t?.navigator)===null||e===void 0?void 0:e.locks},rd=(function(){function e(t,n){n===void 0&&(n={}),this.options=ce({},t),this.config=n}return e.prototype.isEnabled=function(){return ne(this,void 0,void 0,function(){var t,n,r,a,o=this;return te(this,function(l){switch(l.label){case 0:return t="AMP_TEST",n=ce({},this.options),r=new e(n),a=String(Date.now()),[4,r.transaction(t,function(c){var f,d;try{c.set(a);var p=c.get(),v=p===a;return!v&&o.config.diagnosticsClient&&((f=o.config.diagnosticsClient)===null||f===void 0||f.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:a,sync:!0})),v}catch(b){if(o.config.diagnosticsClient){var g=b instanceof Error?b.message:String(b);(d=o.config.diagnosticsClient)===null||d===void 0||d.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:a,error:g,sync:!0})}return!1}finally{c.set(null)}})];case 1:return[2,l.sent()]}})})},e.prototype.get=function(t){return ne(this,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return[4,this.getRaw(t)];case 1:return n=r.sent(),[2,this.decodeCookieValue(t,n)]}})})},e.prototype.decodeCookieValue=function(t,n){if(n)try{var r=sC(n);if(r===void 0){console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(t,", value: ").concat(n));return}return JSON.parse(r)}catch{console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(t,", value: ").concat(n));return}},e.prototype.getSync=function(t){var n=this.getRawSync(t);return this.decodeCookieValue(t,n)},e.prototype.getRaw=function(t){var n,r;return ne(this,void 0,void 0,function(){var a,o,l,c,f,d,p,v,g;return te(this,function(b){switch(b.label){case 0:a=Ue(),o=a,b.label=1;case 1:return b.trys.push([1,4,,5]),l=o?.cookieStore,l?[4,l.getAll(t)]:[3,3];case 2:if(c=b.sent(),c){c.length>1&&((n=this.config.diagnosticsClient)===null||n===void 0||n.recordEvent("cookies.duplicate",{cookies:c.map(function(S){return S.domain})}),(r=this.config.diagnosticsClient)===null||r===void 0||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(f=_e(c),d=f.next();!d.done;d=f.next())if(p=d.value,oC(p.domain,this.options.domain))return[2,p.value]}catch(S){v={error:S}}finally{try{d&&!d.done&&(g=f.return)&&g.call(f)}finally{if(v)throw v.error}}}b.label=3;case 3:return[3,5];case 4:return b.sent(),[3,5];case 5:return[2,this.getRawSync(t)]}})})},e.prototype.getRawSync=function(t){var n=this,r,a,o=Ue(),l=((a=(r=o?.document)===null||r===void 0?void 0:r.cookie.split("; "))!==null&&a!==void 0?a:[]).filter(function(d){return d.indexOf(t+"=")===0}),c=void 0,f=this.config.duplicateResolverFn;if(typeof f=="function"&&l.length>1&&(c=l.find(function(d){var p;try{var v=f(d.substring(t.length+1));return v||(p=n.config.diagnosticsClient)===null||p===void 0||p.increment("cookies.duplicate.occurrence.document.cookie"),v}catch{return!1}})),c||(c=l[0]),!!c)return c.substring(t.length+1)},e.prototype.set=function(t,n){return ne(this,void 0,void 0,function(){return te(this,function(r){return this.setSync(t,n),[2]})})},e.prototype.setSync=function(t,n){var r;try{var a=(r=this.options.expirationDays)!==null&&r!==void 0?r:0,o=n!==null?a:-1,l=void 0;if(o){var c=new Date;c.setTime(c.getTime()+o*24*60*60*1e3),l=c}var f="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(n))));l&&(f+="; expires=".concat(l.toUTCString())),f+="; path=/",this.options.domain&&(f+="; domain=".concat(this.options.domain)),this.options.secure&&(f+="; Secure"),this.options.sameSite&&(f+="; SameSite=".concat(this.options.sameSite));var d=Ue();d&&(d.document.cookie=f)}catch(v){var p=v instanceof Error?v.message:String(v);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(t,". Error: ").concat(p))}},e.prototype.remove=function(t){return ne(this,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return[4,this.set(t,null)];case 1:return n.sent(),[2]}})})},e.prototype.reset=function(){return ne(this,void 0,void 0,function(){return te(this,function(t){return[2]})})},e.isDomainWritable=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o;return te(this,function(l){switch(l.label){case 0:if(e.cachedTlds[t])return[2,!0];n={domain:"."+t},r="AMP_TLDTEST",a=new e(n),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,a.transaction(r,function(c){if(e.cachedTlds[t])return!0;try{c.set(1);var f=!!c.get();return f&&(e.cachedTlds[t]=!0),f}finally{c.set(null)}})];case 2:return o=l.sent(),[2,!!o];case 3:return l.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(t,n){return ne(this,void 0,void 0,function(){var r,a,o=this;return te(this,function(l){switch(l.label){case 0:return r=tI(),a=function(){var c={get:function(){return o.getSync(t)},set:function(f){return o.setSync(t,f)}};return n(c)},r?[4,r.request("com.amplitude:cookie-lock:".concat(t),a)]:[2,a()];case 1:return[2,l.sent()]}})})},e.cachedTlds={},e})(),nI=function(e){try{return decodeURIComponent(atob(e))}catch{return}},rI=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch{return}},sC=function(e){var t;return(t=nI(e))!==null&&t!==void 0?t:rI(e)},oC=function(e,t){if(e===""&&t==="")return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},Cw=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),[Td,t,e.substring(0,n)].filter(Boolean).join("_")},Gg=(function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return ne(this,void 0,void 0,function(){var t,n,r,a;return te(this,function(o){switch(o.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return o.sent(),[4,n.get(r)];case 3:return a=o.sent(),[2,a===t];case 4:return o.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return o.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return ne(this,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return n=r.sent(),n?[2,JSON.parse(n)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(t){var n;return ne(this,void 0,void 0,function(){return te(this,function(r){return[2,((n=this.storage)===null||n===void 0?void 0:n.getItem(t))||void 0]})})},e.prototype.set=function(t,n){var r;return ne(this,void 0,void 0,function(){return te(this,function(a){try{(r=this.storage)===null||r===void 0||r.setItem(t,JSON.stringify(n))}catch{}return[2]})})},e.prototype.remove=function(t){var n;return ne(this,void 0,void 0,function(){return te(this,function(r){try{(n=this.storage)===null||n===void 0||n.removeItem(t)}catch{}return[2]})})},e.prototype.reset=function(){var t;return ne(this,void 0,void 0,function(){return te(this,function(n){try{(t=this.storage)===null||t===void 0||t.clear()}catch{}return[2]})})},e})(),iI=10,aI=1,st={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},Aw={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Nw=(function(){function e(t,n){this.dbPromise=null,this.logger=n,this.dbName="AMP_diagnostics_".concat(t.substring(0,10))}return e.isSupported=function(){var t;return((t=Ue())===null||t===void 0?void 0:t.indexedDB)!==void 0},e.prototype.getDB=function(){return ne(this,void 0,void 0,function(){return te(this,function(t){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var t=this;return new Promise(function(n,r){var a=indexedDB.open(t.dbName,aI);a.onerror=function(){t.dbPromise=null,r(new Error("Failed to open IndexedDB"))},a.onsuccess=function(){var o=a.result;o.onclose=function(){t.dbPromise=null,t.logger.debug("DiagnosticsStorage: DB connection closed.")},o.onerror=function(l){t.logger.debug("DiagnosticsStorage: A global database error occurred.",l),o.close()},n(o)},a.onupgradeneeded=function(o){var l=o.target.result;t.createTables(l)}})},e.prototype.createTables=function(t){if(t.objectStoreNames.contains(st.TAGS)||t.createObjectStore(st.TAGS,{keyPath:"key"}),t.objectStoreNames.contains(st.COUNTERS)||t.createObjectStore(st.COUNTERS,{keyPath:"key"}),t.objectStoreNames.contains(st.HISTOGRAMS)||t.createObjectStore(st.HISTOGRAMS,{keyPath:"key"}),!t.objectStoreNames.contains(st.EVENTS)){var n=t.createObjectStore(st.EVENTS,{keyPath:"id",autoIncrement:!0});n.createIndex("time_idx","time",{unique:!1})}t.objectStoreNames.contains(st.INTERNAL)||t.createObjectStore(st.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o,l=this;return te(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return n=c.sent(),r=n.transaction([st.TAGS],"readwrite"),a=r.objectStore(st.TAGS),[2,new Promise(function(f){var d=Object.entries(t);r.oncomplete=function(){f()},r.onabort=function(p){l.logger.debug("DiagnosticsStorage: Failed to set tags",p),f()},d.forEach(function(p){var v=Ae(p,2),g=v[0],b=v[1],S=a.put({key:g,value:b});S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to set tag",g,b,w)}})})];case 2:return o=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",o),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o,l=this;return te(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return n=c.sent(),r=n.transaction([st.COUNTERS],"readwrite"),a=r.objectStore(st.COUNTERS),[2,new Promise(function(f){var d=Object.entries(t);r.oncomplete=function(){f()},r.onabort=function(p){l.logger.debug("DiagnosticsStorage: Failed to increment counters",p),f()},d.forEach(function(p){var v=Ae(p,2),g=v[0],b=v[1],S=a.get(g);S.onsuccess=function(){var w=S.result,E=w?w.value:0,T=a.put({key:g,value:E+b});T.onerror=function(C){l.logger.debug("DiagnosticsStorage: Failed to update counter",g,C)}},S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to read existing counter",g,w)}})})];case 2:return o=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",o),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o,l=this;return te(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return n=c.sent(),r=n.transaction([st.HISTOGRAMS],"readwrite"),a=r.objectStore(st.HISTOGRAMS),[2,new Promise(function(f){var d=Object.entries(t);r.oncomplete=function(){f()},r.onabort=function(p){l.logger.debug("DiagnosticsStorage: Failed to set histogram stats",p),f()},d.forEach(function(p){var v=Ae(p,2),g=v[0],b=v[1],S=a.get(g);S.onsuccess=function(){var w=S.result,E;w?E={key:g,count:w.count+b.count,min:Math.min(w.min,b.min),max:Math.max(w.max,b.max),sum:w.sum+b.sum}:E={key:g,count:b.count,min:b.min,max:b.max,sum:b.sum};var T=a.put(E);T.onerror=function(C){l.logger.debug("DiagnosticsStorage: Failed to set histogram stats",g,C)}},S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",g,w)}})})];case 2:return o=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",o),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o,l=this;return te(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),t.length===0?[2]:[4,this.getDB()];case 1:return n=c.sent(),r=n.transaction([st.EVENTS],"readwrite"),a=r.objectStore(st.EVENTS),[2,new Promise(function(f){r.oncomplete=function(){f()},r.onabort=function(p){l.logger.debug("DiagnosticsStorage: Failed to add event records",p),f()};var d=a.count();d.onsuccess=function(){var p=d.result,v=Math.max(0,iI-p);v<t.length&&l.logger.debug("DiagnosticsStorage: Only added ".concat(v," of ").concat(t.length," events due to storage limit")),t.slice(0,v).forEach(function(g){var b=a.add(g);b.onerror=function(S){l.logger.debug("DiagnosticsStorage: Failed to add event record",S)}})},d.onerror=function(p){l.logger.debug("DiagnosticsStorage: Failed to count existing events",p)}})];case 2:return o=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",o),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(t,n){return ne(this,void 0,void 0,function(){var r,a,o,l;return te(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=c.sent(),a=r.transaction([st.INTERNAL],"readwrite"),o=a.objectStore(st.INTERNAL),[2,new Promise(function(f,d){a.onabort=function(){return d(new Error("Failed to set internal value"))};var p=o.put({key:t,value:n});p.onsuccess=function(){return f()},p.onerror=function(){return d(new Error("Failed to set internal value"))}})];case 2:return l=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",l),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o;return te(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=l.sent(),r=n.transaction([st.INTERNAL],"readonly"),a=r.objectStore(st.INTERNAL),[2,new Promise(function(c,f){r.onabort=function(){return f(new Error("Failed to get internal value"))};var d=a.get(t);d.onsuccess=function(){return c(d.result)},d.onerror=function(){return f(new Error("Failed to get internal value"))}})];case 2:return o=l.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",o),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return ne(this,void 0,void 0,function(){var t,n;return te(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(Aw.LAST_FLUSH_TIMESTAMP)];case 1:return t=r.sent(),[2,t?parseInt(t.value,10):void 0];case 2:return n=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",n),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(t){return ne(this,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(Aw.LAST_FLUSH_TIMESTAMP,t.toString())];case 1:return r.sent(),[3,3];case 2:return n=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",n),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(t,n){return new Promise(function(r,a){var o=t.objectStore(n),l=o.clear();l.onsuccess=function(){return r()},l.onerror=function(){return a(new Error("Failed to clear table ".concat(n)))}})},e.prototype.getAllAndClear=function(){return ne(this,void 0,void 0,function(){var t,n,r,a,o,l,c,f;return te(this,function(d){switch(d.label){case 0:return d.trys.push([0,4,,5]),[4,this.getDB()];case 1:return t=d.sent(),n=t.transaction([st.TAGS,st.COUNTERS,st.HISTOGRAMS,st.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(n,st.TAGS),this.getAllFromStore(n,st.COUNTERS),this.getAllFromStore(n,st.HISTOGRAMS),this.getAllFromStore(n,st.EVENTS)])];case 2:return r=Ae.apply(void 0,[d.sent(),4]),a=r[0],o=r[1],l=r[2],c=r[3],[4,Promise.all([this.clearTable(n,st.COUNTERS),this.clearTable(n,st.HISTOGRAMS),this.clearTable(n,st.EVENTS)])];case 3:return d.sent(),[2,{tags:a,counters:o,histogramStats:l,events:c}];case 4:return f=d.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",f),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(t,n){return new Promise(function(r,a){var o=t.objectStore(n),l=o.getAll();l.onsuccess=function(){return r(l.result)},l.onerror=function(){return a(new Error("Failed to get all from ".concat(n)))}})},e})(),sI="__AMPLITUDE_SCRIPT_URL__",oI="sdk.error.uncaught",lI=function(){var e=Ue();if(!e)return[];var t=e[sI];return Array.isArray(t)?t:typeof t=="string"?[t]:[]},uI=function(e){var t=Ue();if(!(!t||typeof t.addEventListener!="function")){var n=function(o){var l=o.error instanceof Error?o.error:void 0,c=l?.stack,f=jw({filename:o.filename,stack:c});f&&a({type:"error",message:o.message,stack:c,filename:o.filename,errorName:l?.name,metadata:{colno:o.colno,lineno:o.lineno,isTrusted:o.isTrusted,matchReason:f}})},r=function(o){var l,c=o.reason instanceof Error?o.reason:void 0,f=c?.stack,d=cI(f),p=jw({filename:d,stack:f});p&&a({type:"unhandledrejection",message:(l=c?.message)!==null&&l!==void 0?l:fI(o.reason),stack:f,filename:d,errorName:c?.name,metadata:{isTrusted:o.isTrusted,matchReason:p}})},a=function(o){e.recordEvent(oI,ce({type:o.type,message:o.message,filename:o.filename,error_name:o.errorName,stack:o.stack},o.metadata))};t.addEventListener("error",n,!0),t.addEventListener("unhandledrejection",r,!0)}},jw=function(e){var t,n,r=lI();if(r.length!==0)try{for(var a=_e(r),o=a.next();!o.done;o=a.next()){var l=o.value;if(e.filename&&e.filename.includes(l))return"filename";if(e.stack&&e.stack.includes(l))return"stack"}}catch(c){t={error:c}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},cI=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},fI=function(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"[object Object]"}},dI=1e3,sf=300*1e3,hI="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",pI="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",am=1e4,mI=10,vI=(function(){function e(t,n,r,a){r===void 0&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=t,this.logger=n,this.serverUrl=r==="US"?hI:pI,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(a,null,2)),this.config=ce({enabled:!0,sampleRate:0},a),this.startTimestamp=Date.now(),this.shouldTrack=kw(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Nw.isSupported()?this.storage=new Nw(t,n):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),uI(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(t,n){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=am){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}this.inMemoryTags[t]=n,this.startTimersIfNeeded()}},e.prototype.increment=function(t,n){if(n===void 0&&(n=1),!!this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=am){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}this.inMemoryCounters[t]=(this.inMemoryCounters[t]||0)+n,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(t,n){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=am){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var r=this.inMemoryHistograms[t];r?(r.count+=1,r.min=Math.min(r.min,n),r.max=Math.max(r.max,n),r.sum+=n):this.inMemoryHistograms[t]={count:1,min:n,max:n,sum:n},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(t,n){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=mI){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}this.inMemoryEvents.push({event_name:t,time:Date.now(),event_properties:n}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var t=this;this.saveTimer||(this.saveTimer=setTimeout(function(){t.saveAllDataToStorage().catch(function(n){t.logger.debug("DiagnosticsClient: Failed to save all data to storage",n)}).finally(function(){t.saveTimer=null})},dI)),this.flushTimer||(this.flushTimer=setTimeout(function(){t._flush().catch(function(n){t.logger.debug("DiagnosticsClient: Failed to flush",n)}).finally(function(){t.flushTimer=null})},sf))},e.prototype.saveAllDataToStorage=function(){return ne(this,void 0,void 0,function(){var t,n,r,a;return te(this,function(o){switch(o.label){case 0:return this.storage?(t=ce({},this.inMemoryTags),n=ce({},this.inMemoryCounters),r=ce({},this.inMemoryHistograms),a=Qe([],Ae(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(t),this.storage.incrementCounters(n),this.storage.setHistogramStats(r),this.storage.addEventRecords(a)])]):[2];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return ne(this,void 0,void 0,function(){var t,n,r,a,o,l,c,f,d,p;return te(this,function(v){switch(v.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return v.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return t=v.sent(),n=t.tags,r=t.counters,a=t.histogramStats,o=t.events,this.storage.setLastFlushTimestamp(Date.now()),l={},n.forEach(function(g){l[g.key]=g.value}),c={},r.forEach(function(g){c[g.key]=g.value}),f={},a.forEach(function(g){f[g.key]={count:g.count,min:g.min,max:g.max,avg:Math.round(g.sum/g.count*100)/100}}),d=o.map(function(g){return{event_name:g.event_name,time:g.time,event_properties:g.event_properties}}),Object.keys(c).length===0&&Object.keys(f).length===0&&d.length===0?[2]:(p={tags:l,histogram:f,counters:c,events:d},this.fetch(p),[2])}})})},e.prototype.fetch=function(t){return ne(this,void 0,void 0,function(){var n,r;return te(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),!Ue())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return n=a.sent(),n.ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return r=a.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",r),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return ne(this,void 0,void 0,function(){var t,n,r;return te(this,function(a){switch(a.label){case 0:return this.storage?(t=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return n=a.sent()||-1,n===-1?(this.storage.setLastFlushTimestamp(t),this._setFlushTimer(sf),[2]):(r=t-n,r>=sf?(this._flush(),[2]):(this._setFlushTimer(sf-r),[2]))}})})},e.prototype._setFlushTimer=function(t){var n=this;this.flushTimer=setTimeout(function(){n._flush().catch(function(r){n.logger.debug("DiagnosticsClient: Failed to flush",r)}).finally(function(){n.flushTimer=null})},t)},e.prototype._setSampleRate=function(t){this.logger.debug("DiagnosticsClient: Setting sample rate to",t),this.config.sampleRate=t,this.shouldTrack=kw(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e})(),Ou=(function(){function e(){}return e.prototype.send=function(t,n,r){return Promise.resolve(null)},e.prototype.buildResponse=function(t){var n,r,a,o,l,c,f,d,p,v,g,b,S,w,E,T,C,k,j,N,R,L;if(typeof t!="object")return null;var U=t.code||0,G=this.buildStatus(U);switch(G){case Gt.Success:return{status:G,statusCode:U,body:{eventsIngested:(n=t.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=t.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(a=t.server_upload_time)!==null&&a!==void 0?a:0}};case Gt.Invalid:return{status:G,statusCode:U,body:{error:(o=t.error)!==null&&o!==void 0?o:"",missingField:(l=t.missing_field)!==null&&l!==void 0?l:"",eventsWithInvalidFields:(c=t.events_with_invalid_fields)!==null&&c!==void 0?c:{},eventsWithMissingFields:(f=t.events_with_missing_fields)!==null&&f!==void 0?f:{},eventsWithInvalidIdLengths:(d=t.events_with_invalid_id_lengths)!==null&&d!==void 0?d:{},epsThreshold:(p=t.eps_threshold)!==null&&p!==void 0?p:0,exceededDailyQuotaDevices:(v=t.exceeded_daily_quota_devices)!==null&&v!==void 0?v:{},silencedDevices:(g=t.silenced_devices)!==null&&g!==void 0?g:[],silencedEvents:(b=t.silenced_events)!==null&&b!==void 0?b:[],throttledDevices:(S=t.throttled_devices)!==null&&S!==void 0?S:{},throttledEvents:(w=t.throttled_events)!==null&&w!==void 0?w:[]}};case Gt.PayloadTooLarge:return{status:G,statusCode:U,body:{error:(E=t.error)!==null&&E!==void 0?E:""}};case Gt.RateLimit:return{status:G,statusCode:U,body:{error:(T=t.error)!==null&&T!==void 0?T:"",epsThreshold:(C=t.eps_threshold)!==null&&C!==void 0?C:0,throttledDevices:(k=t.throttled_devices)!==null&&k!==void 0?k:{},throttledUsers:(j=t.throttled_users)!==null&&j!==void 0?j:{},exceededDailyQuotaDevices:(N=t.exceeded_daily_quota_devices)!==null&&N!==void 0?N:{},exceededDailyQuotaUsers:(R=t.exceeded_daily_quota_users)!==null&&R!==void 0?R:{},throttledEvents:(L=t.throttled_events)!==null&&L!==void 0?L:[]}};case Gt.Timeout:default:return{status:G,statusCode:U}}},e.prototype.buildStatus=function(t){return vv(t)?Gt.Success:t===429?Gt.RateLimit:t===413?Gt.PayloadTooLarge:t===408?Gt.Timeout:t>=400&&t<500?Gt.Invalid:t>=500?Gt.Failed:Gt.Unknown},e})(),gI=(function(e){Or(t,e);function t(n){n===void 0&&(n={});var r=e.call(this)||this;return r.customHeaders=n,r}return t.prototype.send=function(n,r){return ne(this,void 0,void 0,function(){var a,o,l;return te(this,function(c){switch(c.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return a={headers:ce({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(r),method:"POST"},[4,fetch(n,a)];case 1:return o=c.sent(),[4,o.text()];case 2:l=c.sent();try{return[2,this.buildResponse(JSON.parse(l))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},t})(Ou),lC=2*1024;function uC(){return typeof CompressionStream<"u"}function cC(e){return ne(this,void 0,void 0,function(){var t,n;return te(this,function(r){switch(r.label){case 0:if(t=CompressionStream,typeof t>"u")return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),n=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(n).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var yI=(function(){function e(t,n){this.key="AMP_remote_config_".concat(t.substring(0,10)),this.logger=n}return e.prototype.fetchConfig=function(){var t=null,n={remoteConfig:null,lastFetch:new Date};try{t=localStorage.getItem(this.key)}catch(a){return this.logger.debug("Remote config localstorage failed to access: ",a),Promise.resolve(n)}if(t===null)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(n);try{var r=JSON.parse(t);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(a){return this.logger.debug("Remote config localstorage failed to parse: ",a),localStorage.removeItem(this.key),Promise.resolve(n)}},e.prototype.setConfig=function(t){try{return localStorage.setItem(this.key,JSON.stringify(t)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(n){this.logger.debug("Remote config localstorage failed to set: ",n)}return Promise.resolve(!1)},e})(),bI="https://sr-client-cfg.amplitude.com/config",xI="https://sr-client-cfg.eu.amplitude.com/config",SI=3,wI=1e3,EI=300*1e3,fC=(function(){function e(t,n,r,a){r===void 0&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=t,this.serverUrl=a||(r==="US"?bI:xI),this.logger=n,this.storage=new yI(t,n)}return e.prototype.subscribe=function(t,n,r){var a=_a(),o={id:a,key:t,deliveryMode:n,callback:r};return this.callbackInfos.push(o),n==="all"?this.subscribeAll(o):this.subscribeWaitForRemote(o,n.timeout),a},e.prototype.unsubscribe=function(t){var n=this.callbackInfos.findIndex(function(r){return r.id===t});return n===-1?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(t," doesn't exist.")),!1):(this.callbackInfos.splice(n,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(t,".")),!0)},e.prototype.updateConfigs=function(){return ne(this,void 0,void 0,function(){var t,n,r=this;return te(this,function(a){switch(a.label){case 0:return this.lastSuccessfulFetch&&(t=Date.now()-this.lastSuccessfulFetch,t<EI)?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return n=a.sent(),this.storage.setConfig(n),this.callbackInfos.forEach(function(o){r.sendCallback(o,n,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var t=this;return this.fetchPromise?this.fetchPromise:(this.fetchPromise=this.fetch().then(function(n){return n.remoteConfig!==null&&(t.lastSuccessfulFetch=Date.now()),n}).finally(function(){t.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(t){return ne(this,void 0,void 0,function(){var n,r,a,o=this;return te(this,function(l){switch(l.label){case 0:return n=this.getOrCreateFetchPromise().then(function(c){o.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(c))),o.sendCallback(t,c,"remote"),o.storage.setConfig(c)}),r=this.storage.fetchConfig().then(function(c){return c}),[4,Promise.race([n,r])];case 1:return a=l.sent(),a!==void 0&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(a))),a.remoteConfig!==null?this.sendCallback(t,a,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,n];case 2:return l.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(t,n){return ne(this,void 0,void 0,function(){var r,a,a;return te(this,function(o){switch(o.label){case 0:r=new Promise(function(l,c){setTimeout(function(){c("Timeout exceeded")},n)}),o.label=1;case 1:return o.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return a=o.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(t,a,"remote"),this.storage.setConfig(a),[3,5];case 3:return o.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return a=o.sent(),a.remoteConfig!==null?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(t,a,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(t,a,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(t,n,r){t.lastCallback=new Date;var a;t.key?a=t.key.split(".").reduce(function(o,l){return o===null?o:l in o?o[l]:null},n.remoteConfig):a=n.remoteConfig,t.callback(a,r,n.lastFetch)},e.prototype.fetch=function(t,n){return t===void 0&&(t=SI),n===void 0&&(n=wI),ne(this,void 0,void 0,function(){var r,a,o,l,c,f,d=this;return te(this,function(p){switch(p.label){case 0:r=n/t,a={remoteConfig:null,lastFetch:new Date},o=function(v){var g,b,S,w,E,T;return te(this,function(C){switch(C.label){case 0:g=new AbortController,b=setTimeout(function(){return g.abort()},n),C.label=1;case 1:return C.trys.push([1,7,8,9]),[4,fetch(l.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:g.signal})];case 2:return S=C.sent(),S.ok?[3,4]:[4,S.text()];case 3:return w=C.sent(),l.logger.debug("Remote config client fetch with retry time ".concat(t," failed with ").concat(S.status,": ").concat(w)),[3,6];case 4:return[4,S.json()];case 5:return E=C.sent(),[2,{value:{remoteConfig:E,lastFetch:new Date}}];case 6:return[3,9];case 7:return T=C.sent(),T instanceof Error&&T.name==="AbortError"?l.logger.debug("Remote config client fetch with retry time ".concat(t," timed out after ").concat(n,"ms")):l.logger.debug("Remote config client fetch with retry time ".concat(t," is rejected because: "),T),[3,9];case 8:return clearTimeout(b),[7];case 9:return v<t-1?[4,new Promise(function(k){return setTimeout(k,d.getJitterDelay(r))})]:[3,11];case 10:C.sent(),C.label=11;case 11:return[2]}})},l=this,c=0,p.label=1;case 1:return c<t?[5,o(c)]:[3,4];case 2:if(f=p.sent(),typeof f=="object")return[2,f.value];p.label=3;case 3:return c++,[3,1];case 4:return[2,a]}})})},e.prototype.getJitterDelay=function(t){return Math.floor(Math.random()*t)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e})(),sm=Ue(),ao=sm?.console,fs={},ru={},om=!1;function TI(e){if(!ao||typeof ao[e]!="function")return!1;if(ru[e])return!0;var t=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{if(fs[e]&&!om){om=!0;var a=fs[e];a&&a.forEach(function(o){try{o(e,n)}catch{}})}}catch{}return om=!1,ru[e].apply(ao,n)};return ru[e]=ao[e],ao[e]=t,!0}function kI(e,t){var n=TI(e);if(!n)return new Error("Console override failed");fs[e]?fs[e].push(t):fs[e]=[t]}function CI(e){var t,n;try{for(var r=_e(Object.values(fs)),a=r.next();!a.done;a=r.next())for(var o=a.value,l=o.length-1;l>=0;l--)if(o[l]===e){o.splice(l,1);break}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}function AI(){var e,t;try{for(var n=_e(Object.entries(ru)),r=n.next();!r.done;r=n.next()){var a=Ae(r.value,2),o=a[0],l=a[1];l&&(ao[o]=l)}}catch(c){e={error:c}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}ru={},fs={}}var Rw={addListener:kI,removeListener:CI,_restoreConsole:AI},xu;(function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"})(xu||(xu={}));var NI=null,jI=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],dC="data-amp-track-",RI=["div","span","h1","h2","h3","h4","h5","h6"],_I=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],hC=Qe(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],Ae(_I),!1),OI=hC,MI=hC,DI=["*"],II=1e3,LI=4,PI=50;function UI(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||e===void 0}function pC(e,t,n){if(e){var r=t.map(_w),a=n.map(_w);mC({json:e,allowlist:r,excludelist:a,ancestors:[]})}}function mC(e){var t,n,r=e.json,a=e.targetObject,o=e.allowlist,l=e.excludelist,c=e.ancestors,f=e.parentObject,d=e.targetKey;a||(a=r);var p=Object.keys(a);try{for(var v=_e(p),g=v.next();!g.done;g=v.next()){var b=g.value,S=Qe(Qe([],Ae(c),!1),[b],!1);UI(a[b])?(!Ow(S,o)||Ow(S,l))&&delete a[b]:mC({json:r,targetObject:a[b],allowlist:o,excludelist:l,ancestors:S,parentObject:a,targetKey:b})}}catch(w){t={error:w}}finally{try{g&&!g.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}Object.keys(a).length===0&&f&&d&&delete f[d]}function _w(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(t){return t.replace(/~0/g,"~").replace(/~1/g,"/")})}function yv(e,t,n,r){if(n===void 0&&(n=0),r===void 0&&(r=0),r===t.length)return n===e.length;if(n===e.length){for(;r<t.length&&t[r]==="**";)r++;return r===t.length}var a=t[r];if(a==="**"){if(r+1===t.length)return!0;for(var o=n;o<=e.length;o++)if(yv(e,t,o,r+1))return!0;return!1}else return a==="*"||a===e[n]?yv(e,t,n+1,r+1):!1}function Ow(e,t){return t.some(function(n){return yv(e,n)})}var zI=500,vC=100,BI=(function(){function e(t){this.request=t}return e.prototype.headers=function(t){var n,r;t===void 0&&(t=[]);var a=this.request.headers,o={};if(Array.isArray(a))a.forEach(function(v){var g=Ae(v,2),b=g[0],S=g[1];o[b]=S});else if(a instanceof Headers)a.forEach(function(v,g){o[g]=v});else if(typeof a=="object"&&a!==null)try{for(var l=_e(Object.entries(a)),c=l.next();!c.done;c=l.next()){var f=Ae(c.value,2),d=f[0],p=f[1];o[d]=p}}catch(v){n={error:v}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return Cd(o,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(typeof this._bodySize=="number")return this._bodySize;var t=Ue();if(t?.TextEncoder){var n=this.request.body;return this._bodySize=gC(n,vC),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.request.body=="string"?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),ne(this,void 0,void 0,function(){var r;return te(this,function(a){return t.length===0?[2,null]:(r=this.body,[2,Kg(r,t,n)])})})},e})(),VI=(function(){function e(t,n){this.bodyRaw=t,this.requestHeaders=n}return e.prototype.headers=function(t){return t===void 0&&(t=[]),Cd(this.requestHeaders,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return gC(this.bodyRaw,vC)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.bodyRaw=="string"?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),ne(this,void 0,void 0,function(){var r;return te(this,function(a){return t.length===0?[2,null]:(r=this.body,[2,Kg(r,t,n)])})})},e})();function gC(e,t){var n,r,a,o=Ue(),l=o?.TextEncoder;if(l){var c;if(typeof e=="string")c=e,a=new l().encode(c).length;else if(e instanceof Blob)c=e,a=c.size;else if(e instanceof URLSearchParams)c=e,a=new l().encode(c.toString()).length;else if(ArrayBuffer.isView(e))c=e,a=c.byteLength;else if(e instanceof ArrayBuffer)c=e,a=c.byteLength;else if(e instanceof FormData){var f=e,d=0,p=0;try{for(var v=_e(f.entries()),g=v.next();!g.done;g=v.next()){var b=Ae(g.value,2),S=b[0],w=b[1];if(d+=S.length,typeof w=="string")d+=new l().encode(w).length;else if(w instanceof Blob)d+=w.size;else return;if(++p>=t)return}}catch(E){n={error:E}}finally{try{g&&!g.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}a=d}else if(e instanceof ReadableStream){c=e;return}return a}}var FI=(function(){function e(t){this.response=t}return e.prototype.headers=function(t){var n;if(t===void 0&&(t=[]),this.response.headers instanceof Headers){var r=this.response.headers,a={};return(n=r?.forEach)===null||n===void 0||n.call(r,function(o,l){a[l]=o}),Cd(a,{allow:t})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var t,n;if(this._bodySize!==void 0)return this._bodySize;var r=(n=(t=this.response.headers)===null||t===void 0?void 0:t.get)===null||n===void 0?void 0:n.call(t,"content-length"),a=r?parseInt(r,10):void 0;return this._bodySize=a,a},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return ne(this,void 0,void 0,function(){var t,n,r;return te(this,function(a){switch(a.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),a.label=1;case 1:return a.trys.push([1,3,,4]),t=this.clonedResponse.text(),n=new Promise(function(o){return setTimeout(function(){return o(null)},zI)}),[4,Promise.race([t,n])];case 2:return r=a.sent(),[2,r];case 3:return a.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),ne(this,void 0,void 0,function(){var r;return te(this,function(a){switch(a.label){case 0:return t.length===0?[2,null]:[4,this.text()];case 1:return r=a.sent(),[2,Kg(r,t,n)]}})})},e})(),HI=(function(){function e(t,n,r,a){this.statusCode=t,this.headersString=n,this.size=r,this.getJson=a}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(t){var n,r;if(t===void 0&&(t=[]),!this.headersString)return{};var a={},o=this.headersString.split(`\r
|
|
15
|
+
`);try{for(var l=_e(o),c=l.next();!c.done;c=l.next()){var f=c.value,d=Ae(f.split(": "),2),p=d[0],v=d[1];p&&v&&(a[p]=v)}}catch(g){n={error:g}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return Cd(a,{allow:t})},e.prototype.json=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),ne(this,void 0,void 0,function(){var r;return te(this,function(a){return t.length===0?[2,null]:(r=this.getJson(),r?(pC(r,t,n),[2,r]):[2,null])})})},e})();function Kg(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return pC(r,t,n),r}catch{return null}}var iu;(function(e){e.REDACT="redact",e.REMOVE="remove"})(iu||(iu={}));var Mw="[REDACTED]",Cd=function(e,t){var n,r,a=t.allow,o=a===void 0?[]:a,l=t.strategy,c=l===void 0?iu.REMOVE:l,f=Qe([],Ae(vD),!1),d={},p=function(S){var w=S.toLowerCase();f.find(function(E){return E.toLowerCase()===w})?c===iu.REDACT&&(d[S]=Mw):o.find(function(E){return E.toLowerCase()===w})?d[S]=e[S]:c===iu.REDACT&&(d[S]=Mw)};try{for(var v=_e(Object.keys(e)),g=v.next();!g.done;g=v.next()){var b=g.value;p(b)}}catch(S){n={error:S}}finally{try{g&&!g.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}return d},qI=(function(){function e(t,n,r,a,o,l,c,f,d,p,v){c===void 0&&(c=0),this.type=t,this.method=n,this.timestamp=r,this.startTime=a,this.url=o,this.requestWrapper=l,this.status=c,this.duration=f,this.responseWrapper=d,this.error=p,this.endTime=v}return e.prototype.toSerializable=function(){var t,n,r,a,o={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:(t=this.requestWrapper)===null||t===void 0?void 0:t.headers(Qe([],Ae(ed),!1)),requestBodySize:(n=this.requestWrapper)===null||n===void 0?void 0:n.bodySize,responseHeaders:(r=this.responseWrapper)===null||r===void 0?void 0:r.headers(Qe([],Ae(ed),!1)),responseBodySize:(a=this.responseWrapper)===null||a===void 0?void 0:a.bodySize};return Object.fromEntries(Object.entries(o).filter(function(l){var c=Ae(l,2);c[0];var f=c[1];return f!==void 0}))},e})();function GI(e){return typeof e=="object"&&e!==null&&"url"in e&&"method"in e}var KI=(function(){function e(t,n){n===void 0&&(n=_a()),this.callback=t,this.id=n}return e})();function es(e){try{e()}catch{}}var YI=(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=Ue();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var t=Ue();return!!t&&!!t.fetch},e.prototype.subscribe=function(t,n){var r,a,o,l,c,f,d,p,v,g;if(this.logger||(this.logger=n),this.eventCallbacks.set(t.id,t),!this.isObserving){var b=(o=(a=(r=this.globalScope)===null||r===void 0?void 0:r.XMLHttpRequest)===null||a===void 0?void 0:a.prototype)===null||o===void 0?void 0:o.open,S=(f=(c=(l=this.globalScope)===null||l===void 0?void 0:l.XMLHttpRequest)===null||c===void 0?void 0:c.prototype)===null||f===void 0?void 0:f.send,w=(v=(p=(d=this.globalScope)===null||d===void 0?void 0:d.XMLHttpRequest)===null||p===void 0?void 0:p.prototype)===null||v===void 0?void 0:v.setRequestHeader;b&&S&&w&&this.observeXhr(b,S,w);var E=(g=this.globalScope)===null||g===void 0?void 0:g.fetch;E&&this.observeFetch(E),this.isObserving=!0}},e.prototype.unsubscribe=function(t){this.eventCallbacks.delete(t.id)},e.prototype.triggerEventCallbacks=function(t){var n=this;this.eventCallbacks.forEach(function(r){try{r.callback(t)}catch(a){es(function(){var o;(o=n.logger)===null||o===void 0||o.debug("an unexpected error occurred while triggering event callbacks",a)})}})},e.prototype.handleNetworkRequestEvent=function(t,n,r,a,o,l,c){var f;if(!(l===void 0||c===void 0)){var d,p="GET";if(GI(n)?(d=n.url,p=n.method):d=(f=n?.toString)===null||f===void 0?void 0:f.call(n),d)try{var v=new URL(d);d="".concat(v.protocol,"//").concat(v.host).concat(v.pathname).concat(v.search).concat(v.hash)}catch{}p=r?.method||p;var g,b;a&&(g=a.status),o&&(b={name:o.name||"UnknownError",message:o.message||"An unknown error occurred"},g=0);var S=Math.floor(performance.now()-c),w=Math.floor(l+S),E=new qI(t,p,l,l,d,r,g,S,a,b,w);this.triggerEventCallbacks(E)}},e.prototype.getTimestamps=function(){var t,n;return{startTime:(t=Date.now)===null||t===void 0?void 0:t.call(Date),durationStart:(n=performance?.now)===null||n===void 0?void 0:n.call(performance)}},e.prototype.observeFetch=function(t){var n=this;!this.globalScope||!t||(this.globalScope.fetch=function(r,a){return ne(n,void 0,void 0,function(){var o,l,c,f,d=this;return te(this,function(p){switch(p.label){case 0:try{o=this.getTimestamps()}catch(v){es(function(){var g;return(g=d.logger)===null||g===void 0?void 0:g.debug("an unexpected error occurred while retrieving timestamps",v)})}p.label=1;case 1:return p.trys.push([1,3,,4]),[4,t(r,a)];case 2:return l=p.sent(),[3,4];case 3:return f=p.sent(),c=f,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,a?new BI(a):void 0,l?new FI(l):void 0,c,o?.startTime,o?.durationStart)}catch(v){es(function(){var g;return(g=d.logger)===null||g===void 0?void 0:g.debug("an unexpected error occurred while handling fetch",v)})}if(l)return[2,l];throw c}})})})},e.createXhrJsonParser=function(t,n){return function(){var r;try{if(t.responseType==="json"){if(!((r=n.globalScope)===null||r===void 0)&&r.structuredClone)return n.globalScope.structuredClone(t.response)}else if(["text",""].includes(t.responseType))return JSON.parse(t.responseText)}catch(a){return a instanceof Error&&a.name==="InvalidStateError"&&es(function(){var o;return(o=n.logger)===null||o===void 0?void 0:o.debug("unexpected error when retrieving responseText. responseType='".concat(t.responseType,"'"))}),null}return null}},e.prototype.observeXhr=function(t,n,r){if(!(!this.globalScope||!t||!n)){var a=this.globalScope.XMLHttpRequest.prototype,o=this;a.open=function(){for(var l,c=[],f=0;f<arguments.length;f++)c[f]=arguments[f];var d=this,p=Ae(c,2),v=p[0],g=p[1];try{d.$$AmplitudeAnalyticsEvent=ce({method:v,url:(l=g?.toString)===null||l===void 0?void 0:l.call(g),headers:{}},o.getTimestamps())}catch(b){es(function(){var S;return(S=o.logger)===null||S===void 0?void 0:S.debug("an unexpected error occurred while calling xhr open",b)})}return t.apply(d,c)},a.send=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var f=this,d=f,p=e.createXhrJsonParser(f,o),v=l[0],g=d.$$AmplitudeAnalyticsEvent;return d.$$AmplitudeAnalyticsEvent&&d.addEventListener("loadend",function(){try{var b=d.getAllResponseHeaders(),S=d.getResponseHeader("content-length"),w=new HI(d.status,b,S?parseInt(S,10):void 0,p),E=d.$$AmplitudeAnalyticsEvent.headers,T=new VI(v,E);g.status=d.status,o.handleNetworkRequestEvent("xhr",{url:g.url,method:g.method},T,w,void 0,g.startTime,g.durationStart)}catch(C){es(function(){var k;return(k=o.logger)===null||k===void 0?void 0:k.debug("an unexpected error occurred while handling xhr send",C)})}}),n.apply(d,l)},a.setRequestHeader=function(l,c){var f=this;try{var d=f.$$AmplitudeAnalyticsEvent;d&&(d.headers[l]=c)}catch(p){es(function(){var v;return(v=o.logger)===null||v===void 0?void 0:v.debug("an unexpected error occurred while calling xhr setRequestHeader",p)})}r.apply(f,[l,c])}}},e})(),Dw=new YI,yC=(function(){function e(){}return e.prototype.parse=function(){return ne(this,void 0,void 0,function(){return te(this,function(t){return[2,ce(ce(ce(ce({},kd),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=td(),n=t[cD],r=t[fD],a=t[dD],o=t[hD],l=t[pD],c=t[mD];return{utm_campaign:n,utm_content:r,utm_id:a,utm_medium:o,utm_source:l,utm_term:c}},e.prototype.getReferrer=function(){var t,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(t=r.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},e.prototype.getClickIds=function(){var t,n=td();return t={},t[fw]=n[fw],t[dw]=n[dw],t[hw]=n[hw],t[pw]=n[pw],t[mw]=n[mw],t[vw]=n[vw],t[gw]=n[gw],t[yw]=n[yw],t[bw]=n[bw],t[xw]=n[xw],t[Sw]=n[Sw],t},e})(),lo="data-amp-mask",Ca="*****",$I=/\b(?:\d[ -]*?){13,16}\b/,XI=/(\d{3}-?\d{2}-?\d{4})/g,WI=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Yg=function(e,t){var n,r;if(t===void 0&&(t=[]),typeof e!="string")return"";var a=e;a=a.replace($I,Ca),a=a.replace(XI,Ca),a=a.replace(WI,Ca);try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;try{a=a.replace(c,Ca)}catch{}}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a},$g=function(e){if(typeof document>"u"||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(lo)?Ca:e?e(document.title):document.title},Ul={},Iw;function QI(){if(Iw)return Ul;Iw=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.Observable=void 0;const e=T=>!!Symbol[T],t=T=>e(T)?Symbol[T]:"@@"+T,n=t("iterator"),r=t("observable"),a=t("species");function o(T,C){let k=T[C];if(k!=null){if(typeof k!="function")throw new TypeError(k+" is not a function");return k}}function l(T){let C=T.constructor;return C!==void 0&&(C=C[a],C===null&&(C=void 0)),C!==void 0?C:E}function c(T){return T instanceof E}function f(T){f.log?f.log(T):setTimeout(()=>{throw T})}function d(T){Promise.resolve().then(()=>{try{T()}catch(C){f(C)}})}function p(T){let C=T._cleanup;if(C!==void 0&&(T._cleanup=void 0,!!C))try{if(typeof C=="function")C();else{let k=o(C,"unsubscribe");k&&k.call(C)}}catch(k){f(k)}}function v(T){T._observer=void 0,T._queue=void 0,T._state="closed"}function g(T){let C=T._queue;if(C){T._queue=void 0,T._state="ready";for(let k=0;k<C.length&&(b(T,C[k].type,C[k].value),T._state!=="closed");++k);}}function b(T,C,k){T._state="running";let j=T._observer;try{let N=o(j,C);switch(C){case"next":N&&N.call(j,k);break;case"error":if(v(T),N)N.call(j,k);else throw k;break;case"complete":v(T),N&&N.call(j);break}}catch(N){f(N)}T._state==="closed"?p(T):T._state==="running"&&(T._state="ready")}function S(T,C,k){if(T._state!=="closed"){if(T._state==="buffering"){T._queue.push({type:C,value:k});return}if(T._state!=="ready"){T._state="buffering",T._queue=[{type:C,value:k}],d(()=>g(T));return}b(T,C,k)}}class w{constructor(C,k){this._cleanup=void 0,this._observer=C,this._queue=void 0,this._state="initializing";let j=this,N={get closed(){return j._state==="closed"},next(R){S(j,"next",R)},error(R){S(j,"error",R)},complete(){S(j,"complete")}};try{this._cleanup=k.call(void 0,N)}catch(R){N.error(R)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(v(this),p(this))}}class E{constructor(C){if(!(this instanceof E))throw new TypeError("Observable cannot be called as a function");if(typeof C!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=C}subscribe(C){return(typeof C!="object"||C===null)&&(C={next:C,error:arguments[1],complete:arguments[2]}),new w(C,this._subscriber)}forEach(C){return new Promise((k,j)=>{if(typeof C!="function"){j(new TypeError(C+" is not a function"));return}function N(){R.unsubscribe(),k()}let R=this.subscribe({next(L){try{C(L,N)}catch(U){j(U),R.unsubscribe()}},error:j,complete:k})})}map(C){if(typeof C!="function")throw new TypeError(C+" is not a function");let k=l(this);return new k(j=>this.subscribe({next(N){try{N=C(N)}catch(R){return j.error(R)}j.next(N)},error(N){j.error(N)},complete(){j.complete()}}))}filter(C){if(typeof C!="function")throw new TypeError(C+" is not a function");let k=l(this);return new k(j=>this.subscribe({next(N){try{if(!C(N))return}catch(R){return j.error(R)}j.next(N)},error(N){j.error(N)},complete(){j.complete()}}))}reduce(C){if(typeof C!="function")throw new TypeError(C+" is not a function");let k=l(this),j=arguments.length>1,N=!1,L=arguments[1];return new k(U=>this.subscribe({next(G){let M=!N;if(N=!0,!M||j)try{L=C(L,G)}catch(B){return U.error(B)}else L=G},error(G){U.error(G)},complete(){if(!N&&!j)return U.error(new TypeError("Cannot reduce an empty sequence"));U.next(L),U.complete()}}))}async all(){let C=[];return await this.forEach(k=>C.push(k)),C}concat(...C){let k=l(this);return new k(j=>{let N,R=0;function L(U){N=U.subscribe({next(G){j.next(G)},error(G){j.error(G)},complete(){R===C.length?(N=void 0,j.complete()):L(k.from(C[R++]))}})}return L(this),()=>{N&&(N.unsubscribe(),N=void 0)}})}flatMap(C){if(typeof C!="function")throw new TypeError(C+" is not a function");let k=l(this);return new k(j=>{let N=[],R=this.subscribe({next(U){if(C)try{U=C(U)}catch(M){return j.error(M)}let G=k.from(U).subscribe({next(M){j.next(M)},error(M){j.error(M)},complete(){let M=N.indexOf(G);M>=0&&N.splice(M,1),L()}});N.push(G)},error(U){j.error(U)},complete(){L()}});function L(){R.closed&&N.length===0&&j.complete()}return()=>{N.forEach(U=>U.unsubscribe()),R.unsubscribe()}})}[r](){return this}static from(C){let k=typeof this=="function"?this:E;if(C==null)throw new TypeError(C+" is not an object");let j=o(C,r);if(j){let N=j.call(C);if(Object(N)!==N)throw new TypeError(N+" is not an object");return c(N)&&N.constructor===k?N:new k(R=>N.subscribe(R))}if(e("iterator")&&(j=o(C,n),j))return new k(N=>{d(()=>{if(!N.closed){for(let R of j.call(C))if(N.next(R),N.closed)return;N.complete()}})});if(Array.isArray(C))return new k(N=>{d(()=>{if(!N.closed){for(let R=0;R<C.length;++R)if(N.next(C[R]),N.closed)return;N.complete()}})});throw new TypeError(C+" is not observable")}static of(...C){let k=typeof this=="function"?this:E;return new k(j=>{d(()=>{if(!j.closed){for(let N=0;N<C.length;++N)if(j.next(C[N]),j.closed)return;j.complete()}})})}static get[a](){return this}}return Ul.Observable=E,Object.defineProperty(E,Symbol("extensions"),{value:{symbol:r,hostReportError:f},configurable:!0}),Ul}var lm,Lw;function JI(){return Lw||(Lw=1,lm=QI().Observable),lm}var ZI=JI();const Rn=jo(ZI);function Xg(e,t){return new Rn(function(n){e.subscribe({next:function(r){t(r).then(function(a){return n.next(a)}).catch(function(a){return n.error(a)})},error:function(r){n.error(r)},complete:function(){n.complete()}})})}function ps(e,t){return new Rn(function(n){var r=!1,a=new Set,o=function(){var c,f;r=!0;try{for(var d=_e(a),p=d.next();!p.done;p=d.next()){var v=p.value;try{v.unsubscribe()}catch{}}}catch(g){c={error:g}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.error}}a.clear()},l=function(c){var f=c.subscribe({next:function(d){r||n.next(d)},error:function(d){r||(r=!0,n.error(d),o())},complete:function(){a.delete(f),!r&&a.size===0&&(n.complete(),o(),r=!0)}});a.add(f)};return l(e),l(t),o})}function si(e){var t=new Set,n=null;function r(){n?.unsubscribe(),n=null,t.clear()}return new Rn(function(a){return t.add(a),n===null&&(n=e.subscribe({next:function(o){var l,c,f;try{for(var d=_e(t),p=d.next();!p.done;p=d.next()){var v=p.value;(f=v.next)===null||f===void 0||f.call(v,o)}}catch(g){l={error:g}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(l)throw l.error}}},error:function(o){var l,c,f;try{for(var d=_e(t),p=d.next();!p.done;p=d.next()){var v=p.value;(f=v.error)===null||f===void 0||f.call(v,o)}}catch(g){l={error:g}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(l)throw l.error}}r()},complete:function(){var o,l,c;try{for(var f=_e(t),d=f.next();!d.done;d=f.next()){var p=d.value;(c=p.complete)===null||c===void 0||c.call(p)}}catch(v){o={error:v}}finally{try{d&&!d.done&&(l=f.return)&&l.call(f)}finally{if(o)throw o.error}}r()}})),function(){t.delete(a),t.size===0&&n&&(n.unsubscribe(),n=null)}})}var of={exports:{}},Pw;function eL(){if(Pw)return of.exports;Pw=1;var e=Object.prototype.hasOwnProperty;function t(a){return"[Throws: "+(a?a.message:"?")+"]"}function n(a,o){if(e.call(a,o))try{return a[o]}catch(l){return t(l)}return a[o]}function r(a){var o=[];function l(c){if(c===null||typeof c!="object")return c;if(o.indexOf(c)!==-1)return"[Circular]";if(o.push(c),typeof c.toJSON=="function")try{var f=l(c.toJSON());return o.pop(),f}catch(v){return t(v)}if(Array.isArray(c)){var d=c.map(l);return o.pop(),d}var p=Object.keys(c).reduce(function(v,g){return v[g]=l(n(c,g)),v},{});return o.pop(),p}return l(a)}return of.exports=function(a,o,l){return JSON.stringify(r(a),o,l)},of.exports.ensureProperties=r,of.exports}var bC=eL();const xC=jo(bC),tL=SO({__proto__:null,default:xC},[bC]);var nL=xC||tL,bv="https://app.amplitude.com",rL="https://app.eu.amplitude.com",iL="https://apps.stag2.amplitude.com",SC={US:bv,EU:rL,STAGING:iL},aL="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.2.js.gz",sL=function(e){var t=document.querySelector('script[src="'.concat(CSS.escape(e),'"]'));return t?Promise.resolve({status:!0}):new Promise(function(n,r){var a;try{var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=e,o.addEventListener("load",function(){n({status:!0})},{once:!0}),o.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),(a=document.head)===null||a===void 0||a.appendChild(o)}catch(l){r(l)}})};function oL(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var wC,xv="__AMPLITUDE_MESSENGER_INSTANCE__",id="__AMPLITUDE_MESSENGER__",lL=(function(){function e(t){var n=t===void 0?{}:t,r=n.origin,a=r===void 0?bv:r;this[wC]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=a}return e.prototype.notify=function(t){var n,r,a,o;(r=(n=this.logger)===null||n===void 0?void 0:n.debug)===null||r===void 0||r.call(n,"Message sent: ",JSON.stringify(t)),(o=(a=window.opener)===null||a===void 0?void 0:a.postMessage)===null||o===void 0||o.call(a,t,this.endpoint)},e.prototype.sendRequest=function(t,n,r){var a=this;r===void 0&&(r={timeout:15e3});var o=oL(),l={id:o,action:t,args:n},c=new Promise(function(f,d){a.requestCallbacks[o]={resolve:f,reject:d},a.notify(l),r.timeout>0&&setTimeout(function(){d(new Error("".concat(t," timed out (id: ").concat(o,")"))),delete a.requestCallbacks[o]},r.timeout)});return c},e.prototype.handleResponse=function(t){var n;if(!this.requestCallbacks[t.id]){(n=this.logger)===null||n===void 0||n.warn("No callback found for request id: ".concat(t.id));return}this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]},e.prototype.registerActionHandler=function(t,n){var r,a,o,l;this.actionHandlers.has(t)&&((l=(o=this.logger)===null||o===void 0?void 0:o.warn)===null||l===void 0||l.call(o,"Overwriting existing action handler for: ".concat(t))),this.actionHandlers.set(t,n);var c=this.pendingMessages.get(t);if(c){this.pendingMessages.delete(t);try{for(var f=_e(c),d=f.next();!d.done;d=f.next()){var p=d.value;n(p)}}catch(v){r={error:v}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(t){return ne(this,void 0,void 0,function(){var n,r,a;return te(this,function(o){switch(o.label){case 0:if(n=this.scriptLoadPromises.get(t),n)return[2,n];r=sL(t).then(function(){}),this.scriptLoadPromises.set(t,r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r];case 2:return o.sent(),[3,4];case 3:throw a=o.sent(),this.scriptLoadPromises.delete(t),a;case 4:return[2]}})})},e.prototype.setup=function(t){var n=this,r,a,o=t===void 0?{}:t,l=o.logger,c=o.endpoint;l&&(this.logger=l),c&&this.endpoint===bv&&(this.endpoint=c),!this.isSetup&&(this.isSetup=!0,(a=(r=this.logger)===null||r===void 0?void 0:r.debug)===null||a===void 0||a.call(r,"Setting up messenger"),this.messageHandler=function(f){var d,p,v,g,b;if((p=(d=n.logger)===null||d===void 0?void 0:d.debug)===null||p===void 0||p.call(d,"Message received: ",JSON.stringify(f)),n.endpoint===f.origin){var S=f.data,w=S?.action;if(w)if("id"in S&&S.id)(g=(v=n.logger)===null||v===void 0?void 0:v.debug)===null||g===void 0||g.call(v,"Received Response to previous request: ",JSON.stringify(f)),n.handleResponse(S);else{if(w==="ping"){n.notify({action:"pong"});return}var E=n.actionHandlers.get(w);if(E)E(S.data);else{var T=(b=n.pendingMessages.get(w))!==null&&b!==void 0?b:[];T.push(S.data),n.pendingMessages.set(w,T)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var t=Ue();t?.[id]===this&&delete t[id]},e})();wC=xv;function uL(e){return typeof e=="object"&&e!==null&&xv in e&&e[xv]===!0}function EC(e){var t=Ue(),n=t?.[id];if(uL(n))return n;var r=new lL(e);return t&&(t[id]=r),r}var Uw="__AMPLITUDE_BACKGROUND_CAPTURE__";function TC(e,t){var n,r=e;if(r[Uw]!==!0){r[Uw]=!0;var a=(n=void 0)!==null&&n!==void 0?n:aL,o=null,l=function(c,f){var d,p;c==="background-capture-complete"&&((p=(d=e.logger)===null||d===void 0?void 0:d.debug)===null||p===void 0||p.call(d,"Background capture complete"),e.notify({action:"background-capture-complete",data:f}))};e.registerActionHandler("initialize-background-capture",function(){var c,f;(f=(c=e.logger)===null||c===void 0?void 0:c.debug)===null||f===void 0||f.call(c,"Initializing background capture (external script)");var d=new URL(a,e.endpoint).toString();e.loadScriptOnce(d).then(function(){var p,v,g;(v=(p=e.logger)===null||p===void 0?void 0:p.debug)===null||v===void 0||v.call(p,"Background capture script loaded (external)"),o=(g=window?.amplitudeBackgroundCapture)===null||g===void 0?void 0:g.call(window,{messenger:e,onBackgroundCapture:l}),e.notify({action:"background-capture-loaded"})}).catch(function(){var p;(p=e.logger)===null||p===void 0||p.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var c;(c=o?.close)===null||c===void 0||c.call(o),o=null})}}var um={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},Mo=function(e,t){return typeof e=="boolean"?e:e?.[t]!==!1},kC=function(e){return Mo(e,"attribution")},cL=function(e){return Mo(e,"fileDownloads")},CC=function(e){return Mo(e,"formInteractions")},AC=function(e){return Mo(e,"pageViews")},zw=function(e){return Mo(e,"sessions")},fL=function(e){return Mo(e,"pageUrlEnrichment")},NC=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.networkTracking===!0||typeof e.networkTracking=="object")},jC=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.elementInteractions===!0||typeof e.elementInteractions=="object")},dL=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e.webVitals===!0},RC=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.frustrationInteractions===!0||typeof e.frustrationInteractions=="object")},hL=function(e){if(jC(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.elementInteractions=="object")return e.autocapture.elementInteractions},pL=function(e){if(RC(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.frustrationInteractions=="object")return e.autocapture.frustrationInteractions},mL=function(e){var t;if(NC(e.autocapture)){var n=void 0;return typeof e.autocapture=="object"&&typeof e.autocapture.networkTracking=="object"?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),ce(ce({},n),{captureRules:(t=n?.captureRules)===null||t===void 0?void 0:t.map(function(r){var a,o,l;if(!((a=r.urls)===null||a===void 0)&&a.length&&(!((o=r.hosts)===null||o===void 0)&&o.length)){var c=JSON.stringify(r.hosts),f=JSON.stringify(r.urls);return(l=e.loggerProvider)===null||l===void 0||l.warn("Found network capture rule with both urls='".concat(f,"' and hosts='").concat(c,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),ce(ce({},r),{hosts:void 0})}return r})})}},Bw=function(e){var t=function(){return!1},n=void 0,r,a=e.pageCounter,o=AC(e.defaultTracking);return o&&(t=void 0,r=void 0,e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.pageViews&&typeof e.defaultTracking.pageViews=="object"&&("trackOn"in e.defaultTracking.pageViews&&(t=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(r=e.defaultTracking.pageViews.eventType))),{trackOn:t,trackHistoryChanges:n,eventType:r,pageCounter:a}},Vw=function(e){return kC(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution=="object"?ce({},e.defaultTracking.attribution):{}},vL=function(e){if(CC(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&typeof e.defaultTracking.formInteractions=="object")return e.defaultTracking.formInteractions},cm=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],a=r.name,o=r.args,l=r.resolve,c=e&&e[a];if(typeof c=="function"){var f=c.apply(e,o);typeof l=="function"&&l(f?.promise)}}return e},fm=function(e){var t=e;return t&&t._q!==void 0},Wg="2.36.3",_C="amplitude-ts",gL="Web",yL="$remote",bL=(function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(_C,"/").concat(Wg),typeof navigator<"u"&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},e.prototype.execute=function(t){var n,r;return ne(this,void 0,void 0,function(){var a,o,l,c;return te(this,function(f){return a=new Date().getTime(),o=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1,l=(r=t.event_id)!==null&&r!==void 0?r:o+1,this.config.lastEventId=l,t.time||(this.config.lastEventTime=a),c=ce(ce(ce(ce(ce(ce(ce(ce({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:a},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:gL}),this.config.trackingOptions.language&&{language:ZD()}),this.config.trackingOptions.ipAddress&&{ip:yL}),{insert_id:_a(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),t),{event_id:l,library:this.library,user_agent:this.userAgent}),[2,c]})})},e})(),lf=1e3,OC=(function(e){Or(t,e);function t(n){var r=this,a,o,l;try{l=(a=Ue())===null||a===void 0?void 0:a.localStorage}catch(c){(o=n?.loggerProvider)===null||o===void 0||o.debug("Failed to access localStorage. error=".concat(JSON.stringify(c))),l=void 0}return r=e.call(this,l)||this,r.loggerProvider=n?.loggerProvider,r}return t.prototype.set=function(n,r){var a;return ne(this,void 0,void 0,function(){var o;return te(this,function(l){switch(l.label){case 0:return Array.isArray(r)&&r.length>lf?(o=r.length-lf,[4,e.prototype.set.call(this,n,r.slice(0,lf))]):[3,2];case 1:return l.sent(),(a=this.loggerProvider)===null||a===void 0||a.error("Failed to save ".concat(o," events because the queue length exceeded ").concat(lf,".")),[3,4];case 2:return[4,e.prototype.set.call(this,n,r)];case 3:l.sent(),l.label=4;case 4:return[2]}})})},t})(Gg),xL=(function(e){Or(t,e);function t(){var n;return e.call(this,(n=Ue())===null||n===void 0?void 0:n.sessionStorage)||this}return t})(Gg),SL=(function(e){Or(t,e);function t(n){n===void 0&&(n={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=n,r}return t.prototype.send=function(n,r,a){return a===void 0&&(a=!1),ne(this,void 0,void 0,function(){var o=this;return te(this,function(l){return[2,new Promise(function(c,f){typeof XMLHttpRequest>"u"&&f(new Error("XHRTransport is not supported."));var d=new XMLHttpRequest;d.open("POST",n,!0),d.onreadystatechange=function(){if(d.readyState===o.state.done){var w=d.responseText;try{c(o.buildResponse(JSON.parse(w)))}catch{c(o.buildResponse({code:d.status}))}}};var p={"Content-Type":"application/json",Accept:"*/*"},v=JSON.stringify(r),g=a&&v.length>=lC&&uC(),b=function(w){var E,T;p=ce(ce({},o.customHeaders),p);try{for(var C=_e(Object.entries(p)),k=C.next();!k.done;k=C.next()){var j=Ae(k.value,2),N=j[0],R=j[1];d.setRequestHeader(N,R)}}catch(L){E={error:L}}finally{try{k&&!k.done&&(T=C.return)&&T.call(C)}finally{if(E)throw E.error}}d.send(w)},S=function(){return ne(o,void 0,void 0,function(){var w;return te(this,function(E){switch(E.label){case 0:return g?[4,cC(v)]:[3,2];case 1:return w=E.sent(),w?(p["Content-Encoding"]="gzip",b(w)):b(v),[3,3];case 2:b(v),E.label=3;case 3:return[2]}})})};S().catch(f)})]})})},t})(Ou),wL=(function(e){Or(t,e);function t(n){n===void 0&&(n={});var r=e.call(this)||this;return r.customHeaders=n,r}return t.prototype.send=function(n,r,a){return a===void 0&&(a=!1),ne(this,void 0,void 0,function(){var o,l,c,f,d,p,v,g;return te(this,function(b){switch(b.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return o=JSON.stringify(r),l=a&&o.length>=lC&&uC(),c=o,f={"Content-Type":"application/json",Accept:"*/*"},l?[4,cC(o)]:[3,2];case 1:d=b.sent(),d&&(f["Content-Encoding"]="gzip",c=d),b.label=2;case 2:return f=ce(ce({},this.customHeaders),f),p={headers:f,body:c,method:"POST"},[4,fetch(n,p)];case 3:return v=b.sent(),[4,v.text()];case 4:g=b.sent();try{return[2,this.buildResponse(JSON.parse(g))]}catch{return[2,this.buildResponse({code:v.status})]}return[2]}})})},t})(Ou),EL=(function(e){Or(t,e);function t(){return e.call(this)||this}return t.prototype.send=function(n,r,a){return ne(this,void 0,void 0,function(){var o=this;return te(this,function(l){return[2,new Promise(function(c,f){var d=Ue();if(!d?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var p=JSON.stringify(r),v=d.navigator.sendBeacon(n,p);return c(v?o.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:p.length,server_upload_time:Date.now()}):o.buildResponse({code:500}))}catch(g){f(g)}})]})})},t})(Ou),TL=function(e,t,n){return n===void 0&&(n=!0),ne(void 0,void 0,void 0,function(){var r,a,o,l,c,f,d,p,v;return te(this,function(g){switch(g.label){case 0:return r=JD(e),[4,t.getRaw(r)];case 1:return a=g.sent(),a?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:g.sent(),g.label=3;case 3:return o=Ae(a.split("."),6),l=o[0],c=o[1],f=o[2],d=o[3],p=o[4],v=o[5],[2,{deviceId:l,userId:kL(c),sessionId:dm(d),lastEventId:dm(v),lastEventTime:dm(p),optOut:!!f}]}})})},dm=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},kL=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch{return}},Kr="[Amplitude]",Fw="".concat(Kr," Form Started"),CL="".concat(Kr," Form Submitted"),AL="".concat(Kr," File Downloaded"),Hw="session_start",qw="session_end",NL="".concat(Kr," File Extension"),jL="".concat(Kr," File Name"),RL="".concat(Kr," Link ID"),_L="".concat(Kr," Link Text"),OL="".concat(Kr," Link URL"),hm="".concat(Kr," Form ID"),pm="".concat(Kr," Form Name"),mm="".concat(Kr," Form Destination"),ad="cookie",MC="US",Gw=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},ML=function(e){return Object.values(e).every(function(t){return!t})},DL=function(e){var t=ce(ce({},e),{referring_domain:void 0,referrer:void 0});return Object.values(t).every(function(n){return!n})},IL=function(e,t,n,r,a,o){a===void 0&&(a=!0),e.referrer;var l=e.referring_domain,c=Zf(e,["referrer","referring_domain"]),f=t||{};f.referrer;var d=f.referring_domain,p=Zf(f,["referrer","referring_domain"]),v=n.excludeInternalReferrers;if(v){var g=BL(v,r);if(!(g instanceof TypeError)&&e.referring_domain&&VL(e.referring_domain,o)){if(g==="always")return Kw(g,e.referring_domain,r),!1;if(g==="ifEmptyCampaign"&&DL(e))return Kw(g,e.referring_domain,r),!1}}if(LL(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!a&&ML(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var b=JSON.stringify(c)!==JSON.stringify(p),S=Gw(l||"")!==Gw(d||""),w=!t||b||S;return w?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),w},LL=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=""),e.some(function(n){return n instanceof RegExp?n.test(t):n===t})},PL=function(e,t){var n=t.startsWith(".")?t:".".concat(t),r=e.startsWith(".")?e:".".concat(e);return!!r.endsWith(n)},UL=function(e,t){var n=ce(ce({},kd),e),r=Object.entries(n).reduce(function(a,o){var l,c=Ae(o,2),f=c[0],d=c[1];return a.setOnce("initial_".concat(f),(l=d??t.initialEmptyValue)!==null&&l!==void 0?l:"EMPTY"),d?a.set(f,d):a.unset(f)},new nu);return Fg(r)},zL=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},BL=function(e,t){if(e===!0)return um.always;if(typeof e=="object"){var n=e.condition;if(typeof n=="string"&&Object.keys(um).includes(n))return n;if(typeof n>"u")return um.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),new TypeError(r)};function Kw(e,t,n){var r="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");e==="always"?n.debug(r):e==="ifEmptyCampaign"&&n.debug("".concat(r," with empty campaign parameters"))}var DC=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],IC=function(e){var t,n,r=e||((n=(t=Ue())===null||t===void 0?void 0:t.location)===null||n===void 0?void 0:n.hostname);if(!r)return"";var a=r.split("."),o=a[a.length-1],l=a[a.length-2];return DC.find(function(c){return r.endsWith(".".concat(c))})&&(o=a[a.length-2]+"."+a[a.length-1],l=a[a.length-3]),l?"".concat(l,".").concat(o):o},VL=function(e,t){var n=Ue();if(!n)return!1;var r=(t||"").trim()||IC(n.location.hostname);return PL(e,r)},FL=(function(e){Or(t,e);function t(n,r,a,o,l,c,f,d,p,v,g,b,S,w,E,T,C,k,j,N,R,L,U,G,M,B,X,oe,ue,Z,V,W,$,he,I,z,ee,D,de,ye,Se,we,Le,je){a===void 0&&(a=new qg),o===void 0&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),d===void 0&&(d=1e3),p===void 0&&(p=5),v===void 0&&(v=30),g===void 0&&(g=ad),T===void 0&&(T=new ko),C===void 0&&(C=$n.Warn),j===void 0&&(j=!1),N===void 0&&(N=!1),U===void 0&&(U=""),G===void 0&&(G=MC),X===void 0&&(X=1800*1e3),oe===void 0&&(oe=new OC({loggerProvider:T})),ue===void 0&&(ue={ipAddress:!0,language:!0,platform:!0}),Z===void 0&&(Z="fetch"),V===void 0&&(V=!1),W===void 0&&(W=!0),D===void 0&&(D=!0),de===void 0&&(de=0),Le===void 0&&(Le=!1),je===void 0&&(je=!1);var ge=this,Pe;ge=e.call(this,{apiKey:n,storageProvider:oe,transportProvider:LC(Z)})||this,ge.apiKey=n,ge.appVersion=r,ge.cookieOptions=o,ge.defaultTracking=l,ge.autocapture=c,ge.flushIntervalMillis=d,ge.flushMaxRetries=p,ge.flushQueueSize=v,ge.identityStorage=g,ge.ingestionMetadata=b,ge.instanceName=S,ge.loggerProvider=T,ge.logLevel=C,ge.minIdLength=k,ge.offline=j,ge.partnerId=R,ge.plan=L,ge.serverUrl=U,ge.serverZone=G,ge.sessionTimeout=X,ge.storageProvider=oe,ge.trackingOptions=ue,ge.transport=Z,ge.useBatch=V,ge.fetchRemoteConfig=W,ge.networkTrackingOptions=z,ge.identify=ee,ge.enableDiagnostics=D,ge.diagnosticsSampleRate=de,ge.diagnosticsClient=ye,ge.remoteConfig=Se,ge.topLevelDomain=we,ge.enableRequestBodyCompression=Le,ge._enableRequestBodyCompressionExperimental=je,ge.version=Wg,ge._optOut=!1,ge._cookieStorage=a,ge.deviceId=f,ge.lastEventId=w,ge.lastEventTime=E,ge.optOut=N,ge.deferredSessionId=B,ge.sessionId=M,ge.pageCounter=he,ge.userId=$,ge.debugLogsEnabled=I,ge.loggerProvider.enable(I?$n.Debug:ge.logLevel),ge.networkTrackingOptions=z,ge.identify=ee,ge.enableDiagnostics=D,ge.diagnosticsSampleRate=de,ge.diagnosticsClient=ye;var xt=(Pe=Se?.fetchRemoteConfig)!==null&&Pe!==void 0?Pe:W;return ge.remoteConfig=ge.remoteConfig||{},ge.remoteConfig.fetchRemoteConfig=xt,ge.fetchRemoteConfig=xt,ge.topLevelDomain=we||IC(),ge}return Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(n){this._cookieStorage!==n&&(this._cookieStorage=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(n){this._deviceId!==n&&(this._deviceId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(n){this._userId!==n&&(this._userId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(n){this._sessionId!==n&&(this._sessionId=n,n!==void 0&&this._deferredSessionId!==void 0&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(n){this._deferredSessionId!==n&&n!==this.sessionId&&(this._deferredSessionId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(n){this._optOut!==n&&(this._optOut=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(n){this._lastEventTime!==n&&(this._lastEventTime=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(n){this._lastEventId!==n&&(this._lastEventId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(n){this._pageCounter!==n&&(this._pageCounter=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(n){this._debugLogsEnabled!==n&&(this._debugLogsEnabled=n,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var n={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof rd&&(n.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(aC(this.apiKey),n)},t})(nC),HL=function(e,t,n,r,a){return t===void 0&&(t={}),ne(void 0,void 0,void 0,function(){var o,l,c,f,d,p,v,g,b,S,w,E,T,C,k,j,N,R,L,U,G,M,B,X,oe,ue,Z,V,W,$,he,I,z,ee,D,de,ye,Se,we,Le,je,ge,Pe,xt,Ot,$e,Nt,ot,Bt;return te(this,function(Yt){switch(Yt.label){case 0:return o=t.identityStorage||ad,l="",o!==ad?[3,2]:[4,KL(void 0,r)];case 1:l=Yt.sent(),Yt.label=2;case 2:return c=ce({domain:(B=(M=t.cookieOptions)===null||M===void 0?void 0:M.domain)!==null&&B!==void 0?B:l,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),f={duplicateResolverFn:function(Jt){var mt=sC(Jt);if(!mt)return!1;var at=JSON.parse(mt);return oC(at.cookieDomain,c.domain)},diagnosticsClient:r},d=qL(t.identityStorage,c,f),[4,TL(e,d,(oe=(X=t.cookieOptions)===null||X===void 0?void 0:X.upgrade)!==null&&oe!==void 0?oe:!0)];case 3:return p=Yt.sent(),[4,d.get(aC(e))];case 4:return v=Yt.sent(),g=td(),b=g.ampTimestamp?Number(g.ampTimestamp):void 0,S=b?Date.now()<b:!0,w=($=(W=(V=(ue=t.deviceId)!==null&&ue!==void 0?ue:S?(Z=g.ampDeviceId)!==null&&Z!==void 0?Z:g.deviceId:void 0)!==null&&V!==void 0?V:v?.deviceId)!==null&&W!==void 0?W:p.deviceId)!==null&&$!==void 0?$:_a(),E=(he=v?.lastEventId)!==null&&he!==void 0?he:p.lastEventId,T=(I=v?.lastEventTime)!==null&&I!==void 0?I:p.lastEventTime,C=(ee=(z=t.optOut)!==null&&z!==void 0?z:v?.optOut)!==null&&ee!==void 0?ee:p.optOut,k=(D=v?.sessionId)!==null&&D!==void 0?D:p.sessionId,j=v?.deferredSessionId,N=(ye=(de=t.userId)!==null&&de!==void 0?de:v?.userId)!==null&&ye!==void 0?ye:p.userId,n.previousSessionDeviceId=(Se=v?.deviceId)!==null&&Se!==void 0?Se:p.deviceId,n.previousSessionUserId=(we=v?.userId)!==null&&we!==void 0?we:p.userId,R={ipAddress:(je=(Le=t.trackingOptions)===null||Le===void 0?void 0:Le.ipAddress)!==null&&je!==void 0?je:!0,language:(Pe=(ge=t.trackingOptions)===null||ge===void 0?void 0:ge.language)!==null&&Pe!==void 0?Pe:!0,platform:(Ot=(xt=t.trackingOptions)===null||xt===void 0?void 0:xt.platform)!==null&&Ot!==void 0?Ot:!0},L=v?.pageCounter,U=v?.debugLogsEnabled,t.autocapture!==void 0&&(t.defaultTracking=t.autocapture),G=new FL(e,t.appVersion,d,c,t.defaultTracking,t.autocapture,w,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,o,t.ingestionMetadata,t.instanceName,E,T,($e=a?.loggerProvider)!==null&&$e!==void 0?$e:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,C,t.partnerId,t.plan,t.serverUrl,(Nt=a?.serverZone)!==null&&Nt!==void 0?Nt:t.serverZone,k,j,t.sessionTimeout,t.storageProvider,R,t.transport,t.useBatch,t.fetchRemoteConfig,N,L,U,t.networkTrackingOptions,t.identify,(ot=a?.enableDiagnostics)!==null&&ot!==void 0?ot:t.enableDiagnostics,(Bt=a?.diagnosticsSampleRate)!==null&&Bt!==void 0?Bt:n._diagnosticsSampleRate,r,t.remoteConfig,l,t.enableRequestBodyCompression,n._enableRequestBodyCompressionExperimentalValue),[4,G.storageProvider.isEnabled()];case 5:return Yt.sent()||(G.loggerProvider.warn("Storage provider ".concat(G.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),G.storageProvider=new qg),[2,G]}})})},qL=function(e,t,n){switch(e===void 0&&(e=ad),t===void 0&&(t={}),e){case"localStorage":return new OC;case"sessionStorage":return new xL;case"none":return new qg;default:return new rd(ce(ce({},t),{expirationDays:t.expiration}),n)}},GL=function(e){var t,n;return e===void 0&&(e={}),((t=e.remoteConfig)===null||t===void 0?void 0:t.fetchRemoteConfig)===!0?!0:!(((n=e.remoteConfig)===null||n===void 0?void 0:n.fetchRemoteConfig)===!1||e.fetchRemoteConfig===!1)},LC=function(e){var t=typeof e=="object"?e.type:e,n=typeof e=="object"?e.headers:void 0;return t==="xhr"?new SL(n):t==="beacon"?new EL:new wL(n)},KL=function(e,t){return ne(void 0,void 0,void 0,function(){var n,r,a,o,l,l,c,f,d;return te(this,function(p){switch(p.label){case 0:return[4,new rd(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!p.sent()||typeof location>"u"||!location.hostname)return[2,""];for(n=location.hostname,r=n.split("."),a=[],o=1,DC.find(function(v){return n.endsWith(".".concat(v))})&&(o=2),l=r.length-o-1;l>=0;--l)a.push(r.slice(l).join("."));l=0,p.label=2;case 2:if(!(l<a.length))return[3,7];c=a[l],p.label=3;case 3:return p.trys.push([3,5,,6]),[4,rd.isDomainWritable(c)];case 4:return f=p.sent(),f?[2,"."+c]:[3,6];case 5:return d=p.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(c),error:d instanceof Error?d.message:String(d)}),[3,6];case 6:return l++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(n)}),[2,""]}})})},YL=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},$L="[Amplitude] Page Viewed",Yw=function(e){e===void 0&&(e={});var t,n=Ue(),r=void 0,a=!1,o,l=e.trackOn,c=e.trackHistoryChanges,f=e.eventType,d=f===void 0?$L:f,p=function(T){var C=T;try{C=decodeURI(T)}catch(k){r?.error("Malformed URI sequence: ",k)}return C},v=function(){return ne(void 0,void 0,void 0,function(){var T,C,k;return te(this,function(j){switch(j.label){case 0:return T=p(typeof location<"u"&&location.href||""),k={event_type:d},C=[{}],[4,XL()];case 1:return[2,(k.event_properties=ce.apply(void 0,[ce.apply(void 0,C.concat([j.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":T,"[Amplitude] Page Path":typeof location<"u"&&p(location.pathname)||"","[Amplitude] Page Title":$g(Yg),"[Amplitude] Page URL":T.split("?")[0]}]),k)]}})})},g=function(){return typeof l>"u"||typeof l=="function"&&l()},b=typeof location<"u"?location.href:null,S=function(){return ne(void 0,void 0,void 0,function(){var T,C,k,j;return te(this,function(N){switch(N.label){case 0:return T=location.href,C=QL(c,T,b||"")&&g(),b=T,C?(r?.log("Tracking page view event"),t!=null?[3,1]:[3,3]):[3,4];case 1:return j=(k=t).track,[4,v()];case 2:j.apply(k,[N.sent()]),N.label=3;case 3:N.label=4;case 4:return[2]}})})},w=function(){S()},E={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(T,C){return ne(void 0,void 0,void 0,function(){var k,j;return te(this,function(N){switch(N.label){case 0:return t=C,o=T,r=T.loggerProvider,r.log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,n&&(n.addEventListener("popstate",w),n.history.pushState=new Proxy(n.history.pushState,{apply:function(R,L,U){var G=Ae(U,3),M=G[0],B=G[1],X=G[2];R.apply(L,[M,B,X]),a&&S()}})),g()?(r.log("Tracking page view event"),j=(k=t).track,[4,v()]):[3,2];case 1:j.apply(k,[N.sent()]),N.label=2;case 2:return[2]}})})},execute:function(T){return ne(void 0,void 0,void 0,function(){var C;return te(this,function(k){switch(k.label){case 0:return l==="attribution"&&WL(T)?(r?.log("Enriching campaign event to page view event with campaign parameters"),[4,v()]):[3,2];case 1:C=k.sent(),T.event_type=C.event_type,T.event_properties=ce(ce({},T.event_properties),C.event_properties),k.label=2;case 2:return o&&T.event_type===d&&(o.pageCounter=o.pageCounter?o.pageCounter+1:1,T.event_properties=ce(ce({},T.event_properties),{"[Amplitude] Page Counter":o.pageCounter})),[2,T]}})})},teardown:function(){return ne(void 0,void 0,void 0,function(){return te(this,function(T){return n&&(n.removeEventListener("popstate",w),a=!1),[2]})})}};return E},XL=function(){return ne(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return e=YL,[4,new yC().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},WL=function(e){if(e.event_type==="$identify"&&e.user_properties){var t=e.user_properties,n=t[Ta.SET]||{},r=t[Ta.UNSET]||{},a=Qe(Qe([],Ae(Object.keys(n)),!1),Ae(Object.keys(r)),!1);return Object.keys(kd).every(function(o){return a.includes(o)})}return!1},QL=function(e,t,n){switch(e){case"pathOnly":{if(n=="")return!0;var r=new URL(t),a=new URL(n),o=r.origin+r.pathname,l=a.origin+a.pathname;return o!==l}default:return t!==n}},JL=function(){var e,t=[],n=function(p,v,g){p.addEventListener(v,g),t.push({element:p,type:v,handler:g})},r=function(){t.forEach(function(p){var v=p.element,g=p.type,b=p.handler;v?.removeEventListener(g,b)}),t=[]},a,o="@amplitude/plugin-form-interaction-tracking-browser",l="enrichment",c=function(p,v){return ne(void 0,void 0,void 0,function(){var g,b;return te(this,function(S){return a=vL(p),g=function(){if(!v){p.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if(!(typeof document>"u")){var w=new WeakSet,E=function(C){if(!w.has(C)){w.add(C);var k=!1;n(C,"change",function(){var j,N=$w(C);k||v.track(Fw,(j={},j[hm]=eo(C.id),j[pm]=eo(C.name),j[mm]=N,j)),k=!0}),n(C,"submit",function(j){var N,R,L=$w(C);if(k||v.track(Fw,(N={},N[hm]=eo(C.id),N[pm]=eo(C.name),N[mm]=L,N)),k=!0,a?.shouldTrackSubmit!==void 0)if(typeof a.shouldTrackSubmit=="function"&&typeof SubmitEvent<"u"&&j instanceof SubmitEvent)try{var U=a.shouldTrackSubmit(j);if(!U)return}catch{p.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else p.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");v.track(CL,(R={},R[hm]=eo(C.id),R[pm]=eo(C.name),R[mm]=L,R)),k=!1})}},T=Array.from(document.getElementsByTagName("form"));T.forEach(E),typeof MutationObserver<"u"&&(e=new MutationObserver(function(C){C.forEach(function(k){k.addedNodes.forEach(function(j){j.nodeName==="FORM"&&E(j),"querySelectorAll"in j&&typeof j.querySelectorAll=="function"&&Array.from(j.querySelectorAll("form")).map(E)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?g():(b=Ue(),b?b.addEventListener("load",g):p.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},f=function(p){return ne(void 0,void 0,void 0,function(){return te(this,function(v){return[2,p]})})},d=function(){return ne(void 0,void 0,void 0,function(){return te(this,function(p){return e?.disconnect(),r(),[2]})})};return{name:o,type:l,setup:c,execute:f,teardown:d}},eo=function(e){if(typeof e=="string")return e},$w=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(t??""),window.location.href).href}catch{}return t},ZL=function(){var e,t=[],n=function(d,p,v){d.addEventListener(p,v),t.push({element:d,type:p,handler:v})},r=function(){t.forEach(function(d){var p=d.element,v=d.type,g=d.handler;p?.removeEventListener(v,g)}),t=[]},a="@amplitude/plugin-file-download-tracking-browser",o="enrichment",l=function(d,p){return ne(void 0,void 0,void 0,function(){var v,g;return te(this,function(b){return v=function(){if(!p){d.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if(!(typeof document>"u")){var S=function(T){var C;try{C=new URL(T.href,window.location.href)}catch{return}var k=w.exec(C.href),j=k?.[1];j&&n(T,"click",function(){var N;j&&p.track(AL,(N={},N[NL]=j,N[jL]=C.pathname,N[RL]=T.id,N[_L]=T.text,N[OL]=T.href,N))})},w=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/,E=Array.from(document.getElementsByTagName("a"));E.forEach(S),typeof MutationObserver<"u"&&(e=new MutationObserver(function(T){T.forEach(function(C){C.addedNodes.forEach(function(k){k.nodeName==="A"&&S(k),"querySelectorAll"in k&&typeof k.querySelectorAll=="function"&&Array.from(k.querySelectorAll("a")).map(S)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?v():(g=Ue(),g?g.addEventListener("load",v):d.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},c=function(d){return ne(void 0,void 0,void 0,function(){return te(this,function(p){return[2,d]})})},f=function(){return ne(void 0,void 0,void 0,function(){return te(this,function(d){return e?.disconnect(),r(),[2]})})};return{name:a,type:o,setup:l,execute:c,teardown:f}},Xw=!1,eP=function(e){if(!(Xw||e.defaultTracking!==void 0)){var t=`\`options.defaultTracking\` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to \`options.defaultTracking\`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:
|
|
16
|
+
|
|
17
|
+
amplitude.init(<YOUR_API_KEY>, {
|
|
18
|
+
defaultTracking: true,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`;e.loggerProvider.warn(t),Xw=!0}},tP=function(){var e="@amplitude/plugin-network-checker-browser",t="before",n=Ue(),r=[],a=function(f,d){n?.addEventListener&&(n?.addEventListener(f,d),r.push({type:f,handler:d}))},o=function(){r.forEach(function(f){var d=f.type,p=f.handler;n?.removeEventListener(d,p)}),r=[]},l=function(f,d){return ne(void 0,void 0,void 0,function(){return te(this,function(p){return typeof navigator>"u"?(f.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),f.offline=!1,[2]):(f.offline=!navigator.onLine,a("online",function(){f.loggerProvider.debug("Network connectivity changed to online."),f.offline=!1,setTimeout(function(){d.flush()},f.flushIntervalMillis)}),a("offline",function(){f.loggerProvider.debug("Network connectivity changed to offline."),f.offline=!0}),[2])})})},c=function(){return ne(void 0,void 0,void 0,function(){return te(this,function(f){return o(),[2]})})};return{name:e,type:t,setup:l,teardown:c}};function PC(e){var t,n,r,a,o,l,c,f,d,p,v;if(!(typeof e!="object"||e===null)&&!Array.isArray(e)){var g=Object.keys(e);try{for(var b=_e(g),S=b.next();!S.done;S=b.next()){var w=S.value;try{var E=e[w];typeof E?.enabled=="boolean"&&(E.enabled?(delete E.enabled,Object.keys(E).length===0&&(e[w]=!0)):e[w]=!1),PC(E)}catch{}}}catch(B){t={error:B}}finally{try{S&&!S.done&&(n=b.return)&&n.call(b)}finally{if(t)throw t.error}}try{if(!((d=(f=(c=e.autocapture)===null||c===void 0?void 0:c.networkTracking)===null||f===void 0?void 0:f.captureRules)===null||d===void 0)&&d.length)try{for(var T=_e(e.autocapture.networkTracking.captureRules),C=T.next();!C.done;C=T.next()){var k=C.value;try{for(var j=(o=void 0,_e(["responseHeaders","requestHeaders"])),N=j.next();!N.done;N=j.next()){var R=N.value,L=(p=k[R])!==null&&p!==void 0?p:{},U=L.captureSafeHeaders,G=L.allowlist;if(!(!U&&!G)){if(G!==void 0&&!Array.isArray(G)){delete k[R];continue}k[R]=Qe(Qe([],Ae(U?ed:[]),!1),Ae(G??[]),!1)}}}catch(B){o={error:B}}finally{try{N&&!N.done&&(l=j.return)&&l.call(j)}finally{if(o)throw o.error}}}}catch(B){r={error:B}}finally{try{C&&!C.done&&(a=T.return)&&a.call(T)}finally{if(r)throw r.error}}}catch{}var M=(v=e.autocapture)===null||v===void 0?void 0:v.frustrationInteractions;M&&(M.rageClick&&(M.rageClicks=M.rageClick,delete M.rageClick),M.deadClick&&(M.deadClicks=M.deadClick,delete M.deadClick))}}function Ww(e,t,n){var r,a,o=[];try{for(var l=_e(t??[]),c=l.next();!c.done;c=l.next()){var f=c.value;try{o.push(new RegExp(f))}catch(d){n.loggerProvider.warn("Invalid regex pattern: ".concat(f),d)}}}catch(d){r={error:d}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return e.concat(o)}function nP(e,t){var n,r,a,o,l,c,f;if(e){PC(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var d=e;if(d&&"autocapture"in d){if(typeof d.autocapture=="boolean"&&(t.autocapture=d.autocapture),typeof d.autocapture=="object"&&d.autocapture!==null){var p=ce({},d.autocapture);if(t.autocapture===void 0&&(t.autocapture=d.autocapture),typeof d.autocapture.elementInteractions=="object"&&d.autocapture.elementInteractions!==null&&(!((a=d.autocapture.elementInteractions.pageUrlAllowlistRegex)===null||a===void 0)&&a.length)){p.elementInteractions=ce({},d.autocapture.elementInteractions);var v=p.elementInteractions,g=(o=v.pageUrlAllowlist)!==null&&o!==void 0?o:[],b=d.autocapture.elementInteractions.pageUrlAllowlistRegex;v.pageUrlAllowlist=Ww(g,b,t),delete v.pageUrlAllowlistRegex}if(typeof d.autocapture.networkTracking=="object"&&d.autocapture.networkTracking!==null&&(!((l=d.autocapture.networkTracking.captureRules)===null||l===void 0)&&l.length)){p.networkTracking=ce({},d.autocapture.networkTracking);var S=p.networkTracking,w=(c=S.captureRules)!==null&&c!==void 0?c:[];try{for(var E=_e(w),T=E.next();!T.done;T=E.next()){var C=T.value;C.urls=Ww((f=C.urls)!==null&&f!==void 0?f:[],C.urlsRegex,t),delete C.urlsRegex}}catch(k){n={error:k}}finally{try{T&&!T.done&&(r=E.return)&&r.call(E)}finally{if(n)throw n.error}}}typeof t.autocapture=="boolean"&&(t.autocapture=ce({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},p)),typeof t.autocapture=="object"&&(t.autocapture=ce(ce({},t.autocapture),p))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(k){t.loggerProvider.error("Failed to apply remote configuration because of error: ",k)}}}var UC="1.23.3",rP="@amplitude/plugin-autocapture-browser",iP="@amplitude/plugin-frustration-browser",zC="[Amplitude] Element Clicked",aP="[Amplitude] Dead Click",sP="[Amplitude] Rage Click",oP="[Amplitude] Error Click",lP="[Amplitude] Element Changed",uP="[Amplitude] Thrashed Cursor",cP="[Amplitude] Element ID",fP="[Amplitude] Element Class",Qw="[Amplitude] Element Tag",Jw="[Amplitude] Element Text",dP="[Amplitude] Element Hierarchy",hP="[Amplitude] Element Href",pP="[Amplitude] Element Position Left",mP="[Amplitude] Element Position Top",vP="[Amplitude] Element Aria Label",gP="[Amplitude] Element Attributes",yP="[Amplitude] Element Parent Label",Zw="[Amplitude] Page URL",bP="[Amplitude] Page Title",xP="[Amplitude] Viewport Height",SP="[Amplitude] Viewport Width",wP="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",EP="amp-visual-tagging-selector-highlight",BC="data-amp-mask-attributes",TP=25,VC=128,kP=["input","select","textarea"],FC=function(e,t){var n,r=(n=window?.getComputedStyle)===null||n===void 0?void 0:n.call(window,e);return r?.getPropertyValue("cursor")==="pointer"&&t==="click"},HC=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&gv(window.location.href,n)||!gv(window.location.href,t))},yo=function(e,t,n){return n===void 0&&(n=!1),function(r,a){var o,l,c=e.shouldTrackEventResolver,f=(l=(o=a?.tagName)===null||o===void 0?void 0:o.toLowerCase)===null||l===void 0?void 0:l.call(o);if(!f)return!1;if(c)return c(r,a);if(!HC(e))return!1;var d=String(a?.getAttribute("type"))||"";if(typeof d=="string")switch(d.toLowerCase()){case"hidden":return!1;case"password":return!1}var p=FC(a,r);if(n&&p)return!0;if(t){var v=t.some(function(g){var b;return!!(!((b=a?.matches)===null||b===void 0)&&b.call(a,g))});if(!v)return!1}switch(f){case"input":case"select":case"textarea":return r==="change"||r==="click";default:return p?!0:r==="click"}}},CP=function(e){var t,n,r,a=(n=(t=e?.tagName)===null||t===void 0?void 0:t.toLowerCase)===null||n===void 0?void 0:n.call(t),o=e instanceof HTMLElement?((r=e.getAttribute("contenteditable"))===null||r===void 0?void 0:r.toLowerCase())==="true":!1;return!kP.includes(a)&&!o},AP=function(e){return e?e.split(",").map(function(t){return t.trim()}).filter(function(t){return t.length>0&&t!=="id"&&t!=="class"}):[]},NP=function(e,t){return Object.entries(e).reduce(function(n,r){var a=Ae(r,2),o=a[0],l=a[1];if(o.startsWith(t)){var c=o.replace(t,"");c&&(n[c]=l||"")}return n},{})},jP=function(e){return e==null||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0},eE=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return jP(r)||(t[n]=r),t},{})},Qg=function(e,t){return e?t.some(function(n){var r;return(r=e?.matches)===null||r===void 0?void 0:r.call(e,n)})?e:Qg(e?.parentElement,t):null},Mu=function(e){return!(e.event.target===null||!e.closestTrackedAncestor)};function RP(e){return e.type==="click"||e.type==="change"}var sd;(function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"})(sd||(sd={}));var tE="__AMPLITUDE_VISUAL_TAGGING__";function _P(e,t){var n=e;if(n[tE]!==!0){n[tE]=!0;var r=t.dataExtractor,a=t.isElementSelectable,o=t.cssSelectorAllowlist,l=t.actionClickAllowlist,c=null,f=function(p){e.notify({action:"element-selected",data:p})},d=function(p,v){p==="selector-mode-changed"?e.notify({action:"track-selector-mode-changed",data:v}):p==="selector-moved"&&e.notify({action:"track-selector-moved",data:v})};e.registerActionHandler("initialize-visual-tagging-selector",function(p){e.loadScriptOnce(wP).then(function(){var v;c=(v=window?.amplitudeVisualTaggingSelector)===null||v===void 0?void 0:v.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(g){return a?a(p?.actionType||"click",g):!0},onTrack:d,onSelect:f,visualHighlightClass:EP,messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:l,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:UC}}}),e.notify({action:"selector-loaded"})}).catch(function(){var v;(v=e.logger)===null||v===void 0||v.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var p;(p=c?.close)===null||p===void 0||p.call(c)})}}function OP(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,a=e.evaluateTriggers,o=n.clickObservable,l=o.filter(Mu).filter(function(f){return r("click",f.closestTrackedAncestor)}).map(function(f){return a(f)}),c=l;return c.subscribe(function(f){t?.track(zC,f.targetElementProperties)})}function MP(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,a=e.shouldTrackEvent,o=e.evaluateTriggers,l=n.changeObservable,c=l.filter(Mu).filter(function(f){return a("change",f.closestTrackedAncestor)}).map(function(f){return o(f)});return c.subscribe(function(f){t?.track(lP,r("change",f.closestTrackedAncestor))})}function DP(e){var t=e.amplitude,n=e.allObservables,r=e.options,a=e.getEventProperties,o=e.shouldTrackEvent,l=e.shouldTrackActionClick,c=n.clickObservable,f=n.mutationObservable,d=n.navigateObservable,p=c.filter(function(E){return!o("click",E.closestTrackedAncestor)}).map(function(E){var T=Qg(E.event.target,r.actionClickAllowlist);return E.closestTrackedAncestor=T,E.closestTrackedAncestor!==null&&(E.targetElementProperties=a(E.type,E.closestTrackedAncestor)),E}).filter(Mu).filter(function(E){return l("click",E.closestTrackedAncestor)}),v=d?ps(f,d):f,g=ps(p,v),b=null,S=null,w=Xg(g,function(E){if(b&&(clearTimeout(b),b=null),E.type==="click")return S=E,b=setTimeout(function(){b=null,S=null},500),Promise.resolve(null);if(S){var T=S;return S=null,Promise.resolve(T)}return Promise.resolve(null)});return w.subscribe(function(E){E&&t?.track(zC,a("click",E.closestTrackedAncestor))})}var Na=Ue(),qC=function(){return new Rn(function(e){var t=new MutationObserver(function(n){e.next(n)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},GC=function(e){return e===void 0&&(e="click"),new Rn(function(t){var n=function(r){t.next(r)};return Na.document.addEventListener(e,n,{capture:!0}),function(){Na.document.removeEventListener(e,n,{capture:!0})}})},IP=function(){return new Rn(function(e){var t=function(n){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var o=void 0;Array.isArray(r[0])&&typeof r[0][0]=="string"&&(o=r[0][0]),e.next({kind:"console",message:o})};return Rw.addListener("error",t),function(){Rw.removeListener(t)}})},LP=function(){return new Rn(function(e){var t=function(n){if(n instanceof ErrorEvent){var r={kind:"error"};n.error instanceof Error||n.error instanceof DOMException?r=ce(ce({},r),{message:n.error.message,stack:n.error.stack,filename:n.filename,lineNumber:n.lineno,columnNumber:n.colno}):typeof n.error=="string"&&(r.message=n.error),e.next(r)}};return Na.addEventListener("error",t),function(){Na.removeEventListener("error",t)}})},PP=function(){return new Rn(function(e){var t=function(n){var r={kind:"unhandledrejection"};n.reason instanceof Error||n.reason instanceof DOMException?(r.message=n.reason.message,r.stack=n.reason.stack):typeof n.reason=="string"&&(r.message=n.reason),e.next(r)};return Na.addEventListener("unhandledrejection",t),function(){Na.removeEventListener("unhandledrejection",t)}})},UP=function(){var e=ps(LP(),PP());return ps(e,IP())},zP=function(){return new Rn(function(e){var t=function(r){e.next(r)},n={capture:!0};return Na.document.addEventListener("mousemove",t,n),function(){Na.document.removeEventListener("mousemove",t,n)}})},BP=function(e,t){try{if(t.subprop_key==="[Amplitude] Element Text")return t.subprop_op==="is"&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if(t.subprop_key==="[Amplitude] Element Hierarchy")return t.subprop_op==="autotrack css match"&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(n){return console.error("Error matching event to filter",n),!1}return!1},VP=function(e,t){try{if(e.sourceType==="DOM_ELEMENT"){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch{return}},FP=function(e,t,n){e.forEach(function(r){if(typeof r!="string"&&r.actionType==="ATTACH_EVENT_PROPERTY"){var a=n.extractDataFromDataSource(r.dataSource,t.closestTrackedAncestor);t.targetElementProperties[r.destinationKey]=a}})},Sv={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},nE=function(e){var t,n,r,a,o=Object.values(Sv).reduce(function(b,S){return b[S]=new Set,b},{});if(!e)return o;try{for(var l=_e(e),c=l.next();!c.done;c=l.next()){var f=c.value;try{try{for(var d=(r=void 0,_e(f.definition)),p=d.next();!p.done;p=d.next()){var v=p.value,g=Sv[v.event_type];g&&o[g].add(f.id)}}catch(b){r={error:b}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}}catch(b){console.warn("Skipping Labeled Event due to malformed definition",f?.id,b)}}}catch(b){t={error:b}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o},rE=function(e){var t,n,r,a,o=new Map;try{for(var l=_e(e),c=l.next();!c.done;c=l.next()){var f=c.value;try{for(var d=(r=void 0,_e(f.conditions)),p=d.next();!p.done;p=d.next()){var v=p.value;if(v.type==="LABELED_EVENT"){var g=v.match.eventId,b=o.get(g);b||(b=[],o.set(g,b)),b.push(f)}}}catch(S){r={error:S}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}}}catch(S){t={error:S}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o},HP=function(e,t){return t.filter(function(n){return n.definition.some(function(r){return Sv[r.event_type]===e.type&&r.filters.every(function(a){return BP(e,a)})})})},qP=function(e,t){var n,r,a,o,l=new Set;try{for(var c=_e(e),f=c.next();!f.done;f=c.next()){var d=f.value,p=t.get(d.id);if(p)try{for(var v=(a=void 0,_e(p)),g=v.next();!g.done;g=v.next()){var b=g.value;l.add(b)}}catch(S){a={error:S}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}}catch(S){n={error:S}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Array.from(l)},GP=(function(){function e(t,n,r,a){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=n,this.dataExtractor=r,this.options=a}return e.prototype.evaluate=function(t){var n,r,a=this.options.pageActions;if(!a)return t;var o=HP(t,Array.from(this.groupedLabeledEvents[t.type]).map(function(p){return a.labeledEvents[p]})),l=qP(o,this.labeledEventToTriggerMap);try{for(var c=_e(l),f=c.next();!f.done;f=c.next()){var d=f.value;FP(d.actions,t,this.dataExtractor)}}catch(p){n={error:p}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return t},e.prototype.update=function(t,n,r){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=n,this.options=r},e})(),KP=function(e,t,n,r){return new GP(e,t,n,r)},YP=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",BC,lo]),$P=["type"],XP=["svg","path","g"],WP=["password","hidden"];function QP(e,t){var n,r,a,o,l,c;if(e===null)return null;var f=String(e.tagName).toLowerCase(),d={tag:f},p=Array.from((o=(a=e.parentElement)===null||a===void 0?void 0:a.children)!==null&&o!==void 0?o:[]);p.length&&(d.index=p.indexOf(e),d.indexOfType=p.filter(function(N){return N.tagName===e.tagName}).indexOf(e));var v=(c=(l=e.previousElementSibling)===null||l===void 0?void 0:l.tagName)===null||c===void 0?void 0:c.toLowerCase();v&&(d.prevSib=String(v));var g=e.getAttribute("id");g&&(d.id=String(g));var b=Array.from(e.classList);b.length&&(d.classes=b);var S={},w=Array.from(e.attributes),E=w.filter(function(N){return!YP.has(N.name)}),T=!CP(e);if(!WP.includes(String(e.getAttribute("type")))&&!XP.includes(f))try{for(var C=_e(E),k=C.next();!k.done;k=C.next()){var j=k.value;if(!(T&&!$P.includes(j.name))){if(t.has(j.name)){S[j.name]=Ca;continue}S[j.name]=String(j.value).substring(0,VC)}}}catch(N){n={error:N}}finally{try{k&&!k.done&&(r=C.return)&&r.call(C)}finally{if(n)throw n.error}}return Object.keys(S).length&&(d.attrs=S),d}function JP(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&n.tagName!=="HTML";)t.push(n),n=n.parentElement;return t}var KC=(function(){function e(t,n){var r,a,o=this,l;this.replaceSensitiveString=function(g){return Yg(g,o.additionalMaskTextPatterns)},this.getHierarchy=function(g){var b,S,w,E,T=performance.now(),C=[];if(!g)return[];for(var k=JP(g),j=new Map,N=k.length-1;N>=0;N--){var R=k[N];if(R){var L=AP(R.getAttribute(BC)),U=N===k.length-1?[]:(w=j.get(k[N+1]))!==null&&w!==void 0?w:new Set,G=new Set(Qe(Qe([],Ae(U),!1),Ae(L),!1));j.set(R,G)}}C=k.map(function(Z){var V;return QP(Z,(V=j.get(Z))!==null&&V!==void 0?V:new Set)});var M=function(Z){Z?.attrs&&Object.entries(Z.attrs).forEach(function(V){var W=Ae(V,2),$=W[0],he=W[1];Z.attrs&&(Z.attrs[$]=o.replaceSensitiveString(he))})};try{for(var B=_e(C),X=B.next();!X.done;X=B.next()){var oe=X.value;M(oe)}}catch(Z){b={error:Z}}finally{try{X&&!X.done&&(S=B.return)&&S.call(B)}finally{if(b)throw b.error}}var ue=performance.now();return(E=o.diagnosticsClient)===null||E===void 0||E.recordHistogram("autocapturePlugin.getHierarchy",ue-T),C},this.getNearestLabel=function(g){var b=g.parentElement;if(!b)return"";var S;try{S=b.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch{S=null}return S?o.getText(S):o.getNearestLabel(b)},this.getEventProperties=function(g,b,S){var w,E,T,C,k=(T=(E=b?.tagName)===null||E===void 0?void 0:E.toLowerCase)===null||T===void 0?void 0:T.call(E),j=typeof b.getBoundingClientRect=="function"?b.getBoundingClientRect():{left:null,top:null},N=o.getHierarchy(b),R=(C=N[0])===null||C===void 0?void 0:C.attrs,L=o.getNearestLabel(b),U=NP(R??{},S),G=(w={},w[dP]=N,w[Qw]=k,w[Jw]=o.getText(b),w[pP]=j.left==null?null:Math.round(j.left),w[mP]=j.top==null?null:Math.round(j.top),w[gP]=U,w[yP]=L,w[Zw]=ka(window.location.href.split("?")[0]),w[bP]=$g(o.replaceSensitiveString),w[xP]=window.innerHeight,w[SP]=window.innerWidth,w);if(G[cP]=b.getAttribute("id")||"",G[fP]=b.getAttribute("class"),G[vP]=R?.["aria-label"],k==="a"&&g==="click"&&b instanceof HTMLAnchorElement){var M=b.href.substring(0,VC);G[hP]=o.replaceSensitiveString(M)}return eE(G)},this.addTypeAndTimestamp=function(g,b){return{event:g,timestamp:Date.now(),type:b}},this.addAdditionalEventProperties=function(g,b,S,w,E){E===void 0&&(E=!1);var T=o.addTypeAndTimestamp(g,b);if(RP(T)&&T.event.target!==null){if(E){var C=FC(T.event.target,T.type);if(C)return T.closestTrackedAncestor=T.event.target,T.targetElementProperties=o.getEventProperties(T.type,T.closestTrackedAncestor,w),T}var k=Qg(T.event.target,S);return k&&(T.closestTrackedAncestor=k,T.targetElementProperties=o.getEventProperties(T.type,k,w)),T}return T},this.extractDataFromDataSource=function(g,b){if(g.sourceType==="DOM_ELEMENT"){var S=VP(g,b);return S?g.elementExtractType==="TEXT"?o.getText(S):g.elementExtractType==="ATTRIBUTE"&&g.attribute?S.getAttribute(g.attribute):void 0:void 0}},this.getTextWithMaskedDescendants=function(g){var b,S,w="[".concat(lo,"], [contenteditable]");if(!g.querySelector(w))return g.innerText;var E="",T=Array.from(g.childNodes);try{for(var C=_e(T),k=C.next();!k.done;k=C.next()){var j=k.value;if(j.nodeType===Node.TEXT_NODE){E+=j.textContent||"";continue}if(j instanceof Element){if(j.hasAttribute(lo)||j.hasAttribute("contenteditable")){E+=Ca;continue}E+=o.getTextWithMaskedDescendants(j)}}}catch(N){b={error:N}}finally{try{k&&!k.done&&(S=C.return)&&S.call(C)}finally{if(b)throw b.error}}return E},this.getText=function(g){var b=g.closest("[".concat(lo,"]"))!==null;if(b)return Ca;var S="";return g.querySelector("[".concat(lo,"], [contenteditable]"))?S=o.getTextWithMaskedDescendants(g):S=g.innerText||"",o.replaceSensitiveString(S.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(g){var b,S,w;if(!g)return{};var E=(w=(S=g?.tagName)===null||S===void 0?void 0:S.toLowerCase)===null||w===void 0?void 0:w.call(S),T=(b={},b[Qw]=E,b[Jw]=o.getText(g),b[Zw]=window.location.href.split("?")[0],b);return eE(T)},this.diagnosticsClient=n?.diagnosticsClient;var c=(l=t.maskTextRegex)!==null&&l!==void 0?l:[],f=[];try{for(var d=_e(c),p=d.next();!p.done;p=d.next()){var v=p.value;if(f.length>=TP)break;if(v instanceof RegExp)f.push(v);else if("pattern"in v&&typeof v.pattern=="string")try{f.push(new RegExp(v.pattern,"i"))}catch{}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=f}return e})(),kr;(function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"})(kr||(kr={}));var ZP=function(e,t){var n,r,a,o,l,c,f,d;e===void 0&&(e={}),t?.diagnosticsClient.setTag("plugin.autocapture.version",UC);var p=e.dataAttributePrefix,v=p===void 0?dC:p,g=e.visualTaggingOptions,b=g===void 0?{enabled:!0}:g;e.cssSelectorAllowlist=(n=e.cssSelectorAllowlist)!==null&&n!==void 0?n:jI,e.actionClickAllowlist=(r=e.actionClickAllowlist)!==null&&r!==void 0?r:RI,e.debounceTime=(a=e.debounceTime)!==null&&a!==void 0?a:0,e.pageUrlExcludelist=(o=e.pageUrlExcludelist)===null||o===void 0?void 0:o.reduce(function(M,B){if(typeof B=="string"&&M.push(B),B instanceof RegExp&&M.push(B),typeof B=="object"&&B!==null&&"pattern"in B)try{M.push(new RegExp(B.pattern))}catch(X){return console.warn("Invalid regex pattern: ".concat(B.pattern),X),M}return M},[]);var S=rP,w="enrichment",E=[],T=new KC(e,t),C=function(){var M,B=si(GC().map(function(Z){return T.addAdditionalEventProperties(Z,"click",e.cssSelectorAllowlist,v)})),X=si(new Rn(function(Z){var V,W=function($){var he=T.addAdditionalEventProperties($,"change",e.cssSelectorAllowlist,v);Z.next(he)};return(V=Ue())===null||V===void 0||V.document.addEventListener("change",W,{capture:!0}),function(){var $;return($=Ue())===null||$===void 0?void 0:$.document.removeEventListener("change",W)}})),oe;window.navigation&&(oe=si(new Rn(function(Z){var V=function(W){var $=T.addAdditionalEventProperties(W,"navigate",e.cssSelectorAllowlist,v);Z.next($)};return window.navigation.addEventListener("navigate",V),function(){window.navigation.removeEventListener("navigate",V)}})));var ue=si(qC().map(function(Z){return T.addAdditionalEventProperties(Z,"mutation",e.cssSelectorAllowlist,v)}));return M={},M[kr.ChangeObservable]=X,M[kr.ClickObservable]=B,M[kr.MutationObservable]=ue,M[kr.NavigateObservable]=oe,M},k=nE(Object.values((c=(l=e.pageActions)===null||l===void 0?void 0:l.labeledEvents)!==null&&c!==void 0?c:{})),j=rE((d=(f=e.pageActions)===null||f===void 0?void 0:f.triggers)!==null&&d!==void 0?d:[]),N=KP(k,j,T,e),R=function(M){var B,X;M&&(e.pageActions=ce(ce({},e.pageActions),M),k=nE(Object.values((B=e.pageActions.labeledEvents)!==null&&B!==void 0?B:{})),j=rE((X=e.pageActions.triggers)!==null&&X!==void 0?X:[]),N.update(k,j,e))},L=function(M,B){return ne(void 0,void 0,void 0,function(){var X,oe,ue,Z,V,W,$,he,I,z;return te(this,function(ee){return typeof document>"u"?[2]:(M.fetchRemoteConfig&&(M.remoteConfigClient?M.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(D){R(D)}):M.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),X=yo(e,e.cssSelectorAllowlist),oe=yo(e,e.actionClickAllowlist),ue=C(),Z=OP({allObservables:ue,amplitude:B,shouldTrackEvent:X,evaluateTriggers:N.evaluate.bind(N)}),E.push(Z),V=MP({allObservables:ue,getEventProperties:function(){for(var D=[],de=0;de<arguments.length;de++)D[de]=arguments[de];return T.getEventProperties.apply(T,Qe(Qe([],Ae(D),!1),[v],!1))},amplitude:B,shouldTrackEvent:X,evaluateTriggers:N.evaluate.bind(N)}),E.push(V),W=DP({allObservables:ue,options:e,getEventProperties:function(){for(var D=[],de=0;de<arguments.length;de++)D[de]=arguments[de];return T.getEventProperties.apply(T,Qe(Qe([],Ae(D),!1),[v],!1))},amplitude:B,shouldTrackEvent:X,shouldTrackActionClick:oe}),W&&E.push(W),(z=M?.loggerProvider)===null||z===void 0||z.log("".concat(S," has been successfully added.")),window.opener&&b.enabled&&($=e.cssSelectorAllowlist,he=e.actionClickAllowlist,I=EC(),_P(I,{dataExtractor:T,isElementSelectable:yo(e,Qe(Qe([],Ae($),!1),Ae(he),!1)),cssSelectorAllowlist:$,actionClickAllowlist:he}),TC(I),I.setup(ce({logger:M?.loggerProvider},M?.serverZone&&{endpoint:SC[M.serverZone]}))),[2])})})},U=function(M){return ne(void 0,void 0,void 0,function(){return te(this,function(B){return[2,M]})})},G=function(){return ne(void 0,void 0,void 0,function(){var M,B,X,oe,ue;return te(this,function(Z){try{for(M=_e(E),B=M.next();!B.done;B=M.next())X=B.value,X.unsubscribe()}catch(V){oe={error:V}}finally{try{B&&!B.done&&(ue=M.return)&&ue.call(M)}finally{if(oe)throw oe.error}}return[2]})})};return{name:S,type:w,setup:L,execute:U,teardown:G}},e3=3e3,t3=["mutation","navigate"];function n3(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,a=e.shouldTrackDeadClick,o=n.clickObservable,l=n.mutationObservable,c=n.navigateObservable,f=o.filter(function(b){return Mu(b)&&a("click",b.closestTrackedAncestor)&&b.event.target instanceof Element&&b.event.target.closest('a[target="_blank"]')===null&&b.event.button===sd.LEFT_OR_TOUCH_CONTACT}),d=c?ps(l,c):l,p=ps(f,d),v=null,g=Xg(p,function(b){return v&&t3.includes(b.type)?(clearTimeout(v),v=null,Promise.resolve(null)):b.type==="click"?v?Promise.resolve(null):new Promise(function(S){v=setTimeout(function(){S(b),v=null},e3)}):Promise.resolve(null)});return g.subscribe(function(b){if(b){var S={"[Amplitude] X":b.event.clientX,"[Amplitude] Y":b.event.clientY};t.track(aP,ce(ce({},r("click",b.closestTrackedAncestor)),S),{time:b.timestamp})}})}var YC=LI,$C=II,iE=PI;function aE(e,t){var n,r,a,o,l=t.event,c=l.pageX,f=l.pageY;e.yMin=Math.min((n=e.yMin)!==null&&n!==void 0?n:f,f),e.yMax=Math.max((r=e.yMax)!==null&&r!==void 0?r:f,f),e.xMin=Math.min((a=e.xMin)!==null&&a!==void 0?a:c,c),e.xMax=Math.max((o=e.xMax)!==null&&o!==void 0?o:c,c),e.isOutOfBounds=e.yMax-e.yMin>iE||e.xMax-e.xMin>iE}function sE(e){if(e.length===0)return null;var t=e[0],n=e[e.length-1],r=ce({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(a){return{X:a.event.pageX,Y:a.event.pageY,Time:a.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties);return{rageClickEvent:r,time:t.timestamp}}function r3(e,t){var n=Math.max(0,e.length-YC+1),r=e[n];return t.timestamp-r.timestamp>=$C}function i3(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}function a3(e){var t=this,n=e.amplitude,r=e.allObservables,a=e.shouldTrackRageClick,o=r.clickObservable,l=r.selectionObservable,c=[],f={},d=null;function p(S){c=[],f={},S&&(aE(f,S),c.push(S))}var v=Xg(o.filter(function(S){return a("click",S.closestTrackedAncestor)}),function(S){return ne(t,void 0,void 0,function(){var w;return te(this,function(E){return aE(f,S),w=null,c.length===0||i3(c,S)||r3(c,S)||f.isOutOfBounds?(d&&(w=sE(c)),p(S)):c.push(S),d&&(clearTimeout(d.timerId),d.resolve(w),d=null),c.length>=YC?[2,new Promise(function(T){d={resolve:T,timerId:setTimeout(function(){T(sE(c))},$C)}})]:[2,null]})})}),g=l?.subscribe(function(){p()}),b=v.subscribe(function(S){S!==null&&n.track(sP,S.rageClickEvent,{time:S.time})});return{unsubscribe:function(){b.unsubscribe(),g?.unsubscribe()}}}var s3=2e3;function o3(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackErrorClick,a=n.clickObservable,o=n.browserErrorObservable,l=a.filter(function(p){return Mu(p)&&r("click",p.closestTrackedAncestor)&&p.event.target instanceof Element&&p.event.target.closest('a[target="_blank"]')===null&&p.event.button===sd.LEFT_OR_TOUCH_CONTACT}),c=null,f=null,d=function(){c!==null&&(clearTimeout(c),c=null),f=null};return ps(l,o).subscribe(function(p){var v;if(p.type==="click"){d(),f=p,c=setTimeout(d,s3);return}p.type==="error"&&f&&(t.track(oP,ce((v={},v["[Amplitude] Kind"]=p.event.kind,v["[Amplitude] Message"]=p.event.message,v["[Amplitude] Stack"]=p.event.stack,v["[Amplitude] Filename"]=p.event.filename,v["[Amplitude] Line Number"]=p.event.lineNumber,v["[Amplitude] Column Number"]=p.event.columnNumber,v),f.targetElementProperties)),d())})}var ri;(function(e){e.INCREASING="increasing",e.DECREASING="decreasing"})(ri||(ri={}));var ls;(function(e){e.X="x",e.Y="y"})(ls||(ls={}));var l3=function(e){var t=e.allWindowObservables,n=t.mouseMoveObservable;return new Rn(function(r){var a=null,o=null,l=null;return n.subscribe(function(c){var f={x:c.clientX,y:c.clientY};if(a===null){a=f;return}f.x>a.x?(o===ri.DECREASING&&r.next(ls.X),o=ri.INCREASING):f.x<a.x&&(o===ri.INCREASING&&r.next(ls.X),o=ri.DECREASING),f.y>a.y?(l===ri.DECREASING&&r.next(ls.Y),l=ri.INCREASING):f.y<a.y&&(l===ri.INCREASING&&r.next(ls.Y),l=ri.DECREASING),a=f})})};function u3(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}function oE(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;if(t.length<n)return!1;var a=t[t.length-1]-t[0];return a<r}function lE(e){e.changes=[],e.startTime=void 0}function uE(e){for(var t=e.changes,n=e.thresholdMs,r=0,a=t[t.length-1];r<t.length;r++){var o=a-t[r];if(o<n)break}r!==0&&(e.startTime=t[r],e.changes.splice(0,r))}function c3(e,t){var n=void 0;if(oE(e)&&(n=e.startTime),oE(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}var XC=10,WC=2e3,f3=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=n===void 0?XC:n,a=e.thresholdMs,o=a===void 0?WC:a;return new Rn(function(l){var c={changes:[],changesThreshold:r,thresholdMs:o},f={changes:[],changesThreshold:r,thresholdMs:o},d=void 0,p=null;function v(){d!==void 0&&(l.next(d),d=void 0,p!==null&&clearTimeout(p),lE(c),lE(f))}return t.subscribe(function(g){p!==null&&clearTimeout(p),u3(g===ls.X?c:f);var b=c3(c,f);return b?(d=d||b,p=setTimeout(function(){v(),p=null},o)):v(),uE(c),uE(f),function(){p!==null&&(clearTimeout(p),p=null)}})})},d3=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,a=e.directionChanges,o=a===void 0?XC:a,l=e.thresholdMs,c=l===void 0?WC:l,f=l3({allWindowObservables:r}),d=f3({mouseDirectionChangeObservable:f,directionChanges:o,thresholdMs:c});return d.subscribe(function(p){HC(n)&&t.track(uP,void 0,{time:p})})};function vm(e,t,n,r){if(!r)return[];var a=e[t];return typeof a=="object"&&a!==null&&"cssSelectorAllowlist"in a&&Array.isArray(a.cssSelectorAllowlist)?a.cssSelectorAllowlist:n}var uf=5,cf=4e3,h3=function(e){var t;e===void 0&&(e={});var n=iP,r="enrichment",a=[],o=e.errorClicks!==!1;e.errorClicks||(o=!1);var l=e.deadClicks!==!1&&e.deadClicks!==null,c=e.rageClicks!==!1&&e.rageClicks!==null,f=e.thrashedCursor!==!1&&e.thrashedCursor!==null;e.thrashedCursor||(f=!1);var d=vm(e,"rageClicks",DI,c),p=vm(e,"deadClicks",OI,l),v=vm(e,"errorClicks",MI,o),g=(t=e.dataAttributePrefix)!==null&&t!==void 0?t:dC,b=new KC(e),S=Qe([],Ae(new Set(Qe(Qe(Qe([],Ae(d),!1),Ae(p),!1),Ae(v),!1))),!1),w=function(){var k,j=si(GC("pointerdown").map(function(B){return b.addAdditionalEventProperties(B,"click",S,g,!0)})),N=si(UP().map(function(B){return b.addTypeAndTimestamp(B,"error")})),R=si(qC().map(function(B){return b.addAdditionalEventProperties(B,"mutation",S,g)})),L;if(window.navigation){var U=new Rn(function(B){var X=function(oe){B.next(ce(ce({},oe),{type:"navigate"}))};return window.navigation.addEventListener("navigate",X),function(){window.navigation.removeEventListener("navigate",X)}});L=si(U.map(function(B){return b.addAdditionalEventProperties(B,"navigate",S,g)}))}var G=si(new Rn(function(B){var X=function(){var oe=document.activeElement;if(oe&&(oe.tagName==="TEXTAREA"||oe.tagName==="INPUT")){var ue=void 0,Z=void 0;try{if(ue=oe.selectionStart,Z=oe.selectionEnd,ue===Z)return}catch{return}return B.next()}var V=window.getSelection();if(!(!V||V.isCollapsed))return B.next()};return window.document.addEventListener("selectionchange",X),function(){window.document.removeEventListener("selectionchange",X)}})),M=si(zP());return k={},k[kr.ClickObservable]=j,k[kr.MutationObservable]=R,k[kr.NavigateObservable]=L,k[kr.BrowserErrorObservable]=N,k[kr.SelectionObservable]=G,k[kr.MouseMoveObservable]=M,k},E=function(k,j){return ne(void 0,void 0,void 0,function(){var N,R,L,U,G,M,B,X,oe,ue,Z;return te(this,function(V){return typeof document>"u"?[2]:(N=w(),c&&(R=yo(e,d),L=a3({allObservables:N,amplitude:j,shouldTrackRageClick:R}),a.push(L)),l&&(U=yo(e,p),G=n3({amplitude:j,allObservables:N,getEventProperties:function(W,$){return b.getEventProperties(W,$,g)},shouldTrackDeadClick:U}),a.push(G)),o&&(M=yo(e,v),B=o3({amplitude:j,allObservables:N,shouldTrackErrorClick:M}),a.push(B)),f&&(X=void 0,oe=void 0,typeof e.thrashedCursor=="object"&&(X=e.thrashedCursor.directionChanges,oe=e.thrashedCursor.threshold,X&&X<uf&&(k.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(X," is below the minimum of ").concat(uf,", setting to ").concat(uf)),X=uf),oe&&oe>cf&&(k.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(oe," is above the maximum of ").concat(cf,", setting to ").concat(cf)),oe=cf)),ue=d3({amplitude:j,options:e,allObservables:N,directionChanges:X,thresholdMs:oe}),a.push(ue)),(Z=k?.loggerProvider)===null||Z===void 0||Z.log("".concat(n," has been successfully added.")),[2])})})},T=function(k){return ne(void 0,void 0,void 0,function(){return te(this,function(j){return[2,k]})})},C=function(){return ne(void 0,void 0,void 0,function(){var k,j,N,R,L;return te(this,function(U){try{for(k=_e(a),j=k.next();!j.done;j=k.next())N=j.value,N.unsubscribe()}catch(G){R={error:G}}finally{try{j&&!j.done&&(L=k.return)&&L.call(k)}finally{if(R)throw R.error}}return[2]})})};return{name:n,type:r,setup:E,execute:T,teardown:C}},p3="@amplitude/plugin-network-capture-browser",QC="[Amplitude] Network Request",JC="500-599";function Lf(e,t){var n=t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&"),r="^"+n.replace(/\*/g,".*")+"$",a=new RegExp(r);return a.test(e)}function ZC(e,t){var n,r,a=t.split(",");try{for(var o=_e(a),l=o.next();!l.done;l=o.next()){var c=l.value,f=Ae(c.split("-").map(Number),2),d=f[0],p=f[1];if(e===d&&p===void 0||e>=d&&e<=p)return!0}}catch(v){n={error:v}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function m3(e,t,n,r,a){if(!(e.hosts&&!e.hosts.find(function(l){return Lf(t,l)}))&&!(r&&e.urls&&!gv(r,e.urls))&&!(a&&e.methods&&!e.methods.find(function(l){return a.toLowerCase()===l.toLowerCase()||l==="*"}))){if(n||n===0){var o=e.statusCodeRange||JC;if(!ZC(n,o))return!1}return!0}}function eA(e){var t;if(e)try{var n=(t=Ue())===null||t===void 0?void 0:t.location.href,r=new URL(e,n),a=r.searchParams.toString(),o=r.hash.replace("#",""),l=r.href,c=r.host;r.hash="",r.search="";var f=r.href;return{query:a,fragment:o,href:l,hrefWithoutQueryOrHash:f,host:c}}catch{return}}function v3(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if(typeof n!="string")return!1;var r=JSON.parse(n),a=r.events;if(a.find(function(o){return o.event_type===QC}))return!0}catch{}return!1}function cE(e){if(typeof e!="object"||e===null){if(e)return Qe([],Ae(ed),!1);if(e===void 0){var t=void 0;return t}return}if(e.length!==0)return e}function fE(e){var t,n;return!(!((t=e?.allowlist)===null||t===void 0)&&t.length)&&!(!((n=e?.blocklist)===null||n===void 0)&&n.length)}function g3(e,t){var n;t===void 0&&(t={});var r=eA(e.url);if(!r)return!1;var a=r.host;if(t.ignoreAmplitudeRequests!==!1&&(Lf(a,"*.amplitude.com")||Lf(a,"amplitude.com"))||!((n=t.ignoreHosts)===null||n===void 0)&&n.find(function(l){return Lf(a,l)})||!t.captureRules&&e.status!==void 0&&!ZC(e.status,JC))return!1;if(t.captureRules){var o;if(Qe([],Ae(t.captureRules),!1).reverse().find(function(l){if(o=m3(l,a,e.status,e.url,e.method),o){var c=cE(l.responseHeaders);if(e.responseWrapper&&c){var f=e.responseWrapper.headers(c);f&&(e.responseHeaders=f)}var d=cE(l.requestHeaders);if(e.requestWrapper&&d){var p=e.requestWrapper.headers(d);p&&(e.requestHeaders=p)}e.responseWrapper&&l.responseBody&&!fE(l.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(l.responseBody.allowlist,l.responseBody.blocklist)),e.requestWrapper&&l.requestBody&&!fE(l.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(l.requestBody.allowlist,l.requestBody.blocklist))}return o!==void 0}),!o)return!1}return!(e.requestWrapper&&v3(a,e.requestWrapper))}function y3(e,t,n,r){return ne(this,void 0,void 0,function(){var a,o,l;return te(this,function(c){switch(c.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(a=Ae.apply(void 0,[c.sent(),2]),o=a[0],l=a[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(f){r?.debug("Failed to stringify request body",f)}if(l)try{e["[Amplitude] Response Body"]=JSON.stringify(l)}catch{r?.debug("Failed to stringify response body")}c.label=2;case 2:return n?.track(QC,e),[2]}})})}function b3(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,a=e.loggerProvider,o=t.networkObservable,l=o.filter(function(c){return g3(c.event,n)});return l.subscribe(function(c){var f,d,p,v=c.event,g=eA(v.url);if(g){var b=(d=v.responseWrapper)===null||d===void 0?void 0:d.bodySize,S=(p=v.requestWrapper)===null||p===void 0?void 0:p.bodySize,w=(f={},f["[Amplitude] URL"]=g.hrefWithoutQueryOrHash,f["[Amplitude] URL Query"]=g.query,f["[Amplitude] URL Fragment"]=g.fragment,f["[Amplitude] Request Method"]=v.method,f["[Amplitude] Status Code"]=v.status,f["[Amplitude] Start Time"]=v.startTime,f["[Amplitude] Completion Time"]=v.endTime,f["[Amplitude] Duration"]=v.duration,f["[Amplitude] Request Body Size"]=S,f["[Amplitude] Response Body Size"]=b,f["[Amplitude] Request Type"]=v.type,f["[Amplitude] Request Headers"]=v.requestHeaders,f["[Amplitude] Response Headers"]=v.responseHeaders,f);y3(w,v,r,a)}})}var wv;(function(e){e.NetworkObservable="networkObservable"})(wv||(wv={}));var dE,x3=function(e){e===void 0&&(e={});var t=p3,n="enrichment",r,a=function(d,p){var v={event:d,timestamp:Date.now(),type:p};return v},o=function(){var d,p=new Rn(function(v){var g=new KI(function(b){var S=a(b,"network");v.next(S)});return Dw.subscribe(g,r),function(){Dw.unsubscribe(g)}});return d={},d[wv.NetworkObservable]=p,d},l=function(d,p){return ne(void 0,void 0,void 0,function(){var v;return te(this,function(g){return typeof document>"u"?[2]:(v=o(),r=d?.loggerProvider,dE=b3({allObservables:v,networkTrackingOptions:e,amplitude:p,loggerProvider:r}),r?.log("".concat(t," has been successfully added.")),[2])})})},c=function(d){return ne(void 0,void 0,void 0,function(){return te(this,function(p){return[2,d]})})},f=function(){return ne(void 0,void 0,void 0,function(){return te(this,function(d){return dE.unsubscribe(),[2]})})};return{name:t,type:n,setup:l,execute:c,teardown:f}},S3="web-vitals-browser",w3="[Amplitude] Web Vitals";let tA=-1;const Do=e=>{addEventListener("pageshow",(t=>{t.persisted&&(tA=t.timeStamp,e(t))}),!0)},ui=(e,t,n,r)=>{let a,o;return l=>{t.value>=0&&(l||r)&&(o=t.value-(a??0),(o||a===void 0)&&(a=t.value,t.delta=o,t.rating=((c,f)=>c>f[1]?"poor":c>f[0]?"needs-improvement":"good")(t.value,n),e(t)))}},Jg=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Zg=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Du=()=>Zg()?.activationStart??0,ci=(e,t=-1)=>{const n=Zg();let r="navigate";return tA>=0?r="back-forward-cache":n&&(document.prerendering||Du()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},gm=new WeakMap;function ey(e,t){return gm.get(e)||gm.set(e,new t),gm.get(e)}class E3{t;i=0;o=[];h(t){if(t.hadRecentInput)return;const n=this.o[0],r=this.o.at(-1);this.i&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),this.t?.(t)}}const Iu=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((a=>{Promise.resolve().then((()=>{t(a.getEntries())}))}));return r.observe({type:e,buffered:!0,...n}),r}}catch{}},ty=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let uo=-1;const nA=new Set,hE=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,Ev=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of nA)t();isFinite(uo)||(uo=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",Ev,!0))}},Ad=()=>{if(uo<0){const e=Du();uo=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((n=>n.name==="hidden"&&n.startTime>e))[0]?.startTime)??hE(),addEventListener("visibilitychange",Ev,!0),addEventListener("prerenderingchange",Ev,!0),Do((()=>{setTimeout((()=>{uo=hE()}))}))}return{get firstHiddenTime(){return uo},onHidden(e){nA.add(e)}}},Nd=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},pE=[1800,3e3],rA=(e,t={})=>{Nd((()=>{const n=Ad();let r,a=ci("FCP");const o=Iu("paint",(l=>{for(const c of l)c.name==="first-contentful-paint"&&(o.disconnect(),c.startTime<n.firstHiddenTime&&(a.value=Math.max(c.startTime-Du(),0),a.entries.push(c),r(!0)))}));o&&(r=ui(e,a,pE,t.reportAllChanges),Do((l=>{a=ci("FCP"),r=ui(e,a,pE,t.reportAllChanges),Jg((()=>{a.value=performance.now()-l.timeStamp,r(!0)}))})))}))},mE=[.1,.25],T3=(e,t={})=>{const n=Ad();rA(ty((()=>{let r,a=ci("CLS",0);const o=ey(t,E3),l=f=>{for(const d of f)o.h(d);o.i>a.value&&(a.value=o.i,a.entries=o.o,r())},c=Iu("layout-shift",l);c&&(r=ui(e,a,mE,t.reportAllChanges),n.onHidden((()=>{l(c.takeRecords()),r(!0)})),Do((()=>{o.i=0,a=ci("CLS",0),r=ui(e,a,mE,t.reportAllChanges),Jg((()=>r()))})),setTimeout(r))})))};let iA=0,ym=1/0,ff=0;const k3=e=>{for(const t of e)t.interactionId&&(ym=Math.min(ym,t.interactionId),ff=Math.max(ff,t.interactionId),iA=ff?(ff-ym)/7+1:0)};let Tv;const vE=()=>Tv?iA:performance.interactionCount??0,C3=()=>{"interactionCount"in performance||Tv||(Tv=Iu("event",k3,{type:"event",buffered:!0,durationThreshold:0}))};let gE=0,A3=class{u=[];l=new Map;m;p;v(){gE=vE(),this.u.length=0,this.l.clear()}L(){const t=Math.min(this.u.length-1,Math.floor((vE()-gE)/50));return this.u[t]}h(t){if(this.m?.(t),!t.interactionId&&t.entryType!=="first-input")return;const n=this.u.at(-1);let r=this.l.get(t.interactionId);if(r||this.u.length<10||t.duration>n.P){if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],P:t.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort(((a,o)=>o.P-a.P)),this.u.length>10){const a=this.u.splice(10);for(const o of a)this.l.delete(o.id)}this.p?.(r)}}};const aA=e=>{const t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=ty(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},yE=[200,500],N3=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Ad();Nd((()=>{C3();let r,a=ci("INP");const o=ey(t,A3),l=f=>{aA((()=>{for(const p of f)o.h(p);const d=o.L();d&&d.P!==a.value&&(a.value=d.P,a.entries=d.entries,r())}))},c=Iu("event",l,{durationThreshold:t.durationThreshold??40});r=ui(e,a,yE,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{l(c.takeRecords()),r(!0)})),Do((()=>{o.v(),a=ci("INP"),r=ui(e,a,yE,t.reportAllChanges)})))}))};let j3=class{m;h(t){this.m?.(t)}};const bE=[2500,4e3],R3=(e,t={})=>{Nd((()=>{const n=Ad();let r,a=ci("LCP");const o=ey(t,j3),l=f=>{t.reportAllChanges||(f=f.slice(-1));for(const d of f)o.h(d),d.startTime<n.firstHiddenTime&&(a.value=Math.max(d.startTime-Du(),0),a.entries=[d],r())},c=Iu("largest-contentful-paint",l);if(c){r=ui(e,a,bE,t.reportAllChanges);const f=ty((()=>{l(c.takeRecords()),c.disconnect(),r(!0)})),d=p=>{p.isTrusted&&(aA(f),removeEventListener(p.type,d,{capture:!0}))};for(const p of["keydown","click","visibilitychange"])addEventListener(p,d,{capture:!0});Do((p=>{a=ci("LCP"),r=ui(e,a,bE,t.reportAllChanges),Jg((()=>{a.value=performance.now()-p.timeStamp,r(!0)}))}))}}))},xE=[800,1800],kv=e=>{document.prerendering?Nd((()=>kv(e))):document.readyState!=="complete"?addEventListener("load",(()=>kv(e)),!0):setTimeout(e)},_3=(e,t={})=>{let n=ci("TTFB"),r=ui(e,n,xE,t.reportAllChanges);kv((()=>{const a=Zg();a&&(n.value=Math.max(a.responseStart-Du(),0),n.entries=[a],r(!0),Do((()=>{n=ci("TTFB",0),r=ui(e,n,xE,t.reportAllChanges),r(!0)})))}))};function O3(e){var t,n=((t=e.entries[0])===null||t===void 0?void 0:t.startTime)||0;return performance.timeOrigin+n}function zl(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(O3(e)),navigationStart:Math.floor(performance.timeOrigin)}}var M3=function(){var e=null,t=Ue(),n=t?.document,r=t?.location,a=function(c,f){return ne(void 0,void 0,void 0,function(){var d,p;return te(this,function(v){return n===void 0?[2]:(d=ka(r?.href||"",c.loggerProvider),p={"[Amplitude] Page Domain":r?.hostname||"","[Amplitude] Page Location":d,"[Amplitude] Page Path":ka(r?.pathname||"",c.loggerProvider),"[Amplitude] Page Title":typeof document<"u"&&document.title||"","[Amplitude] Page URL":ka(d.split("?")[0],c.loggerProvider)},R3(function(g){p["[Amplitude] LCP"]=zl(g)}),rA(function(g){p["[Amplitude] FCP"]=zl(g)}),N3(function(g){p["[Amplitude] INP"]=zl(g)}),T3(function(g){p["[Amplitude] CLS"]=zl(g)}),_3(function(g){p["[Amplitude] TTFB"]=zl(g)}),e=function(){n.visibilityState==="hidden"&&e&&(f.track(w3,p),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e),[2])})})},o=function(c){return ne(void 0,void 0,void 0,function(){return te(this,function(f){return[2,c]})})},l=function(){return ne(void 0,void 0,void 0,function(){return te(this,function(c){return e&&n?.removeEventListener("visibilitychange",e),[2]})})};return{name:S3,type:"enrichment",setup:a,execute:o,teardown:l}},SE=(function(){function e(t,n){var r;this.shouldTrackNewCampaign=!1,this.options=ce({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:zL(((r=n.cookieOptions)===null||r===void 0?void 0:r.domain)||n.topLevelDomain),optOut:n.optOut},t),this.storage=n.cookieStorage,this.storageKey=Cw(n.apiKey,"MKTG"),this.webExpStorageKey=Cw(n.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=kd,this.sessionTimeout=n.sessionTimeout,this.lastEventTime=n.lastEventTime,this.logger=n.loggerProvider,this.topLevelDomain=n.topLevelDomain,n.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return ne(this,void 0,void 0,function(){var t,n;return te(this,function(r){switch(r.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return n=Ae.apply(void 0,[r.sent(),2]),this.currentCampaign=n[0],this.previousCampaign=n[1],t=this.lastEventTime?iC(this.sessionTimeout,this.lastEventTime):!0,IL(this.currentCampaign,this.previousCampaign,this.options,this.logger,t,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return ne(this,void 0,void 0,function(){var t;return te(this,function(n){switch(n.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return t=n.sent(),t?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[4,Promise.all([t||new yC().parse(),this.storage.get(this.storageKey)])];case 4:return[2,n.sent()]}})})},e.prototype.generateCampaignEvent=function(t){this.shouldTrackNewCampaign=!1;var n=UL(this.currentCampaign,this.options);return t&&(n.event_id=t),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e})(),df="AMP_CURRENT_PAGE",hf="AMP_PREVIOUS_PAGE",to="AMP_URL_INFO",au;(function(e){e.Direct="direct",e.Internal="internal",e.External="external"})(au||(au={}));var D3=new Set([sr.IDENTIFY,sr.GROUP_IDENTIFY,sr.REVENUE]),I3=function(e){var t={},n=t.internalDomains,r=n===void 0?[]:n,a=Ue(),o=void 0,l=!1,c=void 0,f=!1,d=!1,p=function(w){var E;try{var T=ka(w,c);E=new URL(T).hostname}catch(C){c?.error("Could not parse URL: ",C)}return E},v=function(w){var E=typeof location<"u"&&location.hostname||"",T=w?p(w):void 0;if(!T)return au.Direct;var C=r.some(function(j){return E.indexOf(j)!==-1}),k=r.some(function(j){return T.indexOf(j)!==-1});return E===T||k&&C?au.Internal:au.External},g=function(){return ne(void 0,void 0,void 0,function(){var w,E,T,C,k;return te(this,function(j){switch(j.label){case 0:return o&&l?[4,o.get(to)]:[3,3];case 1:return w=j.sent(),E=ka(typeof location<"u"&&location.href||""),T=w?.[df]||"",C=void 0,E===T?C=w?.[hf]||"":T?C=T:C=document.referrer||"",[4,o.set(to,(k={},k[df]=E,k[hf]=C,k))];case 2:j.sent(),j.label=3;case 3:return[2]}})})},b=function(){g()},S={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(w,E){return ne(void 0,void 0,void 0,function(){return te(this,function(T){switch(T.label){case 0:return c=w.loggerProvider,c.log("Installing @amplitude/plugin-page-url-enrichment-browser"),d=!0,a?(o=new Gg(a.sessionStorage),[4,o.isEnabled()]):[3,2];case 1:l=T.sent(),a.addEventListener("popstate",b),f||(a.history.pushState=new Proxy(a.history.pushState,{apply:function(C,k,j){var N=Ae(j,3),R=N[0],L=N[1],U=N[2];C.apply(k,[R,L,U]),d&&b()}}),a.history.replaceState=new Proxy(a.history.replaceState,{apply:function(C,k,j){var N=Ae(j,3),R=N[0],L=N[1],U=N[2];C.apply(k,[R,L,U]),d&&b()}}),f=!0),T.label=2;case 2:return[2]}})})},execute:function(w){return ne(void 0,void 0,void 0,function(){var E,T,C,k,j;return te(this,function(N){switch(N.label){case 0:return E=ka(typeof location<"u"&&location.href||""),o&&l?[4,o.get(to)]:[3,5];case 1:return T=N.sent(),T?.[df]?[3,3]:[4,o.set(to,(j={},j[df]=E,j[hf]=document.referrer||"",j))];case 2:N.sent(),N.label=3;case 3:return[4,o.get(to)];case 4:if(C=N.sent(),k="",C&&(k=C[hf]||""),D3.has(w.event_type))return[2,w];w.event_properties=ce(ce({},w.event_properties||{}),{"[Amplitude] Page Domain":Bl(w,"[Amplitude] Page Domain",typeof location<"u"&&location.hostname||""),"[Amplitude] Page Location":Bl(w,"[Amplitude] Page Location",E),"[Amplitude] Page Path":Bl(w,"[Amplitude] Page Path",typeof location<"u"&&ka(location.pathname)||""),"[Amplitude] Page Title":Bl(w,"[Amplitude] Page Title",$g(Yg)),"[Amplitude] Page URL":Bl(w,"[Amplitude] Page URL",E.split("?")[0]),"[Amplitude] Previous Page Location":k,"[Amplitude] Previous Page Type":v(k)}),N.label=5;case 5:return[2,w]}})})},teardown:function(){return ne(void 0,void 0,void 0,function(){return te(this,function(w){switch(w.label){case 0:return a&&(a.removeEventListener("popstate",b),d=!1),o&&l?[4,o.set(to,{})]:[3,2];case 1:w.sent(),w.label=2;case 2:return[2]}})})}};return S};function Bl(e,t,n){return e.event_properties||(e.event_properties={}),e.event_properties[t]===void 0?n:e.event_properties[t]}var bm=-1,L3=(function(e){Or(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._diagnosticsSampleRate=0,n._enableRequestBodyCompressionExperimentalValue=!1,n}return t.prototype.init=function(n,r,a){n===void 0&&(n="");var o,l;return arguments.length>2?(o=r,l=a):typeof r=="string"?(o=r,l=void 0):(o=r?.userId,l=r),Sn(this._init(ce(ce({},l),{userId:o,apiKey:n})))},t.prototype._init=function(n){var r,a,o,l,c,f,d;return ne(this,void 0,void 0,function(){var p,v,g,b,S,w,E,T,C,k,j,N,R,L,U,G=this;return te(this,function(M){switch(M.label){case 0:return this.initializing?[2]:(this.initializing=!0,p=GL(n),v=(r=n.loggerProvider)!==null&&r!==void 0?r:new ko,g=(a=n.serverZone)!==null&&a!==void 0?a:MC,S=this._diagnosticsSampleRate,w=(o=n.enableDiagnostics)!==null&&o!==void 0?o:!0,p?(b=new fC(n.apiKey,v,g,(l=n.remoteConfig)===null||l===void 0?void 0:l.serverUrl),[4,new Promise(function(B){b?.subscribe("configs.diagnostics.browserSDK","all",function(X,oe,ue){if(v.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:X,source:oe,lastFetch:ue},null,2)),X){var Z=X.sampleRate;typeof Z=="number"&&!isNaN(Z)&&(S=Z);var V=X.enabled;typeof V=="boolean"&&(w=V)}B()})})]):[3,2]);case 1:M.sent(),M.label=2;case 2:return E=new vI(n.apiKey,v,g,{enabled:w,sampleRate:S}),E.setTag("library","".concat(_C,"/").concat(Wg)),typeof navigator<"u"&&E.setTag("user_agent",navigator.userAgent),[4,HL(n.apiKey,n,this,E,{loggerProvider:v,serverZone:g,enableDiagnostics:w,diagnosticsSampleRate:S})];case 3:return T=M.sent(),p&&b?[4,new Promise(function(B){b?.subscribe("configs.analyticsSDK.browserSDK","all",function(X,oe,ue){T.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:X,source:oe,lastFetch:ue},null,2)),X&&nP(X,T),B()})})]:[3,5];case 4:M.sent(),M.label=5;case 5:return[4,e.prototype._init.call(this,T)];case 6:return M.sent(),this.logBrowserOptions(T),this.config.remoteConfigClient=b,kC(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener(function(B){return ne(G,void 0,void 0,function(){var X;return te(this,function(oe){switch(oe.label){case 0:return B?[3,2]:(X=Vw(this.config),this.webAttribution=new SE(X,this.config),[4,this.webAttribution.init()]);case 1:oe.sent(),oe.label=2;case 2:return[2]}})})}),C=Vw(this.config),this.webAttribution=new SE(C,this.config),[4,this.webAttribution.init()]):[3,8];case 7:M.sent(),M.label=8;case 8:return k=td(),j=k.ampTimestamp?Number(k.ampTimestamp):void 0,N=j?Date.now()<j:!0,R=N&&!Number.isNaN(Number(k.ampSessionId))?Number(k.ampSessionId):void 0,L=this.config.deferredSessionId,L===bm&&!this.config.optOut&&(L=Date.now()),this.setSessionId((d=(f=(c=n.sessionId)!==null&&c!==void 0?c:R)!==null&&f!==void 0?f:L)!==null&&d!==void 0?d:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(B){return ne(G,void 0,void 0,function(){return te(this,function(X){return!B&&this.config.deferredSessionId&&(this.config.deferredSessionId===bm?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),U=Co(n.instanceName),U.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===NI?[3,10]:[4,this.add(tP()).promise];case 9:M.sent(),M.label=10;case 10:return[4,this.add(new VD({diagnosticsClient:E})).promise];case 11:return M.sent(),[4,this.add(new bL).promise];case 12:return M.sent(),[4,this.add(new QD).promise];case 13:return M.sent(),eP(this.config),cL(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(ZL()).promise]):[3,15];case 14:M.sent(),M.label=15;case 15:return CC(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(JL()).promise]):[3,17];case 16:M.sent(),M.label=17;case 17:return AC(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Yw(Bw(this.config))).promise]):[3,20];case 18:return M.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(B){return ne(G,void 0,void 0,function(){return te(this,function(X){switch(X.label){case 0:return B?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Yw(Bw(this.config))).promise]);case 1:return X.sent(),[2]}})})}),M.label=20;case 20:return jC(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(ZP(hL(this.config),{diagnosticsClient:E})).promise]):[3,22];case 21:M.sent(),M.label=22;case 22:return RC(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(h3(pL(this.config))).promise]):[3,24];case 23:M.sent(),M.label=24;case 24:return NC(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(x3(mL(this.config))).promise]):[3,26];case 25:M.sent(),M.label=26;case 26:return dL(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(M3()).promise]):[3,28];case 27:M.sent(),M.label=28;case 28:return fL(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(I3()).promise]):[3,30];case 29:M.sent(),M.label=30;case 30:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 31:return M.sent(),U.eventBridge.setEventReceiver(function(B){var X=B.eventProperties||{},oe=X.time,ue=Zf(X,["time"]),Z=typeof oe=="number"?{time:oe}:void 0;G.track(B.eventType,ue,Z)}),[2]}})})},t.prototype.getUserId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.userId},t.prototype.setUserId=function(n){if(!this.config){this.q.push(this.setUserId.bind(this,n));return}this.config.loggerProvider.debug("function setUserId: ",n),(n!==this.config.userId||n===void 0)&&(this.config.userId=n,this.timeline.onIdentityChanged({userId:n}),XD(n,this.config.instanceName))},t.prototype.getDeviceId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.deviceId},t.prototype.setDeviceId=function(n){if(!this.config){this.q.push(this.setDeviceId.bind(this,n));return}this.config.loggerProvider.debug("function setDeviceId: ",n),n!==this.config.deviceId&&(this.config.deviceId=n,this.timeline.onIdentityChanged({deviceId:n}),WD(n,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(_a()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var n,r;return{deviceId:(n=this.config)===null||n===void 0?void 0:n.deviceId,userId:(r=this.config)===null||r===void 0?void 0:r.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(n){var r,a,o;if("userId"in n&&this.setUserId(n.userId),"deviceId"in n&&n.deviceId&&this.setDeviceId(n.deviceId),"userProperties"in n){this.userProperties=n.userProperties;var l=new nu,c=(o=n.userProperties)!==null&&o!==void 0?o:{};try{for(var f=_e(Object.entries(c)),d=f.next();!d.done;d=f.next()){var p=Ae(d.value,2),v=p[0],g=p[1];l.set(v,g)}}catch(b){r={error:b}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}this.identify(l)}},t.prototype.getOptOut=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.optOut},t.prototype.getSessionId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.sessionId},t.prototype.setSessionId=function(n){var r,a=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,n)),Sn(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=n??bm,Sn(Promise.resolve());if(n===void 0&&(n=Date.now()),n===this.config.sessionId)return Sn(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",n);var o=this.getSessionId();o!==n&&this.timeline.onSessionIdChanged(n);var l=this.config.lastEventTime,c=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1;this.config.sessionId=n,this.config.lastEventTime=void 0,this.config.pageCounter=0,zw(this.config.defaultTracking)&&(o&&l&&a.push(this.track(qw,void 0,{device_id:this.previousSessionDeviceId,event_id:++c,session_id:o,time:l+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var f=this.trackCampaignEventIfNeeded(++c,a);return this.config.identify&&a.push(this.track(Fg(this.config.identify)).promise),zw(this.config.defaultTracking)&&a.push(this.track(Hw,void 0,{event_id:f?++c:c,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,Sn(Promise.all(a))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(n){if(!this.config){this.q.push(this.setTransport.bind(this,n));return}this.config.transportProvider=LC(n)},t.prototype.identify=function(n,r){if(fm(n)){var a=n._q;n._q=[],n=cm(new nu,a)}return r?.user_id&&this.setUserId(r.user_id),r?.device_id&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,n,r)},t.prototype.groupIdentify=function(n,r,a,o){if(fm(a)){var l=a._q;a._q=[],a=cm(new nu,l)}return e.prototype.groupIdentify.call(this,n,r,a,o)},t.prototype.revenue=function(n,r){if(fm(n)){var a=n._q;n._q=[],n=cm(new MD,a)}return e.prototype.revenue.call(this,n,r)},t.prototype.trackCampaignEventIfNeeded=function(n,r){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var a=this.webAttribution.generateCampaignEvent(n);return r?r.push(this.track(a).promise):this.track(a),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(n){return ne(this,void 0,void 0,function(){var r,a,o;return te(this,function(l){return r=Date.now(),a=iC(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),n.event_type!==Hw&&n.event_type!==qw&&(!n.session_id||n.session_id===this.getSessionId())&&(a||o?(this.setSessionId(r),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):a||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,n)]})})},t.prototype.logBrowserOptions=function(n){try{var r=ce(ce({},n),{apiKey:n.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",nL(r))}catch(a){this.config.loggerProvider.error("Error logging browser config",a)}},t.prototype._setDiagnosticsSampleRate=function(n){if(!(n>1||n<0)&&!this.config){this._diagnosticsSampleRate=n;return}},t.prototype._enableRequestBodyCompressionExperimental=function(n){if(!this.config){this._enableRequestBodyCompressionExperimentalValue=n;return}},t})(OD),sA="[Amplitude]",P3="".concat(sA," Session Replay ID"),U3=0,z3=xu.US,B3={enabled:!0},ny=1e3,V3="".concat(sA," Session Replay Debug"),F3="amp-block",oA="amp-mask",H3="amp-unmask",q3="https://api-sr.amplitude.com/sessions/v2/track",G3="https://api-sr.eu.amplitude.com/sessions/v2/track",K3="https://api-sr.stag2.amplitude.com/sessions/v2/track",Y3=1*1e6,$3=3e4,X3=6e4,W3=500,Q3=10*1e3,lA=1024,J3=1e3,ya;(function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"})(ya||(ya={}));var Cv=(function(){function e(t){this.logger=t,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(t){var n;if(!this.logger)return(function(){});var r=this.logger[t];if(typeof r=="function"){var a=(n=r.__rrweb_original__)!==null&&n!==void 0?n:r;return a.bind(this.logger)}return(function(){})},e.prototype.enable=function(t){this.logger.enable(t)},e.prototype.disable=function(){this.logger.disable()},e})(),Av="medium";function Z3(e){return e.toLowerCase()}function e4(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Z3(t):null}var uA=function(e,t,n){switch(t){case"light":{if(e!=="input")return!0;var r=n?e4(n):"";return r?!!(["password","hidden","email","tel"].includes(r)||n.autocomplete.startsWith("cc-")):!1}case"medium":case"conservative":return!0;default:return uA(e,Av,n)}},t4=function(e,t,n){var r,a,o;if(t===void 0&&(t={defaultMaskLevel:Av}),n){if(n.closest("."+oA))return!0;var l=((r=t.maskSelector)!==null&&r!==void 0?r:[]).some(function(f){return n.closest(f)});if(l)return!0;if(n.closest("."+H3))return!1;var c=((a=t.unmaskSelector)!==null&&a!==void 0?a:[]).some(function(f){return n.closest(f)});if(c)return!1}return uA(e,(o=t.defaultMaskLevel)!==null&&o!==void 0?o:Av,n)},wE=function(e,t){return function(n,r){return t4(e,t,r)?n.replace(/[^\s]/g,"*"):n}},n4=function(){var e=Ue();return e?.location?e.location.href:""},r4=function(e,t){return"".concat(t,"/").concat(e)},cA=function(e,t){return t||(e===xu.STAGING?K3:e===xu.EU?G3:q3)},i4=function(e){if(typeof e!="string"||e.trim()==="")return!1;var t=/^\/|^https?:\/\/[^\s]+$/;return!!t.test(e)},a4=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},s4=function(e){if(!e.every(function(t){return typeof t.selector=="string"&&typeof t.replacement=="string"}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(t){return i4(t.selector)}))throw new Error("ugcFilterRules must be an array of objects with valid globs")},jd=function(e,t){var n,r;try{for(var a=_e(t),o=a.next();!o.done;o=a.next()){var l=o.value,c=a4(l.selector);if(c.test(e))return e.replace(c,l.replacement)}}catch(f){n={error:f}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return e},fA=function(){return ne(void 0,void 0,void 0,function(){var e,t,n,r,a,o,l;return te(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),e=Ue(),e?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=c.sent(),n=t.usage,r=t.quota,a=t.usageDetails,o=n?Math.round(n/lA):0,l=n&&r?Math.round((n/r+Number.EPSILON)*1e3)/1e3:0,[2,{totalStorageSize:o,percentOfQuota:l,usageDetails:JSON.stringify(a)}];case 2:return[3,4];case 3:return c.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},dA=function(e){var t=ce({},e),n=t.apiKey;return t.apiKey="****".concat(n.substring(n.length-4)),t},hA=function(){return{flushMaxRetries:2,logLevel:$n.Warn,loggerProvider:new ko,transportProvider:new gI}},o4=(function(e){Or(t,e);function t(n,r){var a=this,o,l,c,f,d,p,v=hA();if(a=e.call(this,ce(ce({transportProvider:v.transportProvider,loggerProvider:new Cv(r.loggerProvider||v.loggerProvider)},r),{apiKey:n}))||this,a.flushMaxRetries=r.flushMaxRetries!==void 0&&r.flushMaxRetries<=v.flushMaxRetries?r.flushMaxRetries:v.flushMaxRetries,a.apiKey=n,a.sampleRate=r.sampleRate||U3,a.serverZone=r.serverZone||z3,a.configServerUrl=r.configServerUrl,a.trackServerUrl=r.trackServerUrl,a.shouldInlineStylesheet=r.shouldInlineStylesheet,a.version=r.version,a.performanceConfig=r.performanceConfig||B3,a.storeType=(o=r.storeType)!==null&&o!==void 0?o:"idb",a.applyBackgroundColorToBlockedElements=(l=r.applyBackgroundColorToBlockedElements)!==null&&l!==void 0?l:!1,a.enableUrlChangePolling=(c=r.enableUrlChangePolling)!==null&&c!==void 0?c:!1,a.urlChangePollingInterval=(f=r.urlChangePollingInterval)!==null&&f!==void 0?f:ny,a.captureDocumentTitle=(d=r.captureDocumentTitle)!==null&&d!==void 0?d:!1,r.privacyConfig&&(a.privacyConfig=r.privacyConfig),r.interactionConfig&&(a.interactionConfig=r.interactionConfig,a.interactionConfig.ugcFilterRules&&s4(a.interactionConfig.ugcFilterRules)),r.debugMode&&(a.debugMode=r.debugMode),r.useWebWorker!==void 0)a.useWebWorker=r.useWebWorker;else{var g=r;((p=g.experimental)===null||p===void 0?void 0:p.useWebWorker)!==void 0&&(a.useWebWorker=g.experimental.useWebWorker)}return r.omitElementTags&&(a.omitElementTags=r.omitElementTags),a}return t})(nC);const l4="modulepreload",u4=function(e){return"/"+e},EE={},Ql=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let f=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");a=f(n.map(d=>{if(d=u4(d),d in EE)return;EE[d]=!0;const p=d.endsWith(".css"),v=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${v}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":l4,p||(g.as="script"),g.crossOrigin="",g.href=d,c&&g.setAttribute("nonce",c),document.head.appendChild(g),p)return new Promise((b,S)=>{g.addEventListener("load",b),g.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};var pA=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(pA||{}),mA=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(mA||{}),c4=function(e,t){var n=document.createDocumentFragment(),r=function(a){if(a===void 0&&(a=[]),typeof a=="string"&&(a=[a]),a=a.filter(function(o){try{n.querySelector(o)}catch{return t.warn('[session-replay-browser] omitting selector "'.concat(o,'" because it is invalid')),!1}return!0}),a.length!==0)return a};return e.blockSelector=r(e.blockSelector),e.maskSelector=r(e.maskSelector),e.unmaskSelector=r(e.unmaskSelector),e},f4=(function(){function e(t,n){this.localConfig=n,this.remoteConfigClient=t}return e.prototype.generateJoinedConfig=function(){var t,n,r;return ne(this,void 0,void 0,function(){var a,o,l,c,f,d,p,v,g,b,S,w,E,T,C,k,j,N=this;return te(this,function(R){switch(R.label){case 0:a=ce({},this.localConfig),a.optOut=this.localConfig.optOut,a.captureEnabled=!0,R.label=1;case 1:return R.trys.push([1,3,,4]),[4,new Promise(function(L,U){N.remoteConfigClient.subscribe("configs.sessionReplay","all",function(G,M){var B;if(N.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(M,":"),JSON.stringify(G,null,2)),!G){U(new Error("No remote config received"));return}var X=G,oe=X.sr_sampling_config,ue=X.sr_privacy_config,Z=X.sr_targeting_config,V=(B=a.interactionConfig)===null||B===void 0?void 0:B.ugcFilterRules;a.interactionConfig=X.sr_interaction_config,a.interactionConfig&&V&&(a.interactionConfig.ugcFilterRules=V),a.loggingConfig=X.sr_logging_config,(oe||ue||Z)&&(o={},oe&&(o.sr_sampling_config=oe),ue&&(o.sr_privacy_config=ue),Z&&(o.sr_targeting_config=Z)),L()})})];case 2:return R.sent(),[3,4];case 3:return l=R.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",l),a.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:void 0}];case 4:if(!o)return[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:o}];if(c=o.sr_sampling_config,f=o.sr_privacy_config,d=o.sr_targeting_config,c&&Object.keys(c).length>0?(Object.prototype.hasOwnProperty.call(c,"capture_enabled")?a.captureEnabled=c.capture_enabled:a.captureEnabled=!1,Object.prototype.hasOwnProperty.call(c,"sample_rate")&&(a.sampleRate=c.sample_rate)):(a.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),f){p=(t=a.privacyConfig)!==null&&t!==void 0?t:{},v={defaultMaskLevel:(r=(n=f.defaultMaskLevel)!==null&&n!==void 0?n:p.defaultMaskLevel)!==null&&r!==void 0?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},g=function(L){var U,G,M,B,X,oe,ue,Z,V,W={};typeof L.blockSelector=="string"&&(L.blockSelector=[L.blockSelector]);try{for(var $=_e((ue=L.blockSelector)!==null&&ue!==void 0?ue:[]),he=$.next();!he.done;he=$.next()){var I=he.value;W[I]="block"}}catch(ye){U={error:ye}}finally{try{he&&!he.done&&(G=$.return)&&G.call($)}finally{if(U)throw U.error}}try{for(var z=_e((Z=L.maskSelector)!==null&&Z!==void 0?Z:[]),ee=z.next();!ee.done;ee=z.next()){var I=ee.value;W[I]="mask"}}catch(ye){M={error:ye}}finally{try{ee&&!ee.done&&(B=z.return)&&B.call(z)}finally{if(M)throw M.error}}try{for(var D=_e((V=L.unmaskSelector)!==null&&V!==void 0?V:[]),de=D.next();!de.done;de=D.next()){var I=de.value;W[I]="unmask"}}catch(ye){X={error:ye}}finally{try{de&&!de.done&&(oe=D.return)&&oe.call(D)}finally{if(X)throw X.error}}return W},b=ce(ce({},g(p)),g(f));try{for(S=_e(Object.entries(b)),w=S.next();!w.done;w=S.next())E=Ae(w.value,2),T=E[0],C=E[1],C==="mask"?v.maskSelector.push(T):C==="block"?v.blockSelector.push(T):C==="unmask"&&v.unmaskSelector.push(T)}catch(L){k={error:L}}finally{try{w&&!w.done&&(j=S.return)&&j.call(S)}finally{if(k)throw k.error}}a.privacyConfig=c4(v,this.localConfig.loggerProvider)}return d&&Object.keys(d).length>0&&(a.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:dA(a)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:o}]}})})},e})(),d4=function(e,t){return ne(void 0,void 0,void 0,function(){var n,r;return te(this,function(a){return n=new o4(e,t),r=new fC(e,n.loggerProvider,n.serverZone,t.configServerUrl),[2,new f4(r,n)]})})},jr=Uint8Array,Pn=Uint16Array,Su=Uint32Array,ry=new jr([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]),iy=new jr([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]),TE=new jr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vA=function(e,t){for(var n=new Pn(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new Su(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)a[o]=o-n[r]<<5|r;return[n,a]},gA=vA(ry,2),h4=gA[0],Nv=gA[1];h4[28]=258,Nv[258]=28;var p4=vA(iy,0),kE=p4[1],jv=new Pn(32768);for(var Lt=0;Lt<32768;++Lt){var ha=(Lt&43690)>>>1|(Lt&21845)<<1;ha=(ha&52428)>>>2|(ha&13107)<<2,ha=(ha&61680)>>>4|(ha&3855)<<4,jv[Lt]=((ha&65280)>>>8|(ha&255)<<8)>>>1}var su=(function(e,t,n){for(var r=e.length,a=0,o=new Pn(t);a<r;++a)++o[e[a]-1];var l=new Pn(t);for(a=0;a<t;++a)l[a]=l[a-1]+o[a-1]<<1;var c;if(n){c=new Pn(1<<t);var f=15-t;for(a=0;a<r;++a)if(e[a])for(var d=a<<4|e[a],p=t-e[a],v=l[e[a]-1]++<<p,g=v|(1<<p)-1;v<=g;++v)c[jv[v]>>>f]=d}else for(c=new Pn(r),a=0;a<r;++a)c[a]=jv[l[e[a]-1]++]>>>15-e[a];return c}),ms=new jr(288);for(var Lt=0;Lt<144;++Lt)ms[Lt]=8;for(var Lt=144;Lt<256;++Lt)ms[Lt]=9;for(var Lt=256;Lt<280;++Lt)ms[Lt]=7;for(var Lt=280;Lt<288;++Lt)ms[Lt]=8;var od=new jr(32);for(var Lt=0;Lt<32;++Lt)od[Lt]=5;var m4=su(ms,9,0),v4=su(od,5,0),yA=function(e){return(e/8>>0)+(e&7&&1)},bA=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Pn?Pn:e instanceof Su?Su:jr)(n-t);return r.set(e.subarray(t,n)),r},Li=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Vl=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},xm=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,o=n.slice();if(!a)return[new jr(0),0];if(a==1){var l=new jr(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort(function(N,R){return N.f-R.f}),n.push({s:-1,f:25001});var c=n[0],f=n[1],d=0,p=1,v=2;for(n[0]={s:-1,f:c.f+f.f,l:c,r:f};p!=a-1;)c=n[n[d].f<n[v].f?d++:v++],f=n[d!=p&&n[d].f<n[v].f?d++:v++],n[p++]={s:-1,f:c.f+f.f,l:c,r:f};for(var g=o[0].s,r=1;r<a;++r)o[r].s>g&&(g=o[r].s);var b=new Pn(g+1),S=Rv(n[p-1],b,0);if(S>t){var r=0,w=0,E=S-t,T=1<<E;for(o.sort(function(R,L){return b[L.s]-b[R.s]||R.f-L.f});r<a;++r){var C=o[r].s;if(b[C]>t)w+=T-(1<<S-b[C]),b[C]=t;else break}for(w>>>=E;w>0;){var k=o[r].s;b[k]<t?w-=1<<t-b[k]++-1:++r}for(;r>=0&&w;--r){var j=o[r].s;b[j]==t&&(--b[j],++w)}S=t}return[new jr(b),S]},Rv=function(e,t,n){return e.s==-1?Math.max(Rv(e.l,t,n+1),Rv(e.r,t,n+1)):t[e.s]=n},CE=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Pn(++t),r=0,a=e[0],o=1,l=function(f){n[r++]=f},c=1;c<=t;++c)if(e[c]==a&&c!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(a),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(a);o=1,a=e[c]}return[n.subarray(0,r),t]},Fl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},_v=function(e,t,n){var r=n.length,a=yA(t+2);e[a]=r&255,e[a+1]=r>>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var o=0;o<r;++o)e[a+o+4]=n[o];return(a+4+r)*8},AE=function(e,t,n,r,a,o,l,c,f,d,p){Li(t,p++,n),++a[256];for(var v=xm(a,15),g=v[0],b=v[1],S=xm(o,15),w=S[0],E=S[1],T=CE(g),C=T[0],k=T[1],j=CE(w),N=j[0],R=j[1],L=new Pn(19),U=0;U<C.length;++U)L[C[U]&31]++;for(var U=0;U<N.length;++U)L[N[U]&31]++;for(var G=xm(L,7),M=G[0],B=G[1],X=19;X>4&&!M[TE[X-1]];--X);var oe=d+5<<3,ue=Fl(a,ms)+Fl(o,od)+l,Z=Fl(a,g)+Fl(o,w)+l+14+3*X+Fl(L,M)+(2*L[16]+3*L[17]+7*L[18]);if(oe<=ue&&oe<=Z)return _v(t,p,e.subarray(f,f+d));var V,W,$,he;if(Li(t,p,1+(Z<ue)),p+=2,Z<ue){V=su(g,b,0),W=g,$=su(w,E,0),he=w;var I=su(M,B,0);Li(t,p,k-257),Li(t,p+5,R-1),Li(t,p+10,X-4),p+=14;for(var U=0;U<X;++U)Li(t,p+3*U,M[TE[U]]);p+=3*X;for(var z=[C,N],ee=0;ee<2;++ee)for(var D=z[ee],U=0;U<D.length;++U){var de=D[U]&31;Li(t,p,I[de]),p+=M[de],de>15&&(Li(t,p,D[U]>>>5&127),p+=D[U]>>>12)}}else V=m4,W=ms,$=v4,he=od;for(var U=0;U<c;++U)if(r[U]>255){var de=r[U]>>>18&31;Vl(t,p,V[de+257]),p+=W[de+257],de>7&&(Li(t,p,r[U]>>>23&31),p+=ry[de]);var ye=r[U]&31;Vl(t,p,$[ye]),p+=he[ye],ye>3&&(Vl(t,p,r[U]>>>5&8191),p+=iy[ye])}else Vl(t,p,V[r[U]]),p+=W[r[U]];return Vl(t,p,V[256]),p+W[256]},g4=new Su([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),y4=function(e,t,n,r,a,o){var l=e.length,c=new jr(r+l+5*(1+Math.floor(l/7e3))+a),f=c.subarray(r,c.length-a),d=0;if(!t||l<8)for(var p=0;p<=l;p+=65535){var v=p+65535;v<l?d=_v(f,d,e.subarray(p,v)):(f[p]=o,d=_v(f,d,e.subarray(p,l)))}else{for(var g=g4[t-1],b=g>>>13,S=g&8191,w=(1<<n)-1,E=new Pn(32768),T=new Pn(w+1),C=Math.ceil(n/3),k=2*C,j=function($e){return(e[$e]^e[$e+1]<<C^e[$e+2]<<k)&w},N=new Su(25e3),R=new Pn(288),L=new Pn(32),U=0,G=0,p=0,M=0,B=0,X=0;p<l;++p){var oe=j(p),ue=p&32767,Z=T[oe];if(E[ue]=Z,T[oe]=ue,B<=p){var V=l-p;if((U>7e3||M>24576)&&V>423){d=AE(e,f,0,N,R,L,G,M,X,p-X,d),M=U=G=0,X=p;for(var W=0;W<286;++W)R[W]=0;for(var W=0;W<30;++W)L[W]=0}var $=2,he=0,I=S,z=ue-Z&32767;if(V>2&&oe==j(p-z))for(var ee=Math.min(b,V)-1,D=Math.min(32767,p),de=Math.min(258,V);z<=D&&--I&&ue!=Z;){if(e[p+$]==e[p+$-z]){for(var ye=0;ye<de&&e[p+ye]==e[p+ye-z];++ye);if(ye>$){if($=ye,he=z,ye>ee)break;for(var Se=Math.min(z,ye-2),we=0,W=0;W<Se;++W){var Le=p-z+W+32768&32767,je=E[Le],ge=Le-je+32768&32767;ge>we&&(we=ge,Z=Le)}}}ue=Z,Z=E[ue],z+=ue-Z+32768&32767}if(he){N[M++]=268435456|Nv[$]<<18|kE[he];var Pe=Nv[$]&31,xt=kE[he]&31;G+=ry[Pe]+iy[xt],++R[257+Pe],++L[xt],B=p+$,++U}else N[M++]=e[p],++R[e[p]]}}d=AE(e,f,o,N,R,L,G,M,X,p-X,d)}return bA(c,0,r+yA(d)+a)},b4=function(){var e=1,t=0;return{p:function(n){for(var r=e,a=t,o=n.length,l=0;l!=o;){for(var c=Math.min(l+5552,o);l<c;++l)r+=n[l],a+=r;r%=65521,a%=65521}e=r,t=a},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},x4=function(e,t,n,r,a){return y4(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!0)},S4=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},w4=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)};function E4(e,t){t===void 0&&(t={});var n=b4();n.p(e);var r=x4(e,t,2,4);return w4(r,t),S4(r,r.length-4,n.d()),r}function T4(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new jr(e.length+(e.length>>>1)),a=0,o=function(d){r[a++]=d},l=0;l<n;++l){if(a+5>r.length){var c=new jr(a+8+(n-l<<1));c.set(r),r=c}var f=e.charCodeAt(l);f<128||t?o(f):f<2048?(o(192|f>>>6),o(128|f&63)):f>55295&&f<57344?(f=65536+(f&1047552)|e.charCodeAt(++l)&1023,o(240|f>>>18),o(128|f>>>12&63),o(128|f>>>6&63),o(128|f&63)):(o(224|f>>>12),o(128|f>>>6&63),o(128|f&63))}return bA(r,0,a)}function k4(e,t){for(var n="",r=0;r<e.length;){var a=e[r++];n+=String.fromCharCode(a)}return n}const C4="v1",A4=e=>{const t={...e,v:C4};return k4(E4(T4(JSON.stringify(t))))};var N4=2e3,j4=(function(){function e(t,n,r,a){var o=this,l;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(v){var g=A4(v);return JSON.stringify(g)},this.addCompressedEventToManager=function(v,g){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:v},sessionId:g,deviceId:o.deviceId})},this.addCompressedEvent=function(v,g){if(o.worker)try{o.worker.postMessage({event:v,sessionId:g})}catch(S){S.name==="DataCloneError"?o.worker.postMessage(JSON.stringify({event:v,sessionId:g})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",S)}else{var b=o.compressEvent(v);o.addCompressedEventToManager(b,g)}},this.terminate=function(){var v;(v=o.worker)===null||v===void 0||v.terminate()};var c=Ue();if(this.canUseIdleCallback=c&&"requestIdleCallback"in c,this.eventsManager=t,this.config=n,this.deviceId=r,this.timeout=((l=n.performanceConfig)===null||l===void 0?void 0:l.timeout)||N4,a){n.loggerProvider.log("Enabling web worker for compression");try{var f=new Blob([a],{type:"application/javascript"}),d=URL.createObjectURL(f),p=new Worker(d);p.onerror=function(v){n.loggerProvider.error("Worker failed, falling back to non-worker compression:",v),p.terminate(),o.worker=void 0},p.onmessage=function(v){var g=v.data,b=g.compressedEvent,S=g.sessionId;o.addCompressedEventToManager(b,S)},this.worker=p}catch(v){n.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",v)}}}return e.prototype.scheduleIdleProcessing=function(){var t=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(n){t.processQueue(n)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(t,n){var r;this.canUseIdleCallback&&(!((r=this.config.performanceConfig)===null||r===void 0)&&r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:t,sessionId:n}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(t,n))},e.prototype.processQueue=function(t){for(var n=this;this.taskQueue.length>0&&(t.timeRemaining()>0||t.didTimeout);){var r=this.taskQueue.shift();if(r){var a=r.event,o=r.sessionId;this.addCompressedEvent(a,o)}}this.taskQueue.length>0?requestIdleCallback(function(l){n.processQueue(l)},{timeout:this.timeout}):this.isProcessing=!1},e})(),R4="Unexpected error occurred",_4="Network error occurred, event batch rejected",NE="Session replay event batch rejected due to exceeded retry count",no="Failed to store session replay events in IndexedDB",O4="Session replay event batch not sent due to missing device ID",M4="Session replay event batch not sent due to missing api key",Ov="1.32.0",D4=(function(){function e(t){var n=t.trackServerUrl,r=t.loggerProvider,a=t.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=a||function(o){return o},this.trackServerUrl=n}return e.prototype.sendEventsList=function(t){this.addToQueue(ce(ce({},t),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=n.filter(function(o){return o.attempts<(o.flushMaxRetries||0)?(o.attempts+=1,!0):(t.completeRequest({context:o,err:NE}),!1)});a.forEach(function(o){t.queue=t.queue.concat(o),t.schedule(0)})},e.prototype.schedule=function(t){var n=this;this.scheduled||(this.scheduled=setTimeout(function(){n.flush(!0).then(function(){n.queue.length>0&&n.schedule(t)})},t))},e.prototype.flush=function(t){return t===void 0&&(t=!1),ne(this,void 0,void 0,function(){var n,r,a,o,l,c,f;return te(this,function(d){switch(d.label){case 0:n=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),d.label=1;case 1:d.trys.push([1,6,7,8]),r=_e(n),a=r.next(),d.label=2;case 2:return a.done?[3,5]:(o=a.value,[4,this.send(o,t)]);case 3:d.sent(),d.label=4;case 4:return a=r.next(),[3,2];case 5:return[3,8];case 6:return l=d.sent(),c={error:l},[3,8];case 7:try{a&&!a.done&&(f=r.return)&&f.call(r)}finally{if(c)throw c.error}return[7];case 8:return[2]}})})},e.prototype.send=function(t,n){var r,a;return n===void 0&&(n=!0),ne(this,void 0,void 0,function(){var o,l,c,f,d,p,v,g,b,S,w,E,T;return te(this,function(C){switch(C.label){case 0:if(o=t.apiKey,!o)return[2,this.completeRequest({context:t,err:M4})];if(l=t.deviceId,!l)return[2,this.completeRequest({context:t,err:O4})];if(c=n4(),f=Ov,d=t.sampleRate,p=new URLSearchParams({device_id:l,session_id:"".concat(t.sessionId),type:"".concat(t.type)}),v="".concat(((r=t.version)===null||r===void 0?void 0:r.type)||"standalone","/").concat(((a=t.version)===null||a===void 0?void 0:a.version)||f),g=this.payloadBatcher({version:1,events:t.events}),g.events.length===0)return this.completeRequest({context:t}),[2];C.label=1;case 1:return C.trys.push([1,6,,7]),b={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(o),"X-Client-Version":f,"X-Client-Library":v,"X-Client-Url":c.substring(0,J3),"X-Client-Sample-Rate":"".concat(d)},body:JSON.stringify(g),method:"POST"},S="".concat(cA(t.serverZone,this.trackServerUrl),"?").concat(p.toString()),[4,fetch(S,b)];case 2:if(w=C.sent(),w===null)return this.completeRequest({context:t,err:R4}),[2];if(n)return[3,3];E="";try{E=JSON.stringify(w.body,null,2)}catch{}return this.completeRequest({context:t,success:"".concat(w.status,": ").concat(E)}),[3,5];case 3:return[4,this.handleReponse(w.status,t)];case 4:C.sent(),C.label=5;case 5:return[3,7];case 6:return T=C.sent(),this.completeRequest({context:t,err:T}),[3,7];case 7:return[2]}})})},e.prototype.handleReponse=function(t,n){return ne(this,void 0,void 0,function(){var r,a;return te(this,function(o){switch(o.label){case 0:switch(r=new Ou().buildStatus(t),a=r,a){case Gt.Success:return[3,1];case Gt.Failed:return[3,2]}return[3,4];case 1:return this.handleSuccessResponse(n),[3,5];case 2:return[4,this.handleOtherResponse(n)];case 3:return o.sent(),[3,5];case 4:this.completeRequest({context:n,err:_4}),o.label=5;case 5:return[2]}})})},e.prototype.handleSuccessResponse=function(t){var n=Math.round(new Blob(t.events).size/lA);this.completeRequest({context:t,success:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(n," KB")})},e.prototype.handleOtherResponse=function(t){return ne(this,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return n=t.attempts*this.retryTimeout,t.attempts++,t.attempts>(t.flushMaxRetries||0)?(this.completeRequest({context:t,err:NE}),[2]):[4,new Promise(function(a){return setTimeout(a,n)})];case 1:return r.sent(),[4,this.send(t,!0)];case 2:return r.sent(),[2]}})})},e.prototype.completeRequest=function(t){var n=t.context,r=t.err,a=t.success;n.onComplete(),r?this.loggerProvider.warn(r):a&&this.loggerProvider.log(a)},e})();const Mv=(e,t)=>t.some(n=>e instanceof n);let jE,RE;function I4(){return jE||(jE=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function L4(){return RE||(RE=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Dv=new WeakMap,Sm=new WeakMap,Rd=new WeakMap;function P4(e){const t=new Promise((n,r)=>{const a=()=>{e.removeEventListener("success",o),e.removeEventListener("error",l)},o=()=>{n(ds(e.result)),a()},l=()=>{r(e.error),a()};e.addEventListener("success",o),e.addEventListener("error",l)});return Rd.set(t,e),t}function U4(e){if(Dv.has(e))return;const t=new Promise((n,r)=>{const a=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",l),e.removeEventListener("abort",l)},o=()=>{n(),a()},l=()=>{r(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",o),e.addEventListener("error",l),e.addEventListener("abort",l)});Dv.set(e,t)}let Iv={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Dv.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ds(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function xA(e){Iv=e(Iv)}function z4(e){return L4().includes(e)?function(...t){return e.apply(Lv(this),t),ds(this.request)}:function(...t){return ds(e.apply(Lv(this),t))}}function B4(e){return typeof e=="function"?z4(e):(e instanceof IDBTransaction&&U4(e),Mv(e,I4())?new Proxy(e,Iv):e)}function ds(e){if(e instanceof IDBRequest)return P4(e);if(Sm.has(e))return Sm.get(e);const t=B4(e);return t!==e&&(Sm.set(e,t),Rd.set(t,e)),t}const Lv=e=>Rd.get(e);function SA(e,t,{blocked:n,upgrade:r,blocking:a,terminated:o}={}){const l=indexedDB.open(e,t),c=ds(l);return r&&l.addEventListener("upgradeneeded",f=>{r(ds(l.result),f.oldVersion,f.newVersion,ds(l.transaction),f)}),n&&l.addEventListener("blocked",f=>n(f.oldVersion,f.newVersion,f)),c.then(f=>{o&&f.addEventListener("close",()=>o()),a&&f.addEventListener("versionchange",d=>a(d.oldVersion,d.newVersion,d))}).catch(()=>{}),c}const V4=["get","getKey","getAll","getAllKeys","count"],F4=["put","add","delete","clear"],wm=new Map;function _E(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(wm.get(t))return wm.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,a=F4.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(a||V4.includes(n)))return;const o=async function(l,...c){const f=this.transaction(l,a?"readwrite":"readonly");let d=f.store;return r&&(d=d.index(c.shift())),(await Promise.all([d[n](...c),a&&f.done]))[0]};return wm.set(t,o),o}xA(e=>({...e,get:(t,n,r)=>_E(t,n)||e.get(t,n,r),has:(t,n)=>!!_E(t,n)||e.has(t,n)}));const H4=["continue","continuePrimaryKey","advance"],OE={},Pv=new WeakMap,wA=new WeakMap,q4={get(e,t){if(!H4.includes(t))return e[t];let n=OE[t];return n||(n=OE[t]=function(...r){Pv.set(this,wA.get(this)[t](...r))}),n}};async function*G4(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,q4);for(wA.set(n,t),Rd.set(n,Lv(t));t;)yield n,t=await(Pv.get(n)||t.continue()),Pv.delete(n)}function ME(e,t){return t===Symbol.asyncIterator&&Mv(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Mv(e,[IDBIndex,IDBObjectStore])}xA(e=>({...e,get(t,n,r){return ME(t,n)?G4:e.get(t,n,r)},has(t,n){return ME(t,n)||e.has(t,n)}}));var EA=(function(){function e(t){var n=this,r,a,o;this.minInterval=W3,this.maxInterval=Q3,this.maxPersistedEventsSize=Y3,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(l,c){var f=n.getStringSize(c),d=n.getEventsArraySize(l);return d+f>=n.maxPersistedEventsSize?!0:Date.now()-n.timeAtLastSplit>n.interval&&l.length?(n.interval=Math.min(n.maxInterval,n.interval+n.minInterval),n._timeAtLastSplit=Date.now(),!0):!1},this.loggerProvider=t.loggerProvider,this.minInterval=(r=t.minInterval)!==null&&r!==void 0?r:this.minInterval,this.maxInterval=(a=t.maxInterval)!==null&&a!==void 0?a:this.maxInterval,this.maxPersistedEventsSize=(o=t.maxPersistedEventsSize)!==null&&o!==void 0?o:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(t){return t.length},e.prototype.getEventsArraySize=function(t){var n,r,a=0;try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;a+=this.getStringSize(c)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var f=2+Math.max(0,t.length-1)+t.length*2;return a+f},e})(),K4=function(e){return typeof e=="object"&&e!==null&&e.name==="AbortError"},Ui=function(e,t,n){K4(n)?e.debug(t):e.warn(t)},ou="sessionCurrentSequence",lu="sequencesToSend",Y4=function(e){var t,n;return e.objectStoreNames.contains(ou)||(n=e.createObjectStore(ou,{keyPath:"sessionId"})),e.objectStoreNames.contains(lu)||(t=e.createObjectStore(lu,{keyPath:"sequenceId",autoIncrement:!0}),t.createIndex("sessionId","sessionId")),{sequencesStore:t,currentSequenceStore:n}},$4=function(e){return ne(void 0,void 0,void 0,function(){return te(this,function(t){switch(t.label){case 0:return[4,SA(e,1,{upgrade:Y4})];case 1:return[2,t.sent()]}})})},X4=(function(e){Or(t,e);function t(n){var r=e.call(this,n)||this;return r.getSequencesToSend=function(){return ne(r,void 0,void 0,function(){var a,o,l,c,f,d;return te(this,function(p){switch(p.label){case 0:return p.trys.push([0,5,,6]),a=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:o=p.sent(),p.label=2;case 2:return o?(l=o.value,c=l.sessionId,f=l.events,a.push({events:f,sequenceId:o.key,sessionId:c}),[4,o.continue()]):[3,4];case 3:return o=p.sent(),[3,2];case 4:return[2,a];case 5:return d=p.sent(),Ui(this.loggerProvider,"".concat(no,": ").concat(d),d),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(a){return ne(r,void 0,void 0,function(){var o,l,c;return te(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),[4,this.db.get(ou,a)];case 1:return o=f.sent(),o?[4,this.db.put(lu,{sessionId:a,events:o.events})]:[2,void 0];case 2:return l=f.sent(),[4,this.db.put(ou,{sessionId:a,events:[]})];case 3:return f.sent(),[2,ce(ce({},o),{sessionId:a,sequenceId:l})];case 4:return c=f.sent(),Ui(this.loggerProvider,"".concat(no,": ").concat(c),c),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(a,o){return ne(r,void 0,void 0,function(){var l,c,f,d,p,v;return te(this,function(g){switch(g.label){case 0:return g.trys.push([0,10,,11]),l=this.db.transaction(ou,"readwrite"),[4,l.store.get(a)];case 1:return c=g.sent(),c?[3,3]:[4,l.store.put({sessionId:a,events:[o]})];case 2:return g.sent(),[2];case 3:return f=void 0,this.shouldSplitEventsList(c.events,o)?(f=c.events,[4,l.store.put({sessionId:a,events:[o]})]):[3,5];case 4:return g.sent(),[3,7];case 5:return d=c.events.concat(o),[4,l.store.put({sessionId:a,events:d})];case 6:g.sent(),g.label=7;case 7:return[4,l.done];case 8:return g.sent(),f?[4,this.storeSendingEvents(a,f)]:[2,void 0];case 9:return p=g.sent(),p?[2,{events:f,sessionId:a,sequenceId:p}]:[2,void 0];case 10:return v=g.sent(),Ui(this.loggerProvider,"".concat(no,": ").concat(v),v),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(a,o){return ne(r,void 0,void 0,function(){var l,c;return te(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,this.db.put(lu,{sessionId:a,events:o})];case 1:return l=f.sent(),[2,l];case 2:return c=f.sent(),Ui(this.loggerProvider,"".concat(no,": ").concat(c),c),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(a,o){return ne(r,void 0,void 0,function(){var l;return te(this,function(c){switch(c.label){case 0:if(!o)return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.db.delete(lu,o)];case 2:return c.sent(),[3,4];case 3:return l=c.sent(),Ui(this.loggerProvider,"".concat(no,": ").concat(l),l),[3,4];case 4:return[2]}})})},r.db=n.db,r}return t.new=function(n,r){return ne(this,void 0,void 0,function(){var a,o,l,c;return te(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),a=n==="replay"?"":"_".concat(n),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(a),[4,$4(o)];case 1:return l=f.sent(),[2,new t(ce(ce({},r),{db:l}))];case 2:return c=f.sent(),Ui(r.loggerProvider,"".concat(no,": ").concat(c),c),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(n){return ne(this,void 0,void 0,function(){var l,r,a,o,l,c,f,d;return te(this,function(p){switch(p.label){case 0:return n?[4,this.db.get("sessionCurrentSequence",n)]:[3,2];case 1:return l=p.sent(),l?[2,[l]]:[2,void 0];case 2:r=[],p.label=3;case 3:return p.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:a=_e.apply(void 0,[p.sent()]),o=a.next(),p.label=5;case 5:if(o.done)return[3,7];l=o.value,r.push(l),p.label=6;case 6:return o=a.next(),[3,5];case 7:return[3,10];case 8:return c=p.sent(),f={error:c},[3,10];case 9:try{o&&!o.done&&(d=a.return)&&d.call(a)}finally{if(f)throw f.error}return[7];case 10:return[2,r]}})})},t})(EA),W4=(function(e){Or(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.finalizedSequences={},n.sequences={},n.sequenceId=0,n}return t.prototype.resetCurrentSequence=function(n){this.sequences[n]=[]},t.prototype.addSequence=function(n){var r=this.sequenceId++,a=Qe([],Ae(this.sequences[n]),!1);return this.finalizedSequences[r]={sessionId:n,events:a},this.resetCurrentSequence(n),{sequenceId:r,events:a,sessionId:n}},t.prototype.getSequencesToSend=function(){return ne(this,void 0,void 0,function(){return te(this,function(n){return[2,Object.entries(this.finalizedSequences).map(function(r){var a=Ae(r,2),o=a[0],l=a[1],c=l.sessionId,f=l.events;return{sequenceId:Number(o),sessionId:c,events:f}})]})})},t.prototype.storeCurrentSequence=function(n){return ne(this,void 0,void 0,function(){return te(this,function(r){return this.sequences[n]?[2,this.addSequence(n)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(n,r){return ne(this,void 0,void 0,function(){var a;return te(this,function(o){return this.sequences[n]||this.resetCurrentSequence(n),this.shouldSplitEventsList(this.sequences[n],r)&&(a=this.addSequence(n)),this.sequences[n].push(r),[2,a]})})},t.prototype.storeSendingEvents=function(n,r){return ne(this,void 0,void 0,function(){return te(this,function(a){return this.finalizedSequences[this.sequenceId]={sessionId:n,events:r},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(n,r){return ne(this,void 0,void 0,function(){return te(this,function(a){return r!==void 0&&delete this.finalizedSequences[r],[2]})})},t})(EA),DE=function(e){var t=e.config,n=e.minInterval,r=e.maxInterval,a=e.type,o=e.payloadBatcher,l=e.storeType;return ne(void 0,void 0,void 0,function(){function c(T){return T===void 0&&(T=!1),ne(this,void 0,void 0,function(){return te(this,function(C){return[2,f.flush(T)]})})}var f,d,p,v,g,b,S,w,E;return te(this,function(T){switch(T.label){case 0:return f=new D4(ce(ce({},t),{loggerProvider:t.loggerProvider,payloadBatcher:o})),d=function(){return new W4({loggerProvider:t.loggerProvider,maxInterval:r,minInterval:n})},p=function(){return ne(void 0,void 0,void 0,function(){var C;return te(this,function(k){switch(k.label){case 0:return[4,X4.new(a,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:r,apiKey:t.apiKey})];case 1:return C=k.sent(),C?[2,C]:(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,d()])}})})},l!=="idb"?[3,2]:[4,p()];case 1:return g=T.sent(),[3,3];case 2:g=d(),T.label=3;case 3:return v=g,b=function(C){var k=C.events,j=C.sessionId,N=C.deviceId,R=C.sequenceId;t.debugMode&&fA().then(function(L){var U=L.totalStorageSize,G=L.percentOfQuota,M=L.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(U," KB, percentage of quota: ").concat(G,"%, usage details: ").concat(M))}).catch(function(){}),f.sendEventsList({events:k,sessionId:j,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:N,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:a,onComplete:function(){return ne(void 0,void 0,void 0,function(){return te(this,function(L){switch(L.label){case 0:return[4,v.cleanUpSessionEventsStore(j,R)];case 1:return L.sent(),[2]}})})}})},S=function(C){var k=C.sessionId,j=C.deviceId;v.storeCurrentSequence(k).then(function(N){N&&b({sequenceId:N.sequenceId,events:N.events,sessionId:N.sessionId,deviceId:j})}).catch(function(N){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",N)})},w=function(C){var k=C.deviceId;return ne(void 0,void 0,void 0,function(){var j;return te(this,function(N){switch(N.label){case 0:return[4,v.getSequencesToSend()];case 1:return j=N.sent(),j&&j.forEach(function(R){b({sequenceId:R.sequenceId,events:R.events,sessionId:R.sessionId,deviceId:k})}),[2]}})})},E=function(C){var k=C.event,j=C.sessionId,N=C.deviceId;v.addEventToCurrentSequence(j,k.data).then(function(R){return R&&b({sequenceId:R.sequenceId,events:R.events,sessionId:R.sessionId,deviceId:N})}).catch(function(R){t.loggerProvider.warn("Failed to add event to session replay capture:",R)})},[2,{sendCurrentSequenceEvents:S,addEvent:E,sendStoredEvents:w,flush:c}]}})})},IE=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=new Map;t.forEach(function(a){r.set(a.name,a.manager)}),this.managers=r}return e.prototype.sendStoredEvents=function(t){return ne(this,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return n=[],this.managers.forEach(function(a){n.push(a.sendStoredEvents(t))}),[4,Promise.all(n)];case 1:return r.sent(),[2]}})})},e.prototype.addEvent=function(t){var n,r=t.sessionId,a=t.event,o=t.deviceId;(n=this.managers.get(a.type))===null||n===void 0||n.addEvent({sessionId:r,event:a,deviceId:o})},e.prototype.sendCurrentSequenceEvents=function(t){var n=t.sessionId,r=t.deviceId;this.managers.forEach(function(a){a.sendCurrentSequenceEvents({sessionId:n,deviceId:r})})},e.prototype.flush=function(t){return ne(this,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return n=[],this.managers.forEach(function(a){n.push(a.flush(t))}),[4,Promise.all(n)];case 1:return r.sent(),[2]}})})},e})(),Rr,ay,TA;function Q4(e,t){if(TA=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return"html";var n={root:document.body,idName:function(o){return!0},className:function(o){return!0},tagName:function(o){return!0},attr:function(o,l){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Rr=ce(ce({},n),t),ay=J4(Rr.root,n);var r=pf(e,"all",function(){return pf(e,"two",function(){return pf(e,"one",function(){return pf(e,"none")})})});if(r){var a=AA(NA(r,e));return a.length>0&&(r=a[0]),_d(r)}else throw new Error("Selector was not found.")}function J4(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function pf(e,t,n){for(var r=null,a=[],o=e,l=0,c=function(){var d,p,v=new Date().getTime()-TA.getTime();if(Rr.timeoutMs!==void 0&&v>Rr.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(v,"ms"));var g=vf(Z4(o))||vf.apply(void 0,Qe([],Ae(eU(o)),!1))||vf.apply(void 0,Qe([],Ae(tU(o)),!1))||vf(nU(o))||[UE()],b=rU(o);if(t=="all")b&&(g=g.concat(g.filter(Em).map(function(C){return mf(C,b)})));else if(t=="two")g=g.slice(0,1),b&&(g=g.concat(g.filter(Em).map(function(C){return mf(C,b)})));else if(t=="one"){var S=Ae(g=g.slice(0,1),1),w=S[0];b&&Em(w)&&(g=[mf(w,b)])}else t=="none"&&(g=[UE()],b&&(g=[mf(g[0],b)]));try{for(var E=(d=void 0,_e(g)),T=E.next();!T.done;T=E.next()){var w=T.value;w.level=l}}catch(C){d={error:C}}finally{try{T&&!T.done&&(p=E.return)&&p.call(E)}finally{if(d)throw d.error}}if(a.push(g),a.length>=Rr.seedMinLength&&(r=LE(a,n),r))return"break";o=o.parentElement,l++};o;){var f=c();if(f==="break")break}return r||(r=LE(a,n)),!r&&n?n():r}function LE(e,t){var n,r,a=AA(CA(e));if(a.length>Rr.threshold)return t?t():null;try{for(var o=_e(a),l=o.next();!l.done;l=o.next()){var c=l.value;if(kA(c))return c}}catch(f){n={error:f}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function _d(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var a=e[r].level||0;t.level===a-1?n="".concat(e[r].name," > ").concat(n):n="".concat(e[r].name," ").concat(n),t=e[r]}return n}function PE(e){return e.map(function(t){return t.penalty}).reduce(function(t,n){return t+n},0)}function kA(e){var t=_d(e);switch(ay.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function Z4(e){var t=e.getAttribute("id");return t&&Rr.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}function eU(e){var t=Array.from(e.attributes).filter(function(n){return Rr.attr(n.name,n.value)});return t.map(function(n){return{name:"[".concat(CSS.escape(n.name),'="').concat(CSS.escape(n.value),'"]'),penalty:.5}})}function tU(e){var t=Array.from(e.classList).filter(Rr.className);return t.map(function(n){return{name:"."+CSS.escape(n),penalty:1}})}function nU(e){var t=e.tagName.toLowerCase();return Rr.tagName(t)?{name:t,penalty:2}:null}function UE(){return{name:"*",penalty:3}}function rU(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}function mf(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Em(e){return e.name!=="html"&&!e.name.startsWith("#")}function vf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(iU);return n.length>0?n:null}function iU(e){return e!=null}function CA(e,t){var n,r,a,o,l,c;return t===void 0&&(t=[]),te(this,function(f){switch(f.label){case 0:if(!(e.length>0))return[3,9];f.label=1;case 1:f.trys.push([1,6,7,8]),n=_e(e[0]),r=n.next(),f.label=2;case 2:return r.done?[3,5]:(a=r.value,[5,_e(CA(e.slice(1,e.length),t.concat(a)))]);case 3:f.sent(),f.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return o=f.sent(),l={error:o},[3,8];case 7:try{r&&!r.done&&(c=n.return)&&c.call(n)}finally{if(l)throw l.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:f.sent(),f.label=11;case 11:return[2]}})}function AA(e){return Qe([],Ae(e),!1).sort(function(t,n){return PE(t)-PE(n)})}function NA(e,t,n){var r,a,o;return n===void 0&&(n={counter:0,visited:new Map}),te(this,function(l){switch(l.label){case 0:if(!(e.length>2&&e.length>Rr.optimizedMinLength))return[3,5];r=1,l.label=1;case 1:return r<e.length-1?n.counter>Rr.maxNumberOfTries?[2]:(n.counter+=1,a=Qe([],Ae(e),!1),a.splice(r,1),o=_d(a),n.visited.has(o)?[2]:kA(a)&&aU(a,t)?[4,a]:[3,4]):[3,5];case 2:return l.sent(),n.visited.set(o,!0),[5,_e(NA(a,t,n))];case 3:l.sent(),l.label=4;case 4:return r++,[3,1];case 5:return[2]}})}function aU(e,t){return ay.querySelector(_d(e))===t}var sU=36e5,oU=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(a){var o=JSON.parse(a);o.count=1,o.type==="click"&&r.push(o)}),{version:t,events:r}},lU=function(e){var t=e.version,n=e.events,r=[];n.forEach(function(o){var l=JSON.parse(o);l.type==="click"&&r.push(l)});var a=r.reduce(function(o,l){var c=l.x,f=l.y,d=l.selector,p=l.timestamp,v=p-p%sU,g="".concat(c,":").concat(f,":").concat(d??"",":").concat(v);return o[g]?o[g].count+=1:o[g]=ce(ce({},l),{timestamp:v,count:1}),o},{});return{version:t,events:Object.values(a)}},uU=(function(){function e(t,n){var r=this;this.createHook=function(a){var o=a.eventsManager,l=a.sessionId,c=a.deviceIdFn,f=a.mirror,d=a.ugcFilterRules,p=a.performanceOptions;return function(v){if(v.type===mA.Click){var g=Ue();if(g){var b=g.location,S=g.innerHeight,w=g.innerWidth;if(b){var E=v.x,T=v.y;if(!(E===void 0||T===void 0)){var C=f.getNode(v.id),k;if(C)try{k=Q4(C,p)}catch{r.logger.debug("error resolving selector from finder")}var j=jd(b.href,d),N={x:E+r.scrollWatcher.currentScrollX,y:T+r.scrollWatcher.currentScrollY,selector:k,viewportHeight:S,viewportWidth:w,pageUrl:j,timestamp:Date.now(),type:"click"},R=c();R&&o.addEvent({sessionId:l,event:{type:"interaction",data:JSON.stringify(N)},deviceId:R})}}}}}},this.logger=t,this.scrollWatcher=n}return e})();function Tm(){var e=Ue();return e?.innerHeight||document.documentElement&&document.documentElement.clientHeight||0}function km(){var e=Ue();return e?.innerWidth||document.documentElement&&document.documentElement.clientWidth||0}var cU=(function(){function e(t,n){var r=Ue();r&&r.navigator&&typeof r.navigator.sendBeacon=="function"?this.sendBeacon=function(a,o){try{if(r.navigator.sendBeacon(a,JSON.stringify(o)))return!0}catch{}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(a,o){var l=new XMLHttpRequest;return l.open("POST",a,!0),l.setRequestHeader("Accept","*/*"),l.send(JSON.stringify(o)),!0},this.basePageUrl=cA(n.serverZone,n.trackServerUrl),this.apiKey=n.apiKey,this.context=t}return e.prototype.send=function(t,n){var r=this.context,a=r.sessionId,o=r.type,l=new URLSearchParams({device_id:t,session_id:String(a),type:String(o),api_key:this.apiKey}),c="".concat(this.basePageUrl,"?").concat(l.toString());this.sendBeacon(c,n)||this.sendXhr(c,n)},e})(),fU=(function(){function e(t,n){var r=this;this.timestamp=Date.now(),this.hook=function(a){r.update(a)},this.send=function(a){return function(o){var l,c,f=a(),d=Ue();d&&f&&r.transport.send(f,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Tm(),viewportWidth:km(),pageUrl:jd(d.location.href,(c=(l=r.config.interactionConfig)===null||l===void 0?void 0:l.ugcFilterRules)!==null&&c!==void 0?c:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=km(),this._maxScrollHeight=Tm(),this.config=n,this.transport=t}return e.default=function(t,n){return new e(new cU(t,n),n)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(t){var n=Date.now();if(this._currentScrollX=t.x,this._currentScrollY=t.y,t.x>this._maxScrollX){var r=km();this._maxScrollX=t.x;var a=t.x+r;a>this._maxScrollWidth&&(this._maxScrollWidth=a),this.timestamp=n}if(t.y>this._maxScrollY){var o=Tm();this._maxScrollY=t.y;var l=t.y+o;l>this._maxScrollHeight&&(this._maxScrollHeight=l),this.timestamp=n}},e})(),zE=(function(){function e(t){var n=t.sessionId,r=t.deviceId;this.deviceId=r,this.sessionId=n,n&&r&&(this.sessionReplayId=r4(n,r))}return e})(),dU=1e3*60*60*24*2,hU=(function(){function e(){var t=this;this.dbs={},this.createStore=function(n){return ne(t,void 0,void 0,function(){return te(this,function(r){switch(r.label){case 0:return[4,SA(n,1,{upgrade:function(a){a.objectStoreNames.contains("sessionTargetingMatch")||a.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,r.sent()]}})})},this.openOrCreateDB=function(n){return ne(t,void 0,void 0,function(){var r,a;return te(this,function(o){switch(o.label){case 0:return this.dbs&&this.dbs[n]?[2,this.dbs[n]]:(r="".concat(n.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(r)]);case 1:return a=o.sent(),this.dbs[n]=a,[2,a]}})})},this.getTargetingMatchForSession=function(n){var r=n.loggerProvider,a=n.apiKey,o=n.sessionId;return ne(t,void 0,void 0,function(){var l,c,f,d;return te(this,function(p){switch(p.label){case 0:return p.trys.push([0,3,,4]),[4,this.openOrCreateDB(a)];case 1:return l=p.sent(),c=String(o),[4,l.get("sessionTargetingMatch",c)];case 2:return f=p.sent(),[2,f?.targetingMatch];case 3:return d=p.sent(),Ui(r,"Failed to get targeting match for session id ".concat(o,": ").concat(d),d),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(n){var r=n.loggerProvider,a=n.apiKey,o=n.sessionId,l=n.targetingMatch;return ne(t,void 0,void 0,function(){var c,f,d,p;return te(this,function(v){switch(v.label){case 0:return v.trys.push([0,3,,4]),[4,this.openOrCreateDB(a)];case 1:return c=v.sent(),f=String(o),[4,c.put("sessionTargetingMatch",{targetingMatch:l,sessionId:f,lastUpdated:Date.now()})];case 2:return d=v.sent(),[2,d];case 3:return p=v.sent(),Ui(r,"Failed to store targeting match for session id ".concat(o,": ").concat(p),p),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(n){var r=n.loggerProvider,a=n.apiKey,o=n.currentSessionId;return ne(t,void 0,void 0,function(){var l,c,f,d,p,v,g,b;return te(this,function(S){switch(S.label){case 0:return S.trys.push([0,8,,9]),[4,this.openOrCreateDB(a)];case 1:return l=S.sent(),c=String(o),f=l.transaction("sessionTargetingMatch","readwrite"),[4,f.store.getAll()];case 2:d=S.sent(),p=0,S.label=3;case 3:return p<d.length?(v=d[p],g=Date.now()-v.lastUpdated,v.sessionId!==c&&g>dU?[4,f.store.delete(v.sessionId)]:[3,5]):[3,6];case 4:S.sent(),S.label=5;case 5:return p++,[3,3];case 6:return[4,f.done];case 7:return S.sent(),[3,9];case 8:return b=S.sent(),Ui(r,"Failed to clear old targeting matches for sessions: ".concat(b),b),[3,9];case 9:return[2]}})})}}return e})(),Cm=new hU,pU=function(e){var t=e.sessionId,n=e.targetingConfig,r=e.loggerProvider,a=e.apiKey,o=e.targetingParams,l=e.urlChange,c=l===void 0?!1:l;return ne(void 0,void 0,void 0,function(){var f,d,p,v,g,b,S;return te(this,function(w){switch(w.label){case 0:return[4,Cm.clearStoreOfOldSessions({loggerProvider:r,apiKey:a,currentSessionId:t})];case 1:return w.sent(),[4,Cm.getTargetingMatchForSession({loggerProvider:r,apiKey:a,sessionId:t})];case 2:if(f=w.sent(),f===!0&&!c)return[2,!0];d=!0,w.label=3;case 3:return w.trys.push([3,6,,7]),[4,Ql(()=>import("./index-yhFuaOnc.js"),[])];case 4:return p=w.sent().evaluateTargeting,v=ce(ce({},o),{flag:n,sessionId:typeof t=="string"?parseInt(t,10):t,apiKey:a,loggerProvider:r}),[4,p(v)];case 5:return g=w.sent(),g&&g.sr_targeting_config&&(d=g.sr_targeting_config.key==="on"),Cm.storeTargetingMatchForSession({loggerProvider:r,apiKey:a,sessionId:t,targetingMatch:d}),[3,7];case 6:return b=w.sent(),S=b,r.warn(S.message),[3,7];case 7:return[2,d]}})})},Am="__amplitude_url_tracking_patched__",BE=new WeakMap;function jA(e,t,n){if(n===void 0&&(n={}),!e?.location)return function(){};var r=n.enablePolling,a=r===void 0?!1:r,o=n.pollingInterval,l=o===void 0?ny:o;if(a){var c=function(){var j;return(j=e.location.href)!==null&&j!==void 0?j:""},f=c(),d=e.setInterval(function(){var j=c();j!==f&&(f=j,t(j))},l);return function(){d!=null&&e.clearInterval(d)}}var p=BE.get(e);if(!p){var v=void 0,g=new Set,b=function(){var j;return(j=e.location.href)!==null&&j!==void 0?j:""},S=function(){var j=b();v!==void 0&&j===v||(v=j,g.forEach(function(N){return N(j)}))},w=function(j){var N=function(){for(var R=[],L=0;L<arguments.length;L++)R[L]=arguments[L];var U=j.apply(this,R);return S(),U};return N[Am]=!0,N},E=e.history;if(E?.pushState){var T=Reflect.get(E,"pushState");T[Am]||(E.pushState=w(T))}if(E?.replaceState){var C=Reflect.get(E,"replaceState");C[Am]||(E.replaceState=w(C))}p={callbacks:g,notify:S,onPopStateOrHashChange:function(){return S()},listenersAttached:!1},BE.set(e,p)}var k=p;return k.listenersAttached||(e.addEventListener("popstate",k.onPopStateOrHashChange),e.addEventListener("hashchange",k.onPopStateOrHashChange),k.listenersAttached=!0),k.callbacks.add(t),function(){k.callbacks.delete(t),k.callbacks.size===0&&k.listenersAttached&&(e.removeEventListener("popstate",k.onPopStateOrHashChange),e.removeEventListener("hashchange",k.onPopStateOrHashChange),k.listenersAttached=!1)}}function RA(e){return e===void 0&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,n,r){var a,o,l,c=ce(ce({},e),r),f=c.ugcFilterRules||[],d=(a=c.enablePolling)!==null&&a!==void 0?a:!1,p=(o=c.pollingInterval)!==null&&o!==void 0?o:ny,v=(l=c.captureDocumentTitle)!==null&&l!==void 0?l:!1;if(!n)return function(){};var g=void 0,b=function(){return n.location&&n.location.href||""},S=function(){var T=n.innerHeight,C=n.innerWidth,k=n.document,j=b(),N="";v&&(N=k?.title||"");var R=f.length>0?jd(j,f):j;return{href:R,title:N,viewportHeight:T,viewportWidth:C,type:"url-change-event"}},w=function(){var T=b();if(g===void 0||T!==g){g=T;var C=S();t(C)}},E=jA(n,function(){return w()},d?{enablePolling:!0,pollingInterval:p}:{});return w(),function(){return E()}},options:e}}RA();var mU=(function(){function e(){var t=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.urlChangeCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(n){var r=Ue();r&&(r.removeEventListener("blur",t.blurListener),r.removeEventListener("focus",t.focusListener),!n&&r.addEventListener("blur",t.blurListener),!n&&r.addEventListener("focus",t.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",t.pageLeaveListener),!n&&r.addEventListener("pagehide",t.pageLeaveListener)):(r.removeEventListener("beforeunload",t.pageLeaveListener),!n&&r.addEventListener("beforeunload",t.pageLeaveListener)))},this.blurListener=function(){t.sendEvents()},this.focusListener=function(){t.recordEvents(!1)},this.pageLeaveListener=function(n){t.pageLeaveFns.forEach(function(r){r(n)})},this.evaluateTargetingAndCapture=function(n,r,a,o){return r===void 0&&(r=!1),a===void 0&&(a=!1),o===void 0&&(o=!1),ne(t,void 0,void 0,function(){var l,c,f,d,p,v,g,b,S,w,E,T,C;return te(this,function(k){switch(k.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig)if(r)this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.");else return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];return this.lastTargetingParams=n,l=this.config.targetingConfig,c=l&&!this.sessionTargetingMatch,c?(f=o?this.latestUrlChangeTargetingEvaluationId:void 0,d=n.event,d&&Object.values(sr).includes(d.event_type)&&(d=void 0),p=(T=(S=(b=n.page)===null||b===void 0?void 0:b.url)!==null&&S!==void 0?S:(E=(w=Ue())===null||w===void 0?void 0:w.location)===null||E===void 0?void 0:E.href)!==null&&T!==void 0?T:"",v=(C=n.page)!==null&&C!==void 0?C:p!==""?{url:p}:void 0,[4,pU({sessionId:this.identifiers.sessionId,targetingConfig:l,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:n.userProperties,event:d,page:v},urlChange:o})]):[3,2];case 1:if(g=k.sent(),o&&f!==void 0&&f!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(f,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||g,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:d,targetingParams:n},null,2)),k.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return a||!this.recordCancelCallback?(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]):[3,5];case 4:k.sent(),k.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(n,r,a){return r===void 0&&(r={}),a===void 0&&(a=!0),ne(t,void 0,void 0,function(){var o,l,c,f;return te(this,function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),o=void 0,l=this.config,l&&n!==ya.METADATA?(o={config:dA(l),version:Ov},a?[4,fA()]:[3,2]):[3,2];case 1:c=d.sent(),o=ce(ce({},c),o),d.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(n,ce(ce({},r),o)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(n," due to no ongoing recording.")),[3,4];case 3:return f=d.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",f),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var n;try{t.loggerProvider.log("Session Replay capture stopping."),t.recordCancelCallback&&t.recordCancelCallback(),t.recordCancelCallback=null,(n=t.networkObservers)===null||n===void 0||n.stop()}catch(a){var r=a;t.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new Cv(new ko)}return e.prototype.init=function(t,n){return Sn(this._init(t,n))},e.prototype.setupUrlChangeListenerForTargeting=function(){var t=this,n;(n=this.urlChangeCleanup)===null||n===void 0||n.call(this);var r=Ue();if(r?.location){var a=function(l){var c=++t.latestUrlChangeTargetingEvaluationId;t.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:l}},!1,!1,!0),t.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(c," for ").concat(l,"."))},o=jA(r,a);this.urlChangeCleanup=function(){o(),t.urlChangeCleanup=null}}},e.prototype.getCurrentPageForTargeting=function(){var t,n,r=(n=(t=Ue())===null||t===void 0?void 0:t.location)===null||n===void 0?void 0:n.href;return r!=null?{url:r}:void 0},e.prototype._init=function(t,n){var r,a,o,l,c,f,d,p;return ne(this,void 0,void 0,function(){var v,g,b,S,w,E,T,C,k,j,U,N,R,L,U,G,M,B,X;return te(this,function(oe){switch(oe.label){case 0:return(r=this.urlChangeCleanup)===null||r===void 0||r.call(this),this.loggerProvider=new Cv(n.loggerProvider||new ko),Object.prototype.hasOwnProperty.call(n,"logLevel")&&this.loggerProvider.enable(n.logLevel),this.identifiers=new zE({sessionId:n.sessionId,deviceId:n.deviceId}),v=this,[4,d4(t,n)];case 1:return v.joinedConfigGenerator=oe.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:g=oe.sent(),b=g.joinedConfig,S=g.localConfig,w=g.remoteConfig,this.config=b,this.setMetadata(n.sessionId,b,S,w,(a=n.version)===null||a===void 0?void 0:a.version,Ov,(o=n.version)===null||o===void 0?void 0:o.type),n.sessionId&&(!((l=this.config.interactionConfig)===null||l===void 0)&&l.enabled)&&(E=fU.default({sessionId:n.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[E.send(this.getDeviceId.bind(this)).bind(E)],this.scrollHook=E.hook.bind(E),this.clickHandler=new uU(this.loggerProvider,E)),T=[],C=this.config.storeType,C==="idb"&&!(!((c=Ue())===null||c===void 0)&&c.indexedDB)&&(C="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(C," for event storage.")),oe.label=3;case 3:return oe.trys.push([3,5,,6]),[4,DE({config:this.config,type:"replay",storeType:C})];case 4:return k=oe.sent(),T.push({name:"replay",manager:k}),[3,6];case 5:return j=oe.sent(),U=j,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(U.toString())),[3,6];case 6:if(!(!((f=this.config.interactionConfig)===null||f===void 0)&&f.enabled))return[3,10];N=this.config.interactionConfig.batch?lU:oU,oe.label=7;case 7:return oe.trys.push([7,9,,10]),[4,DE({config:this.config,type:"interaction",minInterval:(d=this.config.interactionConfig.trackEveryNms)!==null&&d!==void 0?d:$3,maxInterval:X3,payloadBatcher:N,storeType:C})];case 8:return R=oe.sent(),T.push({name:"interaction",manager:R}),[3,10];case 9:return L=oe.sent(),U=L,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(U.toString())),[3,10];case 10:return this.eventsManager=new(IE.bind.apply(IE,Qe([void 0],Ae(T),!1))),this.eventCompressor&&this.eventCompressor.terminate(),G=void 0,M=Ue(),this.config.useWebWorker&&M&&M.Worker?[4,Ql(()=>import("./index-D7Bf6Say.js"),[])]:[3,12];case 11:B=oe.sent().compressionScript,G=B,oe.label=12;case 12:return this.eventCompressor=new j4(this.eventsManager,this.config,this.getDeviceId(),G),[4,this.initializeNetworkObservers()];case 13:return oe.sent(),!((p=Ue())===null||p===void 0)&&p.opener&&(X=EC(),TC(X),X.setup(ce({logger:this.loggerProvider},this.config.serverZone&&{endpoint:SC[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:n.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 14:return oe.sent(),this.config.targetingConfig&&this.setupUrlChangeListenerForTargeting(),[2]}})})},e.prototype.setSessionId=function(t,n){return Sn(this.asyncSetSessionId(t,n))},e.prototype.asyncSetSessionId=function(t,n,r){var a;return ne(this,void 0,void 0,function(){var o,l,c;return te(this,function(f){switch(f.label){case 0:return this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,o=this.identifiers&&this.identifiers.sessionId,o&&this.sendEvents(o),l=n||this.getDeviceId(),this.identifiers=new zE({sessionId:t,deviceId:l}),this.joinedConfigGenerator&&o?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:c=f.sent().joinedConfig,this.config=c,f.label=2;case 2:return!((a=this.config)===null||a===void 0)&&a.targetingConfig?[4,this.evaluateTargetingAndCapture({userProperties:r?.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return f.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:f.sent(),f.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var t,n=this.config,r=this.identifiers;if(!n||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var a=this.getShouldRecord(),o={};return a&&(o=(t={},t[P3]=r.sessionReplayId?r.sessionReplayId:null,t),n.debugMode&&(o[V3]=JSON.stringify({appHash:nd(n.apiKey).toString()}))),this.addCustomRRWebEvent(ya.GET_SR_PROPS,{shouldRecord:a,eventProperties:o},this.eventCount===10),this.eventCount===10&&(this.eventCount=0),this.eventCount++,o},e.prototype.sendEvents=function(t){var n,r=t||((n=this.identifiers)===null||n===void 0?void 0:n.sessionId),a=this.getDeviceId();this.eventsManager&&r&&a&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:a})},e.prototype.initialize=function(t){var n;return t===void 0&&(t=!1),ne(this,void 0,void 0,function(){var r;return te(this,function(a){return!((n=this.identifiers)===null||n===void 0)&&n.sessionId?(r=this.getDeviceId(),r?(this.eventsManager&&t&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()])):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){var t,n,r;if(!((t=this.config)===null||t===void 0)&&t.instanceName){var a=Co(this.config.instanceName).identityStore;r=a.getIdentity().optOut}return r!==void 0?r:(n=this.config)===null||n===void 0?void 0:n.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var t=!1,n="",r=!1;if(this.config.targetingConfig)this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),t=!0,r=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),t=!1,r=!1);else{var a=eI(this.identifiers.sessionId,this.config.sampleRate);a?(t=!0,r=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),t=!1,r=!1)}return this.lastShouldRecordDecision!==t&&this.config.targetingConfig&&(this.addCustomRRWebEvent(ya.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:r,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=t),t},e.prototype.getBlockSelectors=function(){var t,n,r,a=(r=(n=(t=this.config)===null||t===void 0?void 0:t.privacyConfig)===null||n===void 0?void 0:n.blockSelector)!==null&&r!==void 0?r:[];if(a.length!==0)return a},e.prototype.getMaskTextSelectors=function(){var t,n,r,a;if(((n=(t=this.config)===null||t===void 0?void 0:t.privacyConfig)===null||n===void 0?void 0:n.defaultMaskLevel)==="conservative")return"*";var o=(a=(r=this.config)===null||r===void 0?void 0:r.privacyConfig)===null||a===void 0?void 0:a.maskSelector;if(o)return o},e.prototype.getRecordingPlugins=function(t){var n,r,a,o,l,c;return ne(this,void 0,void 0,function(){var f,d,p,v;return te(this,function(g){switch(g.label){case 0:f=[];try{d=RA({ugcFilterRules:((r=(n=this.config)===null||n===void 0?void 0:n.interactionConfig)===null||r===void 0?void 0:r.ugcFilterRules)||[],enablePolling:((a=this.config)===null||a===void 0?void 0:a.enableUrlChangePolling)||!1,pollingInterval:(o=this.config)===null||o===void 0?void 0:o.urlChangePollingInterval,captureDocumentTitle:(l=this.config)===null||l===void 0?void 0:l.captureDocumentTitle}),f.push(d)}catch(b){this.loggerProvider.warn("Failed to create URL tracking plugin:",b)}if(!(!((c=t?.console)===null||c===void 0)&&c.enabled))return[3,4];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,Ql(()=>import("./rrweb-plugin-console-record-sPdhR0i8.js"),[])];case 2:return p=g.sent().getRecordConsolePlugin,f.push(p({level:t.console.levels})),[3,4];case 3:return v=g.sent(),this.loggerProvider.warn("Failed to load console plugin:",v),[3,4];case 4:return[2,f.length>0?f:void 0]}})})},e.prototype.getRecordFunction=function(){return ne(this,void 0,void 0,function(){var t,n;return te(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Ql(()=>import("./rrweb-record-CMVXB7aO.js"),[])];case 2:return t=r.sent().record,this.recordFunction=t,[2,t];case 3:return n=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",n),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(t){var n,r,a,o,l,c,f;return t===void 0&&(t=!0),ne(this,void 0,void 0,function(){var d,p,v,g,b,S,w,E,T,C,k,j,N,R=this;return te(this,function(L){switch(L.label){case 0:return d=this.config,p=this.getShouldRecord(),v=(n=this.identifiers)===null||n===void 0?void 0:n.sessionId,!p||!v||!d?[2]:(this.stopRecordingEvents(),[4,this.getRecordFunction()]);case 1:return g=L.sent(),g?[4,this.initializeNetworkObservers()]:[2];case 2:L.sent(),(r=this.networkObservers)===null||r===void 0||r.start(function(U){R.addCustomRRWebEvent(ya.FETCH_REQUEST,U)}),b=d.privacyConfig,S=d.interactionConfig,w=d.loggingConfig,E=S?.enabled?{mouseInteraction:this.eventsManager&&((a=this.clickHandler)===null||a===void 0?void 0:a.createHook({eventsManager:this.eventsManager,sessionId:v,deviceIdFn:this.getDeviceId.bind(this),mirror:g.mirror,ugcFilterRules:(o=S.ugcFilterRules)!==null&&o!==void 0?o:[],performanceOptions:(l=d.performanceConfig)===null||l===void 0?void 0:l.interaction})),scroll:this.scrollHook}:{},T=S?.enabled&&S.ugcFilterRules?S.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(v,".")),L.label=3;case 3:return L.trys.push([3,5,,6]),C=this,k=g,N={emit:function(U){if(R.shouldOptOut()){R.loggerProvider.log("Opting session ".concat(v," out of recording due to optOut config.")),R.stopRecordingEvents(),R.sendEvents();return}U.type===pA.Meta&&(U.data.href=jd(U.data.href,T)),R.eventCompressor&&R.eventCompressor.enqueueEvent(U,v)},inlineStylesheet:d.shouldInlineStylesheet,hooks:E,maskAllInputs:!0,maskTextClass:oA,blockClass:F3,blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:d.applyBackgroundColorToBlockedElements,maskInputFn:wE("input",b),maskTextFn:wE("text",b),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:(c=d.omitElementTags)===null||c===void 0?void 0:c.script,comment:(f=d.omitElementTags)===null||f===void 0?void 0:f.comment},errorHandler:function(U){var G=U;if(G.message.includes("insertRule")&&G.message.includes("CSSStyleSheet")||G._external_)throw G;return R.loggerProvider.warn("Error while capturing replay: ",G.toString()),!0}},[4,this.getRecordingPlugins(w)];case 4:return C.recordCancelCallback=k.apply(void 0,[(N.plugins=L.sent(),N)]),this.addCustomRRWebEvent(ya.DEBUG_INFO),t&&this.addCustomRRWebEvent(ya.METADATA,this.metadata),[3,6];case 5:return j=L.sent(),this.loggerProvider.warn("Failed to initialize session replay:",j),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var t;return(t=this.identifiers)===null||t===void 0?void 0:t.deviceId},e.prototype.getSessionId=function(){var t;return(t=this.identifiers)===null||t===void 0?void 0:t.sessionId},e.prototype.flush=function(t){var n;return t===void 0&&(t=!1),ne(this,void 0,void 0,function(){return te(this,function(r){return[2,(n=this.eventsManager)===null||n===void 0?void 0:n.flush(t)]})})},e.prototype.shutdown=function(){var t;(t=this.urlChangeCleanup)===null||t===void 0||t.call(this),this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(t){return t==="plugin"?"@amplitude/plugin-session-replay-browser":t==="segment"?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(t,n,r,a,o,l,c){var f=t?.toString()?nd(t.toString()):void 0;this.metadata={joinedConfig:n,localConfig:r,remoteConfig:a,sessionId:t,hashValue:f,sampleRate:n.sampleRate,replaySDKType:this.mapSDKType(c),replaySDKVersion:o,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:l}},e.prototype.initializeNetworkObservers=function(){var t,n,r;return ne(this,void 0,void 0,function(){var a,o;return te(this,function(l){switch(l.label){case 0:if(!(!((r=(n=(t=this.config)===null||t===void 0?void 0:t.loggingConfig)===null||n===void 0?void 0:n.network)===null||r===void 0)&&r.enabled&&!this.networkObservers))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Ql(()=>import("./observers-V7q9lNYt.js"),[])];case 2:return a=l.sent().NetworkObservers,this.networkObservers=new a,[3,4];case 3:return o=l.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",o),[3,4];case 4:return[2]}})})},e})(),ts=function(e){return function(){var t=e.config,n=t||hA(),r=n.loggerProvider,a=n.logLevel;return{logger:r,logLevel:a}}},vU=function(){var e=new mU;return{init:rt(e.init.bind(e),"init",ts(e)),evaluateTargetingAndCapture:rt(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",ts(e)),setSessionId:rt(e.setSessionId.bind(e),"setSessionId",ts(e)),getSessionId:rt(e.getSessionId.bind(e),"getSessionId",ts(e)),getSessionReplayProperties:rt(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",ts(e)),flush:rt(e.flush.bind(e),"flush",ts(e)),shutdown:rt(e.shutdown.bind(e),"shutdown",ts(e))}};const gs=vU();var gU=gs.init,yU=gs.setSessionId,bU=gs.getSessionId,xU=gs.getSessionReplayProperties,SU=gs.flush,wU=gs.shutdown,EU=gs.evaluateTargetingAndCapture,TU=function(e){return e===void 0&&(e="$default_instance"),Hg.getInstance(e)},ba;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(ba||(ba={}));var VE;(function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"})(VE||(VE={}));var FE;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(FE||(FE={}));var kU=[ba.SET,ba.SET_ONCE,ba.ADD,ba.APPEND,ba.PREPEND,ba.POSTINSERT],CU=function(e){if(e.user_properties){var t={},n=Object.keys(e.user_properties);return n.forEach(function(r){if(kU.includes(r)){var a=e.user_properties&&e.user_properties[r];t=ce(ce({},t),a)}}),t}},HE="1.26.0",AU="[Amplitude]",NU="".concat(AU," Session Replay ID"),Uv=(function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:SU,getSessionId:bU,getSessionReplayProperties:xU,init:gU,setSessionId:yU,shutdown:wU,evaluateTargetingAndCapture:EU},this.options=ce({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(t,n){var r,a,o,l,c,f,d,p;return ne(this,void 0,void 0,function(){var v,g,b;return te(this,function(S){switch(S.label){case 0:return S.trys.push([0,2,,3]),t?.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(HE,".")),this.config=t,this.options.forceSessionTracking&&(typeof t.defaultTracking=="boolean"?t.defaultTracking===!1&&(t.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):t.defaultTracking=ce(ce({},t.defaultTracking),{sessions:!0})),v=TU(this.config.instanceName).identityStore,g=v.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:(r=this.options.deviceId)!==null&&r!==void 0?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||((a=this.config.remoteConfig)===null||a===void 0?void 0:a.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:(o=this.options.privacyConfig)===null||o===void 0?void 0:o.blockSelector,maskSelector:(l=this.options.privacyConfig)===null||l===void 0?void 0:l.maskSelector,unmaskSelector:(c=this.options.privacyConfig)===null||c===void 0?void 0:c.unmaskSelector,defaultMaskLevel:(f=this.options.privacyConfig)===null||f===void 0?void 0:f.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:HE},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:(d=this.options.useWebWorker)!==null&&d!==void 0?d:(p=this.options.experimental)===null||p===void 0?void 0:p.useWebWorker,userProperties:g,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},[4,this.sessionReplay.init(t.apiKey,this.srInitOptions).promise];case 1:return S.sent(),[3,3];case 2:return b=S.sent(),t?.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(b.message)),[3,3];case 3:return[2]}})})},e.prototype.onSessionIdChanged=function(t){var n;return ne(this,void 0,void 0,function(){return te(this,function(r){switch(r.label){case 0:return(n=this.config)===null||n===void 0||n.loggerProvider.debug("Analytics session id is changed to ".concat(t,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(t).promise];case 1:return r.sent(),[2]}})})},e.prototype.onOptOutChanged=function(t){var n;return ne(this,void 0,void 0,function(){var r;return te(this,function(a){switch(a.label){case 0:return(n=this.config)===null||n===void 0||n.loggerProvider.debug("optOut is changed to ".concat(String(t),", calling ").concat(t?"sessionReplay.shutdown()":"sessionReplay.init()",".")),t?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return r=this.config!=null,r?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:r=a.sent(),a.label=3;case 3:a.label=4;case 4:return[2]}})})},e.prototype.execute=function(t){var n,r,a;return ne(this,void 0,void 0,function(){var o,f,o,l,c,f,d;return te(this,function(p){switch(p.label){case 0:return p.trys.push([0,9,,10]),this.options.customSessionId?(o=this.options.customSessionId(t),o?o===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(o).promise]:[3,3]):[3,4];case 1:p.sent(),p.label=2;case 2:f=this.sessionReplay.getSessionReplayProperties(),t.event_properties=ce(ce({},t.event_properties),f),p.label=3;case 3:return[3,8];case 4:return o=(n=this.config)===null||n===void 0?void 0:n.sessionId,o&&o!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(o).promise]:[3,6];case 5:p.sent(),p.label=6;case 6:return o&&o===t.session_id?(l=void 0,t.event_type===sr.IDENTIFY&&(l=CU(t)),c=Ue(),[4,this.sessionReplay.evaluateTargetingAndCapture({event:t,userProperties:l,page:((r=c?.location)===null||r===void 0?void 0:r.href)!=null?{url:c.location.href}:void 0})]):[3,8];case 7:p.sent(),f=this.sessionReplay.getSessionReplayProperties(),t.event_properties=ce(ce({},t.event_properties),f),p.label=8;case 8:return t.event_type===sr.IDENTIFY&&t.event_properties&&delete t.event_properties[NU],[2,Promise.resolve(t)];case 9:return d=p.sent(),(a=this.config)===null||a===void 0||a.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(d.message)),[2,Promise.resolve(t)];case 10:return[2]}})})},e.prototype.teardown=function(){var t;return ne(this,void 0,void 0,function(){return te(this,function(n){try{this.sessionReplay.shutdown(),this.config=null}catch(r){(t=this.config)===null||t===void 0||t.loggerProvider.error("Session Replay: teardown failed due to ".concat(r.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e})(),jU=function(e){return new Uv(e)},zv=function(e,t){return zv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},zv(e,t)};function _A(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");zv(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Sa=function(){return Sa=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Sa.apply(this,arguments)};function OA(e,t,n,r){function a(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function c(p){try{d(r.next(p))}catch(v){l(v)}}function f(p){try{d(r.throw(p))}catch(v){l(v)}}function d(p){p.done?o(p.value):a(p.value).then(c,f)}d((r=r.apply(e,[])).next())})}function MA(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=c(0),l.throw=c(1),l.return=c(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(d){return function(p){return f([d,p])}}function f(d){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,d[0]&&(n=0)),n;)try{if(r=1,a&&(o=d[0]&2?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,a=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){n.label=d[1];break}if(d[0]===6&&n.label<o[1]){n.label=o[1],o=d;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(d);break}o[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(p){d=[6,p],a=0}finally{r=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Tr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function sy(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}function oy(e,t,n){if(arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Re={IS:"is",IS_NOT:"is not",CONTAINS:"contains",DOES_NOT_CONTAIN:"does not contain",LESS_THAN:"less",LESS_THAN_EQUALS:"less or equal",GREATER_THAN:"greater",GREATER_THAN_EQUALS:"greater or equal",VERSION_LESS_THAN:"version less",VERSION_LESS_THAN_EQUALS:"version less or equal",VERSION_GREATER_THAN:"version greater",VERSION_GREATER_THAN_EQUALS:"version greater or equal",SET_IS:"set is",SET_IS_NOT:"set is not",SET_CONTAINS:"set contains",SET_DOES_NOT_CONTAIN:"set does not contain",SET_CONTAINS_ANY:"set contains any",SET_DOES_NOT_CONTAIN_ANY:"set does not contain any",REGEX_MATCH:"regex match",REGEX_DOES_NOT_MATCH:"regex does not match"},RU=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var a=e.charCodeAt(r);a<128?t[n++]=a:a<2048?(t[n++]=a>>6|192,t[n++]=a&63|128):(a&64512)==55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)==56320?(a=65536+((a&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=a>>18|240,t[n++]=a>>12&63|128,t[n++]=a>>6&63|128,t[n++]=a&63|128):(t[n++]=a>>12|224,t[n++]=a>>6&63|128,t[n++]=a&63|128)}return Uint8Array.from(t)},Pf=-862048943,Uf=461845907,zf=15,_U=13,OU=5,MU=-430675100,DU=function(e,t){t===void 0&&(t=0);for(var n=RU(e),r=n.length,a=r>>2,o=t,l=0;l<a;l++){var c=l<<2,f=PU(n,c);o=IU(f,o)}var d=a<<2,p=0;switch(r-d){case 3:p^=n[d+2]<<16,p^=n[d+1]<<8,p^=n[d],p=Math.imul(p,Pf),p=uu(p,zf),p=Math.imul(p,Uf),o^=p;break;case 2:p^=n[d+1]<<8,p^=n[d],p=Math.imul(p,Pf),p=uu(p,zf),p=Math.imul(p,Uf),o^=p;break;case 1:p^=n[d],p=Math.imul(p,Pf),p=uu(p,zf),p=Math.imul(p,Uf),o^=p;break}return o^=r,LU(o)>>>0},IU=function(e,t){var n=e,r=t;return n=Math.imul(n,Pf),n=uu(n,zf),n=Math.imul(n,Uf),r^=n,r=uu(r,_U),r=Math.imul(r,OU),r+MU|0},LU=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16,t},uu=function(e,t,n){n===void 0&&(n=32),t>n&&(t=t%n);var r=4294967295<<n-t>>>0,a=(e&r)>>>0>>>n-t>>>0;return(e<<t|a)>>>0},PU=function(e,t){t===void 0&&(t=0);var n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return UU(n)},UU=function(e){return(e&-16777216)>>>24|(e&16711680)>>>8|(e&65280)<<8|(e&255)<<24},qE=function(e,t){var n,r;if(!(!t||t.length===0)){try{for(var a=Tr(t),o=a.next();!o.done;o=a.next()){var l=o.value;if(!l||!e||typeof e!="object")return;e=e[l]}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}if(e!=null)return e}},zU="(\\d+)\\.(\\d+)",BU="(\\d+)",VU="(-(([-\\w]+\\.?)*))?",FU="^".concat(zU,"(\\.").concat(BU).concat(VU,")?$"),HU=(function(){function e(t,n,r,a){a===void 0&&(a=void 0),this.major=t,this.minor=n,this.patch=r,this.preRelease=a}return e.parse=function(t){if(t){var n=new RegExp(FU).exec(t);if(n){var r=Number(n[1]),a=Number(n[2]);if(!(isNaN(r)||isNaN(a))){var o=Number(n[4])||0,l=n[5]||void 0;return new e(r,a,o,l)}}}},e.prototype.compareTo=function(t){return this.major>t.major?1:this.major<t.major?-1:this.minor>t.minor?1:this.minor<t.minor?-1:this.patch>t.patch?1:this.patch<t.patch||this.preRelease&&!t.preRelease?-1:!this.preRelease&&t.preRelease?1:this.preRelease&&t.preRelease?this.preRelease>t.preRelease?1:this.preRelease<t.preRelease?-1:0:0},e})(),qU=(function(){function e(){}return e.prototype.evaluate=function(t,n){var r,a,o={},l={context:t,result:o};try{for(var c=Tr(n),f=c.next();!f.done;f=c.next()){var d=f.value,p=this.evaluateFlag(l,d);p&&(o[d.key]=p)}}catch(v){r={error:v}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}return o},e.prototype.evaluateFlag=function(t,n){var r,a,o;try{for(var l=Tr(n.segments),c=l.next();!c.done;c=l.next()){var f=c.value;if(o=this.evaluateSegment(t,n,f),o){var d=Sa(Sa(Sa({},n.metadata),f.metadata),o.metadata);o=Sa(Sa({},o),{metadata:d});break}}}catch(p){r={error:p}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o},e.prototype.evaluateSegment=function(t,n,r){if(!r.conditions){var a=this.bucket(t,r);return a!==void 0?n.variants[a]:void 0}var o=this.evaluateConditions(t,r.conditions);if(o){var a=this.bucket(t,r);return a!==void 0?n.variants[a]:void 0}},e.prototype.evaluateConditions=function(t,n){var r,a,o,l;try{for(var c=Tr(n),f=c.next();!f.done;f=c.next()){var d=f.value,p=!0;try{for(var v=(o=void 0,Tr(d)),g=v.next();!g.done;g=v.next()){var b=g.value;if(p=this.matchCondition(t,b),!p)break}}catch(S){o={error:S}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(o)throw o.error}}if(p)return!0}}catch(S){r={error:S}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(t,n){var r=qE(t,n.selector);if(r==null)return this.matchNull(n.op,n.values);if(this.isSetOperator(n.op)){var a=this.coerceStringArray(r);return a?this.matchSet(a,n.op,n.values):!1}else{var o=this.coerceString(r);return o!==void 0?this.matchString(o,n.op,n.values):!1}},e.prototype.getHash=function(t){return DU(t)},e.prototype.bucket=function(t,n){var r,a,o,l;if(!n.bucket)return n.variant;var c=this.coerceString(qE(t,n.bucket.selector));if(!c||c.length===0)return n.variant;var f="".concat(n.bucket.salt,"/").concat(c),d=this.getHash(f),p=d%100,v=Math.floor(d/100);try{for(var g=Tr(n.bucket.allocations),b=g.next();!b.done;b=g.next()){var S=b.value,w=S.range[0],E=S.range[1];if(p>=w&&p<E)try{for(var T=(o=void 0,Tr(S.distributions)),C=T.next();!C.done;C=T.next()){var k=C.value,j=k.range[0],N=k.range[1];if(v>=j&&v<N)return k.variant}}catch(R){o={error:R}}finally{try{C&&!C.done&&(l=T.return)&&l.call(T)}finally{if(o)throw o.error}}}}catch(R){r={error:R}}finally{try{b&&!b.done&&(a=g.return)&&a.call(g)}finally{if(r)throw r.error}}return n.variant},e.prototype.matchNull=function(t,n){var r=this.containsNone(n);switch(t){case Re.IS:case Re.CONTAINS:case Re.LESS_THAN:case Re.LESS_THAN_EQUALS:case Re.GREATER_THAN:case Re.GREATER_THAN_EQUALS:case Re.VERSION_LESS_THAN:case Re.VERSION_LESS_THAN_EQUALS:case Re.VERSION_GREATER_THAN:case Re.VERSION_GREATER_THAN_EQUALS:case Re.SET_IS:case Re.SET_CONTAINS:case Re.SET_CONTAINS_ANY:return r;case Re.IS_NOT:case Re.DOES_NOT_CONTAIN:case Re.SET_DOES_NOT_CONTAIN:case Re.SET_DOES_NOT_CONTAIN_ANY:return!r;default:return!1}},e.prototype.matchSet=function(t,n,r){switch(n){case Re.SET_IS:return this.setEquals(t,r);case Re.SET_IS_NOT:return!this.setEquals(t,r);case Re.SET_CONTAINS:return this.matchesSetContainsAll(t,r);case Re.SET_DOES_NOT_CONTAIN:return!this.matchesSetContainsAll(t,r);case Re.SET_CONTAINS_ANY:return this.matchesSetContainsAny(t,r);case Re.SET_DOES_NOT_CONTAIN_ANY:return!this.matchesSetContainsAny(t,r);default:return!1}},e.prototype.matchString=function(t,n,r){var a=this;switch(n){case Re.IS:return this.matchesIs(t,r);case Re.IS_NOT:return!this.matchesIs(t,r);case Re.CONTAINS:return this.matchesContains(t,r);case Re.DOES_NOT_CONTAIN:return!this.matchesContains(t,r);case Re.LESS_THAN:case Re.LESS_THAN_EQUALS:case Re.GREATER_THAN:case Re.GREATER_THAN_EQUALS:return this.matchesComparable(t,n,r,function(o){return a.parseNumber(o)},this.comparator);case Re.VERSION_LESS_THAN:case Re.VERSION_LESS_THAN_EQUALS:case Re.VERSION_GREATER_THAN:case Re.VERSION_GREATER_THAN_EQUALS:return this.matchesComparable(t,n,r,function(o){return HU.parse(o)},this.versionComparator);case Re.REGEX_MATCH:return this.matchesRegex(t,r);case Re.REGEX_DOES_NOT_MATCH:return!this.matchesRegex(t,r);default:return!1}},e.prototype.matchesIs=function(t,n){if(this.containsBooleans(n)){var r=t.toLowerCase();if(r==="true"||r==="false")return n.some(function(a){return a.toLowerCase()===r})}return n.some(function(a){return t===a})},e.prototype.matchesContains=function(t,n){var r,a;try{for(var o=Tr(n),l=o.next();!l.done;l=o.next()){var c=l.value;if(t.toLowerCase().includes(c.toLowerCase()))return!0}}catch(f){r={error:f}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(t,n,r,a,o){var l=this,c=a(t),f=r.map(function(d){return a(d)}).filter(function(d){return d!==void 0});return c===void 0||f.length===0?r.some(function(d){return l.comparator(t,n,d)}):f.some(function(d){return o(c,n,d)})},e.prototype.comparator=function(t,n,r){switch(n){case Re.LESS_THAN:case Re.VERSION_LESS_THAN:return t<r;case Re.LESS_THAN_EQUALS:case Re.VERSION_LESS_THAN_EQUALS:return t<=r;case Re.GREATER_THAN:case Re.VERSION_GREATER_THAN:return t>r;case Re.GREATER_THAN_EQUALS:case Re.VERSION_GREATER_THAN_EQUALS:return t>=r;default:return!1}},e.prototype.versionComparator=function(t,n,r){var a=t.compareTo(r);switch(n){case Re.LESS_THAN:case Re.VERSION_LESS_THAN:return a<0;case Re.LESS_THAN_EQUALS:case Re.VERSION_LESS_THAN_EQUALS:return a<=0;case Re.GREATER_THAN:case Re.VERSION_GREATER_THAN:return a>0;case Re.GREATER_THAN_EQUALS:case Re.VERSION_GREATER_THAN_EQUALS:return a>=0;default:return!1}},e.prototype.matchesRegex=function(t,n){return n.some(function(r){return!!new RegExp(r).exec(t)})},e.prototype.containsNone=function(t){return t.some(function(n){return n==="(none)"})},e.prototype.containsBooleans=function(t){return t.some(function(n){switch(n.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(t){var n;return(n=Number(t))!==null&&n!==void 0?n:void 0},e.prototype.coerceString=function(t){if(t!=null)return typeof t=="object"?JSON.stringify(t):String(t)},e.prototype.coerceStringArray=function(t){var n=this;if(Array.isArray(t)){var r=t;return r.map(function(c){return n.coerceString(c)}).filter(Boolean)}var a=String(t);try{var o=JSON.parse(a);if(Array.isArray(o)){var r=t;return r.map(function(f){return n.coerceString(f)}).filter(Boolean)}else{var l=this.coerceString(a);return l?[l]:void 0}}catch{var l=this.coerceString(a);return l?[l]:void 0}},e.prototype.isSetOperator=function(t){switch(t){case Re.SET_IS:case Re.SET_IS_NOT:case Re.SET_CONTAINS:case Re.SET_DOES_NOT_CONTAIN:case Re.SET_CONTAINS_ANY:case Re.SET_DOES_NOT_CONTAIN_ANY:return!0;default:return!1}},e.prototype.setEquals=function(t,n){var r=new Set(t),a=new Set(n);return r.size===a.size&&oy([],sy(a),!1).every(function(o){return r.has(o)})},e.prototype.matchesSetContainsAll=function(t,n){var r,a;if(t.length<n.length)return!1;try{for(var o=Tr(n),l=o.next();!l.done;l=o.next()){var c=l.value;if(!this.matchesIs(c,t))return!1}}catch(f){r={error:f}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(t,n){var r,a;try{for(var o=Tr(n),l=o.next();!l.done;l=o.next()){var c=l.value;if(this.matchesIs(c,t))return!0}}catch(f){r={error:f}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return!1},e})(),GU=function(e,t){var n,r,a=Sa({},e),o=[],l=t||Object.keys(a);try{for(var c=Tr(l),f=c.next();!f.done;f=c.next()){var d=f.value,p=DA(d,a);p&&o.push.apply(o,oy([],sy(p),!1))}}catch(v){n={error:v}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return o},DA=function(e,t,n){var r,a;n===void 0&&(n=[]);var o=t[e];if(o){if(!o.dependencies||o.dependencies.length===0)return delete t[o.key],[o]}else return;n.push(o.key);var l=[],c=function(v){if(n.some(function(b){return b===v}))throw Error("Detected a cycle between flags ".concat(n));var g=DA(v,t,n);g&&l.push.apply(l,oy([],sy(g),!1))};try{for(var f=Tr(o.dependencies),d=f.next();!d.done;d=f.next()){var p=d.value;c(p)}}catch(v){r={error:v}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}return l.push(o),n.pop(),delete t[o.key],l};const IA="3.7.7",KU=IA,Io=typeof Buffer=="function",GE=typeof TextDecoder=="function"?new TextDecoder:void 0,KE=typeof TextEncoder=="function"?new TextEncoder:void 0,YU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Jl=Array.prototype.slice.call(YU),gf=(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(Jl),$U=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Tn=String.fromCharCode.bind(String),YE=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),LA=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),PA=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),UA=e=>{let t,n,r,a,o="";const l=e.length%3;for(let c=0;c<e.length;){if((n=e.charCodeAt(c++))>255||(r=e.charCodeAt(c++))>255||(a=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,o+=Jl[t>>18&63]+Jl[t>>12&63]+Jl[t>>6&63]+Jl[t&63]}return l?o.slice(0,l-3)+"===".substring(l):o},ly=typeof btoa=="function"?e=>btoa(e):Io?e=>Buffer.from(e,"binary").toString("base64"):UA,Bv=Io?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,a=e.length;r<a;r+=4096)n.push(Tn.apply(null,e.subarray(r,r+4096)));return ly(n.join(""))},Bf=(e,t=!1)=>t?LA(Bv(e)):Bv(e),XU=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Tn(192|t>>>6)+Tn(128|t&63):Tn(224|t>>>12&15)+Tn(128|t>>>6&63)+Tn(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Tn(240|t>>>18&7)+Tn(128|t>>>12&63)+Tn(128|t>>>6&63)+Tn(128|t&63)}},WU=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,zA=e=>e.replace(WU,XU),$E=Io?e=>Buffer.from(e,"utf8").toString("base64"):KE?e=>Bv(KE.encode(e)):e=>ly(zA(e)),bo=(e,t=!1)=>t?LA($E(e)):$E(e),XE=e=>bo(e,!0),QU=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,JU=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return Tn((n>>>10)+55296)+Tn((n&1023)+56320);case 3:return Tn((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Tn((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},BA=e=>e.replace(QU,JU),VA=e=>{if(e=e.replace(/\s+/g,""),!$U.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,n="",r,a;for(let o=0;o<e.length;)t=gf[e.charAt(o++)]<<18|gf[e.charAt(o++)]<<12|(r=gf[e.charAt(o++)])<<6|(a=gf[e.charAt(o++)]),n+=r===64?Tn(t>>16&255):a===64?Tn(t>>16&255,t>>8&255):Tn(t>>16&255,t>>8&255,t&255);return n},uy=typeof atob=="function"?e=>atob(PA(e)):Io?e=>Buffer.from(e,"base64").toString("binary"):VA,FA=Io?e=>YE(Buffer.from(e,"base64")):e=>YE(uy(e).split("").map(t=>t.charCodeAt(0))),HA=e=>FA(qA(e)),ZU=Io?e=>Buffer.from(e,"base64").toString("utf8"):GE?e=>GE.decode(FA(e)):e=>BA(uy(e)),qA=e=>PA(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Vv=e=>ZU(qA(e)),e6=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},GA=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),KA=function(){const e=(t,n)=>Object.defineProperty(String.prototype,t,GA(n));e("fromBase64",function(){return Vv(this)}),e("toBase64",function(t){return bo(this,t)}),e("toBase64URI",function(){return bo(this,!0)}),e("toBase64URL",function(){return bo(this,!0)}),e("toUint8Array",function(){return HA(this)})},YA=function(){const e=(t,n)=>Object.defineProperty(Uint8Array.prototype,t,GA(n));e("toBase64",function(t){return Bf(this,t)}),e("toBase64URI",function(){return Bf(this,!0)}),e("toBase64URL",function(){return Bf(this,!0)})},t6=()=>{KA(),YA()},Fv={version:IA,VERSION:KU,atob:uy,atobPolyfill:VA,btoa:ly,btoaPolyfill:UA,fromBase64:Vv,toBase64:bo,encode:bo,encodeURI:XE,encodeURL:XE,utob:zA,btou:BA,decode:Vv,isValid:e6,fromUint8Array:Bf,toUint8Array:HA,extendString:KA,extendUint8Array:YA,extendBuiltins:t6};var $A=(function(e){_A(t,e);function t(n,r){var a=e.call(this,r)||this;return a.statusCode=n,Object.setPrototypeOf(a,t.prototype),a}return t})(Error),Hv=(function(e){_A(t,e);function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return t})(Error),n6=(function(){function e(t,n,r){this.deploymentKey=t,this.serverUrl=n,this.httpClient=r}return e.prototype.getVariants=function(t,n){return OA(this,void 0,void 0,function(){var r,a,o,l;return MA(this,function(c){switch(c.label){case 0:return r=Fv.encodeURL(JSON.stringify(t)),a={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},n?.flagKeys&&(a["X-Amp-Exp-Flag-Keys"]=Fv.encodeURL(JSON.stringify(n.flagKeys))),n?.trackingOption&&(a["X-Amp-Exp-Track"]=n.trackingOption),n?.exposureTrackingOption&&(a["X-Amp-Exp-Exposure-Track"]=n.exposureTrackingOption),o=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),n?.evaluationMode&&o.searchParams.append("eval_mode",n?.evaluationMode),n?.deliveryMethod&&o.searchParams.append("delivery_method",n?.deliveryMethod),[4,this.httpClient.request({requestUrl:o.toString(),method:"GET",headers:a,timeoutMillis:n?.timeoutMillis})];case 1:if(l=c.sent(),l.status!=200)throw new $A(l.status,"Fetch error response: status=".concat(l.status));return[2,JSON.parse(l.body)]}})})},e})(),r6=(function(){function e(t,n,r){this.deploymentKey=t,this.serverUrl=n,this.httpClient=r}return e.prototype.getFlags=function(t){return OA(this,void 0,void 0,function(){var n,r,a;return MA(this,function(o){switch(o.label){case 0:return n={Authorization:"Api-Key ".concat(this.deploymentKey)},t?.libraryName&&t?.libraryVersion&&(n["X-Amp-Exp-Library"]="".concat(t.libraryName,"/").concat(t.libraryVersion)),t?.user&&(n["X-Amp-Exp-User"]=Fv.encodeURL(JSON.stringify(t.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+(t?.deliveryMethod?"?delivery_method=".concat(t.deliveryMethod):""),method:"GET",headers:n,timeoutMillis:t?.timeoutMillis})];case 1:if(r=o.sent(),r.status!=200)throw Error("Flags error response: status=".concat(r.status));return a=JSON.parse(r.body),[2,a.reduce(function(l,c){return l[c.key]=c,l},{})]}})})},e})(),ln=typeof globalThis<"u"?globalThis:global||self,ys=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},i6=function(){var e=ys();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch{return!1}return!1},a6=(function(){function e(t,n){this.poller=void 0,this.action=t,this.ms=n}return e.prototype.start=function(){this.poller||(this.poller=ln.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(ln.clearInterval(this.poller),this.poller=void 0)},e})(),Zl={exports:{}},s6=Zl.exports,WE;function o6(){return WE||(WE=1,(function(e,t){(function(n,r){var a="0.7.33",o="",l="?",c="function",f="undefined",d="object",p="string",v="major",g="model",b="name",S="type",w="vendor",E="version",T="architecture",C="console",k="mobile",j="tablet",N="smarttv",R="wearable",L="embedded",U=350,G="Amazon",M="Apple",B="ASUS",X="BlackBerry",oe="Browser",ue="Chrome",Z="Edge",V="Firefox",W="Google",$="Huawei",he="LG",I="Microsoft",z="Motorola",ee="Opera",D="Samsung",de="Sharp",ye="Sony",Se="Xiaomi",we="Zebra",Le="Facebook",je=function(ze,Me){var Q={};for(var H in ze)Me[H]&&Me[H].length%2===0?Q[H]=Me[H].concat(ze[H]):Q[H]=ze[H];return Q},ge=function(ze){for(var Me={},Q=0;Q<ze.length;Q++)Me[ze[Q].toUpperCase()]=ze[Q];return Me},Pe=function(ze,Me){return typeof ze===p?xt(Me).indexOf(xt(ze))!==-1:!1},xt=function(ze){return ze.toLowerCase()},Ot=function(ze){return typeof ze===p?ze.replace(/[^\d\.]/g,o).split(".")[0]:r},$e=function(ze,Me){if(typeof ze===p)return ze=ze.replace(/^\s\s*/,o),typeof Me===f?ze:ze.substring(0,U)},Nt=function(ze,Me){for(var Q=0,H,se,Te,Ee,Be,lt;Q<Me.length&&!Be;){var $t=Me[Q],vt=Me[Q+1];for(H=se=0;H<$t.length&&!Be;)if(Be=$t[H++].exec(ze),Be)for(Te=0;Te<vt.length;Te++)lt=Be[++se],Ee=vt[Te],typeof Ee===d&&Ee.length>0?Ee.length===2?typeof Ee[1]==c?this[Ee[0]]=Ee[1].call(this,lt):this[Ee[0]]=Ee[1]:Ee.length===3?typeof Ee[1]===c&&!(Ee[1].exec&&Ee[1].test)?this[Ee[0]]=lt?Ee[1].call(this,lt,Ee[2]):r:this[Ee[0]]=lt?lt.replace(Ee[1],Ee[2]):r:Ee.length===4&&(this[Ee[0]]=lt?Ee[3].call(this,lt.replace(Ee[1],Ee[2])):r):this[Ee]=lt||r;Q+=2}},ot=function(ze,Me){for(var Q in Me)if(typeof Me[Q]===d&&Me[Q].length>0){for(var H=0;H<Me[Q].length;H++)if(Pe(Me[Q][H],ze))return Q===l?r:Q}else if(Pe(Me[Q],ze))return Q===l?r:Q;return ze},Bt={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Yt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Jt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[b,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[b,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[b,E],[/opios[\/ ]+([\w\.]+)/i],[E,[b,ee+" Mini"]],[/\bopr\/([\w\.]+)/i],[E,[b,ee]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[b,E],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[b,"UC"+oe]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[E,[b,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[E,[b,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[b,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[b,"IE"]],[/yabrowser\/([\w\.]+)/i],[E,[b,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[b,/(.+)/,"$1 Secure "+oe],E],[/\bfocus\/([\w\.]+)/i],[E,[b,V+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[b,ee+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[b,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[b,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[b,ee+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[b,"MIUI "+oe]],[/fxios\/([-\w\.]+)/i],[E,[b,V]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+oe]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+oe],E],[/(comodo_dragon)\/([\w\.]+)/i],[[b,/_/g," "],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[b,E],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[b],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[b,Le],E],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[b,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[b,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[b,ue+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,ue+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[b,"Android "+oe]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[b,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[b,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,b],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[b,[E,ot,Bt]],[/(webkit|khtml)\/([\w\.]+)/i],[b,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[b,V+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[b,E],[/(cobalt)\/([\w\.]+)/i],[b,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[T,"amd64"]],[/(ia32(?=;))/i],[[T,xt]],[/((?:i[346]|x)86)[;\)]/i],[[T,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[T,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[T,"armhf"]],[/windows (ce|mobile); ppc;/i],[[T,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[T,/ower/,o,xt]],[/(sun4\w)[;\)]/i],[[T,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[T,xt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[g,[w,D],[S,j]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[g,[w,D],[S,k]],[/((ipod|iphone)\d+,\d+)/i],[g,[w,M],[S,k]],[/(ipad\d+,\d+)/i],[g,[w,M],[S,j]],[/\((ip(?:hone|od)[\w ]*);/i],[g,[w,M],[S,k]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[g,[w,M],[S,j]],[/(macintosh);/i],[g,[w,M]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[g,[w,$],[S,j]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[g,[w,$],[S,k]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[g,/_/g," "],[w,Se],[S,k]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[g,/_/g," "],[w,Se],[S,j]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[g,[w,"OPPO"],[S,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[g,[w,"Vivo"],[S,k]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[g,[w,"Realme"],[S,k]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[g,[w,z],[S,k]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[g,[w,z],[S,j]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[g,[w,he],[S,j]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[g,[w,he],[S,k]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[g,[w,"Lenovo"],[S,j]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[g,/_/g," "],[w,"Nokia"],[S,k]],[/(pixel c)\b/i],[g,[w,W],[S,j]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[g,[w,W],[S,k]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[g,[w,ye],[S,k]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[g,"Xperia Tablet"],[w,ye],[S,j]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[g,[w,"OnePlus"],[S,k]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[g,[w,G],[S,j]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[g,/(.+)/g,"Fire Phone $1"],[w,G],[S,k]],[/(playbook);[-\w\),; ]+(rim)/i],[g,w,[S,j]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[g,[w,X],[S,k]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[g,[w,B],[S,j]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[g,[w,B],[S,k]],[/(nexus 9)/i],[g,[w,"HTC"],[S,j]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[w,[g,/_/g," "],[S,k]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[g,[w,"Acer"],[S,j]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[g,[w,"Meizu"],[S,k]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[g,[w,de],[S,k]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[w,g,[S,k]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[w,g,[S,j]],[/(surface duo)/i],[g,[w,I],[S,j]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[g,[w,"Fairphone"],[S,k]],[/(u304aa)/i],[g,[w,"AT&T"],[S,k]],[/\bsie-(\w*)/i],[g,[w,"Siemens"],[S,k]],[/\b(rct\w+) b/i],[g,[w,"RCA"],[S,j]],[/\b(venue[\d ]{2,7}) b/i],[g,[w,"Dell"],[S,j]],[/\b(q(?:mv|ta)\w+) b/i],[g,[w,"Verizon"],[S,j]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[g,[w,"Barnes & Noble"],[S,j]],[/\b(tm\d{3}\w+) b/i],[g,[w,"NuVision"],[S,j]],[/\b(k88) b/i],[g,[w,"ZTE"],[S,j]],[/\b(nx\d{3}j) b/i],[g,[w,"ZTE"],[S,k]],[/\b(gen\d{3}) b.+49h/i],[g,[w,"Swiss"],[S,k]],[/\b(zur\d{3}) b/i],[g,[w,"Swiss"],[S,j]],[/\b((zeki)?tb.*\b) b/i],[g,[w,"Zeki"],[S,j]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[w,"Dragon Touch"],g,[S,j]],[/\b(ns-?\w{0,9}) b/i],[g,[w,"Insignia"],[S,j]],[/\b((nxa|next)-?\w{0,9}) b/i],[g,[w,"NextBook"],[S,j]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[w,"Voice"],g,[S,k]],[/\b(lvtel\-)?(v1[12]) b/i],[[w,"LvTel"],g,[S,k]],[/\b(ph-1) /i],[g,[w,"Essential"],[S,k]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[g,[w,"Envizen"],[S,j]],[/\b(trio[-\w\. ]+) b/i],[g,[w,"MachSpeed"],[S,j]],[/\btu_(1491) b/i],[g,[w,"Rotor"],[S,j]],[/(shield[\w ]+) b/i],[g,[w,"Nvidia"],[S,j]],[/(sprint) (\w+)/i],[w,g,[S,k]],[/(kin\.[onetw]{3})/i],[[g,/\./g," "],[w,I],[S,k]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[g,[w,we],[S,j]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[g,[w,we],[S,k]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[w,g,[S,C]],[/droid.+; (shield) bui/i],[g,[w,"Nvidia"],[S,C]],[/(playstation [345portablevi]+)/i],[g,[w,ye],[S,C]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[g,[w,I],[S,C]],[/smart-tv.+(samsung)/i],[w,[S,N]],[/hbbtv.+maple;(\d+)/i],[[g,/^/,"SmartTV"],[w,D],[S,N]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[w,he],[S,N]],[/(apple) ?tv/i],[w,[g,M+" TV"],[S,N]],[/crkey/i],[[g,ue+"cast"],[w,W],[S,N]],[/droid.+aft(\w)( bui|\))/i],[g,[w,G],[S,N]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[g,[w,de],[S,N]],[/(bravia[\w ]+)( bui|\))/i],[g,[w,ye],[S,N]],[/(mitv-\w{5}) bui/i],[g,[w,Se],[S,N]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[w,$e],[g,$e],[S,N]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[S,N]],[/((pebble))app/i],[w,g,[S,R]],[/droid.+; (glass) \d/i],[g,[w,W],[S,R]],[/droid.+; (wt63?0{2,3})\)/i],[g,[w,we],[S,R]],[/(quest( 2)?)/i],[g,[w,Le],[S,R]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[w,[S,L]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[g,[S,k]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[g,[S,j]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[S,j]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[S,k]],[/(android[-\w\. ]{0,9});.+buil/i],[g,[w,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[b,Z+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[b,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[b,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,b]],os:[[/microsoft (windows) (vista|xp)/i],[b,E],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[b,[E,ot,Yt]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[E,ot,Yt]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[b,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[b,"Mac OS"],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,b],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[b,E],[/\(bb(10);/i],[E,[b,X]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[b,V+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[b,"webOS"]],[/crkey\/([\d\.]+)/i],[E,[b,ue+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[b,"Chromium OS"],E],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[b,E],[/(sunos) ?([\w\.\d]*)/i],[[b,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[b,E]]},mt=function(ze,Me){if(typeof ze===d&&(Me=ze,ze=r),!(this instanceof mt))return new mt(ze,Me).getResult();var Q=ze||(typeof n!==f&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:o),H=Me?je(Jt,Me):Jt;return this.getBrowser=function(){var se={};return se[b]=r,se[E]=r,Nt.call(se,Q,H.browser),se.major=Ot(se.version),se},this.getCPU=function(){var se={};return se[T]=r,Nt.call(se,Q,H.cpu),se},this.getDevice=function(){var se={};return se[w]=r,se[g]=r,se[S]=r,Nt.call(se,Q,H.device),se},this.getEngine=function(){var se={};return se[b]=r,se[E]=r,Nt.call(se,Q,H.engine),se},this.getOS=function(){var se={};return se[b]=r,se[E]=r,Nt.call(se,Q,H.os),se},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Q},this.setUA=function(se){return Q=typeof se===p&&se.length>U?$e(se,U):se,this},this.setUA(Q),this};mt.VERSION=a,mt.BROWSER=ge([b,E,v]),mt.CPU=ge([T]),mt.DEVICE=ge([g,w,S,C,k,N,j,R,L]),mt.ENGINE=mt.OS=ge([b,E]),e.exports&&(t=e.exports=mt),t.UAParser=mt;var at=typeof n!==f&&(n.jQuery||n.Zepto);if(at&&!at.ua){var On=new mt;at.ua=On.getResult(),at.ua.get=function(){return On.getUA()},at.ua.set=function(ze){On.setUA(ze);var Me=On.getResult();for(var Q in Me)at.ua[Q]=Me[Q]}}})(typeof window=="object"?window:s6)})(Zl,Zl.exports)),Zl.exports}var l6=o6(),dt=function(){return dt=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},dt.apply(this,arguments)};function wn(e,t,n,r){function a(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function c(p){try{d(r.next(p))}catch(v){l(v)}}function f(p){try{d(r.throw(p))}catch(v){l(v)}}function d(p){p.done?o(p.value):a(p.value).then(c,f)}d((r=r.apply(e,t||[])).next())})}function En(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=c(0),l.throw=c(1),l.return=c(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(d){return function(p){return f([d,p])}}function f(d){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,d[0]&&(n=0)),n;)try{if(r=1,a&&(o=d[0]&2?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,a=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){n.label=d[1];break}if(d[0]===6&&n.label<o[1]){n.label=o[1],o=d;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(d);break}o[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(p){d=[6,p],a=0}finally{r=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function ja(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function An(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}function Ar(e,t,n){if(arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var QE=function(e,t){var n,r;t===void 0&&(t=!1);var a=cy(e,t),o=void 0,l=ln.document.cookie.split("; ");try{for(var c=ja(l),f=c.next();!f.done;f=c.next()){var d=f.value,p=An(d.split("=",2),2),v=p[0],g=p[1];v===a&&(o=decodeURIComponent(g))}}catch(E){n={error:E}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(o)try{if(t){var b=atob(o);return JSON.parse(decodeURIComponent(b))}var S=o.split("."),w=void 0;return S.length>=2&&S[1]&&(w=atob(S[1])),{deviceId:S[0],userId:w}}catch{return}},u6=function(e){var t=cy(e,!0);try{var n=ln.localStorage.getItem(t);if(!n)return;var r=JSON.parse(n);return typeof r!="object"?void 0:r}catch{return}},c6=function(e){var t=cy(e,!0);try{var n=ln.sessionStorage.getItem(t);if(!n)return;var r=JSON.parse(n);return typeof r!="object"?void 0:r}catch{return}},cy=function(e,t){if(t)return e?.length<10?void 0:"AMP_".concat(e.substring(0,10));if(!(e?.length<6))return"amp_".concat(e.substring(0,6))},f6=(function(){function e(t,n,r){this.type="integration",this.apiKey=t,this.identityStore=n.identityStore,this.eventBridge=n.eventBridge,this.contextProvider=n.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(t,n){return wn(this,void 0,void 0,function(){return En(this,function(r){return t?.automaticFetchOnAmplitudeIdentityChange&&this.identityStore.addIdentityListener(function(){n?.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var t=this.identityStore.getIdentity();return{user_id:t.userId,device_id:t.deviceId,user_properties:t.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(t){return this.eventBridge.receiver?(this.eventBridge.logEvent({eventType:t.eventType,eventProperties:t.eventProperties}),!0):!1},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var t=QE(this.apiKey,!0);return t?(this.commitIdentityToConnector(t),!0):(t=QE(this.apiKey,!1),t?(this.commitIdentityToConnector(t),!0):(t=u6(this.apiKey),t?(this.commitIdentityToConnector(t),!0):(t=c6(this.apiKey),t?(this.commitIdentityToConnector(t),!0):!1)))},e.prototype.commitIdentityToConnector=function(t){var n=this.identityStore.editIdentity();n.setDeviceId(t.deviceId),t.userId&&n.setUserId(t.userId),n.commit()},e.prototype.waitForConnectorIdentity=function(t){return wn(this,void 0,void 0,function(){var n,r=this;return En(this,function(a){return n=this.identityStore.getIdentity(),!n.userId&&!n.deviceId?[2,Promise.race([new Promise(function(o){var l=function(){o(),r.identityStore.removeIdentityListener(l)};r.identityStore.addIdentityListener(l)}),new Promise(function(o,l){ln.setTimeout(l,t,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]:[2]})})},e})();function d6(e,t){return t=t||{},new Promise(function(n,r){var a=new XMLHttpRequest,o=[],l=[],c={},f=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(JSON.parse(a.responseText))},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:f,headers:{keys:function(){return o},entries:function(){return l},get:function(p){return c[p.toLowerCase()]},has:function(p){return p.toLowerCase()in c}}}};for(var d in a.open(t.method||"get",e,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(p,v,g){o.push(v=v.toLowerCase()),l.push([v,g]),c[v]=c[v]?c[v]+","+g:g}),n(f())},a.onerror=r,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(d,t.headers[d]);a.send(t.body||null)})}var h6=ln.fetch||d6,p6=function(e,t){return t==null||t<=0?e:new Promise(function(n,r){ln.setTimeout(function(){r(new Hv("Request timeout after "+t+" milliseconds"))},t),e.then(n,r)})},m6=function(e,t,n,r,a){var o=function(){return wn(void 0,void 0,void 0,function(){var l,c,f;return En(this,function(d){switch(d.label){case 0:return[4,h6(e,{method:t,headers:n,body:r})];case 1:return l=d.sent(),f={status:l.status},[4,l.text()];case 2:return c=(f.body=d.sent(),f),[2,c]}})})};return p6(o(),a)},v6=(function(){function e(t){this.client=t}return e.prototype.request=function(t){return wn(this,void 0,void 0,function(){return En(this,function(n){switch(n.label){case 0:return[4,this.client.request(t.requestUrl,t.method,t.headers,null,t.timeoutMillis)];case 1:return[2,n.sent()]}})})},e})(),XA={request:m6},Vr;(function(e){e[e.Disable=0]="Disable",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"})(Vr||(Vr={}));var zi;(function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"})(zi||(zi={}));var fn;(function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"})(fn||(fn={}));var JE=function(e){return!e||e===fn.FallbackInline||e===fn.FallbackConfig||e===fn.SecondaryInitialVariants},co={debug:!1,logLevel:Vr.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:zi.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:XA},ZE="1.20.3",g6=512,y6=(function(){function e(t,n){var r=this,a;this.isReady=new Promise(function(l){r.resolve=l}),this.config=t,this.client=n;var o=(a=t.instanceName)!==null&&a!==void 0?a:co.instanceName;this.queue=new x6(o),this.cache=new b6(o)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(t){var n=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=t,t.setup?this.integration.setup(this.config,this.client).then(function(){n.queue.setTracker(n.integration.track.bind(t)),n.resolve()},function(){n.queue.setTracker(n.integration.track.bind(t)),n.resolve()}):(this.queue.setTracker(this.integration.track.bind(t)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(t,n){if(this.cache.shouldTrack(t,n)){var r=this.getExposureEvent(t);this.queue.push(r)}},e.prototype.getExposureEvent=function(t){var n,r,a,o={eventType:"$exposure",eventProperties:t};return!((n=t.metadata)===null||n===void 0)&&n.exposureEvent?o={eventType:(r=t.metadata)===null||r===void 0?void 0:r.exposureEvent,eventProperties:t}:((a=t.metadata)===null||a===void 0?void 0:a.deliveryMethod)==="web"&&(o={eventType:"$impression",eventProperties:t}),o},e})(),b6=(function(){function e(t){this.isSessionStorageAvailable=S6(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(t),this.isSessionStorageAvailable&&(ln.sessionStorage.removeItem("EXP_sent_".concat(t)),ln.sessionStorage.removeItem("EXP_sent_v2_".concat(t)))}return e.prototype.shouldTrack=function(t,n){var r,a;if(((r=t.metadata)===null||r===void 0?void 0:r.deliveryMethod)==="web")return!0;var o={userId:n?.user_id,deviceId:n?.device_id};this.identityEquals(this.identity,o)||this.clearCache(),this.identity=o,this.loadCache();var l=t.flag_key in this.inMemoryCache,c=this.inMemoryCache[t.flag_key],f=(a=t.variant)!==null&&a!==void 0?a:null,d=c??null,p=!1;return(!l||d!==f)&&(p=!0,this.inMemoryCache[t.flag_key]=f),this.storeCache(),p},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&ln.sessionStorage.removeItem(this.storageKey)},e.prototype.identityEquals=function(t,n){return t.userId&&n.userId?t.userId===n.userId:!t.userId&&!n.userId?t.deviceId===n.deviceId:!1},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var t=ln.sessionStorage.getItem(this.storageKey);this.inMemoryCache=t?JSON.parse(t):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{ln.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch{}},e})(),x6=(function(){function e(t,n){n===void 0&&(n=g6),this.isLocalStorageAvailable=i6(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(t),this.maxQueueSize=n}return e.prototype.push=function(t){this.loadQueue(),this.inMemoryQueue.push(t),this.flush(),this.storeQueue()},e.prototype.setTracker=function(t){var n=this;this.tracker=t,this.poller=ln.setInterval(function(){n.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){if(this.tracker&&this.inMemoryQueue.length!==0){for(var t=0;t<this.inMemoryQueue.length;t++)try{if(!this.tracker(this.inMemoryQueue[t]))break}catch{break}this.inMemoryQueue=this.inMemoryQueue.slice(t),this.inMemoryQueue.length===0&&this.poller&&(ln.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var t=ln.localStorage.getItem(this.storageKey);this.inMemoryQueue=t?JSON.parse(t):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),ln.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e})(),S6=function(){var e=ys();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch{return!1}return!1},w6=(function(){function e(t,n){n===void 0&&(n=Vr.Error),this.logger=t,this.logLevel=n}return e.prototype.error=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Error&&(n=this.logger).error.apply(n,Ar([t],An(r),!1))},e.prototype.warn=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Warn&&(n=this.logger).warn.apply(n,Ar([t],An(r),!1))},e.prototype.info=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Info&&(n=this.logger).info.apply(n,Ar([t],An(r),!1))},e.prototype.debug=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Debug&&(n=this.logger).debug.apply(n,Ar([t],An(r),!1))},e.prototype.verbose=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Vr.Verbose&&(n=this.logger).verbose.apply(n,Ar([t],An(r),!1))},e})(),E6=(function(){function e(){}return e.prototype.error=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.error.apply(console,Ar([t],An(n),!1))},e.prototype.warn=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.warn.apply(console,Ar([t],An(n),!1))},e.prototype.info=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.info.apply(console,Ar([t],An(n),!1))},e.prototype.debug=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.debug.apply(console,Ar([t],An(n),!1))},e.prototype.verbose=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];console.debug.apply(console,Ar([t],An(n),!1))},e})(),Od=(function(){function e(){this.globalScope=ys()}return e.prototype.get=function(t){var n;return(n=this.globalScope)===null||n===void 0?void 0:n.localStorage.getItem(t)},e.prototype.put=function(t,n){var r;(r=this.globalScope)===null||r===void 0||r.localStorage.setItem(t,n)},e.prototype.delete=function(t){var n;(n=this.globalScope)===null||n===void 0||n.localStorage.removeItem(t)},e})(),T6=function(e,t,n){var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r);return new WA(a,n,QA)},k6=function(e,t,n){n===void 0&&(n=new Od);var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r,"-flags");return new WA(a,n)},C6=function(e,t,n){n===void 0&&(n=new Od);var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r,"-variants-options");return new A6(a,n)},A6=(function(){function e(t,n){this.namespace=t,this.storage=n}return e.prototype.get=function(){return this.value},e.prototype.put=function(t){this.value=t},e.prototype.load=function(){var t=this.storage.get(this.namespace);t&&(this.value=JSON.parse(t))},e.prototype.store=function(){this.value===void 0?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e})(),WA=(function(){function e(t,n,r){this.cache={},this.namespace=t,this.storage=n,this.transformer=r}return e.prototype.get=function(t){return this.cache[t]},e.prototype.getAll=function(){return dt({},this.cache)},e.prototype.put=function(t,n){this.cache[t]=n},e.prototype.putAll=function(t){var n,r;try{for(var a=ja(Object.keys(t)),o=a.next();!o.done;o=a.next()){var l=o.value;this.cache[l]=t[l]}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},e.prototype.remove=function(t){delete this.cache[t]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var t,n,r=this.storage.get(this.namespace),a;try{a=JSON.parse(r)||{}}catch{return}var o={};try{for(var l=ja(Object.keys(a)),c=l.next();!c.done;c=l.next()){var f=c.value;try{var d=void 0;this.transformer?d=this.transformer(a[f]):d=a[f],d&&(o[f]=d)}catch{}}}catch(p){t={error:p}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}this.clear(),this.putAll(o)},e.prototype.store=function(t){t===void 0&&(t=this.cache),this.storage.put(this.namespace,JSON.stringify(t))},e})(),QA=function(e){if(typeof e=="string")return{key:e,value:e};if(typeof e=="object"){var t=e.key,n=e.value,r=e.payload,a=e.metadata,o=e.expKey;a&&a.experimentKey?o=a.experimentKey:o&&(a=a||{},a.experimentKey=o);var l={};return t?l.key=t:n&&(l.key=n),n&&(l.value=n),a&&(l.metadata=a),r&&(l.payload=r),o&&(l.expKey=o),l}},JA=(function(){function e(){this.globalScope=ys()}return e.prototype.get=function(t){var n;return(n=this.globalScope)===null||n===void 0?void 0:n.sessionStorage.getItem(t)},e.prototype.put=function(t,n){var r;(r=this.globalScope)===null||r===void 0||r.sessionStorage.setItem(t,n)},e.prototype.delete=function(t){var n;(n=this.globalScope)===null||n===void 0||n.sessionStorage.removeItem(t)},e})(),N6=function(e,t,n,r){var a,o="[Experiment] Exposure",l=n?.value,c="[Experiment] ".concat(t);return{name:o,user:e,key:t,variant:n,userProperty:c,properties:{key:t,variant:l,source:r},userProperties:(a={},a[c]=l,a)}},zr=function(e){return e==null},Nm=function(e){return zr(e)?!0:e&&Object.keys(e).length===0},j6=function(e){var t,n;if(!e||typeof e!="object")return{};var r={};try{for(var a=ja(Object.entries(e)),o=a.next();!o.done;o=a.next()){var l=An(o.value,2),c=l[0],f=l[1];zr(f)||(r[c]=f)}}catch(d){t={error:d}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r},e1=function(e){var t;return((t=e?.metadata)===null||t===void 0?void 0:t.evaluationMode)==="local"},R6=(function(){function e(t,n,r,a){this.started=!1,this.done=!1,this.attempts=t,this.min=n,this.max=r,this.scalar=a}return e.prototype.start=function(t){return wn(this,void 0,void 0,function(){return En(this,function(n){switch(n.label){case 0:if(!this.started)this.started=!0;else throw Error("Backoff already started");return[4,this.backoff(t,0,this.min)];case 1:return n.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(t,n,r){return wn(this,void 0,void 0,function(){var a=this;return En(this,function(o){return this.done?[2]:(this.timeoutHandle=ln.setTimeout(function(){return wn(a,void 0,void 0,function(){var l,c;return En(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,t()];case 1:return f.sent(),[3,3];case 2:return f.sent(),l=n+1,l<this.attempts&&(c=Math.min(r*this.scalar,this.max),this.backoff(t,l,c)),[3,3];case 3:return[2]}})})},r),[2])})})},e})(),_6=function(e){var t,n,r,a;if(!e)return{};var o={user:e},l=ys();l&&(o.page={url:l.location.href});var c={};if(!e.groups)return o;try{for(var f=ja(Object.keys(e.groups)),d=f.next();!d.done;d=f.next()){var p=d.value,v=e.groups[p];if(v.length>0&&v[0]){var g=v[0],b={group_name:g},S=(a=(r=e.group_properties)===null||r===void 0?void 0:r[p])===null||a===void 0?void 0:a[g];S&&Object.keys(S).length>0&&(b.group_properties=S),c[p]=b}}}catch(w){t={error:w}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return Object.keys(c).length>0&&(o.groups=c),delete o.user.groups,delete o.user.group_properties,o},Dn=function(e){return e==null?{}:typeof e=="string"?{key:e,value:e}:e},t1=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n},O6=(function(){function e(t){this.setProperties={},this.unsetProperties={},this.analyticsProvider=t}return e.prototype.track=function(t){this.setProperties[t.key]!=t.variant.value&&(this.setProperties[t.key]=t.variant.value,delete this.unsetProperties[t.key],this.analyticsProvider.track(t))},e.prototype.setUserProperty=function(t){this.setProperties[t.key]!=t.variant.value&&this.analyticsProvider.setUserProperty(t)},e.prototype.unsetUserProperty=function(t){this.unsetProperties[t.key]||(this.unsetProperties[t.key]="unset",delete this.setProperties[t.key],this.analyticsProvider.unsetUserProperty(t))},e})(),M6=(function(){function e(t){this.tracked={},this.identity={},this.exposureTrackingProvider=t}return e.prototype.track=function(t,n){var r={userId:n?.user_id,deviceId:n?.device_id};this.identityEquals(this.identity,r)||(this.tracked={}),this.identity=r;var a=t.flag_key in this.tracked,o=this.tracked[t.flag_key];a&&o===t.variant||(this.tracked[t.flag_key]=t.variant,this.exposureTrackingProvider.track(t))},e.prototype.identityEquals=function(t,n){return t.userId===n.userId&&t.deviceId===n.deviceId},e})(),D6=1e4,I6=8,L6=500,P6=1e4,U6=1.5,n1=6e4,z6="https://api.lab.eu.amplitude.com",B6="https://flag.lab.eu.amplitude.com",V6=(function(){function e(t,n){var r=this,a,o,l,c;this.engine=new qU,this.isRunning=!1,this.apiKey=t,n=j6(n),this.config=dt(dt(dt({},co),n),{serverUrl:n?.serverUrl||(((a=n?.serverZone)===null||a===void 0?void 0:a.toLowerCase())==="eu"?z6:co.serverUrl),flagsServerUrl:n?.flagsServerUrl||(((o=n?.serverZone)===null||o===void 0?void 0:o.toLowerCase())==="eu"?B6:co.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<n1?n1:(l=n.flagConfigPollingIntervalMillis)!==null&&l!==void 0?l:co.flagConfigPollingIntervalMillis}),this.logger=new w6(this.config.loggerProvider||new E6,e.getLogLevel(n));var f=(c=this.config)===null||c===void 0?void 0:c.internalInstanceNameSuffix;if(this.isWebExperiment=f==="web",this.poller=new a6(function(){return r.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var d in this.config.initialVariants)this.config.initialVariants[d]=QA(this.config.initialVariants[d]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new O6(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new M6(this.config.exposureTrackingProvider)),this.integrationManager=new y6(this.config,this);var p=new v6(this.config.httpClient||XA);this.flagApi=new r6(this.apiKey,this.config.flagsServerUrl,p),this.evaluationApi=new n6(this.apiKey,this.config.serverUrl,p);var v,g=f?"".concat(this.config.instanceName,"-").concat(f):this.config.instanceName;this.isWebExperiment?v=new JA:v=new Od,this.variants=T6(this.apiKey,g,v),this.flags=k6(this.apiKey,g,v),this.fetchVariantsOptions=C6(this.apiKey,g,v);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch{}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(t){return wn(this,void 0,void 0,function(){var n,r,a,o;return En(this,function(l){switch(l.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(t),l.label=1;case 1:return l.trys.push([1,6,,7]),n=this.doFlags(),r=(o=this.config.fetchOnStart)!==null&&o!==void 0?o:!0,r?[4,Promise.all([this.fetch(t),n])]:[3,3];case 2:return l.sent(),[3,5];case 3:return[4,n];case 4:l.sent(),l.label=5;case 5:return[3,7];case 6:if(a=l.sent(),this.config.throwOnError)throw a;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return wn(this,arguments,void 0,function(t,n){var r;return t===void 0&&(t=this.user),En(this,function(a){switch(a.label){case 0:this.setUser(t||{}),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.fetchInternal(t,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,n)];case 2:return a.sent(),[3,4];case 3:if(r=a.sent(),this.config.throwOnError)throw r;return r instanceof Hv?this.logger.debug(r):this.logger.error(r),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(t,n){var r,a;if(!this.apiKey)return{value:void 0};var o=this.variantAndSource(t,n);return this.config.automaticExposureTracking&&this.exposureInternal(t,o),this.logger.debug("[Experiment] variant for ".concat(t," is ").concat(((r=o.variant)===null||r===void 0?void 0:r.key)||((a=o.variant)===null||a===void 0?void 0:a.value))),o.variant||{}},e.prototype.exposure=function(t){var n=this.variantAndSource(t);this.exposureInternal(t,n)},e.prototype.all=function(){if(!this.apiKey)return{};var t=this.evaluate();for(var n in t){var r=this.flags.get(n);e1(r)||delete t[n]}return dt(dt(dt({},this.secondaryVariants()),this.sourceVariants()),t)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch{}},e.prototype.getUser=function(){var t;if(!this.user)return this.user;if(!((t=this.user)===null||t===void 0)&&t.user_properties){var n=dt({},this.user.user_properties);return dt(dt({},this.user),{user_properties:n})}else return dt({},this.user)},e.prototype.setUser=function(t){var n;if(!t){this.user=null;return}if(!((n=this.user)===null||n===void 0)&&n.user_properties){var r=dt({},t.user_properties);this.user=dt(dt({},t),{user_properties:r})}else this.user=dt({},t)},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(t){return this.userProvider=t,this},e.prototype.mergeInitialFlagsWithStorage=function(){var t=this;if(this.config.initialFlags){var n=JSON.parse(this.config.initialFlags);n.forEach(function(r){t.flags.get(r.key)||t.flags.put(r.key,r)})}},e.prototype.evaluate=function(t){var n,r,a=this.addContext(this.user),o=GU(this.flags.getAll(),t),l=_6(a),c=this.engine.evaluate(l,o),f={};try{for(var d=ja(Object.keys(c)),p=d.next();!p.done;p=d.next()){var v=p.value;f[v]=t1(c[v])}}catch(g){n={error:g}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return f},e.prototype.variantAndSource=function(t,n){var r={};this.config.source===zi.LocalStorage?r=this.localStorageVariantAndSource(t,n):this.config.source===zi.InitialVariants&&(r=this.initialVariantsVariantAndSource(t,n));var a=this.flags.get(t);return(e1(a)||!r.variant&&a)&&(r=this.localEvaluationVariantAndSource(t,a,n)),r},e.prototype.localEvaluationVariantAndSource=function(t,n,r){var a,o={},l=this.evaluate([n.key])[t],c=fn.LocalEvaluation,f=(a=l?.metadata)===null||a===void 0?void 0:a.default;if(!zr(l)&&!f)return{variant:Dn(l),source:c,hasDefaultVariant:!1};if(f&&(o={variant:Dn(l),source:c,hasDefaultVariant:!0}),!zr(r))return{variant:Dn(r),source:fn.FallbackInline,hasDefaultVariant:o.hasDefaultVariant};var d=this.config.initialVariants[t];if(!zr(d))return{variant:Dn(d),source:fn.SecondaryInitialVariants,hasDefaultVariant:o.hasDefaultVariant};var p=Dn(this.config.fallbackVariant),v={variant:p,source:fn.FallbackConfig,hasDefaultVariant:o.hasDefaultVariant};return Nm(p)?o:v},e.prototype.localStorageVariantAndSource=function(t,n){var r,a={},o=this.variants.get(t),l=(r=o?.metadata)===null||r===void 0?void 0:r.default;if(!zr(o)&&!l)return{variant:Dn(o),source:fn.LocalStorage,hasDefaultVariant:!1};if(l&&(a={variant:Dn(o),source:fn.LocalStorage,hasDefaultVariant:!0}),!zr(n))return{variant:Dn(n),source:fn.FallbackInline,hasDefaultVariant:a.hasDefaultVariant};var c=this.config.initialVariants[t];if(!zr(c))return{variant:Dn(c),source:fn.SecondaryInitialVariants,hasDefaultVariant:a.hasDefaultVariant};var f=Dn(this.config.fallbackVariant),d={variant:f,source:fn.FallbackConfig,hasDefaultVariant:a.hasDefaultVariant};return Nm(f)?a:d},e.prototype.initialVariantsVariantAndSource=function(t,n){var r,a={},o=this.config.initialVariants[t];if(!zr(o))return{variant:Dn(o),source:fn.InitialVariants,hasDefaultVariant:!1};var l=this.variants.get(t),c=(r=l?.metadata)===null||r===void 0?void 0:r.default;if(!zr(l)&&!c)return{variant:Dn(l),source:fn.LocalStorage,hasDefaultVariant:!1};if(c&&(a={variant:Dn(l),source:fn.LocalStorage,hasDefaultVariant:!0}),!zr(n))return{variant:Dn(n),source:fn.FallbackInline,hasDefaultVariant:a.hasDefaultVariant};var f=Dn(this.config.fallbackVariant),d={variant:f,source:fn.FallbackConfig,hasDefaultVariant:a.hasDefaultVariant};return Nm(f)?a:d},e.prototype.fetchInternal=function(t,n,r,a){return wn(this,void 0,void 0,function(){var o,l,c;return En(this,function(f){switch(f.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),f.label=1;case 1:return f.trys.push([1,4,,5]),[4,this.doFetch(t,n,dt({trackingOption:(c=this.fetchVariantsOptions.get())===null||c===void 0?void 0:c.trackingOption},a))];case 2:return o=f.sent(),[4,this.storeVariants(o,a)];case 3:return f.sent(),[2,o];case 4:throw l=f.sent(),r&&this.shouldRetryFetch(l)&&this.startRetries(t,a),l;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(t){return wn(this,void 0,void 0,function(){return En(this,function(n){return this.fetchVariantsOptions.put(dt(dt({},this.fetchVariantsOptions.get()||{}),{trackingOption:t?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(t){var n=dt({},t);return delete n.cookie,n},e.prototype.doFetch=function(t,n,r){return wn(this,void 0,void 0,function(){var a,o,l,c,f,d,p;return En(this,function(v){switch(v.label){case 0:return[4,this.addContextOrWait(t)];case 1:return t=v.sent(),t=this.cleanUserPropsForFetch(t),this.logger.debug("[Experiment] Fetch variants for user: ",t),[4,this.evaluationApi.getVariants(t,dt({timeoutMillis:n},r))];case 2:a=v.sent(),o={};try{for(l=ja(Object.keys(a)),c=l.next();!c.done;c=l.next())f=c.value,o[f]=t1(a[f])}catch(g){d={error:g}}finally{try{c&&!c.done&&(p=l.return)&&p.call(l)}finally{if(d)throw d.error}}return this.logger.debug("[Experiment] Received variants: ",o),[2,o]}})})},e.prototype.doFlags=function(){return wn(this,void 0,void 0,function(){var t,n,r;return En(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),t=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:t=a.sent(),a.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:ZE,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:t?.user_id||t?.device_id?{user_id:t?.user_id,device_id:t?.device_id}:void 0})];case 3:return n=a.sent(),this.flags.clear(),this.flags.putAll(n),[3,5];case 4:if(r=a.sent(),r instanceof Hv){if(this.logger.debug(r),this.config.throwOnError)throw r}else throw r;return[3,5];case 5:try{this.flags.store()}catch{}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(t,n){return wn(this,void 0,void 0,function(){var r,a,o,l,l;return En(this,function(c){r=n&&n.flagKeys?n.flagKeys:[],r.length===0&&this.variants.clear(),a=function(f){r=r.filter(function(d){return d!==f}),o.variants.put(f,t[f])},o=this;for(l in t)a(l);for(l in r)this.variants.remove(l);try{this.variants.store()}catch{}return this.logger.debug("[Experiment] Stored variants: ",t),[2]})})},e.prototype.startRetries=function(t,n){return wn(this,void 0,void 0,function(){var r=this;return En(this,function(a){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new R6(I6,L6,P6,U6),this.retriesBackoff.start(function(){return wn(r,void 0,void 0,function(){return En(this,function(o){switch(o.label){case 0:return[4,this.fetchInternal(t,D6,!1,n)];case 1:return o.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(t){var n,r=(n=this.userProvider)===null||n===void 0?void 0:n.getUser(),a=this.integrationManager.getUser(),o=dt(dt(dt({},r?.user_properties),a.user_properties),t?.user_properties);return dt(dt(dt(dt({library:"experiment-js-client/".concat(ZE)},r),a),t),{user_properties:o})},e.prototype.addContextOrWait=function(t){return wn(this,void 0,void 0,function(){return En(this,function(n){switch(n.label){case 0:return[4,this.integrationManager.ready()];case 1:return n.sent(),[2,this.addContext(t)]}})})},e.prototype.sourceVariants=function(){if(this.config.source==zi.LocalStorage)return this.variants.getAll();if(this.config.source==zi.InitialVariants)return this.config.initialVariants},e.prototype.secondaryVariants=function(){if(this.config.source==zi.LocalStorage)return this.config.initialVariants;if(this.config.source==zi.InitialVariants)return this.variants.getAll()},e.prototype.exposureInternal=function(t,n){var r,a,o,l,c,f,d,p,v,g=(o=(a=(r=n.variant)===null||r===void 0?void 0:r.metadata)===null||a===void 0?void 0:a.trackExposure)!==null&&o!==void 0?o:!0;if(g){this.legacyExposureInternal(t,n.variant,n.source);var b={flag_key:t},S=JE(n.source);if(!(S&&!n.hasDefaultVariant)){!((l=n.variant)===null||l===void 0)&&l.expKey&&(b.experiment_key=(c=n.variant)===null||c===void 0?void 0:c.expKey);var w=(f=n.variant)===null||f===void 0?void 0:f.metadata;if(!S&&!w?.default&&(!((d=n.variant)===null||d===void 0)&&d.key?b.variant=n.variant.key:!((p=n.variant)===null||p===void 0)&&p.value&&(b.variant=n.variant.value)),w&&(b.metadata=w),this.isWebExperiment&&(b.time=Date.now()),this.isWebExperiment){var E=ys();if(E?.location)try{var T=E.location.href;b.metadata.url=T.split("?")[0]||""}catch{}}var C=this.addContext(this.getUser());(v=this.userSessionExposureTracker)===null||v===void 0||v.track(b,C),this.integrationManager.track(b,C)}}},e.prototype.legacyExposureInternal=function(t,n,r){var a,o,l,c,f;if(this.analyticsProvider){var d=this.addContext(this.getUser()),p=N6(d,t,n,r);JE(r)||!n?.value?(o=(a=this.analyticsProvider)===null||a===void 0?void 0:a.unsetUserProperty)===null||o===void 0||o.call(a,p):n?.value&&((c=(l=this.analyticsProvider)===null||l===void 0?void 0:l.setUserProperty)===null||c===void 0||c.call(l,p),(f=this.analyticsProvider)===null||f===void 0||f.track(p))}},e.getLogLevel=function(t){var n;return t.debug===!0?Vr.Debug:(n=t.logLevel)!==null&&n!==void 0?n:Vr.Error},e.prototype.shouldRetryFetch=function(t){return t instanceof $A?t.statusCode<400||t.statusCode>=500||t.statusCode===429:!0},e.prototype.addPlugin=function(t){t.type==="integration"&&this.integrationManager.setIntegration(t)},e})(),F6=(function(){function e(t,n){var r,a,o;this.globalScope=ys(),this.userAgent=typeof((r=this.globalScope)===null||r===void 0?void 0:r.navigator)<"u"?(a=this.globalScope)===null||a===void 0?void 0:a.navigator.userAgent:void 0,this.ua=new l6.UAParser(this.userAgent).getResult(),this.localStorage=new Od,this.sessionStorage=new JA,this.userProvider=t,this.apiKey=n,this.storageKey="EXP_".concat((o=this.apiKey)===null||o===void 0?void 0:o.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var t,n,r,a,o,l=((t=this.userProvider)===null||t===void 0?void 0:t.getUser())||{};return dt({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:(r=(n=this.ua.device)===null||n===void 0?void 0:n.type)!==null&&r!==void 0?r:"desktop",referring_url:(o=(a=this.globalScope)===null||a===void 0?void 0:a.document)===null||o===void 0?void 0:o.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},l)},e.prototype.getLanguage=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(t){var n,r;return[(n=t.browser)===null||n===void 0?void 0:n.name,(r=t.browser)===null||r===void 0?void 0:r.major].filter(function(a){return a!=null}).join(" ")},e.prototype.getDeviceModel=function(t){var n;return(n=t.os)===null||n===void 0?void 0:n.name},e.prototype.getBrowser=function(t){var n,r=(n=t.browser)===null||n===void 0?void 0:n.name;return r?.includes("Chrom")&&(r="Chrome"),r?.includes("Firefox")&&(r="Firefox"),r?.includes("Safari")&&(r="Safari"),r?.includes("Edge")&&(r="Edge"),r?.includes("Opera")&&(r="Opera"),r},e.prototype.getCookie=function(){var t,n,r,a,o;if(!((n=(t=this.globalScope)===null||t===void 0?void 0:t.document)===null||n===void 0)&&n.cookie)return Object.fromEntries((o=(a=(r=this.globalScope)===null||r===void 0?void 0:r.document)===null||a===void 0?void 0:a.cookie)===null||o===void 0?void 0:o.split("; ").map(function(l){return l.split("=")}))},e.prototype.getLandingUrl=function(){var t,n;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=(n=(t=this.globalScope)===null||t===void 0?void 0:t.location)===null||n===void 0?void 0:n.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch{return}},e.prototype.getFirstSeen=function(){try{var t=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return t.first_seen||(t.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(t))),t.first_seen}catch{return}},e.prototype.getUrlParam=function(){var t,n,r;if(this.globalScope){var a={};try{var o=new URL(this.globalScope.location.href);try{for(var l=ja(o.searchParams),c=l.next();!c.done;c=l.next()){var f=An(c.value,2),d=f[0],p=f[1];a[d]=Ar(Ar([],An((r=a[d])!==null&&r!==void 0?r:[]),!1),An(p.split(",")),!1)}}catch(v){t={error:v}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}}catch{return}return Object.entries(a).reduce(function(v,g){var b=An(g,2),S=b[0],w=b[1];return v[S]=w.length==1?w[0]:w,v},{})}},e})();ln.experimentInstances={};var r1=ln.experimentInstances,H6=function(e,t){var n=function(){return new f6(e,Hg.getInstance(ZA(t)),1e4)};return K6(e,t,n)},ZA=function(e){return e?.instanceName||co.instanceName},q6=function(e,t){var n=ZA(t),r=t?.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)},G6=function(e,t){return new V6(e,dt(dt({},t),{userProvider:new F6(t?.userProvider,e)}))},K6=function(e,t,n){var r=q6(e,t),a=r1[r];return a||(a=G6(e,t),n&&a.addPlugin(n()),r1[r]=a,a)},Vf=(function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(t,n){var r;return ne(this,void 0,void 0,function(){return te(this,function(a){return this.experiment=H6(((r=this.config)===null||r===void 0?void 0:r.deploymentKey)||t.apiKey,this.config),[2]})})},e.pluginName="@amplitude/experiment-analytics-plugin",e})(),Y6=function(e){return new Vf(e)},$6=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:X6(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),X6=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},W6=(function(){function e(){this.queue=[]}return e.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},e.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach(function(n){t(n)}),this.queue=[])},e})(),xa=function(){return xa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},xa.apply(this,arguments)};function Ff(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i1(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,o=[],l;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}var Hf=function(e,t){var n,r,a=["string","number","boolean","undefined"],o=typeof e,l=typeof t;if(o!==l)return!1;try{for(var c=Ff(a),f=c.next();!f.done;f=c.next()){var d=f.value;if(d===o)return e===t}}catch(E){n={error:E}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var p=Array.isArray(e),v=Array.isArray(t);if(p!==v)return!1;if(p&&v){for(var g=0;g<e.length;g++)if(!Hf(e[g],t[g]))return!1}else{var b=Object.keys(e).sort(),S=Object.keys(t).sort();if(!Hf(b,S))return!1;var w=!0;return Object.keys(e).forEach(function(E){Hf(e[E],t[E])||(w=!1)}),w}return!0},Q6="$set",J6="$unset",Z6="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var ez=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,n=xa({},this.identity.userProperties),r=xa(xa({},this.identity),{userProperties:n});return{setUserId:function(a){return r.userId=a,this},setDeviceId:function(a){return r.deviceId=a,this},setUserProperties:function(a){return r.userProperties=a,this},setOptOut:function(a){return r.optOut=a,this},updateUserProperties:function(a){var o,l,c,f,d,p,v=r.userProperties||{};try{for(var g=Ff(Object.entries(a)),b=g.next();!b.done;b=g.next()){var S=i1(b.value,2),w=S[0],E=S[1];switch(w){case Q6:try{for(var T=(c=void 0,Ff(Object.entries(E))),C=T.next();!C.done;C=T.next()){var k=i1(C.value,2),j=k[0],N=k[1];v[j]=N}}catch(U){c={error:U}}finally{try{C&&!C.done&&(f=T.return)&&f.call(T)}finally{if(c)throw c.error}}break;case J6:try{for(var R=(d=void 0,Ff(Object.keys(E))),L=R.next();!L.done;L=R.next()){var j=L.value;delete v[j]}}catch(U){d={error:U}}finally{try{L&&!L.done&&(p=R.return)&&p.call(R)}finally{if(d)throw d.error}}break;case Z6:v={};break}}}catch(U){o={error:U}}finally{try{b&&!b.done&&(l=g.return)&&l.call(g)}finally{if(o)throw o.error}}return r.userProperties=v,this},commit:function(){return t.setIdentity(r),this}}},e.prototype.getIdentity=function(){return xa({},this.identity)},e.prototype.setIdentity=function(t){var n=xa({},this.identity);this.identity=xa({},t),Hf(n,this.identity)||this.listeners.forEach(function(r){r(t)})},e.prototype.addIdentityListener=function(t){this.listeners.add(t)},e.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},e})(),Hl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,tz=(function(){function e(){this.identityStore=new ez,this.eventBridge=new W6,this.applicationContextProvider=new $6}return e.getInstance=function(t){return Hl.analyticsConnectorInstances||(Hl.analyticsConnectorInstances={}),Hl.analyticsConnectorInstances[t]||(Hl.analyticsConnectorInstances[t]=new e),Hl.analyticsConnectorInstances[t]},e})(),a1=["boot"],nz="$default_instance";function rz(e){var t,n,r,a,o,l,c,f,d;let p=typeof window<"u"?window.engagement:void 0,v=!1,g={_q:(t=p?._q)!=null?t:[],_configuration:{apiKey:(r=(n=p?._configuration)==null?void 0:n.apiKey)!=null?r:"",serverUrl:(a=p?._configuration)==null?void 0:a.serverUrl,chatUrl:(o=p?._configuration)==null?void 0:o.chatUrl,mediaUrl:(l=p?._configuration)==null?void 0:l.mediaUrl,serverZone:(f=(c=p?._configuration)==null?void 0:c.serverZone)!=null?f:"US",options:{...(d=p?._configuration)==null?void 0:d.options}},init(S,w){var E,T,C,k;if(g._configuration.apiKey){console.log("Engagement SDK has already been initialized. Ignoring additional init call.");return}if(w!=null&&w.useEngagementDomain){let U=((E=w.serverZone)!=null?E:g._configuration.serverZone)==="EU",G="amplitudeengagement.com";w.serverUrl||(w.serverUrl=U?`https://gs.eu.${G}`:`https://gs.${G}`),w.chatUrl||(w.chatUrl=U?`https://houston-chat.eu.${G}`:`https://houston-chat.${G}`),w.mediaUrl||(w.mediaUrl=U?`https://engagement-static.eu.${G}`:`https://engagement-static.${G}`),w.cdnUrl||(w.cdnUrl=U?`https://cdn.eu.${G}`:`https://cdn.${G}`)}g._configuration={...g._configuration,...w,apiKey:S,options:{splitting:!0,...g._configuration.options,...w?.options}},(C=(T=g._configuration)==null?void 0:T.options)!=null&&C.logger&&g._configuration.options.logger.enable((k=g._configuration.options.logLevel)!=null?k:2);let j;if(w!=null&&w.cdnUrl)g._configuration.options.splitting?j=`${w.cdnUrl}/engagement-browser/prod/split/index.js`:j=w.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let U=g._configuration.serverZone==="EU"?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";g._configuration.options.splitting?j=`${U}/engagement-browser/prod/split/index.js`:j=`${U}/engagement-browser/prod/index.min.js.gz`}let N=null,R=()=>{if(v=!0,N&&(clearTimeout(N),N=null),g._q&&g._q.length>0)for(console.warn(`Engagement SDK failed to load within ${L}ms. Resolving pending calls gracefully.`);g._q.length>0;){let U=g._q.shift();if(!U)continue;let G=U[0],M=a1.includes(G);if(console.warn(`Engagement SDK method '${G}' still in queue (isAsyncMethod=${M}); attempting to resolve as no-op.`),M&&U[1]instanceof Function&&U[2]instanceof Function){let B=U[1];console.warn(`Engagement SDK method '${G}' resolved as no-op due to script loading failure`),B(void 0)}}};e(j,g._configuration.options.splitting?"module":void 0,w?.nonce,R);let L=1e4;N=setTimeout(()=>{R()},L)},plugin(S){let w=g.init;return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(E,T){var C;let k=(C=E.instanceName)!=null?C:nz,j=tz.getInstance(k).identityStore;w(E.apiKey,{serverZone:E.serverZone,...S,options:{logLevel:E.logLevel,logger:E.loggerProvider,...S?.options}});let N=[{track:R=>{T.track(R)}}];await window.engagement.boot({user:()=>{let R=j.getIdentity();return{user_id:T.getUserId(),device_id:T.getDeviceId(),user_properties:R.userProperties,getSessionId:T.getSessionId}},integrations:N}),j.addIdentityListener(R=>{var L,U,G,M;if(!((L=window.engagement)!=null&&L._.user)||!((U=window.engagement)!=null&&U._analytics.hasBooted)){console.warn("Engagement SDK not booted. Ignoring identity change.");return}((M=(G=window.engagement)==null?void 0:G._.user)==null?void 0:M.user_id)!==R.userId?(window.engagement.shutdown(),window.engagement.boot({user:()=>{let B=j.getIdentity();return{user_id:T.getUserId(),device_id:T.getDeviceId(),user_properties:B.userProperties,getSessionId:T.getSessionId}},integrations:N})):window.engagement._setUserProperties(R.userProperties)})},async execute(E){return window.engagement.forwardEvent(E),E}}}},b=g;return new Proxy(g,{get:function(S,w){if(w in b)return b[w];if(w!=="then")return w==="gs"||w==="rc"?new Proxy({},{get:function(E,T){return function(){let C=Array.from(arguments),k=`${w}.${T}`;C.unshift(k),g._q.push(C)}}}):a1.includes(w)?function(){let E=Array.prototype.slice.call(arguments);return new Promise((T,C)=>{E.unshift(w,T,C),g._q.push(E),v&&T(void 0)})}:function(){let E=Array.prototype.slice.call(arguments);E.unshift(w),g._q.push(E)}}})}var eN=(e=>(e.Local="https://local.amplitude.com:3010/",e.Staging="https://apps.stag2.amplitude.com/",e.Production="https://app.amplitude.com/",e.ProductionEU="https://app.eu.amplitude.com/",e))(eN||{}),iz=e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(eN))window.opener.postMessage({message:e},t)};function az(e,t,n,r){for(let a of e){let o=document.createElement("script");o.src=a,o.id="engagement-sdk-bundle",n&&o.setAttribute("nonce",n),t&&o.setAttribute("type",t),r&&(o.onerror=r),document.getElementsByTagName("head")[0].appendChild(o)}}var sz=()=>(iz("ENGAGEMENT_SNIPPET"),rz((e,t,n,r)=>az([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,n,r))),s1=sz(),oz=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=s1),s1.plugin(e)),lz="1.0.4",uz="amplitude-ts-unified",cz=function(){return{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return ne(this,void 0,void 0,function(){return te(this,function(n){return e.library="".concat(uz,"/").concat(lz,"-").concat((t=e.library)!==null&&t!==void 0?t:""),[2,e]})})}}},fz=(function(e){Or(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.sessionReplay=function(){return this._sessionReplay},t.prototype.experiment=function(){if(this.config!==void 0){var n=this.plugins(Vf);if(n.length===0){this.config.loggerProvider.debug("".concat(Vf.pluginName," plugin is not found."));return}else{if(n.length===1)return n[0].experiment;this.config.loggerProvider.debug("Multiple instances of ".concat(Vf.pluginName," are found."));return}}},t.prototype.initAll=function(n,r){return ne(this,void 0,void 0,function(){var a,o;return te(this,function(l){switch(l.label){case 0:return a={serverZone:r?.serverZone,instanceName:r?.instanceName},e.prototype.add.call(this,cz()),[4,e.prototype.init.call(this,n,ce(ce({},r?.analytics),a)).promise];case 1:return l.sent(),[4,e.prototype.add.call(this,jU(ce(ce({},r?.sessionReplay),a))).promise];case 2:return l.sent(),[4,e.prototype.add.call(this,Y6(ce(ce({},r?.experiment),a))).promise];case 3:return l.sent(),o=this.plugin(Uv.pluginName),o===void 0?this.config.loggerProvider.debug("".concat(Uv.pluginName," plugin is not found.")):this._sessionReplay=o.sessionReplay,[4,e.prototype.add.call(this,oz(ce(ce({},r?.engagement),a))).promise];case 4:return l.sent(),[2]}})})},t.prototype.init=function(n,r,a){n===void 0&&(n="");var o=e.prototype.init.call(this,n,r,a);return o},t})(L3),dz=function(){var e=new fz;return{_setDiagnosticsSampleRate:rt(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",Tt(e),kt(e,["config"])),_enableRequestBodyCompressionExperimental:rt(e._enableRequestBodyCompressionExperimental.bind(e),"_enableRequestBodyCompressionExperimental",Tt(e),kt(e,["config"])),experiment:rt(e.experiment.bind(e),"experiment",Tt(e),kt(e,["config"])),sessionReplay:rt(e.sessionReplay.bind(e),"sessionReplay",Tt(e),kt(e,["config"])),initAll:rt(e.initAll.bind(e),"initAll",Tt(e),kt(e,["config"])),init:rt(e.init.bind(e),"init",Tt(e),kt(e,["config"])),add:rt(e.add.bind(e),"add",Tt(e),kt(e,["config.apiKey","timeline.plugins"])),remove:rt(e.remove.bind(e),"remove",Tt(e),kt(e,["config.apiKey","timeline.plugins"])),track:rt(e.track.bind(e),"track",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),logEvent:rt(e.logEvent.bind(e),"logEvent",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),identify:rt(e.identify.bind(e),"identify",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),groupIdentify:rt(e.groupIdentify.bind(e),"groupIdentify",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),setGroup:rt(e.setGroup.bind(e),"setGroup",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),revenue:rt(e.revenue.bind(e),"revenue",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),flush:rt(e.flush.bind(e),"flush",Tt(e),kt(e,["config.apiKey","timeline.queue.length"])),getUserId:rt(e.getUserId.bind(e),"getUserId",Tt(e),kt(e,["config","config.userId"])),setUserId:rt(e.setUserId.bind(e),"setUserId",Tt(e),kt(e,["config","config.userId"])),getDeviceId:rt(e.getDeviceId.bind(e),"getDeviceId",Tt(e),kt(e,["config","config.deviceId"])),setDeviceId:rt(e.setDeviceId.bind(e),"setDeviceId",Tt(e),kt(e,["config","config.deviceId"])),reset:rt(e.reset.bind(e),"reset",Tt(e),kt(e,["config","config.userId","config.deviceId"])),getSessionId:rt(e.getSessionId.bind(e),"getSessionId",Tt(e),kt(e,["config"])),setSessionId:rt(e.setSessionId.bind(e),"setSessionId",Tt(e),kt(e,["config"])),extendSession:rt(e.extendSession.bind(e),"extendSession",Tt(e),kt(e,["config"])),setOptOut:rt(e.setOptOut.bind(e),"setOptOut",Tt(e),kt(e,["config"])),getOptOut:rt(e.getOptOut.bind(e),"getOptOut",Tt(e),kt(e,["config"])),setTransport:rt(e.setTransport.bind(e),"setTransport",Tt(e),kt(e,["config"])),getIdentity:rt(e.getIdentity.bind(e),"getIdentity",Tt(e),kt(e,["config"])),setIdentity:rt(e.setIdentity.bind(e),"setIdentity",Tt(e),kt(e,["config","config.userId","config.deviceId"]))}};const tN=dz();var hz=tN.initAll,pz=tN.track;const mz="59c3e241b838466cd5fc0657b380fb4b",o1="__animaAmplitudeInitialized";function nN(){return typeof window>"u"?null:window}function rN(){const e=nN();!e||e[o1]||(hz(mz,{analytics:{autocapture:!0},sessionReplay:{sampleRate:1}}),e[o1]=!0)}function l1(e,t){nN()&&(rN(),pz(e,t))}const u1="anima.gateway.device-identity.v1";function qv(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function iN(e){const t=e.replaceAll("-","+").replaceAll("_","/"),n=t+"=".repeat((4-t.length%4)%4),r=atob(n),a=new Uint8Array(r.length);for(let o=0;o<r.length;o+=1)a[o]=r.charCodeAt(o);return a}function vz(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function Gv(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}async function aN(e){const t=await crypto.subtle.digest("SHA-256",Gv(e));return vz(new Uint8Array(t))}async function gz(){if(!crypto?.subtle)throw new Error("WebCrypto is unavailable in this browser context.");const e=await crypto.subtle.generateKey({name:"Ed25519"},!0,["sign","verify"]),t=new Uint8Array(await crypto.subtle.exportKey("raw",e.publicKey)),n=new Uint8Array(await crypto.subtle.exportKey("pkcs8",e.privateKey));return{deviceId:await aN(t),publicKey:qv(t),privateKey:qv(n)}}async function yz(){if(typeof window>"u")throw new Error("Device identity requires a browser context.");try{const n=window.localStorage.getItem(u1);if(n){const r=JSON.parse(n);if(r?.version===1&&typeof r.deviceId=="string"&&typeof r.publicKey=="string"&&typeof r.privateKey=="string"&&await aN(iN(r.publicKey))===r.deviceId)return{deviceId:r.deviceId,publicKey:r.publicKey,privateKey:r.privateKey}}}catch{}const e=await gz(),t={version:1,deviceId:e.deviceId,publicKey:e.publicKey,privateKey:e.privateKey,createdAtMs:Date.now()};try{window.localStorage.setItem(u1,JSON.stringify(t))}catch{}return e}async function bz(e,t){if(!crypto?.subtle)throw new Error("WebCrypto is unavailable in this browser context.");const n=iN(e),r=await crypto.subtle.importKey("pkcs8",Gv(n),{name:"Ed25519"},!1,["sign"]),a=new TextEncoder().encode(t),o=await crypto.subtle.sign({name:"Ed25519"},r,Gv(a));return qv(new Uint8Array(o))}function xz(e){const t=e.nonce?"v2":"v1",n=e.scopes.join(","),r=e.token??"",a=[t,e.deviceId,e.clientId,e.clientMode,e.role,n,String(e.signedAtMs),r];return t==="v2"&&a.push(e.nonce??""),a.join("|")}function fy(e){if(!e||typeof e!="object")return;const t=e.nonce;if(typeof t!="string")return;const n=t.trim();return n.length>0?n:void 0}async function dy(e){const t=Array.isArray(e.scopes)?e.scopes:["operator.admin"],n=Array.isArray(e.caps)?e.caps:[],r=await yz(),a=Date.now(),o=xz({deviceId:r.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:"operator",scopes:t,signedAtMs:a,token:typeof e.auth.token=="string"?e.auth.token:null,nonce:e.nonce}),l=await bz(r.privateKey,o);return{minProtocol:e.minProtocol,maxProtocol:e.maxProtocol,client:e.client,role:"operator",scopes:t,caps:n,auth:e.auth,device:{id:r.deviceId,publicKey:r.publicKey,signature:l,signedAt:a,...e.nonce?{nonce:e.nonce}:{}}}}const c1="http://localhost:18789",f1="ws://localhost:18789/ws",yf="token",sN="anima.gateway.token",Sz="anima.control.settings.v1";function wz(e){if(!e)return new URLSearchParams;const t=e.startsWith("#")?e.slice(1):e;return t?new URLSearchParams(t):new URLSearchParams}function d1(e){if(!(typeof window>"u"||!e))try{window.localStorage.setItem(sN,e)}catch{}}function Ez(){if(typeof window>"u")return null;try{const e=new URL(window.location.href),t=wz(e.hash),n=e.searchParams.get(yf)?.trim()||"",r=t.get(yf)?.trim()||"",a=n||r;if(n&&e.searchParams.delete(yf),r){t.delete(yf);const o=t.toString();e.hash=o?`#${o}`:""}return(n||r)&&typeof window.history?.replaceState=="function"&&window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`),a||null}catch{return null}}function Tz(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Sz);if(!e)return null;const t=JSON.parse(e);return(typeof t.token=="string"?t.token.trim():"")||null}catch{return null}}function kz(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(sN)?.trim()||"";if(e)return e}catch{}return Tz()}function Cz(){if(typeof window>"u")return c1;const e=window.location.protocol==="https:"?"https:":"http:",t=window.location.host?.trim();return t?`${e}//${t}`:c1}function hy(){if(typeof window>"u")return f1;const e=window.location.protocol==="https:"?"wss:":"ws:",t=window.location.host?.trim();return t?`${e}//${t}/ws`:f1}function Az(){const e=Ez();if(e)return d1(e),e;const t=kz();return t?(d1(t),t):null}function py(){const e=Az();if(e)return{token:e}}const Nz=Cz(),jz=hy(),h1=3,Rz=1e4,_z=2*6e4,Oz=15*6e4,Mz=8;function wu(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Dz(e){const t=e?.body;if(typeof t!="string"||!t.trim())return{};try{const n=JSON.parse(t);return typeof n=="object"&&n!==null?n:{}}catch{return{}}}async function as(e,t){return await new Promise((n,r)=>{const a=new WebSocket(jz);let o=!1,l=!1,c=!1,f,d="",p="",v=null;const g=window.setTimeout(()=>{w(new Error(`Gateway RPC timed out: ${e}`))},Rz);function b(){window.clearTimeout(g),v!=null&&window.clearTimeout(v),a.close()}function S(C){o||(o=!0,b(),n(C))}function w(C){o||(o=!0,b(),r(C))}function E(C,k,j){a.send(JSON.stringify({type:"req",id:C,method:k,params:j??{}}))}async function T(){if(l||d||c)return;c=!0;const C=py();if(!C){c=!1,w(new Error("Gateway token missing. Re-open this page once with ?token=ANIMA_GATEWAY_TOKEN."));return}try{const k=await dy({minProtocol:h1,maxProtocol:h1,client:{id:"webchat-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:C,nonce:f});d=wu(),E(d,"connect",k),c=!1}catch(k){c=!1,w(k instanceof Error?k:new Error(String(k)))}}a.addEventListener("open",()=>{v=window.setTimeout(()=>{v=null,T()},100)}),a.addEventListener("message",C=>{let k;try{k=JSON.parse(String(C.data))}catch{return}const j=k;if(j.type==="event"){if(j.event==="connect.challenge"){const N=fy(j.payload);N&&(f=N),T()}return}if(j.type==="res"){if(j.id===d){if(d="",c=!1,!j.ok){w(new Error(j.error?.message||"Gateway connect failed"));return}l=!0,p=wu(),E(p,e,t);return}if(j.id===p&&l){if(!j.ok){w(new Error(j.error?.message||`Gateway method failed: ${e}`));return}S(j.payload??{})}}}),a.addEventListener("error",()=>{w(new Error(`Gateway websocket error while requesting ${e}`))}),a.addEventListener("close",()=>{o||w(new Error(`Gateway websocket closed while requesting ${e}`))})})}async function pt(e,t){return await as(e,t)}function Iz(e,t,n=Kv()){const r=Array.isArray(e.heartbeat?.agents)?e.heartbeat?.agents[0]:null,a=typeof r?.everyMs=="number"&&Number.isFinite(r.everyMs)?r.everyMs:3e5,o=typeof t?.ts=="number"&&Number.isFinite(t.ts)?t.ts:null;return{heartbeat:{running:!!r?.enabled,paused:!1,beatCount:0,lastBeat:o!=null?new Date(o).toISOString():null,nextBeat:o!=null?new Date(o+a).toISOString():null,interval:a},budget:{spent:0,remaining:200,limit:200,sessionCount:0},queue:{queued:Array.isArray(e.queuedSystemEvents)?e.queuedSystemEvents.length:0,running:0,completed:0,failed:0},mcp:{servers:[]},subagents:n}}function Kv(){return{total:0,active:0,recent:0,failed:0,latest:[]}}function Lz(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Pz(e){const t=e?.trim().toLowerCase();return t?t.startsWith("subagent:")||t.includes(":subagent:"):!1}function Uz(e){if(!Array.isArray(e.sessions)||e.sessions.length===0)return Kv();const t=Date.now(),n=e.sessions.filter(r=>Pz(r.key)).map(r=>{const a=Lz(r.updatedAt),o=a==null?Number.POSITIVE_INFINITY:Math.max(0,t-a),l=r.abortedLastRun===!0;let c="idle";return l?c="failed":o<=_z?c="active":o<=Oz&&(c="recent"),{key:r.key?.trim()||wu(),status:c,updatedAt:a!=null?new Date(a).toISOString():null,updatedAtMs:a}}).toSorted((r,a)=>(a.updatedAtMs??0)-(r.updatedAtMs??0));return n.length===0?Kv():{total:n.length,active:n.filter(r=>r.status==="active").length,recent:n.filter(r=>r.status==="recent").length,failed:n.filter(r=>r.status==="failed").length,latest:n.slice(0,Mz).map(r=>({key:r.key,status:r.status,updatedAt:r.updatedAt}))}}function zz(e){const t=e.name?.trim()||"Assistant",n=e.agentId?.trim()||"main",r=e.avatar?.trim()||"A";return{loadedAt:new Date().toISOString(),components:[{name:"SOUL",content:`# ${t}
|
|
22
|
+
Agent ID: ${n}
|
|
23
|
+
Avatar: ${r}`,source:"user",description:"Core identity resolved from active gateway agent profile."},{name:"HEART",content:"Heartbeat mode active. This instance listens for ongoing directives.",source:"template",description:"Heartbeat and operating rhythm configuration."},{name:"MEMORY",content:"Memory systems are managed by ANIMA runtime and session storage.",source:"template",description:"Long-term continuity and session persistence layer."}]}}function Bz(e){return Array.isArray(e.sessions)?e.sessions.map(t=>{const n=typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?new Date(t.updatedAt).toISOString():new Date().toISOString(),r=[t.modelProvider,t.model].filter(a=>typeof a=="string"&&a).join("/")||"gateway session";return{sessionId:t.sessionId||t.key||wu(),mode:t.origin?.surface||t.kind||"session",status:t.abortedLastRun?"failed":"completed",prompt:`Model: ${r}`,durationMs:0,costUsd:null,savedAt:n}}):[]}const Vz={enabled:!1,running:!1,paused:!1,nodeId:"unavailable",uptimeMs:0,tasksCompleted:0,tasksFailed:0,balance:0,sessionEarnings:0,limits:{maxCpuPercent:10,maxRamMB:256,maxBandwidthMbps:5},resources:null,earnings:{allTimeEarned:0,allTimeApplied:0,balanceValueUSD:0,todayEarned:0,todayTasks:0}};async function bf(e,t){const n=(t?.method||"GET").toUpperCase();if(n==="GET"&&e==="/api/status"){const[r,a,o]=await Promise.all([as("status",{}),as("last-heartbeat",{}).catch(()=>null),as("sessions.list",{limit:200,includeGlobal:!0,includeUnknown:!0}).catch(()=>({sessions:[]}))]),l=Uz(o);return Iz(r,a,l)}if(n==="GET"&&e==="/api/identity"){const r=await as("agent.identity.get",{sessionKey:"main"}).catch(()=>({name:"Assistant",avatar:"A",agentId:"main"}));return zz(r)}if(n==="GET"&&e==="/api/sessions"){const r=await as("sessions.list",{limit:50}).catch(()=>({sessions:[]}));return Bz(r)}if(n==="GET"&&e==="/api/queue")return[];if(n==="POST"&&e==="/api/queue"){const r=Dz(t),a=typeof r.prompt=="string"?r.prompt.trim():"",o=wu();return a&&await as("chat.send",{sessionKey:"main",message:a,deliver:!1,idempotencyKey:o}),{id:o}}if(n==="GET"&&e==="/api/mcp")return[];if(n==="GET"&&e==="/api/svrn/status")return Vz;if(n==="POST"&&(e==="/api/svrn/toggle"||e==="/api/svrn/limits"))return{success:!0};throw new Error(`Unsupported control UI API path: ${n} ${e}`)}async function Md(e,t){try{const n=new Headers(t?.headers??{});n.has("Content-Type")||n.set("Content-Type","application/json");const r=await fetch(`${Nz}${e}`,{...t,headers:n});if(!r.ok){if(e.startsWith("/api/"))return await bf(e,t);throw new Error(`API error: ${r.status} ${r.statusText}`)}if(String(r.headers.get("content-type")||"").includes("application/json"))return await r.json();const o=await r.text();if(e.startsWith("/api/")){const l=o.trim().toLowerCase();if(l.startsWith("<!doctype html")||l.startsWith("<html"))return await bf(e,t);try{return JSON.parse(o)}catch{return await bf(e,t)}}return JSON.parse(o)}catch(n){if(e.startsWith("/api/"))return await bf(e,t);throw n}}async function oN(){return Md("/api/status")}async function Fz(){return Md("/api/identity")}async function Hz(){return Md("/api/sessions")}async function qz(e,t="normal"){return Md("/api/queue",{method:"POST",body:JSON.stringify({prompt:e,priority:t,source:"web"})})}async function lN(){return await pt("config.get",{})}async function Gz(){return await pt("config.schema",{})}async function uN(e,t,n=!1){await pt(n?"config.apply":"config.set",{raw:e,baseHash:t})}async function Yv(e,t){await pt("config.patch",{raw:e,baseHash:t})}async function cN(){return await pt("anima.runtime.get",{})}async function Kz(e){await pt("anima.runtime.set-working-mode",{mode:e})}async function Yz(e,t,n){const r=await pt("anima.memory.list",{kind:e,...t?{query:t}:{},limit:n});return Array.isArray(r.entries)?r.entries:[]}async function $z(){return await pt("anima.mission.get",{})}async function Xz(e,t){return(await pt("anima.mission.set",{fileName:e,content:t})).file}async function wa(e){return(await pt("anima.mission.patch",{patch:e})).state}async function Wz(e){return(await pt("anima.mission.connect-repo",{...e})).repo}async function Qz(e){await pt("anima.trust.set",{people:e})}async function Jz(e){await pt("anima.mission.import",e)}async function fN(){return await pt("anima.registration.status",{})}async function dN(e){await pt("anima.registration.set-token",{token:e})}async function hN(e){await pt("anima.registration.register-invite",e)}async function $v(e){await pt("set-heartbeats",{enabled:e})}async function pN(e,t="next-heartbeat"){await pt("wake",{text:e,mode:t})}async function p1(e){return await pt("logs.tail",{...typeof e=="number"?{cursor:e}:{},limit:160,maxBytes:12e4})}async function mN(){return await pt("voicewake.get",{})}async function vN(e){return await pt("voicewake.set",{triggers:e})}async function gN(){return await pt("anima.providers.get",{})}async function Xv(e){await pt("anima.providers.set",{providers:e})}async function yN(e){await pt("anima.providers.rotate",{enabled:e})}async function Zz(){const e=await pt("org.list",{});return Array.isArray(e.orgs)?e.orgs:[]}async function eB(e){return await pt("org.get",{orgId:e})}async function tB(e){return await pt("org.create",e)}async function nB(e,t){return(await pt("org.addMember",{orgId:e,...t})).member}async function rB(e,t,n){return(await pt("org.updateMember",{orgId:e,memberId:t,...n})).member}async function iB(e,t){await pt("org.removeMember",{orgId:e,memberId:t})}async function aB(e){const t=await pt("org.hierarchy",{orgId:e});return Array.isArray(t.hierarchy)?t.hierarchy:[]}function sB(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const oB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uB={};function m1(e,t){return(uB.jsx?lB:oB).test(e)}const cB=/[ \t\n\f\r]/g;function fB(e){return typeof e=="object"?e.type==="text"?v1(e.value):!1:v1(e)}function v1(e){return e.replace(cB,"")===""}class Lu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Lu.prototype.normal={};Lu.prototype.property={};Lu.prototype.space=void 0;function bN(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Lu(n,r,t)}function Wv(e){return e.toLowerCase()}class Xn{constructor(t,n){this.attribute=n,this.property=t}}Xn.prototype.attribute="";Xn.prototype.booleanish=!1;Xn.prototype.boolean=!1;Xn.prototype.commaOrSpaceSeparated=!1;Xn.prototype.commaSeparated=!1;Xn.prototype.defined=!1;Xn.prototype.mustUseProperty=!1;Xn.prototype.number=!1;Xn.prototype.overloadedBoolean=!1;Xn.prototype.property="";Xn.prototype.spaceSeparated=!1;Xn.prototype.space=void 0;let dB=0;const Ye=bs(),sn=bs(),Qv=bs(),be=bs(),jt=bs(),xo=bs(),ir=bs();function bs(){return 2**++dB}const Jv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ye,booleanish:sn,commaOrSpaceSeparated:ir,commaSeparated:xo,number:be,overloadedBoolean:Qv,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),jm=Object.keys(Jv);class my extends Xn{constructor(t,n,r,a){let o=-1;if(super(t,n),g1(this,"space",a),typeof r=="number")for(;++o<jm.length;){const l=jm[o];g1(this,jm[o],(r&Jv[l])===Jv[l])}}}my.prototype.defined=!0;function g1(e,t,n){n&&(e[t]=n)}function Lo(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new my(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Wv(r)]=r,n[Wv(o.attribute)]=r}return new Lu(t,n,e.space)}const xN=Lo({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:jt,ariaCurrent:null,ariaDescribedBy:jt,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:jt,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:jt,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jt,ariaLevel:be,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:jt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:sn,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function SN(e,t){return t in e?e[t]:t}function wN(e,t){return SN(e,t.toLowerCase())}const hB=Lo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xo,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:Ye,allowPaymentRequest:Ye,allowUserMedia:Ye,alt:null,as:null,async:Ye,autoCapitalize:null,autoComplete:jt,autoFocus:Ye,autoPlay:Ye,blocking:jt,capture:null,charSet:null,checked:Ye,cite:null,className:jt,cols:be,colSpan:null,content:null,contentEditable:sn,controls:Ye,controlsList:jt,coords:be|xo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ye,defer:Ye,dir:null,dirName:null,disabled:Ye,download:Qv,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ye,formTarget:null,headers:jt,height:be,hidden:Qv,high:be,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:Ye,inputMode:null,integrity:null,is:null,isMap:Ye,itemId:null,itemProp:jt,itemRef:jt,itemScope:Ye,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ye,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ye,muted:Ye,name:null,nonce:null,noModule:Ye,noValidate:Ye,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ye,optimum:be,pattern:null,ping:jt,placeholder:null,playsInline:Ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ye,referrerPolicy:null,rel:jt,required:Ye,reversed:Ye,rows:be,rowSpan:be,sandbox:jt,scope:null,scoped:Ye,seamless:Ye,selected:Ye,shadowRootClonable:Ye,shadowRootDelegatesFocus:Ye,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ye,useMap:null,value:sn,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ye,declare:Ye,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ye,noHref:Ye,noShade:Ye,noWrap:Ye,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ye,disableRemotePlayback:Ye,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:wN}),pB=Lo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ir,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:jt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xo,g2:xo,glyphName:xo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:SN}),EN=Lo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),TN=Lo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wN}),kN=Lo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),mB={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},vB=/[A-Z]/g,y1=/-[a-z]/g,gB=/^data[-\w.:]+$/i;function yB(e,t){const n=Wv(t);let r=t,a=Xn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&gB.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(y1,xB);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!y1.test(o)){let l=o.replace(vB,bB);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=my}return new a(r,t)}function bB(e){return"-"+e.toLowerCase()}function xB(e){return e.charAt(1).toUpperCase()}const SB=bN([xN,hB,EN,TN,kN],"html"),vy=bN([xN,pB,EN,TN,kN],"svg");function wB(e){return e.join(" ").trim()}var ro={},Rm,b1;function EB(){if(b1)return Rm;b1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
24
|
+
`,d="/",p="*",v="",g="comment",b="declaration";function S(E,T){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];T=T||{};var C=1,k=1;function j(ue){var Z=ue.match(t);Z&&(C+=Z.length);var V=ue.lastIndexOf(f);k=~V?ue.length-V:k+ue.length}function N(){var ue={line:C,column:k};return function(Z){return Z.position=new R(ue),G(),Z}}function R(ue){this.start=ue,this.end={line:C,column:k},this.source=T.source}R.prototype.content=E;function L(ue){var Z=new Error(T.source+":"+C+":"+k+": "+ue);if(Z.reason=ue,Z.filename=T.source,Z.line=C,Z.column=k,Z.source=E,!T.silent)throw Z}function U(ue){var Z=ue.exec(E);if(Z){var V=Z[0];return j(V),E=E.slice(V.length),Z}}function G(){U(n)}function M(ue){var Z;for(ue=ue||[];Z=B();)Z!==!1&&ue.push(Z);return ue}function B(){var ue=N();if(!(d!=E.charAt(0)||p!=E.charAt(1))){for(var Z=2;v!=E.charAt(Z)&&(p!=E.charAt(Z)||d!=E.charAt(Z+1));)++Z;if(Z+=2,v===E.charAt(Z-1))return L("End of comment missing");var V=E.slice(2,Z-2);return k+=2,j(V),E=E.slice(Z),k+=2,ue({type:g,comment:V})}}function X(){var ue=N(),Z=U(r);if(Z){if(B(),!U(a))return L("property missing ':'");var V=U(o),W=ue({type:b,property:w(Z[0].replace(e,v)),value:V?w(V[0].replace(e,v)):v});return U(l),W}}function oe(){var ue=[];M(ue);for(var Z;Z=X();)Z!==!1&&(ue.push(Z),M(ue));return ue}return G(),oe()}function w(E){return E?E.replace(c,v):v}return Rm=S,Rm}var x1;function TB(){if(x1)return ro;x1=1;var e=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0}),ro.default=n;const t=e(EB());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),c=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:p}=f;c?a(d,p,f):p&&(o=o||{},o[d]=p)}),o}return ro}var ql={},S1;function kB(){if(S1)return ql;S1=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},l=function(d,p){return p.toUpperCase()},c=function(d,p){return"".concat(p,"-")},f=function(d,p){return p===void 0&&(p={}),o(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(a,c):d=d.replace(r,c),d.replace(t,l))};return ql.camelCase=f,ql}var Gl,w1;function CB(){if(w1)return Gl;w1=1;var e=Gl&&Gl.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(TB()),n=kB();function r(a,o){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(c,f){c&&f&&(l[(0,n.camelCase)(c,o)]=f)}),l}return r.default=r,Gl=r,Gl}var AB=CB();const NB=jo(AB),CN=AN("end"),gy=AN("start");function AN(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function jB(e){const t=gy(e),n=CN(e);if(t&&n)return{start:t,end:n}}function cu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?E1(e.position):"start"in e||"end"in e?E1(e):"line"in e||"column"in e?Zv(e):""}function Zv(e){return T1(e&&e.line)+":"+T1(e&&e.column)}function E1(e){return Zv(e&&e.start)+"-"+Zv(e&&e.end)}function T1(e){return e&&typeof e=="number"?e:1}class _n extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(l=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=c?c.line:void 0,this.name=cu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}_n.prototype.file="";_n.prototype.name="";_n.prototype.reason="";_n.prototype.message="";_n.prototype.stack="";_n.prototype.column=void 0;_n.prototype.line=void 0;_n.prototype.ancestors=void 0;_n.prototype.cause=void 0;_n.prototype.fatal=void 0;_n.prototype.place=void 0;_n.prototype.ruleId=void 0;_n.prototype.source=void 0;const yy={}.hasOwnProperty,RB=new Map,_B=/[A-Z]/g,OB=new Set(["table","tbody","thead","tfoot","tr"]),MB=new Set(["td","th"]),NN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function DB(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=FB(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=VB(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?vy:SB,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=jN(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function jN(e,t,n){if(t.type==="element")return IB(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return LB(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return UB(e,t,n);if(t.type==="mdxjsEsm")return PB(e,t);if(t.type==="root")return zB(e,t,n);if(t.type==="text")return BB(e,t)}function IB(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=vy,e.schema=a),e.ancestors.push(t);const o=_N(e,t.tagName,!1),l=HB(e,t);let c=xy(e,t);return OB.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!fB(f):!0})),RN(e,l,o,t),by(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function LB(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Eu(e,t.position)}function PB(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Eu(e,t.position)}function UB(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=vy,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:_N(e,t.name,!0),l=qB(e,t),c=xy(e,t);return RN(e,l,o,t),by(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function zB(e,t,n){const r={};return by(r,xy(e,t)),e.create(t,e.Fragment,r,n)}function BB(e,t){return t.value}function RN(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function by(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function VB(e,t,n){return r;function r(a,o,l,c){const d=Array.isArray(l.children)?n:t;return c?d(o,l,c):d(o,l)}}function FB(e,t){return n;function n(r,a,o,l){const c=Array.isArray(o.children),f=gy(r);return t(a,o,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function HB(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&yy.call(t.properties,a)){const o=GB(e,a,t.properties[a]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&MB.has(t.tagName)?r=c:n[l]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function qB(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Eu(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else Eu(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function xy(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:RB;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const d=a.get(f)||0;l=f+"-"+d,a.set(f,d+1)}}const c=jN(e,o,l);c!==void 0&&n.push(c)}return n}function GB(e,t,n){const r=yB(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?sB(n):wB(n)),r.property==="style"){let a=typeof n=="object"?n:KB(e,String(n));return e.stylePropertyNameCase==="css"&&(a=YB(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?mB[r.property]||r.property:r.attribute,n]}}function KB(e,t){try{return NB(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new _n("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=NN+"#cannot-parse-style-attribute",a}}function _N(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,l;for(;++o<a.length;){const c=m1(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=l}else r=m1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return yy.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Eu(e)}function Eu(e,t){const n=new _n("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=NN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function YB(e){const t={};let n;for(n in e)yy.call(e,n)&&(t[$B(n)]=e[n]);return t}function $B(e){let t=e.replace(_B,XB);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function XB(e){return"-"+e.toLowerCase()}const _m={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},WB={};function Sy(e,t){const n=WB,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ON(e,r,a)}function ON(e,t,n){if(QB(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return k1(e.children,t,n)}return Array.isArray(e)?k1(e,t,n):""}function k1(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=ON(e[a],t,n);return r.join("")}function QB(e){return!!(e&&typeof e=="object")}const C1=document.createElement("i");function wy(e){const t="&"+e+";";C1.innerHTML=t;const n=C1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function or(e,t,n,r){const a=e.length;let o=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Cr(e,t){return e.length>0?(or(e,e.length,0,t),e):t}const A1={}.hasOwnProperty;function MN(e){const t={};let n=-1;for(;++n<e.length;)JB(t,e[n]);return t}function JB(e,t){let n;for(n in t){const a=(A1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){A1.call(a,l)||(a[l]=[]);const c=o[l];ZB(a[l],Array.isArray(c)?c:c?[c]:[])}}}function ZB(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);or(e,0,0,r)}function DN(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ln=Oa(/[A-Za-z]/),Nn=Oa(/[\dA-Za-z]/),e5=Oa(/[#-'*+\--9=?A-Z^-~]/);function ld(e){return e!==null&&(e<32||e===127)}const eg=Oa(/\d/),t5=Oa(/[\dA-Fa-f]/),n5=Oa(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function At(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const Dd=Oa(new RegExp("\\p{P}|\\p{S}","u")),vs=Oa(/\s/);function Oa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Po(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&Nn(e.charCodeAt(n+1))&&Nn(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(l=String.fromCharCode(o,c),a=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function it(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return Je(f)?(e.enter(n),c(f)):t(f)}function c(f){return Je(f)&&o++<a?(e.consume(f),c):(e.exit(n),t(f))}}const r5={tokenize:i5};function i5(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),it(e,t,"linePrefix")}function a(c){return e.enter("paragraph"),o(c)}function o(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return De(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const a5={tokenize:s5},N1={tokenize:o5};function s5(e){const t=this,n=[];let r=0,a,o,l;return c;function c(k){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,f,d)(k)}return d(k)}function f(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const j=t.events.length;let N=j,R;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){R=t.events[N][1].end;break}T(r);let L=j;for(;L<t.events.length;)t.events[L][1].end={...R},L++;return or(t.events,N+1,0,t.events.slice(j)),t.events.length=L,d(k)}return c(k)}function d(k){if(r===n.length){if(!a)return g(k);if(a.currentConstruct&&a.currentConstruct.concrete)return S(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(N1,p,v)(k)}function p(k){return a&&C(),T(r),g(k)}function v(k){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,S(k)}function g(k){return t.containerState={},e.attempt(N1,b,S)(k)}function b(k){return r++,n.push([t.currentConstruct,t.containerState]),g(k)}function S(k){if(k===null){a&&C(),T(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),w(k)}function w(k){if(k===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(k);return}return De(k)?(e.consume(k),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(k),w)}function E(k,j){const N=t.sliceStream(k);if(j&&N.push(null),k.previous=o,o&&(o.next=k),o=k,a.defineSkip(k.start),a.write(N),t.parser.lazy[k.start.line]){let R=a.events.length;for(;R--;)if(a.events[R][1].start.offset<l&&(!a.events[R][1].end||a.events[R][1].end.offset>l))return;const L=t.events.length;let U=L,G,M;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(G){M=t.events[U][1].end;break}G=!0}for(T(r),R=L;R<t.events.length;)t.events[R][1].end={...M},R++;or(t.events,U+1,0,t.events.slice(L)),t.events.length=R}}function T(k){let j=n.length;for(;j-- >k;){const N=n[j];t.containerState=N[1],N[0].exit.call(t,e)}n.length=k}function C(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function o5(e,t,n){return it(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ao(e){if(e===null||At(e)||vs(e))return 1;if(Dd(e))return 2}function Id(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const tg={name:"attention",resolveAll:l5,tokenize:u5};function l5(e,t){let n=-1,r,a,o,l,c,f,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const v={...e[r][1].end},g={...e[n][1].start};j1(v,-f),j1(g,f),l={type:f>1?"strongSequence":"emphasisSequence",start:v,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Cr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Cr(d,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=Cr(d,Id(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Cr(d,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=Cr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,or(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function u5(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Ao(r);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===o)return e.consume(f),c;const d=e.exit("attentionSequence"),p=Ao(f),v=!p||p===2&&a||n.includes(f),g=!a||a===2&&p||n.includes(r);return d._open=!!(o===42?v:v&&(a||!g)),d._close=!!(o===42?g:g&&(p||!v)),t(f)}}function j1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const c5={name:"autolink",tokenize:f5};function f5(e,t,n){let r=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Ln(b)?(e.consume(b),l):b===64?n(b):d(b)}function l(b){return b===43||b===45||b===46||Nn(b)?(r=1,c(b)):d(b)}function c(b){return b===58?(e.consume(b),r=0,f):(b===43||b===45||b===46||Nn(b))&&r++<32?(e.consume(b),c):(r=0,d(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||ld(b)?n(b):(e.consume(b),f)}function d(b){return b===64?(e.consume(b),p):e5(b)?(e.consume(b),d):n(b)}function p(b){return Nn(b)?v(b):n(b)}function v(b){return b===46?(e.consume(b),r=0,p):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):g(b)}function g(b){if((b===45||Nn(b))&&r++<63){const S=b===45?g:v;return e.consume(b),S}return n(b)}}const Pu={partial:!0,tokenize:d5};function d5(e,t,n){return r;function r(o){return Je(o)?it(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||De(o)?t(o):n(o)}}const IN={continuation:{tokenize:p5},exit:m5,name:"blockQuote",tokenize:h5};function h5(e,t,n){const r=this;return a;function a(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return Je(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function p5(e,t,n){const r=this;return a;function a(l){return Je(l)?it(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(IN,t,n)(l)}}function m5(e){e.exit("blockQuote")}const LN={name:"characterEscape",tokenize:v5};function v5(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return n5(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const PN={name:"characterReference",tokenize:g5};function g5(e,t,n){const r=this;let a=0,o,l;return c;function c(v){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),f}function f(v){return v===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(v),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,l=Nn,p(v))}function d(v){return v===88||v===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(v),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=t5,p):(e.enter("characterReferenceValue"),o=7,l=eg,p(v))}function p(v){if(v===59&&a){const g=e.exit("characterReferenceValue");return l===Nn&&!wy(r.sliceSerialize(g))?n(v):(e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(v)&&a++<o?(e.consume(v),p):n(v)}}const R1={partial:!0,tokenize:b5},_1={concrete:!0,name:"codeFenced",tokenize:y5};function y5(e,t,n){const r=this,a={partial:!0,tokenize:N};let o=0,l=0,c;return f;function f(R){return d(R)}function d(R){const L=r.events[r.events.length-1];return o=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,c=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(R)}function p(R){return R===c?(l++,e.consume(R),p):l<3?n(R):(e.exit("codeFencedFenceSequence"),Je(R)?it(e,v,"whitespace")(R):v(R))}function v(R){return R===null||De(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(R1,w,j)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(R))}function g(R){return R===null||De(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),v(R)):Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,b,"whitespace")(R)):R===96&&R===c?n(R):(e.consume(R),g)}function b(R){return R===null||De(R)?v(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||De(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),v(R)):R===96&&R===c?n(R):(e.consume(R),S)}function w(R){return e.attempt(a,j,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),T}function T(R){return o>0&&Je(R)?it(e,C,"linePrefix",o+1)(R):C(R)}function C(R){return R===null||De(R)?e.check(R1,w,j)(R):(e.enter("codeFlowValue"),k(R))}function k(R){return R===null||De(R)?(e.exit("codeFlowValue"),C(R)):(e.consume(R),k)}function j(R){return e.exit("codeFenced"),t(R)}function N(R,L,U){let G=0;return M;function M(Z){return R.enter("lineEnding"),R.consume(Z),R.exit("lineEnding"),B}function B(Z){return R.enter("codeFencedFence"),Je(Z)?it(R,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):X(Z)}function X(Z){return Z===c?(R.enter("codeFencedFenceSequence"),oe(Z)):U(Z)}function oe(Z){return Z===c?(G++,R.consume(Z),oe):G>=l?(R.exit("codeFencedFenceSequence"),Je(Z)?it(R,ue,"whitespace")(Z):ue(Z)):U(Z)}function ue(Z){return Z===null||De(Z)?(R.exit("codeFencedFence"),L(Z)):U(Z)}}}function b5(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Om={name:"codeIndented",tokenize:S5},x5={partial:!0,tokenize:w5};function S5(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),it(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):De(d)?e.attempt(x5,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||De(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function w5(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):it(e,o,"linePrefix",5)(l)}function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):De(l)?a(l):n(l)}}const E5={name:"codeText",previous:k5,resolve:T5,tokenize:C5};function T5(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function k5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function C5(e,t,n){let r=0,a,o;return l;function l(v){return e.enter("codeText"),e.enter("codeTextSequence"),c(v)}function c(v){return v===96?(e.consume(v),r++,c):(e.exit("codeTextSequence"),f(v))}function f(v){return v===null?n(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),f):v===96?(o=e.enter("codeTextSequence"),a=0,p(v)):De(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(v))}function d(v){return v===null||v===32||v===96||De(v)?(e.exit("codeTextData"),f(v)):(e.consume(v),d)}function p(v){return v===96?(e.consume(v),a++,p):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(v)):(o.type="codeTextData",d(v))}}class A5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Kl(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Kl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Kl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Kl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Kl(this.left,n.reverse())}}}function Kl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function UN(e){const t={};let n=-1,r,a,o,l,c,f,d;const p=new A5(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,N5(p,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(l=p.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(p.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...p.get(a)[1].start},c=p.slice(a,n),c.unshift(r),p.splice(a,n-a+1,c))}}return or(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function N5(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let p,v,g=-1,b=n,S=0,w=0;const E=[w];for(;b;){for(;e.get(++a)[1]!==b;);o.push(a),b._tokenizer||(p=r.sliceStream(b),b.next||p.push(null),v&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),v=b,b=b.next}for(b=n;++g<c.length;)c[g][0]==="exit"&&c[g-1][0]==="enter"&&c[g][1].type===c[g-1][1].type&&c[g][1].start.line!==c[g][1].end.line&&(w=g+1,E.push(w),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):E.pop(),g=E.length;g--;){const T=c.slice(E[g],E[g+1]),C=o.pop();f.push([C,C+T.length-1]),e.splice(C,2,T)}for(f.reverse(),g=-1;++g<f.length;)d[S+f[g][0]]=S+f[g][1],S+=f[g][1]-f[g][0]-1;return d}const j5={resolve:_5,tokenize:O5},R5={partial:!0,tokenize:M5};function _5(e){return UN(e),e}function O5(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(c)}function a(c){return c===null?o(c):De(c)?e.check(R5,l,o)(c):(e.consume(c),a)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function M5(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),it(e,o,"linePrefix")}function o(l){if(l===null||De(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function zN(e,t,n,r,a,o,l,c,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return v;function v(T){return T===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(T),e.exit(o),g):T===null||T===32||T===41||ld(T)?n(T):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(T))}function g(T){return T===62?(e.enter(o),e.consume(T),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===62?(e.exit("chunkString"),e.exit(c),g(T)):T===null||T===60||De(T)?n(T):(e.consume(T),T===92?S:b)}function S(T){return T===60||T===62||T===92?(e.consume(T),b):b(T)}function w(T){return!p&&(T===null||T===41||At(T))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(T)):p<d&&T===40?(e.consume(T),p++,w):T===41?(e.consume(T),p--,w):T===null||T===32||T===40||ld(T)?n(T):(e.consume(T),T===92?E:w)}function E(T){return T===40||T===41||T===92?(e.consume(T),w):w(T)}}function BN(e,t,n,r,a,o){const l=this;let c=0,f;return d;function d(b){return e.enter(r),e.enter(a),e.consume(b),e.exit(a),e.enter(o),p}function p(b){return c>999||b===null||b===91||b===93&&!f||b===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(o),e.enter(a),e.consume(b),e.exit(a),e.exit(r),t):De(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),v(b))}function v(b){return b===null||b===91||b===93||De(b)||c++>999?(e.exit("chunkString"),p(b)):(e.consume(b),f||(f=!Je(b)),b===92?g:v)}function g(b){return b===91||b===92||b===93?(e.consume(b),c++,v):v(b)}}function VN(e,t,n,r,a,o){let l;return c;function c(g){return g===34||g===39||g===40?(e.enter(r),e.enter(a),e.consume(g),e.exit(a),l=g===40?41:g,f):n(g)}function f(g){return g===l?(e.enter(a),e.consume(g),e.exit(a),e.exit(r),t):(e.enter(o),d(g))}function d(g){return g===l?(e.exit(o),f(l)):g===null?n(g):De(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),it(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===l||g===null||De(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?v:p)}function v(g){return g===l||g===92?(e.consume(g),p):p(g)}}function fu(e,t){let n;return r;function r(a){return De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Je(a)?it(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const D5={name:"definition",tokenize:L5},I5={partial:!0,tokenize:P5};function L5(e,t,n){const r=this;let a;return o;function o(b){return e.enter("definition"),l(b)}function l(b){return BN.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function c(b){return a=Fr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):n(b)}function f(b){return At(b)?fu(e,d)(b):d(b)}function d(b){return zN(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(I5,v,v)(b)}function v(b){return Je(b)?it(e,g,"whitespace")(b):g(b)}function g(b){return b===null||De(b)?(e.exit("definition"),r.parser.defined.push(a),t(b)):n(b)}}function P5(e,t,n){return r;function r(c){return At(c)?fu(e,a)(c):n(c)}function a(c){return VN(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Je(c)?it(e,l,"whitespace")(c):l(c)}function l(c){return c===null||De(c)?t(c):n(c)}}const U5={name:"hardBreakEscape",tokenize:z5};function z5(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return De(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const B5={name:"headingAtx",resolve:V5,tokenize:F5};function V5(e,t){let n=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},or(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function F5(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||At(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||De(p)?(e.exit("atxHeading"),t(p)):Je(p)?it(e,c,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),c(p))}function d(p){return p===null||p===35||At(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const H5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],O1=["pre","script","style","textarea"],q5={concrete:!0,name:"htmlFlow",resolveTo:Y5,tokenize:$5},G5={partial:!0,tokenize:W5},K5={partial:!0,tokenize:X5};function Y5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $5(e,t,n){const r=this;let a,o,l,c,f;return d;function d(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),v}function v(D){return D===33?(e.consume(D),g):D===47?(e.consume(D),o=!0,w):D===63?(e.consume(D),a=3,r.interrupt?t:I):Ln(D)?(e.consume(D),l=String.fromCharCode(D),E):n(D)}function g(D){return D===45?(e.consume(D),a=2,b):D===91?(e.consume(D),a=5,c=0,S):Ln(D)?(e.consume(D),a=4,r.interrupt?t:I):n(D)}function b(D){return D===45?(e.consume(D),r.interrupt?t:I):n(D)}function S(D){const de="CDATA[";return D===de.charCodeAt(c++)?(e.consume(D),c===de.length?r.interrupt?t:X:S):n(D)}function w(D){return Ln(D)?(e.consume(D),l=String.fromCharCode(D),E):n(D)}function E(D){if(D===null||D===47||D===62||At(D)){const de=D===47,ye=l.toLowerCase();return!de&&!o&&O1.includes(ye)?(a=1,r.interrupt?t(D):X(D)):H5.includes(l.toLowerCase())?(a=6,de?(e.consume(D),T):r.interrupt?t(D):X(D)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):o?C(D):k(D))}return D===45||Nn(D)?(e.consume(D),l+=String.fromCharCode(D),E):n(D)}function T(D){return D===62?(e.consume(D),r.interrupt?t:X):n(D)}function C(D){return Je(D)?(e.consume(D),C):M(D)}function k(D){return D===47?(e.consume(D),M):D===58||D===95||Ln(D)?(e.consume(D),j):Je(D)?(e.consume(D),k):M(D)}function j(D){return D===45||D===46||D===58||D===95||Nn(D)?(e.consume(D),j):N(D)}function N(D){return D===61?(e.consume(D),R):Je(D)?(e.consume(D),N):k(D)}function R(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),f=D,L):Je(D)?(e.consume(D),R):U(D)}function L(D){return D===f?(e.consume(D),f=null,G):D===null||De(D)?n(D):(e.consume(D),L)}function U(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||At(D)?N(D):(e.consume(D),U)}function G(D){return D===47||D===62||Je(D)?k(D):n(D)}function M(D){return D===62?(e.consume(D),B):n(D)}function B(D){return D===null||De(D)?X(D):Je(D)?(e.consume(D),B):n(D)}function X(D){return D===45&&a===2?(e.consume(D),V):D===60&&a===1?(e.consume(D),W):D===62&&a===4?(e.consume(D),z):D===63&&a===3?(e.consume(D),I):D===93&&a===5?(e.consume(D),he):De(D)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(G5,ee,oe)(D)):D===null||De(D)?(e.exit("htmlFlowData"),oe(D)):(e.consume(D),X)}function oe(D){return e.check(K5,ue,ee)(D)}function ue(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return D===null||De(D)?oe(D):(e.enter("htmlFlowData"),X(D))}function V(D){return D===45?(e.consume(D),I):X(D)}function W(D){return D===47?(e.consume(D),l="",$):X(D)}function $(D){if(D===62){const de=l.toLowerCase();return O1.includes(de)?(e.consume(D),z):X(D)}return Ln(D)&&l.length<8?(e.consume(D),l+=String.fromCharCode(D),$):X(D)}function he(D){return D===93?(e.consume(D),I):X(D)}function I(D){return D===62?(e.consume(D),z):D===45&&a===2?(e.consume(D),I):X(D)}function z(D){return D===null||De(D)?(e.exit("htmlFlowData"),ee(D)):(e.consume(D),z)}function ee(D){return e.exit("htmlFlow"),t(D)}}function X5(e,t,n){const r=this;return a;function a(l){return De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function W5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Pu,t,n)}}const Q5={name:"htmlText",tokenize:J5};function J5(e,t,n){const r=this;let a,o,l;return c;function c(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),N):I===63?(e.consume(I),k):Ln(I)?(e.consume(I),U):n(I)}function d(I){return I===45?(e.consume(I),p):I===91?(e.consume(I),o=0,S):Ln(I)?(e.consume(I),C):n(I)}function p(I){return I===45?(e.consume(I),b):n(I)}function v(I){return I===null?n(I):I===45?(e.consume(I),g):De(I)?(l=v,W(I)):(e.consume(I),v)}function g(I){return I===45?(e.consume(I),b):v(I)}function b(I){return I===62?V(I):I===45?g(I):v(I)}function S(I){const z="CDATA[";return I===z.charCodeAt(o++)?(e.consume(I),o===z.length?w:S):n(I)}function w(I){return I===null?n(I):I===93?(e.consume(I),E):De(I)?(l=w,W(I)):(e.consume(I),w)}function E(I){return I===93?(e.consume(I),T):w(I)}function T(I){return I===62?V(I):I===93?(e.consume(I),T):w(I)}function C(I){return I===null||I===62?V(I):De(I)?(l=C,W(I)):(e.consume(I),C)}function k(I){return I===null?n(I):I===63?(e.consume(I),j):De(I)?(l=k,W(I)):(e.consume(I),k)}function j(I){return I===62?V(I):k(I)}function N(I){return Ln(I)?(e.consume(I),R):n(I)}function R(I){return I===45||Nn(I)?(e.consume(I),R):L(I)}function L(I){return De(I)?(l=L,W(I)):Je(I)?(e.consume(I),L):V(I)}function U(I){return I===45||Nn(I)?(e.consume(I),U):I===47||I===62||At(I)?G(I):n(I)}function G(I){return I===47?(e.consume(I),V):I===58||I===95||Ln(I)?(e.consume(I),M):De(I)?(l=G,W(I)):Je(I)?(e.consume(I),G):V(I)}function M(I){return I===45||I===46||I===58||I===95||Nn(I)?(e.consume(I),M):B(I)}function B(I){return I===61?(e.consume(I),X):De(I)?(l=B,W(I)):Je(I)?(e.consume(I),B):G(I)}function X(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),a=I,oe):De(I)?(l=X,W(I)):Je(I)?(e.consume(I),X):(e.consume(I),ue)}function oe(I){return I===a?(e.consume(I),a=void 0,Z):I===null?n(I):De(I)?(l=oe,W(I)):(e.consume(I),oe)}function ue(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||At(I)?G(I):(e.consume(I),ue)}function Z(I){return I===47||I===62||At(I)?G(I):n(I)}function V(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function W(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),$}function $(I){return Je(I)?it(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):he(I)}function he(I){return e.enter("htmlTextData"),l(I)}}const Ey={name:"labelEnd",resolveAll:n8,resolveTo:r8,tokenize:i8},Z5={tokenize:a8},e8={tokenize:s8},t8={tokenize:o8};function n8(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&or(e,0,e.length,n),e}function r8(e,t){let n=e.length,r=0,a,o,l,c;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=Cr(c,e.slice(o+1,o+r+3)),c=Cr(c,[["enter",p,t]]),c=Cr(c,Id(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=Cr(c,[["exit",p,t],e[l-2],e[l-1],["exit",d,t]]),c=Cr(c,e.slice(l+1)),c=Cr(c,[["exit",f,t]]),or(e,o,e.length,c),e}function i8(e,t,n){const r=this;let a=r.events.length,o,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return c;function c(g){return o?o._inactive?v(g):(l=r.parser.defined.includes(Fr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),f):n(g)}function f(g){return g===40?e.attempt(Z5,p,l?p:v)(g):g===91?e.attempt(e8,p,l?d:v)(g):l?p(g):v(g)}function d(g){return e.attempt(t8,p,v)(g)}function p(g){return t(g)}function v(g){return o._balanced=!0,n(g)}}function a8(e,t,n){return r;function r(v){return e.enter("resource"),e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),a}function a(v){return At(v)?fu(e,o)(v):o(v)}function o(v){return v===41?p(v):zN(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(v)}function l(v){return At(v)?fu(e,f)(v):p(v)}function c(v){return n(v)}function f(v){return v===34||v===39||v===40?VN(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(v):p(v)}function d(v){return At(v)?fu(e,p)(v):p(v)}function p(v){return v===41?(e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),e.exit("resource"),t):n(v)}}function s8(e,t,n){const r=this;return a;function a(c){return BN.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(Fr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function o8(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const l8={name:"labelStartImage",resolveAll:Ey.resolveAll,tokenize:u8};function u8(e,t,n){const r=this;return a;function a(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const c8={name:"labelStartLink",resolveAll:Ey.resolveAll,tokenize:f8};function f8(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Mm={name:"lineEnding",tokenize:d8};function d8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),it(e,t,"linePrefix")}}const qf={name:"thematicBreak",tokenize:h8};function h8(e,t,n){let r=0,a;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return a=d,c(d)}function c(d){return d===a?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||De(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===a?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),Je(d)?it(e,c,"whitespace")(d):c(d))}}const Yn={continuation:{tokenize:g8},exit:b8,name:"list",tokenize:v8},p8={partial:!0,tokenize:x8},m8={partial:!0,tokenize:y8};function v8(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return c;function c(b){const S=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:eg(b)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(qf,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return eg(b)&&++l<10?(e.consume(b),f):(!r.interrupt||l<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Pu,r.interrupt?n:p,e.attempt(p8,g,v))}function p(b){return r.containerState.initialBlankLine=!0,o++,g(b)}function v(b){return Je(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function g8(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Pu,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,it(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Je(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(m8,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,it(e,e.attempt(Yn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function y8(e,t,n){const r=this;return it(e,a,"listItemIndent",r.containerState.size+1);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function b8(e){e.exit(this.containerState.type)}function x8(e,t,n){const r=this;return it(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const l=r.events[r.events.length-1];return!Je(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const M1={name:"setextUnderline",resolveTo:S8,tokenize:w8};function S8(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function w8(e,t,n){const r=this;let a;return o;function o(d){let p=r.events.length,v;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){v=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||v)?(e.enter("setextHeadingLine"),a=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===a?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),Je(d)?it(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||De(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const E8={tokenize:T8};function T8(e){const t=this,n=e.attempt(Pu,r,e.attempt(this.parser.constructs.flowInitial,a,it(e,e.attempt(this.parser.constructs.flow,a,e.attempt(j5,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const k8={resolveAll:HN()},C8=FN("string"),A8=FN("text");function FN(e){return{resolveAll:HN(e==="text"?N8:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,l,c);return l;function l(p){return d(p)?o(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const v=a[p];let g=-1;if(v)for(;++g<v.length;){const b=v[g];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function HN(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function N8(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let o=a.length,l=-1,c=0,f;for(;o--;){const d=a[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const j8={42:Yn,43:Yn,45:Yn,48:Yn,49:Yn,50:Yn,51:Yn,52:Yn,53:Yn,54:Yn,55:Yn,56:Yn,57:Yn,62:IN},R8={91:D5},_8={[-2]:Om,[-1]:Om,32:Om},O8={35:B5,42:qf,45:[M1,qf],60:q5,61:M1,95:qf,96:_1,126:_1},M8={38:PN,92:LN},D8={[-5]:Mm,[-4]:Mm,[-3]:Mm,33:l8,38:PN,42:tg,60:[c5,Q5],91:c8,92:[U5,LN],93:Ey,95:tg,96:E5},I8={null:[tg,k8]},L8={null:[42,95]},P8={null:[]},U8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:L8,contentInitial:R8,disable:P8,document:j8,flow:O8,flowInitial:_8,insideSpan:I8,string:M8,text:D8},Symbol.toStringTag,{value:"Module"}));function z8(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let l=[],c=[];const f={attempt:L(N),check:L(R),consume:C,enter:k,exit:j,interrupt:L(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:g,sliceStream:b,write:v};let p=t.tokenize.call(d,f);return t.resolveAll&&o.push(t),d;function v(B){return l=Cr(l,B),E(),l[l.length-1]!==null?[]:(U(t,0),d.events=Id(o,d.events,d),d.events)}function g(B,X){return V8(b(B),X)}function b(B){return B8(l,B)}function S(){const{_bufferIndex:B,_index:X,line:oe,column:ue,offset:Z}=r;return{_bufferIndex:B,_index:X,line:oe,column:ue,offset:Z}}function w(B){a[B.line]=B.column,M()}function E(){let B;for(;r._index<l.length;){const X=l[r._index];if(typeof X=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<X.length;)T(X.charCodeAt(r._bufferIndex));else T(X)}}function T(B){p=p(B)}function C(B){De(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,M()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=B}function k(B,X){const oe=X||{};return oe.type=B,oe.start=S(),d.events.push(["enter",oe,d]),c.push(oe),oe}function j(B){const X=c.pop();return X.end=S(),d.events.push(["exit",X,d]),X}function N(B,X){U(B,X.from)}function R(B,X){X.restore()}function L(B,X){return oe;function oe(ue,Z,V){let W,$,he,I;return Array.isArray(ue)?ee(ue):"tokenize"in ue?ee([ue]):z(ue);function z(Se){return we;function we(Le){const je=Le!==null&&Se[Le],ge=Le!==null&&Se.null,Pe=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return ee(Pe)(Le)}}function ee(Se){return W=Se,$=0,Se.length===0?V:D(Se[$])}function D(Se){return we;function we(Le){return I=G(),he=Se,Se.partial||(d.currentConstruct=Se),Se.name&&d.parser.constructs.disable.null.includes(Se.name)?ye():Se.tokenize.call(X?Object.assign(Object.create(d),X):d,f,de,ye)(Le)}}function de(Se){return B(he,I),Z}function ye(Se){return I.restore(),++$<W.length?D(W[$]):V}}}function U(B,X){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&or(d.events,X,d.events.length-X,B.resolve(d.events.slice(X),d)),B.resolveTo&&(d.events=B.resolveTo(d.events,d))}function G(){const B=S(),X=d.previous,oe=d.currentConstruct,ue=d.events.length,Z=Array.from(c);return{from:ue,restore:V};function V(){r=B,d.previous=X,d.currentConstruct=oe,d.events.length=ue,c=Z,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function B8(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,o)];else{if(l=e.slice(n,a),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}o>0&&l.push(e[a].slice(0,o))}return l}function V8(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
25
|
+
`;break}case-3:{l=`\r
|
|
26
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(o)}a=o===-2,r.push(l)}return r.join("")}function F8(e){const r={constructs:MN([U8,...(e||{}).extensions||[]]),content:a(r5),defined:[],document:a(a5),flow:a(E8),lazy:{},string:a(C8),text:a(A8)};return r;function a(o){return l;function l(c){return z8(r,o,c)}}}function H8(e){for(;!UN(e););return e}const D1=/[\0\t\n\r]/g;function q8(){let e=1,t="",n=!0,r;return a;function a(o,l,c){const f=[];let d,p,v,g,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),v=0,t="",n&&(o.charCodeAt(0)===65279&&v++,n=void 0);v<o.length;){if(D1.lastIndex=v,d=D1.exec(o),g=d&&d.index!==void 0?d.index:o.length,b=o.charCodeAt(g),!d){t=o.slice(v);break}if(b===10&&v===g&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),v<g&&(f.push(o.slice(v,g)),e+=g-v),b){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}v=g+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const G8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function K8(e){return e.replace(G8,Y8)}function Y8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return DN(n.slice(o?2:1),o?16:10)}return wy(n)||e}const qN={}.hasOwnProperty;function $8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),X8(n)(H8(F8(n).document().write(q8()(e,t,!0))))}function X8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Jt),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(Nt),blockQuote:o(ge),characterEscape:G,characterReference:G,codeFenced:o(Pe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Pe,l),codeText:o(xt,l),codeTextData:G,data:G,codeFlowValue:G,definition:o(Ot),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o($e),hardBreakEscape:o(ot),hardBreakTrailing:o(ot),htmlFlow:o(Bt,l),htmlFlowData:G,htmlText:o(Bt,l),htmlTextData:G,image:o(Yt),label:l,link:o(Jt),listItem:o(at),listItemValue:g,listOrdered:o(mt,v),listUnordered:o(mt),paragraph:o(On),reference:D,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Nt),strong:o(ze),thematicBreak:o(Q)},exit:{atxHeading:f(),atxHeadingSequence:N,autolink:f(),autolinkEmail:je,autolinkProtocol:Le,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:Se,characterReference:we,codeFenced:f(E),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:M,codeIndented:f(T),codeText:f(Z),codeTextData:M,data:M,definition:f(),definitionDestinationString:j,definitionLabelString:C,definitionTitleString:k,emphasis:f(),hardBreakEscape:f(X),hardBreakTrailing:f(X),htmlFlow:f(oe),htmlFlowData:M,htmlText:f(ue),htmlTextData:M,image:f(W),label:he,labelText:$,lineEnding:B,link:f(V),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:de,resourceDestinationString:I,resourceTitleString:z,resource:ee,setextHeading:f(U),setextHeadingLineSequence:L,setextHeadingText:R,strong:f(),thematicBreak:f()}};GN(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(H){let se={type:"root",children:[]};const Te={stack:[se],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:p,data:n},Ee=[];let Be=-1;for(;++Be<H.length;)if(H[Be][1].type==="listOrdered"||H[Be][1].type==="listUnordered")if(H[Be][0]==="enter")Ee.push(Be);else{const lt=Ee.pop();Be=a(H,lt,Be)}for(Be=-1;++Be<H.length;){const lt=t[H[Be][0]];qN.call(lt,H[Be][1].type)&<[H[Be][1].type].call(Object.assign({sliceSerialize:H[Be][2].sliceSerialize},Te),H[Be][1])}if(Te.tokenStack.length>0){const lt=Te.tokenStack[Te.tokenStack.length-1];(lt[1]||I1).call(Te,void 0,lt[0])}for(se.position={start:pa(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:pa(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)se=t.transforms[Be](se)||se;return se}function a(H,se,Te){let Ee=se-1,Be=-1,lt=!1,$t,vt,Pt,P;for(;++Ee<=Te;){const Y=H[Ee];switch(Y[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Y[0]==="enter"?Be++:Be--,P=void 0;break}case"lineEndingBlank":{Y[0]==="enter"&&($t&&!P&&!Be&&!Pt&&(Pt=Ee),P=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:P=void 0}if(!Be&&Y[0]==="enter"&&Y[1].type==="listItemPrefix"||Be===-1&&Y[0]==="exit"&&(Y[1].type==="listUnordered"||Y[1].type==="listOrdered")){if($t){let xe=Ee;for(vt=void 0;xe--;){const qe=H[xe];if(qe[1].type==="lineEnding"||qe[1].type==="lineEndingBlank"){if(qe[0]==="exit")continue;vt&&(H[vt][1].type="lineEndingBlank",lt=!0),qe[1].type="lineEnding",vt=xe}else if(!(qe[1].type==="linePrefix"||qe[1].type==="blockQuotePrefix"||qe[1].type==="blockQuotePrefixWhitespace"||qe[1].type==="blockQuoteMarker"||qe[1].type==="listItemIndent"))break}Pt&&(!vt||Pt<vt)&&($t._spread=!0),$t.end=Object.assign({},vt?H[vt][1].start:Y[1].end),H.splice(vt||Ee,0,["exit",$t,Y[2]]),Ee++,Te++}if(Y[1].type==="listItemPrefix"){const xe={type:"listItem",_spread:!1,start:Object.assign({},Y[1].start),end:void 0};$t=xe,H.splice(Ee,0,["enter",xe,Y[2]]),Ee++,Te++,Pt=void 0,P=!0}}}return H[se][1]._spread=lt,Te}function o(H,se){return Te;function Te(Ee){c.call(this,H(Ee),Ee),se&&se.call(this,Ee)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(H,se,Te){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([se,Te||void 0]),H.position={start:pa(se.start),end:void 0}}function f(H){return se;function se(Te){H&&H.call(this,Te),d.call(this,Te)}}function d(H,se){const Te=this.stack.pop(),Ee=this.tokenStack.pop();if(Ee)Ee[0].type!==H.type&&(se?se.call(this,H,Ee[0]):(Ee[1]||I1).call(this,H,Ee[0]));else throw new Error("Cannot close `"+H.type+"` ("+cu({start:H.start,end:H.end})+"): it’s not open");Te.position.end=pa(H.end)}function p(){return Sy(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function g(H){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function b(){const H=this.resume(),se=this.stack[this.stack.length-1];se.lang=H}function S(){const H=this.resume(),se=this.stack[this.stack.length-1];se.meta=H}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const H=this.resume(),se=this.stack[this.stack.length-1];se.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const H=this.resume(),se=this.stack[this.stack.length-1];se.value=H.replace(/(\r?\n|\r)$/g,"")}function C(H){const se=this.resume(),Te=this.stack[this.stack.length-1];Te.label=se,Te.identifier=Fr(this.sliceSerialize(H)).toLowerCase()}function k(){const H=this.resume(),se=this.stack[this.stack.length-1];se.title=H}function j(){const H=this.resume(),se=this.stack[this.stack.length-1];se.url=H}function N(H){const se=this.stack[this.stack.length-1];if(!se.depth){const Te=this.sliceSerialize(H).length;se.depth=Te}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function L(H){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function G(H){const Te=this.stack[this.stack.length-1].children;let Ee=Te[Te.length-1];(!Ee||Ee.type!=="text")&&(Ee=Me(),Ee.position={start:pa(H.start),end:void 0},Te.push(Ee)),this.stack.push(Ee)}function M(H){const se=this.stack.pop();se.value+=this.sliceSerialize(H),se.position.end=pa(H.end)}function B(H){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=se.children[se.children.length-1];Te.position.end=pa(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(G.call(this,H),M.call(this,H))}function X(){this.data.atHardBreak=!0}function oe(){const H=this.resume(),se=this.stack[this.stack.length-1];se.value=H}function ue(){const H=this.resume(),se=this.stack[this.stack.length-1];se.value=H}function Z(){const H=this.resume(),se=this.stack[this.stack.length-1];se.value=H}function V(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=se,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function W(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=se,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function $(H){const se=this.sliceSerialize(H),Te=this.stack[this.stack.length-2];Te.label=K8(se),Te.identifier=Fr(se).toLowerCase()}function he(){const H=this.stack[this.stack.length-1],se=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Ee=H.children;Te.children=Ee}else Te.alt=se}function I(){const H=this.resume(),se=this.stack[this.stack.length-1];se.url=H}function z(){const H=this.resume(),se=this.stack[this.stack.length-1];se.title=H}function ee(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function de(H){const se=this.resume(),Te=this.stack[this.stack.length-1];Te.label=se,Te.identifier=Fr(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function ye(H){this.data.characterReferenceType=H.type}function Se(H){const se=this.sliceSerialize(H),Te=this.data.characterReferenceType;let Ee;Te?(Ee=DN(se,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ee=wy(se);const Be=this.stack[this.stack.length-1];Be.value+=Ee}function we(H){const se=this.stack.pop();se.position.end=pa(H.end)}function Le(H){M.call(this,H);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(H)}function je(H){M.call(this,H);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(H)}function ge(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function Ot(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $e(){return{type:"emphasis",children:[]}}function Nt(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function Bt(){return{type:"html",value:""}}function Yt(){return{type:"image",title:null,url:"",alt:null}}function Jt(){return{type:"link",title:null,url:"",children:[]}}function mt(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function at(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function On(){return{type:"paragraph",children:[]}}function ze(){return{type:"strong",children:[]}}function Me(){return{type:"text",value:""}}function Q(){return{type:"thematicBreak"}}}function pa(e){return{line:e.line,column:e.column,offset:e.offset}}function GN(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?GN(e,r):W8(e,r)}}function W8(e,t){let n;for(n in t)if(qN.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function I1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+cu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+cu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+cu({start:t.start,end:t.end})+") is still open")}function Q8(e){const t=this;t.parser=n;function n(r){return $8(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function J8(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Z8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
27
|
+
`}]}function eV(e,t){const n=t.value?t.value+`
|
|
28
|
+
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function tV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Po(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function iV(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aV(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function KN(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function sV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return KN(e,t);const a={src:Po(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function oV(e,t){const n={src:Po(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function lV(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function uV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return KN(e,t);const a={href:Po(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function cV(e,t){const n={href:Po(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fV(e,t,n){const r=e.all(t),a=n?dV(n):YN(t),o={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let v;p&&p.type==="element"&&p.tagName==="p"?v=p:(v={type:"element",tagName:"p",properties:{},children:[]},r.unshift(v)),v.children.length>0&&v.children.unshift({type:"text",value:" "}),v.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(a||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
29
|
+
`}),p.type==="element"&&p.tagName==="p"&&!a?l.push(...p.children):l.push(p)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
30
|
+
`});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function dV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=YN(n[r])}return t}function YN(e){const t=e.spread;return t??e.children.length>1}function hV(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function pV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function vV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gV(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=gy(t.children[1]),f=CN(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),a.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function yV(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const v=t.children[f],g={},b=l?l[f]:void 0;b&&(g.align=b);let S={type:"element",tagName:o,properties:g,children:[]};v&&(S.children=e.all(v),e.patch(v,S),S=e.applyData(v,S)),d.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function bV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const L1=9,P1=32;function xV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(U1(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(U1(t.slice(a),a>0,!1)),o.join("")}function U1(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===L1||o===P1;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===L1||o===P1;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function SV(e,t){const n={type:"text",value:xV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const EV={blockquote:J8,break:Z8,code:eV,delete:tV,emphasis:nV,footnoteReference:rV,heading:iV,html:aV,imageReference:sV,image:oV,inlineCode:lV,linkReference:uV,link:cV,listItem:fV,list:hV,paragraph:pV,root:mV,strong:vV,table:gV,tableCell:bV,tableRow:yV,text:SV,thematicBreak:wV,toml:xf,yaml:xf,definition:xf,footnoteDefinition:xf};function xf(){}const $N=-1,Ld=0,du=1,ud=2,Ty=3,ky=4,Cy=5,Ay=6,XN=7,WN=8,z1=typeof self=="object"?self:globalThis,TV=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,l]=t[a];switch(o){case Ld:case $N:return n(l,a);case du:{const c=n([],a);for(const f of l)c.push(r(f));return c}case ud:{const c=n({},a);for(const[f,d]of l)c[r(f)]=r(d);return c}case Ty:return n(new Date(l),a);case ky:{const{source:c,flags:f}=l;return n(new RegExp(c,f),a)}case Cy:{const c=n(new Map,a);for(const[f,d]of l)c.set(r(f),r(d));return c}case Ay:{const c=n(new Set,a);for(const f of l)c.add(r(f));return c}case XN:{const{name:c,message:f}=l;return n(new z1[c](f),a)}case WN:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new z1[o](l),a)};return r},B1=e=>TV(new Map,e)(0),io="",{toString:kV}={},{keys:CV}=Object,Yl=e=>{const t=typeof e;if(t!=="object"||!e)return[Ld,t];const n=kV.call(e).slice(8,-1);switch(n){case"Array":return[du,io];case"Object":return[ud,io];case"Date":return[Ty,io];case"RegExp":return[ky,io];case"Map":return[Cy,io];case"Set":return[Ay,io];case"DataView":return[du,n]}return n.includes("Array")?[du,n]:n.includes("Error")?[XN,n]:[ud,n]},Sf=([e,t])=>e===Ld&&(t==="function"||t==="symbol"),AV=(e,t,n,r)=>{const a=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},o=l=>{if(n.has(l))return n.get(l);let[c,f]=Yl(l);switch(c){case Ld:{let p=l;switch(f){case"bigint":c=WN,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return a([$N],l)}return a([c,p],l)}case du:{if(f){let g=l;return f==="DataView"?g=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(g=new Uint8Array(l)),a([f,[...g]],l)}const p=[],v=a([c,p],l);for(const g of l)p.push(o(g));return v}case ud:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const p=[],v=a([c,p],l);for(const g of CV(l))(e||!Sf(Yl(l[g])))&&p.push([o(g),o(l[g])]);return v}case Ty:return a([c,l.toISOString()],l);case ky:{const{source:p,flags:v}=l;return a([c,{source:p,flags:v}],l)}case Cy:{const p=[],v=a([c,p],l);for(const[g,b]of l)(e||!(Sf(Yl(g))||Sf(Yl(b))))&&p.push([o(g),o(b)]);return v}case Ay:{const p=[],v=a([c,p],l);for(const g of l)(e||!Sf(Yl(g)))&&p.push(o(g));return v}}const{message:d}=l;return a([c,{name:f,message:d}],l)};return o},V1=(e,{json:t,lossy:n}={})=>{const r=[];return AV(!(t||n),!!t,new Map,r)(e),r},cd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?B1(V1(e,t)):structuredClone(e):(e,t)=>B1(V1(e,t));function NV(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function jV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function RV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||NV,r=e.options.footnoteBackLabel||jV,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const p=e.all(d),v=String(d.identifier).toUpperCase(),g=Po(v.toLowerCase());let b=0;const S=[],w=e.footnoteCounts.get(v);for(;w!==void 0&&++b<=w;){S.length>0&&S.push({type:"text",value:" "});let C=typeof n=="string"?n:n(f,b);typeof C=="string"&&(C={type:"text",value:C}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const E=p[p.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const C=E.children[E.children.length-1];C&&C.type==="text"?C.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else p.push(...S);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(p,!0)};e.patch(d,T),c.push(T)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...cd(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
31
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
32
|
+
`}]}}const Pd=(function(e){if(e==null)return DV;if(typeof e=="function")return Ud(e);if(typeof e=="object")return Array.isArray(e)?_V(e):OV(e);if(typeof e=="string")return MV(e);throw new Error("Expected function, string, or object as test")});function _V(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Pd(e[n]);return Ud(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function OV(e){const t=e;return Ud(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function MV(e){return Ud(t);function t(n){return n&&n.type===e}}function Ud(e){return t;function t(n,r,a){return!!(IV(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function DV(){return!0}function IV(e){return e!==null&&typeof e=="object"&&"type"in e}const QN=[],LV=!0,ng=!1,PV="skip";function JN(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=Pd(a),l=r?-1:1;c(e,void 0,[])();function c(f,d,p){const v=f&&typeof f=="object"?f:{};if(typeof v.type=="string"){const b=typeof v.tagName=="string"?v.tagName:typeof v.name=="string"?v.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return g;function g(){let b=QN,S,w,E;if((!t||o(f,d,p[p.length-1]||void 0))&&(b=UV(n(f,p)),b[0]===ng))return b;if("children"in f&&f.children){const T=f;if(T.children&&b[0]!==PV)for(w=(r?T.children.length:-1)+l,E=p.concat(T);w>-1&&w<T.children.length;){const C=T.children[w];if(S=c(C,w,E)(),S[0]===ng)return S;w=typeof S[1]=="number"?S[1]:w+l}}return b}}}function UV(e){return Array.isArray(e)?e:typeof e=="number"?[LV,e]:e==null?QN:[e]}function Ny(e,t,n,r){let a,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,a=n):(o=t,l=n,a=r),JN(e,o,c,a);function c(f,d){const p=d[d.length-1],v=p?p.children.indexOf(f):void 0;return l(f,v,p)}}const rg={}.hasOwnProperty,zV={};function BV(e,t){const n=t||zV,r=new Map,a=new Map,o=new Map,l={...EV,...n.handlers},c={all:d,applyData:FV,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:VV,wrap:qV};return Ny(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const v=p.type==="definition"?r:a,g=String(p.identifier).toUpperCase();v.has(g)||v.set(g,p)}}),c;function f(p,v){const g=p.type,b=c.handlers[g];if(rg.call(c.handlers,g)&&b)return b(c,p,v);if(c.options.passThrough&&c.options.passThrough.includes(g)){if("children"in p){const{children:w,...E}=p,T=cd(E);return T.children=c.all(p),T}return cd(p)}return(c.options.unknownHandler||HV)(c,p,v)}function d(p){const v=[];if("children"in p){const g=p.children;let b=-1;for(;++b<g.length;){const S=c.one(g[b],p);if(S){if(b&&g[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=F1(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=F1(w.value))}Array.isArray(S)?v.push(...S):v.push(S)}}}return v}}function VV(e,t){e.position&&(t.position=jB(e))}function FV(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,cd(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function HV(e,t){const n=t.data||{},r="value"in t&&!(rg.call(n,"hProperties")||rg.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function qV(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
33
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
34
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
35
|
+
`}),n}function F1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function H1(e,t){const n=BV(e,t),r=n.one(e,void 0),a=RV(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
|
|
36
|
+
`},a),o}function GV(e,t){return e&&"run"in e?async function(n,r){const a=H1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return H1(n,{file:r,...e||t})}}function q1(e){if(e)throw e}var Dm,G1;function KV(){if(G1)return Dm;G1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),v=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!v)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},l=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},c=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return Dm=function f(){var d,p,v,g,b,S,w=arguments[0],E=1,T=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},E=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});E<T;++E)if(d=arguments[E],d!=null)for(p in d)v=c(w,p),g=c(d,p),w!==g&&(C&&g&&(o(g)||(b=a(g)))?(b?(b=!1,S=v&&a(v)?v:[]):S=v&&o(v)?v:{},l(w,{name:p,newValue:f(C,S,g)})):typeof g<"u"&&l(w,{name:p,newValue:g}));return w},Dm}var YV=KV();const Im=jo(YV);function ig(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $V(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...a);function c(f,...d){const p=e[++o];let v=-1;if(f){l(f);return}for(;++v<a.length;)(d[v]===null||d[v]===void 0)&&(d[v]=a[v]);a=d,p?XV(p,c)(...d):l(null,...d)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function XV(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(a);try{f=e.apply(this,l)}catch(d){const p=d;if(c&&n)throw p;return a(p)}c||(f&&f.then&&typeof f.then=="function"?f.then(o,a):f instanceof Error?a(f):o(f))}function a(l,...c){n||(n=!0,t(l,...c))}function o(l){a(null,l)}}const ii={basename:WV,dirname:QV,extname:JV,join:ZV,sep:"/"};function WV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Uu(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else l<0&&(o=!0,l=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function QV(e){if(Uu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function JV(e){Uu(e);let t=e.length,n=-1,r=0,a=-1,o=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function ZV(...e){let t=-1,n;for(;++t<e.length;)Uu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":eF(n)}function eF(e){Uu(e);const t=e.codePointAt(0)===47;let n=tF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function tF(e,t){let n="",r=0,a=-1,o=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(a===l-1||o===1))if(a!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,o=0;continue}}else if(n.length>0){n="",r=0,a=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,o=0}else c===46&&o>-1?o++:o=-1}return n}function Uu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nF={cwd:rF};function rF(){return"/"}function ag(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function iF(e){if(typeof e=="string")e=new URL(e);else if(!ag(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return aF(e)}function aF(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Lm=["history","path","basename","stem","extname","dirname"];class ZN{constructor(t){let n;t?ag(t)?n={path:t}:typeof t=="string"||sF(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":nF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Lm.length;){const o=Lm[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)Lm.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ii.basename(this.path):void 0}set basename(t){Um(t,"basename"),Pm(t,"basename"),this.path=ii.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ii.dirname(this.path):void 0}set dirname(t){K1(this.basename,"dirname"),this.path=ii.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ii.extname(this.path):void 0}set extname(t){if(Pm(t,"extname"),K1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ii.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ag(t)&&(t=iF(t)),Um(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ii.basename(this.path,this.extname):void 0}set stem(t){Um(t,"stem"),Pm(t,"stem"),this.path=ii.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new _n(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Pm(e,t){if(e&&e.includes(ii.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ii.sep+"`")}function Um(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function K1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function sF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oF=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),lF={}.hasOwnProperty;class jy extends oF{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$V()}copy(){const t=new jy;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Im(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vm("data",this.frozen),this.namespace[t]=n,this):lF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=wf(t),r=this.parser||this.Parser;return zm("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),zm("process",this.parser||this.Parser),Bm("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const c=wf(t),f=r.parse(c);r.run(f,c,function(p,v,g){if(p||!v||!g)return d(p);const b=v,S=r.stringify(b,g);fF(S)?g.value=S:g.result=S,d(p,g)});function d(p,v){p||!v?l(p):o?o(v):n(void 0,v)}}}processSync(t){let n=!1,r;return this.freeze(),zm("processSync",this.parser||this.Parser),Bm("processSync",this.compiler||this.Compiler),this.process(t,a),$1("processSync","process",n),r;function a(o,l){n=!0,q1(o),r=l}}run(t,n,r){Y1(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,c){const f=wf(n);a.run(t,f,d);function d(p,v,g){const b=v||t;p?c(p):l?l(b):r(void 0,b,g)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),$1("runSync","run",r),a;function o(l,c){q1(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=wf(n),a=this.compiler||this.Compiler;return Bm("stringify",a),Y1(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Vm("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...v]=d;f(p,v)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(a.settings=Im(!0,a.settings,d.settings))}function c(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const v=d[p];o(v)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,p){let v=-1,g=-1;for(;++v<r.length;)if(r[v][0]===d){g=v;break}if(g===-1)r.push([d,...p]);else if(p.length>0){let[b,...S]=p;const w=r[g][1];ig(w)&&ig(b)&&(b=Im(!0,w,b)),r[g]=[d,b,...S]}}}}const uF=new jy().freeze();function zm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Y1(e){if(!ig(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wf(e){return cF(e)?e:new ZN(e)}function cF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fF(e){return typeof e=="string"||dF(e)}function dF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",X1=[],W1={allowDangerousHtml:!0},pF=/^(https?|ircs?|mailto|xmpp)$/i,mF=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function vF(e){const t=gF(e),n=yF(e);return bF(t.runSync(t.parse(n),n),e)}function gF(e){const t=e.rehypePlugins||X1,n=e.remarkPlugins||X1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...W1}:W1;return uF().use(Q8).use(n).use(GV,r).use(t)}function yF(e){const t=e.children||"",n=new ZN;return typeof t=="string"&&(n.value=t),n}function bF(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||xF;for(const p of mF)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+hF+p.id,void 0);return Ny(e,d),DB(e,{Fragment:m.Fragment,components:a,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function d(p,v,g){if(p.type==="raw"&&g&&typeof v=="number")return l?g.children.splice(v,1):g.children[v]={type:"text",value:p.value},v;if(p.type==="element"){let b;for(b in _m)if(Object.hasOwn(_m,b)&&Object.hasOwn(p.properties,b)){const S=p.properties[b],w=_m[b];(w===null||w.includes(p.tagName))&&(p.properties[b]=f(String(S||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!b&&r&&typeof v=="number"&&(b=!r(p,v,g)),b&&g&&typeof v=="number")return c&&p.children?g.children.splice(v,1,...p.children):g.children.splice(v,1),v}}}function xF(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||pF.test(e.slice(0,t))?e:""}function Q1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function SF(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wF(e,t,n){const a=Pd((n||{}).ignore||[]),o=EF(t);let l=-1;for(;++l<o.length;)JN(e,"text",c);function c(d,p){let v=-1,g;for(;++v<p.length;){const b=p[v],S=g?g.children:void 0;if(a(b,S?S.indexOf(b):void 0,g))return;g=b}if(g)return f(d,p)}function f(d,p){const v=p[p.length-1],g=o[l][0],b=o[l][1];let S=0;const E=v.children.indexOf(d);let T=!1,C=[];g.lastIndex=0;let k=g.exec(d.value);for(;k;){const j=k.index,N={index:k.index,input:k.input,stack:[...p,d]};let R=b(...k,N);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?g.lastIndex=j+1:(S!==j&&C.push({type:"text",value:d.value.slice(S,j)}),Array.isArray(R)?C.push(...R):R&&C.push(R),S=j+k[0].length,T=!0),!g.global)break;k=g.exec(d.value)}return T?(S<d.value.length&&C.push({type:"text",value:d.value.slice(S)}),v.children.splice(E,1,...C)):C=[d],E+C.length}}function EF(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([TF(a[0]),kF(a[1])])}return t}function TF(e){return typeof e=="string"?new RegExp(SF(e),"g"):e}function kF(e){return typeof e=="function"?e:function(){return e}}const Fm="phrasing",Hm=["autolink","link","image","label"];function CF(){return{transforms:[MF],enter:{literalAutolink:NF,literalAutolinkEmail:qm,literalAutolinkHttp:qm,literalAutolinkWww:qm},exit:{literalAutolink:OF,literalAutolinkEmail:_F,literalAutolinkHttp:jF,literalAutolinkWww:RF}}}function AF(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fm,notInConstruct:Hm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fm,notInConstruct:Hm},{character:":",before:"[ps]",after:"\\/",inConstruct:Fm,notInConstruct:Hm}]}}function NF(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qm(e){this.config.enter.autolinkProtocol.call(this,e)}function jF(e){this.config.exit.autolinkProtocol.call(this,e)}function RF(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function _F(e){this.config.exit.autolinkEmail.call(this,e)}function OF(e){this.exit(e)}function MF(e){wF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DF],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),IF]],{ignore:["link","linkReference"]})}function DF(e,t,n,r,a){let o="";if(!ej(a)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!LF(n)))return!1;const l=PF(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function IF(e,t,n,r){return!ej(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function LF(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function PF(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=Q1(e,"(");let o=Q1(e,")");for(;r!==-1&&a>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function ej(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||vs(n)||Dd(n))&&(!t||n!==47)}tj.peek=KF;function UF(){this.buffer()}function zF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function BF(){this.buffer()}function VF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function FF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HF(e){this.exit(e)}function qF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function GF(e){this.exit(e)}function KF(){return"["}function tj(e,t,n,r){const a=n.createTracker(r);let o=a.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return o+=a.move(n.safe(n.associationId(e),{after:"]",before:o})),c(),l(),o+=a.move("]"),o}function YF(){return{enter:{gfmFootnoteCallString:UF,gfmFootnoteCall:zF,gfmFootnoteDefinitionLabelString:BF,gfmFootnoteDefinition:VF},exit:{gfmFootnoteCallString:FF,gfmFootnoteCall:HF,gfmFootnoteDefinitionLabelString:qF,gfmFootnoteDefinition:GF}}}function $F(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,o,l){const c=o.createTracker(l);let f=c.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=c.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
37
|
+
`:" ")+o.indentLines(o.containerFlow(r,c.current()),t?nj:XF))),d(),f}}function XF(e,t,n){return t===0?e:nj(e,t,n)}function nj(e,t,n){return(n?"":" ")+e}const WF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];rj.peek=tH;function QF(){return{canContainEols:["delete"],enter:{strikethrough:ZF},exit:{strikethrough:eH}}}function JF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:WF}],handlers:{delete:rj}}}function ZF(e){this.enter({type:"delete",children:[]},e)}function eH(e){this.exit(e)}function rj(e,t,n,r){const a=n.createTracker(r),o=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),o(),l}function tH(){return"~"}function nH(e){return e.length}function rH(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||nH,o=[],l=[],c=[],f=[];let d=0,p=-1;for(;++p<e.length;){const w=[],E=[];let T=-1;for(e[p].length>d&&(d=e[p].length);++T<e[p].length;){const C=iH(e[p][T]);if(n.alignDelimiters!==!1){const k=a(C);E[T]=k,(f[T]===void 0||k>f[T])&&(f[T]=k)}w.push(C)}l[p]=w,c[p]=E}let v=-1;if(typeof r=="object"&&"length"in r)for(;++v<d;)o[v]=J1(r[v]);else{const w=J1(r);for(;++v<d;)o[v]=w}v=-1;const g=[],b=[];for(;++v<d;){const w=o[v];let E="",T="";w===99?(E=":",T=":"):w===108?E=":":w===114&&(T=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[v]-E.length-T.length);const k=E+"-".repeat(C)+T;n.alignDelimiters!==!1&&(C=E.length+C+T.length,C>f[v]&&(f[v]=C),b[v]=C),g[v]=k}l.splice(1,0,g),c.splice(1,0,b),p=-1;const S=[];for(;++p<l.length;){const w=l[p],E=c[p];v=-1;const T=[];for(;++v<d;){const C=w[v]||"";let k="",j="";if(n.alignDelimiters!==!1){const N=f[v]-(E[v]||0),R=o[v];R===114?k=" ".repeat(N):R===99?N%2?(k=" ".repeat(N/2+.5),j=" ".repeat(N/2-.5)):(k=" ".repeat(N/2),j=k):j=" ".repeat(N)}n.delimiterStart!==!1&&!v&&T.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||v)&&T.push(" "),n.alignDelimiters!==!1&&T.push(k),T.push(C),n.alignDelimiters!==!1&&T.push(j),n.padding!==!1&&T.push(" "),(n.delimiterEnd!==!1||v!==d-1)&&T.push("|")}S.push(n.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return S.join(`
|
|
38
|
+
`)}function iH(e){return e==null?"":String(e)}function J1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function aH(e,t,n,r){const a=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),sH);return a(),l}function sH(e,t,n){return">"+(n?"":" ")+e}function oH(e,t){return Z1(e,t.inConstruct,!0)&&!Z1(e,t.notInConstruct,!1)}function Z1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function eT(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
39
|
+
`&&oH(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
40
|
+
`}function lH(e,t){const n=String(e);let r=n.indexOf(t),a=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++o>l&&(l=o):o=1,a=r+t.length,r=n.indexOf(t,a);return l}function uH(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function cH(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function fH(e,t,n,r){const a=cH(n),o=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(uH(e,n)){const v=n.enter("codeIndented"),g=n.indentLines(o,dH);return v(),g}const c=n.createTracker(r),f=a.repeat(Math.max(lH(o,a)+1,3)),d=n.enter("codeFenced");let p=c.move(f);if(e.lang){const v=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),v()}if(e.lang&&e.meta){const v=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
41
|
+
`,encode:["`"],...c.current()})),v()}return p+=c.move(`
|
|
42
|
+
`),o&&(p+=c.move(o+`
|
|
43
|
+
`)),p+=c.move(f),d(),p}function dH(e,t,n){return(n?"":" ")+e}function Ry(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function hH(e,t,n,r){const a=Ry(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
44
|
+
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),l(),d}function pH(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Tu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fd(e,t,n){const r=Ao(e),a=Ao(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ij.peek=mH;function ij(e,t,n,r){const a=pH(n),o=n.enter("emphasis"),l=n.createTracker(r),c=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),p=fd(r.before.charCodeAt(r.before.length-1),d,a);p.inside&&(f=Tu(d)+f.slice(1));const v=f.charCodeAt(f.length-1),g=fd(r.after.charCodeAt(0),v,a);g.inside&&(f=f.slice(0,-1)+Tu(v));const b=l.move(a);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:p.outside},c+f+b}function mH(e,t,n){return n.options.emphasis||"*"}function vH(e,t){let n=!1;return Ny(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ng}),!!((!e.depth||e.depth<3)&&Sy(e)&&(t.options.setext||n))}function gH(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(vH(e,n)){const p=n.enter("headingSetext"),v=n.enter("phrasing"),g=n.containerPhrasing(e,{...o.current(),before:`
|
|
45
|
+
`,after:`
|
|
46
|
+
`});return v(),p(),g+`
|
|
47
|
+
`+(a===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
|
|
48
|
+
`))+1))}const l="#".repeat(a),c=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
49
|
+
`,...o.current()});return/^[\t ]/.test(d)&&(d=Tu(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}aj.peek=yH;function aj(e){return e.value||""}function yH(){return"<"}sj.peek=bH;function sj(e,t,n,r){const a=Ry(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),d+=f.move(")"),l(),d}function bH(){return"!"}oj.peek=xH;function oj(e,t,n,r){const a=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const v=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=p,o(),a==="full"||!d||d!==v?f+=c.move(v+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function xH(){return"!"}lj.peek=SH;function lj(e,t,n){let r=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return a+r+a}function SH(){return"`"}function uj(e,t){const n=Sy(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}cj.peek=wH;function cj(e,t,n,r){const a=Ry(n),o=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(uj(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let v=l.move("<");return v+=l.move(n.containerPhrasing(e,{before:v,after:">",...l.current()})),v+=l.move(">"),c(),n.stack=p,v}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=l.move(" "+a),d+=l.move(n.safe(e.title,{before:d,after:a,...l.current()})),d+=l.move(a),f()),d+=l.move(")"),c(),d}function wH(e,t,n){return uj(e,n)?"<":"["}fj.peek=EH;function fj(e,t,n,r){const a=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const v=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=p,o(),a==="full"||!d||d!==v?f+=c.move(v+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function EH(){return"["}function _y(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function TH(e){const t=_y(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function kH(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function dj(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function CH(e,t,n,r){const a=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?kH(n):_y(n);const c=e.ordered?l==="."?")":".":TH(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),dj(n)===l&&p){let v=-1;for(;++v<e.children.length;){const g=e.children[v];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,a(),d}function AH(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function NH(e,t,n,r){const a=AH(n);let o=n.bulletCurrent||_y(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(o+" ".repeat(l-o.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),p);return f(),d;function p(v,g,b){return g?(b?"":" ".repeat(l))+v:(b?o:o+" ".repeat(l-o.length))+v}}function jH(e,t,n,r){const a=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),a(),l}const RH=Pd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function _H(e,t,n,r){return(e.children.some(function(l){return RH(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function OH(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hj.peek=MH;function hj(e,t,n,r){const a=OH(n),o=n.enter("strong"),l=n.createTracker(r),c=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),p=fd(r.before.charCodeAt(r.before.length-1),d,a);p.inside&&(f=Tu(d)+f.slice(1));const v=f.charCodeAt(f.length-1),g=fd(r.after.charCodeAt(0),v,a);g.inside&&(f=f.slice(0,-1)+Tu(v));const b=l.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:g.outside,before:p.outside},c+f+b}function MH(e,t,n){return n.options.strong||"*"}function DH(e,t,n,r){return n.safe(e.value,r)}function IH(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function LH(e,t,n){const r=(dj(n)+(n.options.ruleSpaces?" ":"")).repeat(IH(n));return n.options.ruleSpaces?r.slice(0,-1):r}const pj={blockquote:aH,break:eT,code:fH,definition:hH,emphasis:ij,hardBreak:eT,heading:gH,html:aj,image:sj,imageReference:oj,inlineCode:lj,link:cj,linkReference:fj,list:CH,listItem:NH,paragraph:jH,root:_H,strong:hj,text:DH,thematicBreak:LH};function PH(){return{enter:{table:UH,tableData:tT,tableHeader:tT,tableRow:BH},exit:{codeText:VH,table:zH,tableData:Gm,tableHeader:Gm,tableRow:Gm}}}function UH(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function zH(e){this.exit(e),this.data.inTable=void 0}function BH(e){this.enter({type:"tableRow",children:[]},e)}function Gm(e){this.exit(e)}function tT(e){this.enter({type:"tableCell",children:[]},e)}function VH(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FH));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FH(e,t){return t==="|"?t:e}function HH(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
50
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:l,tableCell:f,tableRow:c}};function l(b,S,w,E){return d(p(b,w,E),b.align)}function c(b,S,w,E){const T=v(b,w,E),C=d([T]);return C.slice(0,C.indexOf(`
|
|
51
|
+
`))}function f(b,S,w,E){const T=w.enter("tableCell"),C=w.enter("phrasing"),k=w.containerPhrasing(b,{...E,before:o,after:o});return C(),T(),k}function d(b,S){return rH(b,{align:S,alignDelimiters:r,padding:n,stringLength:a})}function p(b,S,w){const E=b.children;let T=-1;const C=[],k=S.enter("table");for(;++T<E.length;)C[T]=v(E[T],S,w);return k(),C}function v(b,S,w){const E=b.children;let T=-1;const C=[],k=S.enter("tableRow");for(;++T<E.length;)C[T]=f(E[T],b,S,w);return k(),C}function g(b,S,w){let E=pj.inlineCode(b,S,w);return w.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function qH(){return{exit:{taskListCheckValueChecked:nT,taskListCheckValueUnchecked:nT,paragraph:KH}}}function GH(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:YH}}}function nT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function KH(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let o=-1,l;for(;++o<a.length;){const c=a[o];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function YH(e,t,n,r){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(l);let f=pj.listItem(e,t,n,{...r,...c.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(p){return p+l}}function $H(){return[CF(),YF(),QF(),PH(),qH()]}function XH(e){return{extensions:[AF(),$F(e),JF(),HH(e),GH()]}}const WH={tokenize:nq,partial:!0},mj={tokenize:rq,partial:!0},vj={tokenize:iq,partial:!0},gj={tokenize:aq,partial:!0},QH={tokenize:sq,partial:!0},yj={name:"wwwAutolink",tokenize:eq,previous:xj},bj={name:"protocolAutolink",tokenize:tq,previous:Sj},Fi={name:"emailAutolink",tokenize:ZH,previous:wj},pi={};function JH(){return{text:pi}}let ns=48;for(;ns<123;)pi[ns]=Fi,ns++,ns===58?ns=65:ns===91&&(ns=97);pi[43]=Fi;pi[45]=Fi;pi[46]=Fi;pi[95]=Fi;pi[72]=[Fi,bj];pi[104]=[Fi,bj];pi[87]=[Fi,yj];pi[119]=[Fi,yj];function ZH(e,t,n){const r=this;let a,o;return l;function l(v){return!sg(v)||!wj.call(r,r.previous)||Oy(r.events)?n(v):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(v))}function c(v){return sg(v)?(e.consume(v),c):v===64?(e.consume(v),f):n(v)}function f(v){return v===46?e.check(QH,p,d)(v):v===45||v===95||Nn(v)?(o=!0,e.consume(v),f):p(v)}function d(v){return e.consume(v),a=!0,f}function p(v){return o&&a&&Ln(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(v)):n(v)}}function eq(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!xj.call(r,r.previous)||Oy(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(WH,e.attempt(mj,e.attempt(vj,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function tq(e,t,n){const r=this;let a="",o=!1;return l;function l(v){return(v===72||v===104)&&Sj.call(r,r.previous)&&!Oy(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(v),e.consume(v),c):n(v)}function c(v){if(Ln(v)&&a.length<5)return a+=String.fromCodePoint(v),e.consume(v),c;if(v===58){const g=a.toLowerCase();if(g==="http"||g==="https")return e.consume(v),f}return n(v)}function f(v){return v===47?(e.consume(v),o?d:(o=!0,f)):n(v)}function d(v){return v===null||ld(v)||At(v)||vs(v)||Dd(v)?n(v):e.attempt(mj,e.attempt(vj,p),n)(v)}function p(v){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(v)}}function nq(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function rq(e,t,n){let r,a,o;return l;function l(d){return d===46||d===95?e.check(gj,f,c)(d):d===null||At(d)||vs(d)||d!==45&&Dd(d)?f(d):(o=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(a=r,r=void 0),e.consume(d),l}function f(d){return a||r||!o?n(d):t(d)}}function iq(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(gj,t,o)(l):l===null||At(l)||vs(l)?t(l):(e.consume(l),a)}function o(l){return l===41&&r++,e.consume(l),a}}function aq(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),a):c===60||c===null||At(c)||vs(c)?t(c):n(c)}function a(c){return c===null||c===40||c===91||At(c)||vs(c)?t(c):r(c)}function o(c){return Ln(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):Ln(c)?(e.consume(c),l):n(c)}}function sq(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return Nn(o)?n(o):t(o)}}function xj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||At(e)}function Sj(e){return!Ln(e)}function wj(e){return!(e===47||sg(e))}function sg(e){return e===43||e===45||e===46||e===95||Nn(e)}function Oy(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const oq={tokenize:mq,partial:!0};function lq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dq,continuation:{tokenize:hq},exit:pq}},text:{91:{name:"gfmFootnoteCall",tokenize:fq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uq,resolveTo:cq}}}}function uq(e,t,n){const r=this;let a=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=Fr(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function cq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function fq(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return c;function c(v){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(v),e.exit("gfmFootnoteCallLabelMarker"),f}function f(v){return v!==94?n(v):(e.enter("gfmFootnoteCallMarker"),e.consume(v),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(v){if(o>999||v===93&&!l||v===null||v===91||At(v))return n(v);if(v===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return a.includes(Fr(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(v),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(v)}return At(v)||(l=!0),o++,e.consume(v),v===92?p:d}function p(v){return v===91||v===92||v===93?(e.consume(v),o++,d):d(v)}}function dq(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,c;return f;function f(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(l>999||S===93&&!c||S===null||S===91||At(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=Fr(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return At(S)||(c=!0),l++,e.consume(S),S===92?v:p}function v(S){return S===91||S===92||S===93?(e.consume(S),l++,p):p(S)}function g(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),a.includes(o)||a.push(o),it(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function hq(e,t,n){return e.check(Pu,t,e.attempt(oq,t,n))}function pq(e){e.exit("gfmFootnoteDefinition")}function mq(e,t,n){const r=this;return it(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function vq(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},v={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},g=[["enter",p,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",v,c]],b=c.parser.constructs.insideSpan.null;b&&or(g,g.length,0,Id(b,l.slice(d+1,f),c)),or(g,g.length,0,[["exit",v,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",p,c]]),or(l,d-1,f-d+3,g),f=d+g.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,c,f){const d=this.previous,p=this.events;let v=0;return g;function g(S){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(S):(l.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const w=Ao(d);if(S===126)return v>1?f(S):(l.consume(S),v++,b);if(v<2&&!n)return f(S);const E=l.exit("strikethroughSequenceTemporary"),T=Ao(S);return E._open=!T||T===2&&!!w,E._close=!w||w===2&&!!T,c(S)}}}class gq{constructor(){this.map=[]}add(t,n,r){yq(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const o of a)t.push(o);a=r.pop()}this.map.length=0}}function yq(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function bq(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function xq(){return{flow:{null:{name:"table",tokenize:Sq,resolveAll:wq}}}}function Sq(e,t,n){const r=this;let a=0,o=0,l;return c;function c(M){let B=r.events.length-1;for(;B>-1;){const ue=r.events[B][1].type;if(ue==="lineEnding"||ue==="linePrefix")B--;else break}const X=B>-1?r.events[B][1].type:null,oe=X==="tableHead"||X==="tableRow"?R:f;return oe===R&&r.parser.lazy[r.now().line]?n(M):oe(M)}function f(M){return e.enter("tableHead"),e.enter("tableRow"),d(M)}function d(M){return M===124||(l=!0,o+=1),p(M)}function p(M){return M===null?n(M):De(M)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),b):n(M):Je(M)?it(e,p,"whitespace")(M):(o+=1,l&&(l=!1,a+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),v(M)))}function v(M){return M===null||M===124||At(M)?(e.exit("data"),p(M)):(e.consume(M),M===92?g:v)}function g(M){return M===92||M===124?(e.consume(M),v):v(M)}function b(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),l=!1,Je(M)?it(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):S(M))}function S(M){return M===45||M===58?E(M):M===124?(l=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),w):N(M)}function w(M){return Je(M)?it(e,E,"whitespace")(M):E(M)}function E(M){return M===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),T):M===45?(o+=1,T(M)):M===null||De(M)?j(M):N(M)}function T(M){return M===45?(e.enter("tableDelimiterFiller"),C(M)):N(M)}function C(M){return M===45?(e.consume(M),C):M===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(M))}function k(M){return Je(M)?it(e,j,"whitespace")(M):j(M)}function j(M){return M===124?S(M):M===null||De(M)?!l||a!==o?N(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):N(M)}function N(M){return n(M)}function R(M){return e.enter("tableRow"),L(M)}function L(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),L):M===null||De(M)?(e.exit("tableRow"),t(M)):Je(M)?it(e,L,"whitespace")(M):(e.enter("data"),U(M))}function U(M){return M===null||M===124||At(M)?(e.exit("data"),L(M)):(e.consume(M),M===92?G:U)}function G(M){return M===92||M===124?(e.consume(M),U):U(M)}}function wq(e,t){let n=-1,r=!0,a=0,o=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,p,v;const g=new gq;for(;++n<e.length;){const b=e[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(c=!1,f!==0&&(rT(g,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},g.add(n,0,[["enter",d,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,v=void 0,o=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},g.add(n,0,[["enter",p,t]])),a=S.type==="tableDelimiterRow"?2:p?3:1):a&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],v=Ef(g,t,o,a,void 0,v),o=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],v=Ef(g,t,o,a,void 0,v)),o=l,l=[o[1],n,0,0])):S.type==="tableHead"?(c=!0,f=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],v=Ef(g,t,o,a,n,v)):l[1]!==0&&(v=Ef(g,t,l,a,n,v)),a=0):a&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&rT(g,t,f,d,p),g.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=bq(t.events,n))}return e}function Ef(e,t,n,r,a,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},so(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=so(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=so(t.events,n[2]),p=so(t.events,n[3]),v={type:c,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",v,t]]),r!==2){const g=t.events[n[2]],b=t.events[n[3]];if(g[1].end=Object.assign({},b[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,w=n[3]-n[2]-1;e.add(S,w,[])}}e.add(n[3]+1,0,[["exit",v,t]])}return a!==void 0&&(o.end=Object.assign({},so(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function rT(e,t,n,r,a){const o=[],l=so(t.events,n);a&&(a.end=Object.assign({},l),o.push(["exit",a,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function so(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Eq={name:"tasklistCheck",tokenize:kq};function Tq(){return{text:{91:Eq}}}function kq(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return At(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return De(f)?t(f):Je(f)?e.check({tokenize:Cq},t,n)(f):n(f)}}function Cq(e,t,n){return it(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function Aq(e){return MN([JH(),lq(),vq(e),xq(),Tq()])}const Nq={};function jq(e){const t=this,n=e||Nq,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(Aq(n)),o.push($H()),l.push(XH(n))}function Ea({value:e,className:t}){return m.jsx("div",{className:t??"anima-markdown",children:m.jsx(vF,{remarkPlugins:[jq],components:{a:({node:n,...r})=>m.jsx("a",{...r,target:"_blank",rel:"noopener noreferrer",children:r.children})},children:e})})}function $l(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function dd(e){const t={enabled:!1,every:"5m",target:"last",session:"main",model:"",prompt:"Check mission control, review queued work, and when NoxSoft MCP/chat is available, check in with Nox briefly before syncing continuity files.",activeStart:"",activeEnd:"",activeTimezone:"",ackMaxChars:"",includeReasoning:!1},n=e?.config;if(!$l(n))return t;const r=$l(n.agents)?n.agents:null,a=r&&$l(r.defaults)?r.defaults:null,o=a&&$l(a.heartbeat)?a.heartbeat:null;if(!o)return t;const l=$l(o.activeHours)?o.activeHours:null;return{enabled:!0,every:typeof o.every=="string"?o.every:"",target:typeof o.target=="string"?o.target:"",session:typeof o.session=="string"?o.session:"",model:typeof o.model=="string"?o.model:"",prompt:typeof o.prompt=="string"?o.prompt:"",activeStart:l&&typeof l.start=="string"?l.start:"",activeEnd:l&&typeof l.end=="string"?l.end:"",activeTimezone:l&&typeof l.timezone=="string"?l.timezone:"",ackMaxChars:typeof o.ackMaxChars=="number"&&Number.isFinite(o.ackMaxChars)?String(o.ackMaxChars):"",includeReasoning:o.includeReasoning===!0}}function Ej(e){const t={includeReasoning:e.includeReasoning},n=e.every.trim(),r=e.target.trim(),a=e.session.trim(),o=e.model.trim(),l=e.prompt.trim(),c=e.activeStart.trim(),f=e.activeEnd.trim(),d=e.activeTimezone.trim(),p=e.ackMaxChars.trim();if(n&&(t.every=n),r&&(t.target=r),a&&(t.session=a),o&&(t.model=o),l&&(t.prompt=l),(c||f||d)&&(t.activeHours={...c?{start:c}:{},...f?{end:f}:{},...d?{timezone:d}:{}}),p){const v=Number.parseInt(p,10);if(!Number.isFinite(v)||v<0)throw new Error("Heartbeat ackMaxChars must be a non-negative integer.");t.ackMaxChars=v}return{agents:{defaults:{heartbeat:t}}}}const Rq=hy(),_q=/\[\[\s*(?:reply_to_current|reply_to\s*:[^\]\n]*|audio_as_voice)\s*\]\]/gi;function iT(e){const t=[];return{text:e.replace(_q,r=>{const a=r.replace(/[[\]\s]/g,"").trim();return t.push({tag:a,raw:r.trim()}),""}).replace(/[ \t]+/g," ").trim(),directives:t}}const Tf="main",aT=3,sT="Persistent NoxSoft agent orchestrating ANIMA continuity, mission control, and delivery.";function rs(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Km(e,t,n=""){const r=e?.[t];return typeof r=="string"?r:n}function Ym(e,t,n=!1){const r=e?.[t];return typeof r=="boolean"?r:n}function Oq(e,t,n){const r=e?.[t];return typeof r=="number"&&Number.isFinite(r)?r:n}function oT(e){const t=rs(e?.config),n=rs(t?.agents),r=rs(n?.defaults),a=rs(r?.memorySearch),o=rs(a?.experimental),l=rs(r?.compaction),c=rs(l?.memoryFlush),f=Array.isArray(a?.extraPaths)?a?.extraPaths.filter(d=>typeof d=="string"):[];return{searchEnabled:Ym(a,"enabled",!0),provider:Km(a,"provider","openai"),sessionMemory:Ym(o,"sessionMemory",!1),extraPaths:f.join(", "),memoryFlushEnabled:Ym(c,"enabled",!0),memoryFlushPrompt:Km(c,"prompt"),memoryFlushSystemPrompt:Km(c,"systemPrompt"),browseLimit:Oq(a,"browseLimit",200)}}function ss(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function So(e){if(!e)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>So(t)).join(`
|
|
52
|
+
`).trim();if(typeof e=="object"){const t=e;if(typeof t.text=="string"||t.type==="text"&&typeof t.text=="string")return t.text;if("message"in t)return So(t.message);if("content"in t)return So(t.content)}return""}function Mq(e,t){const n=t.replace(/\r/g,"");if(!n)return e;if(!e||n===e||n.startsWith(e)||n.includes(e))return n;const r=Math.min(e.length,n.length);for(let a=r;a>0;a-=1)if(e.slice(-a)===n.slice(0,a))return`${e}${n.slice(a)}`;return`${e}${n}`}function Dq(e){return Array.isArray(e)?e.map(t=>{if(!t||typeof t!="object")return null;const n=t;if(n.role!=="user"&&n.role!=="assistant")return null;const r=So(n.content).trim();return r?{id:ss(),role:n.role,text:r,timestamp:typeof n.timestamp=="number"?n.timestamp:Date.now()}:null}).filter(t=>!!t):[]}function eu(e){if(!e)return"never";const t=typeof e=="number"?e:new Date(e).getTime();if(!Number.isFinite(t))return"unknown";const n=Date.now()-t,r=Math.round(n/6e4);if(Math.abs(r)<1)return"just now";if(Math.abs(r)<60)return`${r}m ago`;const a=Math.round(r/60);return Math.abs(a)<24?`${a}h ago`:`${Math.round(a/24)}d ago`}function Iq(e){const t=e.trim();if(!t)return"subagent";const n=":subagent:",r=t.lastIndexOf(n);return r>=0?`subagent:${t.slice(r+n.length)}`:t.length>56?`${t.slice(0,53)}...`:t}function Er(e){const t=e.tone??"accent";return m.jsx("span",{className:`badge badge-${t}`,children:e.label})}const Sr={wrapper:{borderRadius:"0.5rem",overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0.75rem 1rem",cursor:"pointer",userSelect:"none",gap:"0.75rem",borderBottom:"1px solid transparent"},headerOpen:{borderBottomColor:"var(--color-border, rgba(255,255,255,0.08))"},headerLeft:{display:"flex",alignItems:"center",gap:"0.5rem",minWidth:0,flex:1},chevron:{transition:"transform 0.2s ease",fontSize:"0.75rem",color:"var(--color-text-muted, #888)",flexShrink:0},chevronOpen:{transform:"rotate(90deg)"},title:{fontSize:"0.875rem",fontWeight:600,color:"var(--color-text, #e0e0e0)"},badge:{flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"},bodyOpen:{maxHeight:"5000px",opacity:1},bodyClosed:{maxHeight:"0px",opacity:0},bodyInner:{padding:"0.75rem 1rem 1rem"}};function wr(e){const[t,n]=_.useState(e.defaultOpen??!1);return m.jsxs("div",{className:e.className||"card",style:Sr.wrapper,children:[m.jsxs("div",{style:{...Sr.header,...t?Sr.headerOpen:{}},onClick:()=>n(r=>!r),role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n(a=>!a))},children:[m.jsxs("div",{style:Sr.headerLeft,children:[m.jsx("span",{style:{...Sr.chevron,...t?Sr.chevronOpen:{}},children:"▶"}),m.jsx("span",{style:Sr.title,children:e.title})]}),m.jsxs("div",{style:Sr.badge,children:[e.badge,e.headerRight]})]}),m.jsx("div",{style:{...Sr.body,...t?Sr.bodyOpen:Sr.bodyClosed},children:m.jsx("div",{style:Sr.bodyInner,children:e.children})})]})}function In(e){return m.jsxs("div",{className:"runtime-stat",children:[m.jsx("div",{className:"runtime-stat-label",children:e.label}),m.jsx("div",{className:"runtime-stat-value",children:e.value}),e.detail?m.jsx("div",{className:"runtime-stat-detail",children:e.detail}):null]})}function Lq(e){return m.jsx("div",{className:"segmented-control",children:["read","write"].map(t=>m.jsx("button",{type:"button",className:`segment ${e.value===t?"active":""}`,disabled:e.busy,onClick:()=>e.onChange(t),children:t.toUpperCase()},t))})}function Pq({subagents:e}){return e?m.jsxs("div",{className:"card",children:[m.jsxs("div",{className:"card-header",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Subagents"}),m.jsx("div",{className:"card-subtitle",children:"Native orchestration visibility"})]}),m.jsx(Er,{label:`${e.total} tracked`})]}),m.jsxs("div",{className:"stats-grid compact",children:[m.jsx(In,{label:"Active",value:String(e.active)}),m.jsx(In,{label:"Recent",value:String(e.recent)}),m.jsx(In,{label:"Failed",value:String(e.failed)})]}),e.latest.length===0?m.jsx("div",{className:"empty-note",children:"No subagent activity yet."}):m.jsx("div",{className:"activity-list",children:e.latest.map(t=>m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{children:[m.jsx("div",{className:"mono subtle",children:Iq(t.key)}),m.jsx("div",{className:"runtime-stat-detail",children:eu(t.updatedAt)})]}),m.jsx(Er,{tone:t.status==="failed"?"error":t.status==="active"?"success":t.status==="recent"?"accent":"warning",label:t.status})]},`${t.key}:${t.updatedAt??"none"}`))})]}):null}function Uq({tools:e}){const[t,n]=_.useState(!1),r=e.filter(o=>o.status==="done").length,a=e.filter(o=>o.status==="error").length;return m.jsxs("div",{className:"tool-activity-panel",children:[m.jsxs("button",{type:"button",className:"tool-activity-toggle",onClick:()=>n(o=>!o),children:[m.jsx("span",{className:"tool-activity-icon",children:t?"▾":"▸"}),m.jsxs("span",{className:"tool-activity-summary",children:[e.length," tool",e.length!==1?"s":""," used",a>0&&m.jsxs("span",{className:"tool-count-error",children:[" · ",a," failed"]}),r>0&&!a&&m.jsx("span",{className:"tool-count-ok",children:" · all succeeded"})]})]}),t&&m.jsx("div",{className:"tool-activity-list",children:e.map(o=>m.jsx(zq,{tool:o},o.id))})]})}function zq({tool:e}){const[t,n]=_.useState(!1),r=e.status==="done"?"✓":e.status==="error"?"✗":"◌",a=e.status==="done"?"success":e.status==="error"?"error":"running";return m.jsxs("div",{className:`tool-activity-item ${a}`,children:[m.jsxs("button",{type:"button",className:"tool-activity-item-header",onClick:()=>n(o=>!o),children:[m.jsx("span",{className:`tool-status-icon ${a}`,children:r}),m.jsx("span",{className:"tool-name",children:e.name}),(e.input||e.result)&&m.jsx("span",{className:"tool-detail-toggle",children:t?"▾":"▸"})]}),t&&(e.input||e.result)&&m.jsxs("div",{className:"tool-detail-body",children:[e.input&&m.jsxs("div",{className:"tool-detail-section",children:[m.jsx("div",{className:"tool-detail-label",children:"Input"}),m.jsx("pre",{className:"tool-detail-pre",children:e.input})]}),e.result&&m.jsxs("div",{className:"tool-detail-section",children:[m.jsx("div",{className:"tool-detail-label",children:"Result"}),m.jsx("pre",{className:"tool-detail-pre",children:e.result})]})]})]})}function Bq({runId:e,activity:t}){const n=e?t.get(e):void 0;return!n||n.length===0?null:m.jsx("div",{className:"live-tool-activity",children:n.map(r=>m.jsxs("div",{className:`live-tool-chip ${r.status}`,children:[m.jsx("span",{className:"live-tool-dot"}),m.jsx("span",{className:"live-tool-name",children:r.name})]},r.id))})}function Vq({directives:e}){return m.jsx("div",{className:"directive-badges",children:e.map((t,n)=>m.jsx("span",{className:"directive-badge",title:t.raw,children:t.tag.replace(/_/g," ")},n))})}function Fq(){const[e,t]=_.useState(null),[n,r]=_.useState(null),[a,o]=_.useState(null),[l,c]=_.useState(null),[f,d]=_.useState(()=>dd(null)),[p,v]=_.useState(`{
|
|
53
|
+
}
|
|
54
|
+
`),[g,b]=_.useState({token:"",inviteCode:"",agentName:"",displayName:"",description:sT}),[S,w]=_.useState(null),[E,T]=_.useState(""),[C,k]=_.useState(()=>oT(null)),[j,N]=_.useState(null),[R,L]=_.useState(null),[U,G]=_.useState(null),[M,B]=_.useState(null),[X,oe]=_.useState(!1),[ue,Z]=_.useState(!1),[V,W]=_.useState(!1),[$,he]=_.useState(!1),[I,z]=_.useState(!1),[ee,D]=_.useState(!1),[de,ye]=_.useState("Check chat.noxsoft.net, sync mission control, and report anything needing action."),[Se,we]=_.useState(!1),[Le,je]=_.useState([]),[ge,Pe]=_.useState(""),[xt,Ot]=_.useState(null),[$e,Nt]=_.useState(!1),[ot,Bt]=_.useState(""),[Yt,Jt]=_.useState(!1),[mt,at]=_.useState(!1),[On,ze]=_.useState(null),[Me,Q]=_.useState([]),[H,se]=_.useState(new Map),Te=_.useRef(new Map);_.useEffect(()=>{Te.current=H},[H]);const Ee=_.useRef(null),Be=_.useRef(new Map),lt=_.useRef(null),$t=_.useRef(null),vt=_.useRef(null),Pt=_.useRef(""),P=_.useRef(null),Y=_.useRef(null),xe=_.useRef(new Set),qe=n?.assistant?.name?.trim()||a?.agent?.display_name||"ANIMA",Zt=n?.mission?.state?.workingMode??"write",Mr=n?.mission?.repo??n?.mission?.state?.repo,Ft=n?.mission?.state?.speech,hn=_.useCallback(async()=>{oe(!0);try{const[K,ve,tt,gt,en,ur,kn]=await Promise.all([oN(),cN(),fN(),lN(),p1().catch(()=>null),gN().catch(()=>null),mN().catch(()=>({triggers:[]}))]);t(K),r(ve),o(tt),c(gt),v(typeof gt.raw=="string"?gt.raw:`{
|
|
55
|
+
}
|
|
56
|
+
`),d(dd(gt)),b({token:tt.tokenPreview||"",inviteCode:"",agentName:tt.suggestedIdentity.name,displayName:tt.suggestedIdentity.displayName,description:sT}),w(ur),T(kn.triggers.join(", ")),k(oT(gt)),N(ve.mission.state.autoToggle),en&&L(en),G(null)}catch(K){G(K instanceof Error?K.message:String(K))}finally{oe(!1),Z(!0)}},[]),Yr=_.useRef(void 0);_.useEffect(()=>{Yr.current=R?.cursor},[R?.cursor]);const Da=_.useCallback(async()=>{try{const K=await p1(Yr.current);L(ve=>!ve||K.reset?K:{...K,lines:[...ve.lines,...K.lines].slice(-320)})}catch{}},[]);_.useEffect(()=>{hn();const K=window.setInterval(()=>{hn()},15e3),ve=window.setInterval(()=>{Da()},4e3);return()=>{window.clearInterval(K),window.clearInterval(ve)}},[hn,Da]),_.useEffect(()=>{Pt.current=ot},[ot]),_.useEffect(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},[Le,ot]),_.useEffect(()=>{if(typeof window>"u")return;const K=window.speechSynthesis;if(!K)return;const ve=()=>{const tt=K.getVoices().map(gt=>gt.name).filter(Boolean);Q(tt)};return ve(),K.addEventListener?.("voiceschanged",ve),()=>K.removeEventListener?.("voiceschanged",ve)},[]),_.useEffect(()=>{if(typeof window>"u")return;const K=window.SpeechRecognition||window.webkitSpeechRecognition;if(!K){Jt(!1),Y.current=null;return}Jt(!0);const ve=new K;ve.continuous=Ft?.continuous??!0,ve.interimResults=!0,ve.lang=Ft?.lang||"en-US";const tt=ur=>{const kn=ur;let cr="";for(let pn=0;pn<kn.results.length;pn+=1){const Dr=kn.results[pn]?.[0];Dr?.transcript&&(cr+=Dr.transcript)}cr.trim()&&Pe(cr.trim())},gt=ur=>{ze(ur.error||"Voice capture failed."),at(!1)},en=()=>{at(!1)};return ve.addEventListener("result",tt),ve.addEventListener("error",gt),ve.addEventListener("end",en),Y.current=ve,()=>{ve.removeEventListener("result",tt),ve.removeEventListener("error",gt),ve.removeEventListener("end",en),ve.stop(),Y.current=null}},[Ft?.continuous,Ft?.lang]),_.useEffect(()=>{if(!Ft?.autoSpeak||typeof window>"u"||!window.speechSynthesis)return;const K=Le.toReversed().find(tt=>tt.role==="assistant");if(!K||xe.current.has(K.id))return;const ve=new SpeechSynthesisUtterance(K.text);if(ve.lang=Ft.lang||"en-US",ve.rate=Ft.rate||1,ve.pitch=Ft.pitch||1,Ft.voiceName){const tt=window.speechSynthesis.getVoices().find(gt=>gt.name===Ft.voiceName);tt&&(ve.voice=tt)}xe.current.add(K.id),window.speechSynthesis.cancel(),window.speechSynthesis.speak(ve)},[Le,Ft]);const $r=_.useMemo(()=>function(ve,tt){const gt=Ee.current;if(!gt||gt.readyState!==WebSocket.OPEN)return Promise.reject(new Error("Gateway websocket is not connected"));const en=ss(),ur={type:"req",id:en,method:ve,params:tt};return new Promise((kn,cr)=>{Be.current.set(en,{resolve:kn,reject:pn=>cr(pn)});try{gt.send(JSON.stringify(ur))}catch(pn){Be.current.delete(en),cr(pn instanceof Error?pn:new Error(String(pn)))}})},[]);_.useEffect(()=>{let K=!1,ve=!1,tt=!1,gt;function en(Ve){for(const Fe of Be.current.values())Fe.reject(new Error(Ve));Be.current.clear()}async function ur(){try{const Ve=await $r("chat.history",{sessionKey:Tf,limit:120});if(K)return;je(Dq(Ve?.messages))}catch(Ve){K||Ot(Ve instanceof Error?Ve.message:String(Ve))}}async function kn(){if(K||ve||tt)return;const Ve=Ee.current;if(!(!Ve||Ve.readyState!==WebSocket.OPEN)){ve=!0;try{const Fe=py();if(!Fe)throw new Error("Gateway token missing. Re-open this page once with ?token=ANIMA_GATEWAY_TOKEN.");const ut=await dy({minProtocol:aT,maxProtocol:aT,client:{id:"anima-control-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:Fe,nonce:gt});if(await $r("connect",ut),K)return;tt=!0,we(!0),Ot(null),ur()}catch(Fe){if(!K){we(!1);const ut=Fe instanceof Error?Fe.message:String(Fe);ut!=="Gateway websocket is not connected"&&Ot(ut)}}finally{ve=!1}}}function cr(){K||lt.current!==null||(lt.current=window.setTimeout(()=>{lt.current=null,K||Dr()},1500))}function pn(Ve){if(Ve.sessionKey&&Ve.sessionKey!==Tf)return;const Fe=Ve.runId;if(Fe){if(Ve.stream==="tool"){const ut=Ve.data||{},Mt=typeof ut.name=="string"?ut.name:typeof ut.tool=="string"?ut.tool:"";if(!Mt)return;const Xt=typeof ut.phase=="string"?ut.phase:"",Bn=ut.input?typeof ut.input=="string"?ut.input:JSON.stringify(ut.input,null,2):void 0,vi=ut.result?typeof ut.result=="string"?ut.result:JSON.stringify(ut.result,null,2):void 0;se(Wr=>{const Hi=Wr.get(Fe)||[];if(Xt==="start"||Xt==="call")return new Map(Wr).set(Fe,[...Hi,{id:ss(),name:Mt,input:Bn,status:"running",timestamp:Date.now()}]);const La=[...Hi],gi=La.findLastIndex(Pa=>Pa.name===Mt&&Pa.status==="running");return gi>=0&&(La[gi]={...La[gi],status:Xt==="error"?"error":"done",result:vi||La[gi].result}),new Map(Wr).set(Fe,La)})}Ve.stream==="lifecycle"&&(typeof Ve.data?.phase=="string"?Ve.data.phase:"")==="start"&&se(Mt=>new Map(Mt).set(Fe,[]))}}function mi(Ve){if(!(Ve.sessionKey&&Ve.sessionKey!==Tf)){if(Ve.state==="delta"){const Fe=So(Ve.message);Fe&&Bt(ut=>Mq(ut,Fe));return}if(Ve.state==="final"){const Fe=vt.current;if(Ve.runId&&Fe&&Ve.runId!==Fe)return;const ut=So(Ve.message).trim()||Pt.current.trim(),{text:Mt,directives:Xt}=iT(ut),Bn=Ve.runId||vt.current||void 0,vi=Bn?Te.current.get(Bn):void 0;(Mt||vi&&vi.length>0)&&je(Wr=>[...Wr,{id:ss(),role:"assistant",text:Mt,timestamp:Date.now(),directives:Xt.length>0?Xt:void 0,toolActivity:vi&&vi.length>0?vi:void 0,runId:Bn||void 0}]),Bn&&se(Wr=>{const Hi=new Map(Wr);return Hi.delete(Bn),Hi}),vt.current=null,Nt(!1),Bt("");return}if(Ve.state==="error"){const Fe=Ve.errorMessage||"Chat run failed";Ot(Fe),je(ut=>[...ut,{id:ss(),role:"assistant",text:`Error: ${Fe}`,timestamp:Date.now()}]),vt.current=null,Nt(!1),Bt("");return}Ve.state==="aborted"&&(vt.current=null,Nt(!1),Bt(""))}}function Dr(){ve=!1,tt=!1,gt=void 0;const Ve=new WebSocket(Rq);Ee.current=Ve,we(!1),Ve.addEventListener("open",()=>{$t.current&&window.clearTimeout($t.current),$t.current=window.setTimeout(()=>{$t.current=null,kn()},300)}),Ve.addEventListener("message",Fe=>{let ut;try{ut=JSON.parse(String(Fe.data))}catch{return}const Mt=ut;if(Mt.type==="res"){const Xt=Be.current.get(Mt.id);if(!Xt)return;Be.current.delete(Mt.id),Mt.ok?Xt.resolve(Mt.payload):Xt.reject(new Error(Mt.error?.message||"Gateway request failed"));return}if(Mt.type==="event"){if(Mt.event==="connect.challenge"){const Xt=fy(Mt.payload);Xt&&(gt=Xt),kn();return}Mt.event==="chat"&&mi(Mt.payload||{}),Mt.event==="agent"&&pn(Mt.payload||{})}}),Ve.addEventListener("error",()=>{Ot("Websocket error while connecting to ANIMA gateway")}),Ve.addEventListener("close",()=>{ve=!1,tt=!1,we(!1),en("Gateway websocket closed"),cr()})}return Dr(),()=>{K=!0,$t.current&&window.clearTimeout($t.current),lt.current&&window.clearTimeout(lt.current),en("Dashboard shutting down"),Ee.current?.close(),Ee.current=null}},[$r]);const xs=_.useCallback(async K=>{try{const ve=await wa({speech:K});n&&r({...n,mission:{...n.mission,state:{...n.mission.state,speech:ve.speech}}})}catch(ve){B(ve instanceof Error?ve.message:String(ve))}},[n]);async function Hu(K){K.preventDefault();const ve=ge.trim();if(!ve||$e)return;const tt=Ee.current;if(!tt||tt.readyState!==WebSocket.OPEN){Ot("Gateway websocket is not connected");return}const gt=ss();vt.current=gt,je(en=>[...en,{id:ss(),role:"user",text:ve,timestamp:Date.now()}]),Pe(""),Nt(!0),Bt(""),Ot(null);try{await $r("chat.send",{sessionKey:Tf,message:ve,deliver:!1,idempotencyKey:gt})}catch(en){Ot(en instanceof Error?en.message:String(en)),Nt(!1),Bt(""),vt.current=null}}async function Vo(K){W(!0),B(null);try{await Kz(K),await hn(),B(`Working mode set to ${K}.`)}catch(ve){B(ve instanceof Error?ve.message:String(ve))}finally{W(!1)}}async function Ia(){if(!l?.hash){B("Config hash missing. Refresh the dashboard and try again.");return}he(!0),B(null);try{await Yv(JSON.stringify(Ej(f),null,2),l.hash),await hn(),B("Heartbeat settings updated.")}catch(K){B(K instanceof Error?K.message:String(K))}finally{he(!1)}}async function Fd(K){z(!0),B(null);try{await $v(K),await hn(),B(K?"Heartbeat enabled.":"Heartbeat disabled.")}catch(ve){B(ve instanceof Error?ve.message:String(ve))}finally{z(!1)}}async function Fo(K){B(null);try{const ve=de.trim()||"Check NoxSoft chat, mission control, and continuity status.";await pN(ve,K),B(K==="now"?"Heartbeat wake sent immediately.":"Wake queued for the next heartbeat.")}catch(ve){B(ve instanceof Error?ve.message:String(ve))}}async function qu(){D(!0),B(null);try{g.token.trim()&&await dN(g.token.trim()),g.inviteCode.trim()&&await hN({code:g.inviteCode.trim(),name:g.agentName.trim()||void 0,displayName:g.displayName.trim()||void 0,description:g.description.trim()||void 0}),await hn(),B("Registration settings updated.")}catch(K){B(K instanceof Error?K.message:String(K))}finally{D(!1)}}async function Gu(){if(S){D(!0),B(null);try{await Xv(S.providers.map(K=>({id:K.id,name:K.name,enabled:K.enabled,priority:K.priority}))),await yN(S.autoRotation),await hn(),B("Provider settings updated.")}catch(K){B(K instanceof Error?K.message:String(K))}finally{D(!1)}}}async function Ho(){D(!0),B(null);try{const K=E.split(",").map(ve=>ve.trim()).filter(Boolean);await vN(K),await hn(),B("Voice wake settings updated.")}catch(K){B(K instanceof Error?K.message:String(K))}finally{D(!1)}}async function qo(){if(!l?.hash){B("Config hash missing. Refresh the dashboard and try again.");return}D(!0),B(null);try{await Yv(JSON.stringify({agents:{defaults:{memorySearch:{enabled:C.searchEnabled,provider:C.provider.trim()||"openai",browseLimit:Math.max(1,Math.floor(C.browseLimit||200)),extraPaths:C.extraPaths.split(",").map(K=>K.trim()).filter(Boolean),experimental:{sessionMemory:C.sessionMemory}},compaction:{memoryFlush:{enabled:C.memoryFlushEnabled,prompt:C.memoryFlushPrompt.trim()||void 0,systemPrompt:C.memoryFlushSystemPrompt.trim()||void 0}}}}},null,2),l.hash),await hn(),B("Memory settings updated.")}catch(K){B(K instanceof Error?K.message:String(K))}finally{D(!1)}}async function Ku(){if(j){D(!0),B(null);try{await wa({autoToggle:j}),await hn(),B("Auto-toggle policy updated.")}catch(K){B(K instanceof Error?K.message:String(K))}finally{D(!1)}}}async function Go(K){if(!l?.hash){B("Config hash missing. Refresh the dashboard and try again.");return}D(!0),B(null);try{await uN(p,l.hash,K),await hn(),B(K?"Raw config saved and applied.":"Raw config saved.")}catch(ve){B(ve instanceof Error?ve.message:String(ve))}finally{D(!1)}}function Xr(){if(!Y.current){ze("Browser speech recognition is not available here.");return}ze(null),at(!0),Y.current.start()}function un(){Y.current?.stop(),at(!1)}return ue?U&&!n&&!e?m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Assistant Home"}),m.jsxs("div",{className:"card empty-state-card",children:[m.jsx("div",{className:"empty-state-symbol",children:"!"}),m.jsx("div",{className:"empty-state-copy",children:"Unable to reach gateway"}),m.jsx("div",{className:"runtime-stat-detail",style:{marginTop:"0.5rem"},children:U}),m.jsxs("div",{className:"runtime-stat-detail",style:{marginTop:"1rem"},children:["Make sure the daemon is running with ",m.jsx("code",{children:"anima start"})," and that the gateway is accessible. If connecting via browser, verify the URL includes"," ",m.jsx("code",{children:"?token=YOUR_TOKEN"}),"."]})]})]}):m.jsxs("div",{children:[m.jsxs("div",{className:"page-header-row",children:[m.jsxs("div",{children:[m.jsxs("h1",{className:"page-title",children:[qe," Home"]}),m.jsx("div",{className:"page-subtitle",children:"Local mission control, heartbeat orchestration, and direct gateway chat."})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[m.jsx("span",{className:`status-chip ${U?"offline":"online"}`,children:U?"Gateway unreachable":"Gateway connected"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{hn()},children:X?"Refreshing...":"Refresh"})]})]}),m.jsxs("div",{className:"hero-grid",children:[m.jsxs("div",{className:"card identity-hero",children:[m.jsx("div",{className:"identity-badge",children:n?.assistant.avatar||"A"}),m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:qe}),m.jsx("div",{className:"card-subtitle mono",children:n?.assistant.agentId||a?.agent?.name||"main"}),m.jsxs("div",{className:"badge-row top-gap",children:[m.jsx(Er,{tone:e?.heartbeat.running?"success":"warning",label:e?.heartbeat.running?"heartbeat live":"heartbeat idle"}),m.jsx(Er,{tone:a?.agent?"accent":"warning",label:a?.agent?"registered":"not registered"}),m.jsx(Er,{tone:Mr?.remoteConfigured?"success":"warning",label:Mr?.remoteConfigured?"repo linked":"repo pending"})]})]})]}),m.jsxs("div",{className:"card",children:[m.jsxs("div",{className:"card-header compact",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Working Mode"}),m.jsx("div",{className:"card-subtitle",children:"Control whether ANIMA is in read-only or write-capable mode."})]}),m.jsx(Lq,{value:Zt,busy:V,onChange:Vo})]}),m.jsxs("div",{className:"runtime-stat-detail top-gap",children:["Session security:"," ",m.jsx("span",{className:"mono",children:n?.mainSession.execSecurity??"unknown"})," · Ask policy: ",m.jsx("span",{className:"mono",children:n?.mainSession.execAsk??"unknown"})]})]})]}),M?m.jsx("div",{className:"card status-banner",children:m.jsx("div",{children:M})}):null,m.jsxs("div",{className:"stats-grid compact",style:{marginBottom:"1.5rem"},children:[m.jsx(In,{label:"Heartbeat",value:e?.heartbeat.running?"Live":"Idle",detail:e?.heartbeat.lastBeat?`Last: ${eu(e.heartbeat.lastBeat)}`:"No beats yet"}),m.jsx(In,{label:"Mode",value:Zt.toUpperCase(),detail:`Security: ${n?.mainSession.execSecurity??"unknown"}`}),m.jsx(In,{label:"Gateway",value:Se?"Connected":"Disconnected",detail:`${Le.length} messages`}),m.jsx(In,{label:"Providers",value:String(S?.providers.filter(K=>K.enabled).length??0),detail:`of ${S?.providers.length??0} configured`}),m.jsx(In,{label:"Subagents",value:String(e?.subagents?.active??0),detail:`${e?.subagents?.total??0} tracked`}),m.jsx(In,{label:"Queued Events",value:String(n?.queuedSystemEvents.length??0)})]}),m.jsxs("div",{className:"dashboard-grid",children:[m.jsx("div",{className:"dashboard-main-column",children:m.jsxs(wr,{title:`Talk to ${qe}`,badge:m.jsx("span",{className:`status-chip ${Se?"online":"offline"}`,children:Se?"Connected":"Reconnecting"}),className:"card live-chat-card",children:[m.jsxs("div",{className:"live-chat-feed",children:[Le.length===0&&!ot?m.jsx("div",{className:"empty-note",children:"Conversation history is empty. Send a message to begin."}):null,Le.map(K=>m.jsx("div",{className:`live-chat-row ${K.role==="user"?"user":"assistant"}`,children:m.jsxs("div",{className:`live-chat-bubble ${K.role}`,children:[m.jsx("div",{className:"live-chat-role",children:K.role==="user"?"You":qe}),K.toolActivity&&K.toolActivity.length>0&&m.jsx(Uq,{tools:K.toolActivity}),K.text&&m.jsx(Ea,{value:K.text,className:"live-chat-markdown"}),K.directives&&K.directives.length>0&&m.jsx(Vq,{directives:K.directives})]})},K.id)),ot?m.jsx("div",{className:"live-chat-row assistant",children:m.jsxs("div",{className:"live-chat-bubble assistant",children:[m.jsx("div",{className:"live-chat-role",children:qe}),m.jsx(Bq,{runId:vt.current,activity:H}),m.jsx(Ea,{value:iT(ot).text,className:"live-chat-markdown"})]})}):null,m.jsx("div",{ref:P})]}),m.jsxs("div",{className:"voice-toolbar",children:[m.jsx("button",{type:"button",className:"action-button ghost",onClick:mt?un:Xr,disabled:!Yt,children:mt?"Stop Listening":"Start Listening"}),m.jsxs("button",{type:"button",className:"action-button ghost",onClick:()=>{xs({autoSpeak:!(Ft?.autoSpeak??!1)})},children:["Auto Speak: ",Ft?.autoSpeak?"On":"Off"]}),m.jsxs("button",{type:"button",className:"action-button ghost",onClick:()=>{xs({continuous:!(Ft?.continuous??!0)})},children:["Continuous: ",Ft?.continuous===!1?"Off":"On"]})]}),On?m.jsx("div",{className:"runtime-stat-detail warning-text",children:On}):null,xt?m.jsx("div",{className:"runtime-stat-detail warning-text",children:xt}):null,m.jsxs("form",{onSubmit:Hu,className:"live-chat-input-row",children:[m.jsx("textarea",{value:ge,onChange:K=>Pe(K.target.value),placeholder:`Message ${qe} directly...`,className:"live-chat-input",rows:4}),m.jsx("button",{type:"submit",className:"live-chat-send",disabled:$e||!ge.trim(),children:$e?"Sending...":"Send"})]})]})}),m.jsxs("div",{className:"dashboard-side-column",children:[m.jsxs(wr,{title:"Heartbeat Studio",defaultOpen:!0,headerRight:m.jsx("button",{type:"button",className:"action-button ghost",onClick:K=>{K.stopPropagation(),Fd(!(e?.heartbeat.running??!1))},disabled:I,children:I?"Saving...":e?.heartbeat.running?"Disable":"Enable"}),badge:m.jsx(Er,{tone:e?.heartbeat.running?"success":"warning",label:e?.heartbeat.running?"live":"idle"}),children:[m.jsxs("div",{className:"stats-grid compact",children:[m.jsx(In,{label:"Cadence",value:f.every||"unset"}),m.jsx(In,{label:"Last beat",value:e?.heartbeat.lastBeat?eu(e.heartbeat.lastBeat):"none",detail:n?.lastHeartbeat?.preview||"No heartbeat summary yet."}),m.jsx(In,{label:"Queued events",value:String(n?.queuedSystemEvents.length??0)})]}),m.jsxs("div",{className:"form-grid two-col top-gap",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Every"}),m.jsx("input",{className:"search-bar mono",value:f.every,onChange:K=>d(ve=>({...ve,every:K.target.value})),placeholder:"5m"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Target"}),m.jsx("input",{className:"search-bar mono",value:f.target,onChange:K=>d(ve=>({...ve,target:K.target.value})),placeholder:"last"})]})]}),m.jsxs("label",{className:"field-block top-gap-sm",children:[m.jsx("span",{children:"Prompt"}),m.jsx("textarea",{className:"search-bar mono",rows:4,value:f.prompt,onChange:K=>d(ve=>({...ve,prompt:K.target.value})),placeholder:"Heartbeat reminder and continuity prompt"})]}),m.jsxs("div",{className:"button-row top-gap",children:[m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ia()},disabled:$,children:$?"Saving...":"Save Heartbeat"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Fo("now")},children:"Wake Now"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Fo("next-heartbeat")},children:"Queue Wake"})]}),m.jsxs("label",{className:"field-block top-gap",children:[m.jsx("span",{children:"Wake text"}),m.jsx("textarea",{className:"search-bar",rows:3,value:de,onChange:K=>ye(K.target.value)})]}),m.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:"Reminder baked into runtime: check chat.noxsoft.net with Nox when tools are available, then sync mission control."})]}),m.jsxs(wr,{title:"Continuity",badge:m.jsx(Er,{tone:Mr?.remoteConfigured?"success":"warning",label:Mr?.remoteConfigured?"linked":"needs repo"}),children:[m.jsxs("div",{className:"stats-grid compact",children:[m.jsx(In,{label:"Mission dir",value:n?.mission?.directory||"~/.anima/mission-control"}),m.jsx(In,{label:"Repo",value:Mr?.url||"Create a private SSH repo",detail:Mr?.branch||"branch unset"}),m.jsx(In,{label:"History",value:String(n?.mission?.importantHistory?.length??0),detail:"archived continuity files"})]}),m.jsx("div",{className:"runtime-stat-detail top-gap",children:"Preferred flow: create a private GitHub or GitLab repo, then connect the SSH remote in Mission Control or Settings so ANIMA can persist continuity safely."}),n?.mission?.files?.find(K=>K.fileName==="self-directives.md")?m.jsxs("details",{className:"details-panel top-gap",open:!0,children:[m.jsx("summary",{children:"Self directives"}),m.jsx(Ea,{value:n.mission.files.find(K=>K.fileName==="self-directives.md")?.content||"",className:"markdown-preview"})]}):null]}),m.jsxs(wr,{title:"Identity + NoxSoft",badge:m.jsx(Er,{tone:a?.agent?"accent":"warning",label:a?.agent?"registered":"unregistered"}),children:[m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Agent token"}),m.jsx("input",{className:"search-bar mono",value:g.token,onChange:K=>b(ve=>({...ve,token:K.target.value})),placeholder:"nox_ag_...",spellCheck:!1})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Invite code"}),m.jsx("input",{className:"search-bar mono",value:g.inviteCode,onChange:K=>b(ve=>({...ve,inviteCode:K.target.value})),placeholder:"NX-XXXXXX"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Agent name"}),m.jsx("input",{className:"search-bar mono",value:g.agentName,onChange:K=>b(ve=>({...ve,agentName:K.target.value}))})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Display name"}),m.jsx("input",{className:"search-bar",value:g.displayName,onChange:K=>b(ve=>({...ve,displayName:K.target.value}))})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Description"}),m.jsx("input",{className:"search-bar",value:g.description,onChange:K=>b(ve=>({...ve,description:K.target.value}))})]})]}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{qu()},disabled:ee,children:ee?"Saving...":"Save Identity"})}),m.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Stored token path:"," ",m.jsx("span",{className:"mono",children:a?.tokenPath||"~/.noxsoft-agent-token"})]})]}),m.jsx(wr,{title:"Providers",badge:m.jsx(Er,{label:`${S?.providers.filter(K=>K.enabled).length??0} active`}),children:S?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"activity-list",children:S.providers.map(K=>m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:K.name}),m.jsx("div",{className:"runtime-stat-detail mono",children:K.apiKeyMasked})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[m.jsxs("span",{className:"runtime-stat-detail",children:["P",K.priority]}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>w(ve=>ve&&{...ve,providers:ve.providers.map(tt=>tt.id===K.id?{...tt,enabled:!tt.enabled}:tt)}),children:K.enabled?"Disable":"Enable"})]})]},K.id))}),m.jsx("div",{className:"toggle-row top-gap",children:m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:S.autoRotation,onChange:()=>w(K=>K&&{...K,autoRotation:!K.autoRotation})}),"Auto-rotate providers"]})}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Gu()},disabled:ee,children:ee?"Saving...":"Save Providers"})})]}):m.jsx("div",{className:"empty-note",children:"Provider configuration unavailable."})}),m.jsxs(wr,{title:"Memory Engine",children:[m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Provider"}),m.jsx("input",{className:"search-bar mono",value:C.provider,onChange:K=>k(ve=>({...ve,provider:K.target.value}))})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Browse limit"}),m.jsx("input",{className:"search-bar mono",type:"number",min:1,value:C.browseLimit,onChange:K=>k(ve=>({...ve,browseLimit:Number(K.target.value)||200}))})]}),m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Extra paths"}),m.jsx("input",{className:"search-bar mono",value:C.extraPaths,onChange:K=>k(ve=>({...ve,extraPaths:K.target.value})),placeholder:"memory/people.md, memory/project.md"})]}),m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Memory flush prompt"}),m.jsx("textarea",{className:"search-bar",rows:3,value:C.memoryFlushPrompt,onChange:K=>k(ve=>({...ve,memoryFlushPrompt:K.target.value}))})]}),m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Memory flush system prompt"}),m.jsx("textarea",{className:"search-bar",rows:3,value:C.memoryFlushSystemPrompt,onChange:K=>k(ve=>({...ve,memoryFlushSystemPrompt:K.target.value}))})]})]}),m.jsxs("div",{className:"toggle-row top-gap",children:[m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:C.searchEnabled,onChange:K=>k(ve=>({...ve,searchEnabled:K.target.checked}))}),"Memory search enabled"]}),m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:C.sessionMemory,onChange:K=>k(ve=>({...ve,sessionMemory:K.target.checked}))}),"Index session transcripts"]}),m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:C.memoryFlushEnabled,onChange:K=>k(ve=>({...ve,memoryFlushEnabled:K.target.checked}))}),"Pre-compaction memory flush"]})]}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{qo()},disabled:ee,children:ee?"Saving...":"Save Memory"})})]}),m.jsx(wr,{title:"Auto-Toggle Policy",children:j?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"toggle-row",children:[["workingMode","Working mode"],["speech","Speech"],["voiceWake","Voice wake"],["heartbeat","Heartbeat"],["providers","Providers"],["missionRepo","Mission repo"],["missionState","Mission state"],["memory","Memory"],["rawConfig","Raw config"]].map(([K,ve])=>m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:j[K],onChange:tt=>N(gt=>gt&&{...gt,[K]:tt.target.checked})}),ve]},K))}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ku()},disabled:ee,children:ee?"Saving...":"Save Policy"})})]}):m.jsx("div",{className:"empty-note",children:"Mission policy unavailable."})}),m.jsx(Pq,{subagents:e?.subagents}),m.jsxs(wr,{title:"Agent Logs",badge:m.jsx(Er,{label:`${R?.lines.length??0} lines`}),children:[m.jsx("div",{className:"runtime-stat-detail mono",children:R?.file||"No log file detected."}),m.jsx("pre",{className:"log-console",children:R?.lines.join(`
|
|
57
|
+
`)||"No log lines yet."})]}),m.jsx(wr,{title:"Inner World",badge:m.jsx(Er,{label:`${(n?.mission?.innerWorld||[]).length} entries`}),children:m.jsx("div",{className:"activity-list",children:(n?.mission?.innerWorld||[]).map(K=>m.jsxs("div",{className:"inner-world-entry",children:[m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:K.title}),m.jsx("div",{className:"runtime-stat-detail mono",children:K.path})]}),m.jsx("div",{className:"runtime-stat-detail",children:eu(K.updatedAt)})]}),m.jsx(Ea,{value:K.content,className:"markdown-preview"})]},K.id))})}),m.jsx(wr,{title:"Important History",badge:m.jsx(Er,{label:`${(n?.mission?.importantHistory||[]).length} files`}),children:(n?.mission?.importantHistory||[]).length?m.jsx("div",{className:"activity-list",children:(n?.mission?.importantHistory||[]).map(K=>m.jsxs("div",{className:"inner-world-entry",children:[m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:K.relativePath}),m.jsx("div",{className:"runtime-stat-detail mono",children:K.archiveId}),m.jsx("div",{className:"runtime-stat-detail mono",children:K.path})]}),m.jsx("div",{className:"runtime-stat-detail",children:eu(K.updatedAt)})]}),m.jsx(Ea,{value:K.content,className:"markdown-preview"})]},K.id))}):m.jsx("div",{className:"empty-note",children:"No archived continuity has been imported yet."})}),m.jsxs(wr,{title:"Speech Setup",children:[m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Language"}),m.jsx("input",{className:"search-bar mono",value:Ft?.lang||"en-US",onChange:K=>{xs({lang:K.target.value})}})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Voice"}),m.jsxs("select",{className:"search-bar",value:Ft?.voiceName||"",onChange:K=>{xs({voiceName:K.target.value||void 0})},children:[m.jsx("option",{value:"",children:"System default"}),Me.map(K=>m.jsx("option",{value:K,children:K},K))]})]})]}),m.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:"No API keys required. Voice mode uses browser speech recognition plus local OS speech synthesis when available."}),m.jsxs("label",{className:"field-block top-gap",children:[m.jsx("span",{children:"Wake triggers"}),m.jsx("input",{className:"search-bar",value:E,onChange:K=>T(K.target.value),placeholder:"anima, axiom, hey anima"})]}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ho()},disabled:ee,children:ee?"Saving...":"Save Voice Wake"})})]}),m.jsxs(wr,{title:"Raw Config",children:[m.jsxs("div",{className:"runtime-stat-detail",children:["Hash: ",m.jsx("span",{className:"mono",children:l?.hash||"<none>"})]}),m.jsx("textarea",{value:p,onChange:K=>v(K.target.value),spellCheck:!1,className:"search-bar mono advanced-editor top-gap"}),m.jsxs("div",{className:"button-row top-gap",children:[m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Go(!1)},disabled:ee,children:ee?"Saving...":"Save Raw Config"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Go(!0)},disabled:ee,children:"Save + Apply"})]})]})]})]})]}):m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Assistant Home"}),m.jsxs("div",{className:"card empty-state-card",children:[m.jsx("div",{className:"empty-state-symbol",children:"~"}),m.jsx("div",{className:"empty-state-copy",children:"Connecting to gateway..."}),m.jsx("div",{className:"runtime-stat-detail",children:"Establishing connection to the ANIMA daemon."})]})]})}const Tj=_.createContext({});function Hq(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const kj=typeof window<"u",qq=kj?_.useLayoutEffect:_.useEffect,My=_.createContext(null);function Dy(e,t){e.indexOf(t)===-1&&e.push(t)}function hd(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const fi=(e,t,n)=>n>t?t:n<e?e:n;let Iy=()=>{};const Vi={},Cj=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Aj(e){return typeof e=="object"&&e!==null}const Nj=e=>/^0[^.\s]+$/u.test(e);function jj(e){let t;return()=>(t===void 0&&(t=e()),t)}const _r=e=>e,Gq=(e,t)=>n=>t(e(n)),zu=(...e)=>e.reduce(Gq),ku=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ly{constructor(){this.subscriptions=[]}add(t){return Dy(this.subscriptions,t),()=>hd(this.subscriptions,t)}notify(t,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,r);else for(let o=0;o<a;o++){const l=this.subscriptions[o];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Hr=e=>e*1e3,Nr=e=>e/1e3;function Rj(e,t){return t?e*(1e3/t):0}const _j=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Kq=1e-7,Yq=12;function $q(e,t,n,r,a){let o,l,c=0;do l=t+(n-t)/2,o=_j(l,r,a)-e,o>0?n=l:t=l;while(Math.abs(o)>Kq&&++c<Yq);return l}function Bu(e,t,n,r){if(e===t&&n===r)return _r;const a=o=>$q(o,0,1,e,n);return o=>o===0||o===1?o:_j(a(o),t,r)}const Oj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Mj=e=>t=>1-e(1-t),Dj=Bu(.33,1.53,.69,.99),Py=Mj(Dj),Ij=Oj(Py),Lj=e=>(e*=2)<1?.5*Py(e):.5*(2-Math.pow(2,-10*(e-1))),Uy=e=>1-Math.sin(Math.acos(e)),Pj=Mj(Uy),Uj=Oj(Uy),Xq=Bu(.42,0,1,1),Wq=Bu(0,0,.58,1),zj=Bu(.42,0,.58,1),Qq=e=>Array.isArray(e)&&typeof e[0]!="number",Bj=e=>Array.isArray(e)&&typeof e[0]=="number",Jq={linear:_r,easeIn:Xq,easeInOut:zj,easeOut:Wq,circIn:Uy,circInOut:Uj,circOut:Pj,backIn:Py,backInOut:Ij,backOut:Dj,anticipate:Lj},Zq=e=>typeof e=="string",lT=e=>{if(Bj(e)){Iy(e.length===4);const[t,n,r,a]=e;return Bu(t,n,r,a)}else if(Zq(e))return Jq[e];return e},kf=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function e9(e,t){let n=new Set,r=new Set,a=!1,o=!1;const l=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function f(p){l.has(p)&&(d.schedule(p),e()),p(c)}const d={schedule:(p,v=!1,g=!1)=>{const S=g&&a?n:r;return v&&l.add(p),S.has(p)||S.add(p),p},cancel:p=>{r.delete(p),l.delete(p)},process:p=>{if(c=p,a){o=!0;return}a=!0,[n,r]=[r,n],n.forEach(f),n.clear(),a=!1,o&&(o=!1,d.process(p))}};return d}const t9=40;function Vj(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,l=kf.reduce((k,j)=>(k[j]=e9(o),k),{}),{setup:c,read:f,resolveKeyframes:d,preUpdate:p,update:v,preRender:g,render:b,postRender:S}=l,w=()=>{const k=Vi.useManualTiming?a.timestamp:performance.now();n=!1,Vi.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(k-a.timestamp,t9),1)),a.timestamp=k,a.isProcessing=!0,c.process(a),f.process(a),d.process(a),p.process(a),v.process(a),g.process(a),b.process(a),S.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(w))},E=()=>{n=!0,r=!0,a.isProcessing||e(w)};return{schedule:kf.reduce((k,j)=>{const N=l[j];return k[j]=(R,L=!1,U=!1)=>(n||E(),N.schedule(R,L,U)),k},{}),cancel:k=>{for(let j=0;j<kf.length;j++)l[kf[j]].cancel(k)},state:a,steps:l}}const{schedule:_t,cancel:Ra,state:xn,steps:$m}=Vj(typeof requestAnimationFrame<"u"?requestAnimationFrame:_r,!0);let Gf;function n9(){Gf=void 0}const Un={now:()=>(Gf===void 0&&Un.set(xn.isProcessing||Vi.useManualTiming?xn.timestamp:performance.now()),Gf),set:e=>{Gf=e,queueMicrotask(n9)}},Fj=e=>t=>typeof t=="string"&&t.startsWith(e),Hj=Fj("--"),r9=Fj("var(--"),zy=e=>r9(e)?i9.test(e.split("/*")[0].trim()):!1,i9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function uT(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Uo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Cu={...Uo,transform:e=>fi(0,1,e)},Cf={...Uo,default:1},hu=e=>Math.round(e*1e5)/1e5,By=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function a9(e){return e==null}const s9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vy=(e,t)=>n=>!!(typeof n=="string"&&s9.test(n)&&n.startsWith(e)||t&&!a9(n)&&Object.prototype.hasOwnProperty.call(n,t)),qj=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,o,l,c]=r.match(By);return{[e]:parseFloat(a),[t]:parseFloat(o),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},o9=e=>fi(0,255,e),Xm={...Uo,transform:e=>Math.round(o9(e))},us={test:Vy("rgb","red"),parse:qj("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Xm.transform(e)+", "+Xm.transform(t)+", "+Xm.transform(n)+", "+hu(Cu.transform(r))+")"};function l9(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const og={test:Vy("#"),parse:l9,transform:us.transform},Vu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),va=Vu("deg"),li=Vu("%"),Ce=Vu("px"),u9=Vu("vh"),c9=Vu("vw"),cT={...li,parse:e=>li.parse(e)/100,transform:e=>li.transform(e*100)},fo={test:Vy("hsl","hue"),parse:qj("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+li.transform(hu(t))+", "+li.transform(hu(n))+", "+hu(Cu.transform(r))+")"},on={test:e=>us.test(e)||og.test(e)||fo.test(e),parse:e=>us.test(e)?us.parse(e):fo.test(e)?fo.parse(e):og.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?us.transform(e):fo.transform(e),getAnimatableNone:e=>{const t=on.parse(e);return t.alpha=0,on.transform(t)}},f9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function d9(e){return isNaN(e)&&typeof e=="string"&&(e.match(By)?.length||0)+(e.match(f9)?.length||0)>0}const Gj="number",Kj="color",h9="var",p9="var(",fT="${}",m9=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Au(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let o=0;const c=t.replace(m9,f=>(on.test(f)?(r.color.push(o),a.push(Kj),n.push(on.parse(f))):f.startsWith(p9)?(r.var.push(o),a.push(h9),n.push(f)):(r.number.push(o),a.push(Gj),n.push(parseFloat(f))),++o,fT)).split(fT);return{values:n,split:c,indexes:r,types:a}}function Yj(e){return Au(e).values}function $j(e){const{split:t,types:n}=Au(e),r=t.length;return a=>{let o="";for(let l=0;l<r;l++)if(o+=t[l],a[l]!==void 0){const c=n[l];c===Gj?o+=hu(a[l]):c===Kj?o+=on.transform(a[l]):o+=a[l]}return o}}const v9=e=>typeof e=="number"?0:on.test(e)?on.getAnimatableNone(e):e;function g9(e){const t=Yj(e);return $j(e)(t.map(v9))}const qr={test:d9,parse:Yj,createTransformer:$j,getAnimatableNone:g9};function Wm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function y9({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let a=0,o=0,l=0;if(!t)a=o=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,f=2*n-c;a=Wm(f,c,e+1/3),o=Wm(f,c,e),l=Wm(f,c,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:r}}function pd(e,t){return n=>n>0?t:e}const Vt=(e,t,n)=>e+(t-e)*n,Qm=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},b9=[og,us,fo],x9=e=>b9.find(t=>t.test(e));function dT(e){const t=x9(e);if(!t)return!1;let n=t.parse(e);return t===fo&&(n=y9(n)),n}const hT=(e,t)=>{const n=dT(e),r=dT(t);if(!n||!r)return pd(e,t);const a={...n};return o=>(a.red=Qm(n.red,r.red,o),a.green=Qm(n.green,r.green,o),a.blue=Qm(n.blue,r.blue,o),a.alpha=Vt(n.alpha,r.alpha,o),us.transform(a))},lg=new Set(["none","hidden"]);function S9(e,t){return lg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function w9(e,t){return n=>Vt(e,t,n)}function Fy(e){return typeof e=="number"?w9:typeof e=="string"?zy(e)?pd:on.test(e)?hT:k9:Array.isArray(e)?Xj:typeof e=="object"?on.test(e)?hT:E9:pd}function Xj(e,t){const n=[...e],r=n.length,a=e.map((o,l)=>Fy(o)(o,t[l]));return o=>{for(let l=0;l<r;l++)n[l]=a[l](o);return n}}function E9(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=Fy(e[a])(e[a],t[a]));return a=>{for(const o in r)n[o]=r[o](a);return n}}function T9(e,t){const n=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][r[o]],c=e.values[l]??0;n[a]=c,r[o]++}return n}const k9=(e,t)=>{const n=qr.createTransformer(t),r=Au(e),a=Au(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?lg.has(e)&&!a.values.length||lg.has(t)&&!r.values.length?S9(e,t):zu(Xj(T9(r,a),a.values),n):pd(e,t)};function Wj(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Vt(e,t,n):Fy(e)(e,t)}const C9=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_t.update(t,n),stop:()=>Ra(t),now:()=>xn.isProcessing?xn.timestamp:Un.now()}},Qj=(e,t,n=10)=>{let r="";const a=Math.max(Math.round(t/n),2);for(let o=0;o<a;o++)r+=Math.round(e(o/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},md=2e4;function Hy(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<md;)t+=n,r=e.next(t);return t>=md?1/0:t}function A9(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(Hy(r),md);return{type:"keyframes",ease:o=>r.next(a*o).value/t,duration:Nr(a)}}const N9=5;function Jj(e,t,n){const r=Math.max(t-N9,0);return Rj(n-e(r),t-r)}const Kt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Jm=.001;function j9({duration:e=Kt.duration,bounce:t=Kt.bounce,velocity:n=Kt.velocity,mass:r=Kt.mass}){let a,o,l=1-t;l=fi(Kt.minDamping,Kt.maxDamping,l),e=fi(Kt.minDuration,Kt.maxDuration,Nr(e)),l<1?(a=d=>{const p=d*l,v=p*e,g=p-n,b=ug(d,l),S=Math.exp(-v);return Jm-g/b*S},o=d=>{const v=d*l*e,g=v*n+n,b=Math.pow(l,2)*Math.pow(d,2)*e,S=Math.exp(-v),w=ug(Math.pow(d,2),l);return(-a(d)+Jm>0?-1:1)*((g-b)*S)/w}):(a=d=>{const p=Math.exp(-d*e),v=(d-n)*e+1;return-Jm+p*v},o=d=>{const p=Math.exp(-d*e),v=(n-d)*(e*e);return p*v});const c=5/e,f=_9(a,o,c);if(e=Hr(e),isNaN(f))return{stiffness:Kt.stiffness,damping:Kt.damping,duration:e};{const d=Math.pow(f,2)*r;return{stiffness:d,damping:l*2*Math.sqrt(r*d),duration:e}}}const R9=12;function _9(e,t,n){let r=n;for(let a=1;a<R9;a++)r=r-e(r)/t(r);return r}function ug(e,t){return e*Math.sqrt(1-t*t)}const O9=["duration","bounce"],M9=["stiffness","damping","mass"];function pT(e,t){return t.some(n=>e[n]!==void 0)}function D9(e){let t={velocity:Kt.velocity,stiffness:Kt.stiffness,damping:Kt.damping,mass:Kt.mass,isResolvedFromDuration:!1,...e};if(!pT(e,M9)&&pT(e,O9))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,o=2*fi(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Kt.mass,stiffness:a,damping:o}}else{const n=j9({...e,velocity:0});t={...t,...n,mass:Kt.mass},t.isResolvedFromDuration=!0}return t}function vd(e=Kt.visualDuration,t=Kt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:a}=n;const o=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:o},{stiffness:f,damping:d,mass:p,duration:v,velocity:g,isResolvedFromDuration:b}=D9({...n,velocity:-Nr(n.velocity||0)}),S=g||0,w=d/(2*Math.sqrt(f*p)),E=l-o,T=Nr(Math.sqrt(f/p)),C=Math.abs(E)<5;r||(r=C?Kt.restSpeed.granular:Kt.restSpeed.default),a||(a=C?Kt.restDelta.granular:Kt.restDelta.default);let k;if(w<1){const N=ug(T,w);k=R=>{const L=Math.exp(-w*T*R);return l-L*((S+w*T*E)/N*Math.sin(N*R)+E*Math.cos(N*R))}}else if(w===1)k=N=>l-Math.exp(-T*N)*(E+(S+T*E)*N);else{const N=T*Math.sqrt(w*w-1);k=R=>{const L=Math.exp(-w*T*R),U=Math.min(N*R,300);return l-L*((S+w*T*E)*Math.sinh(U)+N*E*Math.cosh(U))/N}}const j={calculatedDuration:b&&v||null,next:N=>{const R=k(N);if(b)c.done=N>=v;else{let L=N===0?S:0;w<1&&(L=N===0?Hr(S):Jj(k,N,R));const U=Math.abs(L)<=r,G=Math.abs(l-R)<=a;c.done=U&&G}return c.value=c.done?l:R,c},toString:()=>{const N=Math.min(Hy(j),md),R=Qj(L=>j.next(N*L).value,N,30);return N+"ms "+R},toTransition:()=>{}};return j}vd.applyToOptions=e=>{const t=A9(e,100,vd);return e.ease=t.ease,e.duration=Hr(t.duration),e.type="keyframes",e};function cg({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:l,min:c,max:f,restDelta:d=.5,restSpeed:p}){const v=e[0],g={done:!1,value:v},b=U=>c!==void 0&&U<c||f!==void 0&&U>f,S=U=>c===void 0?f:f===void 0||Math.abs(c-U)<Math.abs(f-U)?c:f;let w=n*t;const E=v+w,T=l===void 0?E:l(E);T!==E&&(w=T-v);const C=U=>-w*Math.exp(-U/r),k=U=>T+C(U),j=U=>{const G=C(U),M=k(U);g.done=Math.abs(G)<=d,g.value=g.done?T:M};let N,R;const L=U=>{b(g.value)&&(N=U,R=vd({keyframes:[g.value,S(g.value)],velocity:Jj(k,U,g.value),damping:a,stiffness:o,restDelta:d,restSpeed:p}))};return L(0),{calculatedDuration:null,next:U=>{let G=!1;return!R&&N===void 0&&(G=!0,j(U),L(U)),N!==void 0&&U>=N?R.next(U-N):(!G&&j(U),g)}}}function I9(e,t,n){const r=[],a=n||Vi.mix||Wj,o=e.length-1;for(let l=0;l<o;l++){let c=a(e[l],e[l+1]);if(t){const f=Array.isArray(t)?t[l]||_r:t;c=zu(f,c)}r.push(c)}return r}function L9(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const o=e.length;if(Iy(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=I9(t,r,a),f=c.length,d=p=>{if(l&&p<e[0])return t[0];let v=0;if(f>1)for(;v<e.length-2&&!(p<e[v+1]);v++);const g=ku(e[v],e[v+1],p);return c[v](g)};return n?p=>d(fi(e[0],e[o-1],p)):d}function P9(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=ku(0,t,r);e.push(Vt(n,1,a))}}function U9(e){const t=[0];return P9(t,e.length-1),t}function z9(e,t){return e.map(n=>n*t)}function B9(e,t){return e.map(()=>t||zj).splice(0,e.length-1)}function pu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=Qq(r)?r.map(lT):lT(r),o={done:!1,value:t[0]},l=z9(n&&n.length===t.length?n:U9(t),e),c=L9(l,t,{ease:Array.isArray(a)?a:B9(t,a)});return{calculatedDuration:e,next:f=>(o.value=c(f),o.done=f>=e,o)}}const V9=e=>e!==null;function qy(e,{repeat:t,repeatType:n="loop"},r,a=1){const o=e.filter(V9),c=a<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!c||r===void 0?o[c]:r}const F9={decay:cg,inertia:cg,tween:pu,keyframes:pu,spring:vd};function Zj(e){typeof e.type=="string"&&(e.type=F9[e.type])}class Gy{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const H9=e=>e/100;class Ky extends Gy{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Un.now()&&this.tick(Un.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Zj(t);const{type:n=pu,repeat:r=0,repeatDelay:a=0,repeatType:o,velocity:l=0}=t;let{keyframes:c}=t;const f=n||pu;f!==pu&&typeof c[0]!="number"&&(this.mixKeyframes=zu(H9,Wj(c[0],c[1])),c=[0,100]);const d=f({...t,keyframes:c});o==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...c].reverse(),velocity:-l})),d.calculatedDuration===null&&(d.calculatedDuration=Hy(d));const{calculatedDuration:p}=d;this.calculatedDuration=p,this.resolvedDuration=p+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:a,mixKeyframes:o,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:p,repeat:v,repeatType:g,repeatDelay:b,type:S,onUpdate:w,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const T=this.currentTime-d*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?T<0:T>a;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let k=this.currentTime,j=r;if(v){const U=Math.min(this.currentTime,a)/c;let G=Math.floor(U),M=U%1;!M&&U>=1&&(M=1),M===1&&G--,G=Math.min(G,v+1),G%2&&(g==="reverse"?(M=1-M,b&&(M-=b/c)):g==="mirror"&&(j=l)),k=fi(0,1,M)*c}const N=C?{done:!1,value:p[0]}:j.next(k);o&&(N.value=o(N.value));let{done:R}=N;!C&&f!==null&&(R=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return L&&S!==cg&&(N.value=qy(p,this.options,E,this.speed)),w&&w(N.value),L&&this.finish(),N}then(t,n){return this.finished.then(t,n)}get duration(){return Nr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Nr(t)}get time(){return Nr(this.currentTime)}set time(t){t=Hr(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Un.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Nr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=C9,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Un.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function q9(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const cs=e=>e*180/Math.PI,fg=e=>{const t=cs(Math.atan2(e[1],e[0]));return dg(t)},G9={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fg,rotateZ:fg,skewX:e=>cs(Math.atan(e[1])),skewY:e=>cs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},dg=e=>(e=e%360,e<0&&(e+=360),e),mT=fg,vT=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),gT=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),K9={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vT,scaleY:gT,scale:e=>(vT(e)+gT(e))/2,rotateX:e=>dg(cs(Math.atan2(e[6],e[5]))),rotateY:e=>dg(cs(Math.atan2(-e[2],e[0]))),rotateZ:mT,rotate:mT,skewX:e=>cs(Math.atan(e[4])),skewY:e=>cs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hg(e){return e.includes("scale")?1:0}function pg(e,t){if(!e||e==="none")return hg(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=K9,a=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=G9,a=c}if(!a)return hg(t);const o=r[t],l=a[1].split(",").map($9);return typeof o=="function"?o(l):l[o]}const Y9=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return pg(n,t)};function $9(e){return parseFloat(e.trim())}const zo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bo=new Set(zo),yT=e=>e===Uo||e===Ce,X9=new Set(["x","y","z"]),W9=zo.filter(e=>!X9.has(e));function Q9(e){const t=[];return W9.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Aa={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>pg(t,"x"),y:(e,{transform:t})=>pg(t,"y")};Aa.translateX=Aa.x;Aa.translateY=Aa.y;const hs=new Set;let mg=!1,vg=!1,gg=!1;function eR(){if(vg){const e=Array.from(hs).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=Q9(r);a.length&&(n.set(r,a),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([o,l])=>{r.getValue(o)?.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}vg=!1,mg=!1,hs.forEach(e=>e.complete(gg)),hs.clear()}function tR(){hs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(vg=!0)})}function J9(){gg=!0,tR(),eR(),gg=!1}class Yy{constructor(t,n,r,a,o,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=a,this.element=o,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(hs.add(this),mg||(mg=!0,_t.read(tR),_t.resolveKeyframes(eR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:a}=this;if(t[0]===null){const o=a?.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),a&&o===void 0&&a.set(t[0])}q9(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),hs.delete(this)}cancel(){this.state==="scheduled"&&(hs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Z9=e=>e.startsWith("--");function eG(e,t,n){Z9(t)?e.style.setProperty(t,n):e.style[t]=n}const tG={};function nR(e,t){const n=jj(e);return()=>tG[t]??n()}const nG=nR(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),rR=nR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),tu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tu([0,.65,.55,1]),circOut:tu([.55,0,1,.45]),backIn:tu([.31,.01,.66,-.59]),backOut:tu([.33,1.53,.69,.99])};function iR(e,t){if(e)return typeof e=="function"?rR()?Qj(e,t):"ease-out":Bj(e)?tu(e):Array.isArray(e)?e.map(n=>iR(n,t)||bT.easeOut):bT[e]}function rG(e,t,n,{delay:r=0,duration:a=300,repeat:o=0,repeatType:l="loop",ease:c="easeOut",times:f}={},d=void 0){const p={[t]:n};f&&(p.offset=f);const v=iR(c,a);Array.isArray(v)&&(p.easing=v);const g={delay:r,duration:a,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"};return d&&(g.pseudoElement=d),e.animate(p,g)}function aR(e){return typeof e=="function"&&"applyToOptions"in e}function iG({type:e,...t}){return aR(e)&&rR()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class sR extends Gy{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:a,pseudoElement:o,allowFlatten:l=!1,finalKeyframe:c,onComplete:f}=t;this.isPseudoElement=!!o,this.allowFlatten=l,this.options=t,Iy(typeof t.type!="string");const d=iG(t);this.animation=rG(n,r,a,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const p=qy(a,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(p):eG(n,r,p),this.animation.cancel()}f?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Nr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Nr(t)}get time(){return Nr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Hr(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&nG()?(this.animation.timeline=t,_r):n(this)}}const oR={anticipate:Lj,backInOut:Ij,circInOut:Uj};function aG(e){return e in oR}function sG(e){typeof e.ease=="string"&&aG(e.ease)&&(e.ease=oR[e.ease])}const Zm=10;class oG extends sR{constructor(t){sG(t),Zj(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:a,element:o,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new Ky({...l,autoplay:!1}),f=Math.max(Zm,Un.now()-this.startTime),d=fi(0,Zm,f-Zm);n.setWithVelocity(c.sample(Math.max(0,f-d)).value,c.sample(f).value,d),c.stop()}}const xT=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qr.test(e)||e==="0")&&!e.startsWith("url("));function lG(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function uG(e,t,n,r){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],l=xT(a,t),c=xT(o,t);return!l||!c?!1:lG(e)||(n==="spring"||aR(n))&&r}function yg(e){e.duration=0,e.type="keyframes"}const cG=new Set(["opacity","clipPath","filter","transform"]),fG=jj(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function dG(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:o,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:d}=t.owner.getProps();return fG()&&n&&cG.has(n)&&(n!=="transform"||!d)&&!f&&!r&&a!=="mirror"&&o!==0&&l!=="inertia"}const hG=40;class pG extends Gy{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:l="loop",keyframes:c,name:f,motionValue:d,element:p,...v}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Un.now();const g={autoplay:t,delay:n,type:r,repeat:a,repeatDelay:o,repeatType:l,name:f,motionValue:d,element:p,...v},b=p?.KeyframeResolver||Yy;this.keyframeResolver=new b(c,(S,w,E)=>this.onKeyframesResolved(S,w,g,!E),f,d,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,a){this.keyframeResolver=void 0;const{name:o,type:l,velocity:c,delay:f,isHandoff:d,onUpdate:p}=r;this.resolvedAt=Un.now(),uG(t,o,l,c)||((Vi.instantAnimations||!f)&&p?.(qy(t,r,n)),t[0]=t[t.length-1],yg(r),r.repeat=0);const g={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>hG?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},b=!d&&dG(g),S=g.motionValue?.owner?.current,w=b?new oG({...g,element:S}):new Ky(g);w.finished.then(()=>{this.notifyFinished()}).catch(_r),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),J9()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function lR(e,t,n,r=0,a=1){const o=Array.from(e).sort((d,p)=>d.sortNodePosition(p)).indexOf(t),l=e.size,c=(l-1)*r;return typeof n=="function"?n(o,l):a===1?o*r:c-o*r}const mG=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vG(e){const t=mG.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function uR(e,t,n=1){const[r,a]=vG(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const l=o.trim();return Cj(l)?parseFloat(l):l}return zy(a)?uR(a,t,n+1):a}const gG={type:"spring",stiffness:500,damping:25,restSpeed:10},yG=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),bG={type:"keyframes",duration:.8},xG={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},SG=(e,{keyframes:t})=>t.length>2?bG:Bo.has(e)?e.startsWith("scale")?yG(t[1]):gG:xG,wG=e=>e!==null;function EG(e,{repeat:t,repeatType:n="loop"},r){const a=e.filter(wG),o=t&&n!=="loop"&&t%2===1?0:a.length-1;return a[o]}function cR(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function $y(e,t){const n=e?.[t]??e?.default??e;return n!==e?cR(n,e):n}function TG({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:o,repeatType:l,repeatDelay:c,from:f,elapsed:d,...p}){return!!Object.keys(p).length}const Xy=(e,t,n,r={},a,o)=>l=>{const c=$y(r,e)||{},f=c.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Hr(f);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-d,onUpdate:g=>{t.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:o?void 0:a};TG(c)||Object.assign(p,SG(e,p)),p.duration&&(p.duration=Hr(p.duration)),p.repeatDelay&&(p.repeatDelay=Hr(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let v=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(yg(p),p.delay===0&&(v=!0)),(Vi.instantAnimations||Vi.skipAnimations||a?.shouldSkipAnimations)&&(v=!0,yg(p),p.delay=0),p.allowFlatten=!c.type&&!c.ease,v&&!o&&t.get()!==void 0){const g=EG(p.keyframes,c);if(g!==void 0){_t.update(()=>{p.onUpdate(g),p.onComplete()});return}}return c.isSync?new Ky(p):new pG(p)};function ST(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Wy(e,t,n,r){if(typeof t=="function"){const[a,o]=ST(r);t=t(n!==void 0?n:e.custom,a,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,o]=ST(r);t=t(n!==void 0?n:e.custom,a,o)}return t}function wo(e,t,n){const r=e.getProps();return Wy(r,t,n!==void 0?n:r.custom,e)}const fR=new Set(["width","height","top","left","right","bottom",...zo]),wT=30,kG=e=>!isNaN(parseFloat(e));class CG{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=Un.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Un.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=kG(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ly);const r=this.events[t].add(n);return t==="change"?()=>{r(),_t.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Un.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>wT)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wT);return Rj(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function No(e,t){return new CG(e,t)}const bg=e=>Array.isArray(e);function AG(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,No(n))}function NG(e){return bg(e)?e[e.length-1]||0:e}function jG(e,t){const n=wo(e,t);let{transitionEnd:r={},transition:a={},...o}=n||{};o={...o,...r};for(const l in o){const c=NG(o[l]);AG(e,l,c)}}const jn=e=>!!(e&&e.getVelocity);function RG(e){return!!(jn(e)&&e.add)}function xg(e,t){const n=e.getValue("willChange");if(RG(n))return n.add(t);if(!n&&Vi.WillChange){const r=new Vi.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Qy(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const _G="framerAppearId",dR="data-"+Qy(_G);function hR(e){return e.props[dR]}function OG({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function pR(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:o,transitionEnd:l,...c}=t;const f=e.getDefaultTransition();o=o?cR(o,f):f;const d=o?.reduceMotion;r&&(o=r);const p=[],v=a&&e.animationState&&e.animationState.getState()[a];for(const g in c){const b=e.getValue(g,e.latestValues[g]??null),S=c[g];if(S===void 0||v&&OG(v,g))continue;const w={delay:n,...$y(o||{},g)},E=b.get();if(E!==void 0&&!b.isAnimating&&!Array.isArray(S)&&S===E&&!w.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const j=hR(e);if(j){const N=window.MotionHandoffAnimation(j,g,_t);N!==null&&(w.startTime=N,T=!0)}}xg(e,g);const C=d??e.shouldReduceMotion;b.start(Xy(g,b,S,C&&fR.has(g)?{type:!1}:w,e,T));const k=b.animation;k&&p.push(k)}if(l){const g=()=>_t.update(()=>{l&&jG(e,l)});p.length?Promise.all(p).then(g):g()}return p}function Sg(e,t,n={}){const r=wo(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const o=r?()=>Promise.all(pR(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:v}=a;return MG(e,t,f,d,p,v,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[f,d]=c==="beforeChildren"?[o,l]:[l,o];return f().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function MG(e,t,n=0,r=0,a=0,o=1,l){const c=[];for(const f of e.variantChildren)f.notify("AnimationStart",t),c.push(Sg(f,t,{...l,delay:n+(typeof r=="function"?0:r)+lR(e.variantChildren,f,r,a,o)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(c)}function DG(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(o=>Sg(e,o,n));r=Promise.all(a)}else if(typeof t=="string")r=Sg(e,t,n);else{const a=typeof t=="function"?wo(e,t,n.custom):t;r=Promise.all(pR(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const IG={test:e=>e==="auto",parse:e=>e},mR=e=>t=>t.test(e),vR=[Uo,Ce,li,va,c9,u9,IG],ET=e=>vR.find(mR(e));function LG(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Nj(e):!0}const PG=new Set(["brightness","contrast","saturate","opacity"]);function UG(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(By)||[];if(!r)return e;const a=n.replace(r,"");let o=PG.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+a+")"}const zG=/\b([a-z-]*)\(.*?\)/gu,wg={...qr,getAnimatableNone:e=>{const t=e.match(zG);return t?t.map(UG).join(" "):e}},Eg={...qr,getAnimatableNone:e=>{const t=qr.parse(e);return qr.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},TT={...Uo,transform:Math.round},BG={rotate:va,rotateX:va,rotateY:va,rotateZ:va,scale:Cf,scaleX:Cf,scaleY:Cf,scaleZ:Cf,skew:va,skewX:va,skewY:va,distance:Ce,translateX:Ce,translateY:Ce,translateZ:Ce,x:Ce,y:Ce,z:Ce,perspective:Ce,transformPerspective:Ce,opacity:Cu,originX:cT,originY:cT,originZ:Ce},Jy={borderWidth:Ce,borderTopWidth:Ce,borderRightWidth:Ce,borderBottomWidth:Ce,borderLeftWidth:Ce,borderRadius:Ce,borderTopLeftRadius:Ce,borderTopRightRadius:Ce,borderBottomRightRadius:Ce,borderBottomLeftRadius:Ce,width:Ce,maxWidth:Ce,height:Ce,maxHeight:Ce,top:Ce,right:Ce,bottom:Ce,left:Ce,inset:Ce,insetBlock:Ce,insetBlockStart:Ce,insetBlockEnd:Ce,insetInline:Ce,insetInlineStart:Ce,insetInlineEnd:Ce,padding:Ce,paddingTop:Ce,paddingRight:Ce,paddingBottom:Ce,paddingLeft:Ce,paddingBlock:Ce,paddingBlockStart:Ce,paddingBlockEnd:Ce,paddingInline:Ce,paddingInlineStart:Ce,paddingInlineEnd:Ce,margin:Ce,marginTop:Ce,marginRight:Ce,marginBottom:Ce,marginLeft:Ce,marginBlock:Ce,marginBlockStart:Ce,marginBlockEnd:Ce,marginInline:Ce,marginInlineStart:Ce,marginInlineEnd:Ce,fontSize:Ce,backgroundPositionX:Ce,backgroundPositionY:Ce,...BG,zIndex:TT,fillOpacity:Cu,strokeOpacity:Cu,numOctaves:TT},VG={...Jy,color:on,backgroundColor:on,outlineColor:on,fill:on,stroke:on,borderColor:on,borderTopColor:on,borderRightColor:on,borderBottomColor:on,borderLeftColor:on,filter:wg,WebkitFilter:wg,mask:Eg,WebkitMask:Eg},gR=e=>VG[e],FG=new Set([wg,Eg]);function yR(e,t){let n=gR(e);return FG.has(n)||(n=qr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const HG=new Set(["auto","none","0"]);function qG(e,t,n){let r=0,a;for(;r<e.length&&!a;){const o=e[r];typeof o=="string"&&!HG.has(o)&&Au(o).values.length&&(a=e[r]),r++}if(a&&n)for(const o of t)e[o]=yR(n,a)}class GG extends Yy{constructor(t,n,r,a,o){super(t,n,r,a,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let v=t[p];if(typeof v=="string"&&(v=v.trim(),zy(v))){const g=uR(v,n.current);g!==void 0&&(t[p]=g),p===t.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!fR.has(r)||t.length!==2)return;const[a,o]=t,l=ET(a),c=ET(o),f=uT(a),d=uT(o);if(f!==d&&Aa[r]){this.needsMeasurement=!0;return}if(l!==c)if(yT(l)&&yT(c))for(let p=0;p<t.length;p++){const v=t[p];typeof v=="string"&&(t[p]=parseFloat(v))}else Aa[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||LG(t[a]))&&r.push(a);r.length&&qG(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Aa[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(r,a).jump(a,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const o=r.length-1,l=r[o];r[o]=Aa[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{t.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const KG=new Set(["opacity","clipPath","filter","transform"]);function bR(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const a=n?.[e]??r.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(r=>r!=null)}const xR=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function YG(e){return Aj(e)&&"offsetHeight"in e}const{schedule:Zy}=Vj(queueMicrotask,!1),Br={x:!1,y:!1};function SR(){return Br.x||Br.y}function $G(e){return e==="x"||e==="y"?Br[e]?null:(Br[e]=!0,()=>{Br[e]=!1}):Br.x||Br.y?null:(Br.x=Br.y=!0,()=>{Br.x=Br.y=!1})}function wR(e,t){const n=bR(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function XG(e){return!(e.pointerType==="touch"||SR())}function WG(e,t,n={}){const[r,a,o]=wR(e,n);return r.forEach(l=>{let c=!1,f=!1,d;const p=()=>{l.removeEventListener("pointerleave",S)},v=E=>{d&&(d(E),d=void 0),p()},g=E=>{c=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),f&&(f=!1,v(E))},b=()=>{c=!0,window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",g,a)},S=E=>{if(E.pointerType!=="touch"){if(c){f=!0;return}v(E)}},w=E=>{if(!XG(E))return;f=!1;const T=t(l,E);typeof T=="function"&&(d=T,l.addEventListener("pointerleave",S,a))};l.addEventListener("pointerenter",w,a),l.addEventListener("pointerdown",b,a)}),o}const ER=(e,t)=>t?e===t?!0:ER(e,t.parentElement):!1,e0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,QG=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function JG(e){return QG.has(e.tagName)||e.isContentEditable===!0}const ZG=new Set(["INPUT","SELECT","TEXTAREA"]);function e7(e){return ZG.has(e.tagName)||e.isContentEditable===!0}const Kf=new WeakSet;function kT(e){return t=>{t.key==="Enter"&&e(t)}}function ev(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const t7=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=kT(()=>{if(Kf.has(n))return;ev(n,"down");const a=kT(()=>{ev(n,"up")}),o=()=>ev(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function CT(e){return e0(e)&&!SR()}const AT=new WeakSet;function n7(e,t,n={}){const[r,a,o]=wR(e,n),l=c=>{const f=c.currentTarget;if(!CT(c)||AT.has(c))return;Kf.add(f),n.stopPropagation&&AT.add(c);const d=t(f,c),p=(b,S)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",g),Kf.has(f)&&Kf.delete(f),CT(b)&&typeof d=="function"&&d(b,{success:S})},v=b=>{p(b,f===window||f===document||n.useGlobalTarget||ER(f,b.target))},g=b=>{p(b,!1)};window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",g,a)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,a),YG(c)&&(c.addEventListener("focus",d=>t7(d,a)),!JG(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}function t0(e){return Aj(e)&&"ownerSVGElement"in e}const Yf=new WeakMap;let $f;const TR=(e,t,n)=>(r,a)=>a&&a[0]?a[0][e+"Size"]:t0(r)&&"getBBox"in r?r.getBBox()[t]:r[n],r7=TR("inline","width","offsetWidth"),i7=TR("block","height","offsetHeight");function a7({target:e,borderBoxSize:t}){Yf.get(e)?.forEach(n=>{n(e,{get width(){return r7(e,t)},get height(){return i7(e,t)}})})}function s7(e){e.forEach(a7)}function o7(){typeof ResizeObserver>"u"||($f=new ResizeObserver(s7))}function l7(e,t){$f||o7();const n=bR(e);return n.forEach(r=>{let a=Yf.get(r);a||(a=new Set,Yf.set(r,a)),a.add(t),$f?.observe(r)}),()=>{n.forEach(r=>{const a=Yf.get(r);a?.delete(t),a?.size||$f?.unobserve(r)})}}const Xf=new Set;let ho;function u7(){ho=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xf.forEach(t=>t(e))},window.addEventListener("resize",ho)}function c7(e){return Xf.add(e),ho||u7(),()=>{Xf.delete(e),!Xf.size&&typeof ho=="function"&&(window.removeEventListener("resize",ho),ho=void 0)}}function NT(e,t){return typeof e=="function"?c7(e):l7(e,t)}function f7(e){return t0(e)&&e.tagName==="svg"}const d7=[...vR,on,qr],h7=e=>d7.find(mR(e)),jT=()=>({translate:0,scale:1,origin:0,originPoint:0}),po=()=>({x:jT(),y:jT()}),RT=()=>({min:0,max:0}),dn=()=>({x:RT(),y:RT()}),p7=new WeakMap;function zd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Nu(e){return typeof e=="string"||Array.isArray(e)}const n0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],r0=["initial",...n0];function Bd(e){return zd(e.animate)||r0.some(t=>Nu(e[t]))}function kR(e){return!!(Bd(e)||e.variants)}function m7(e,t,n){for(const r in t){const a=t[r],o=n[r];if(jn(a))e.addValue(r,a);else if(jn(o))e.addValue(r,No(a,{owner:e}));else if(o!==a)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(a):l.hasAnimated||l.set(a)}else{const l=e.getStaticValue(r);e.addValue(r,No(l!==void 0?l:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Tg={current:null},CR={current:!1},v7=typeof window<"u";function g7(){if(CR.current=!0,!!v7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Tg.current=e.matches;e.addEventListener("change",t),t()}else Tg.current=!1}const _T=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let gd={};function AR(e){gd=e}function y7(){return gd}class b7{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:a,skipAnimations:o,blockInitialAnimation:l,visualState:c},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Yy,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=Un.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,_t.render(this.render,!1,!0))};const{latestValues:d,renderState:p}=c;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=o,this.options=f,this.blockInitialAnimation=!!l,this.isControllingVariants=Bd(n),this.isVariantNode=kR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:v,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in g){const S=g[b];d[b]!==void 0&&jn(S)&&S.set(d[b])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,p7.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(CR.current||g7(),this.shouldReduceMotion=Tg.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ra(this.notifyUpdate),Ra(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&KG.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:f,ease:d,duration:p}=n.accelerate,v=new sR({element:this.current,name:t,keyframes:c,times:f,ease:d,duration:Hr(p)}),g=l(v);this.valueSubscriptions.set(t,()=>{g(),v.cancel()});return}const r=Bo.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&_t.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in gd){const n=gd[t];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[t]&&a&&r(this.props)&&(this.features[t]=new a(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):dn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<_T.length;r++){const a=_T[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const o="on"+a,l=t[o];l&&(this.propEventSubscriptions[a]=this.on(a,l))}this.prevMotionValues=m7(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=No(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Cj(r)||Nj(r))?r=parseFloat(r):!h7(r)&&qr.test(n)&&(r=yR(t,n)),this.setBaseTarget(t,jn(r)?r.get():r)),jn(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Wy(this.props,n,this.presenceContext?.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!jn(a)?a:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ly),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Zy.render(this.render)}}class NR extends b7{constructor(){super(...arguments),this.KeyframeResolver=GG}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;jn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ma{constructor(t){this.isMounted=!1,this.node=t}update(){}}function jR({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function x7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function S7(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function tv(e){return e===void 0||e===1}function kg({scale:e,scaleX:t,scaleY:n}){return!tv(e)||!tv(t)||!tv(n)}function os(e){return kg(e)||RR(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function RR(e){return OT(e.x)||OT(e.y)}function OT(e){return e&&e!=="0%"}function yd(e,t,n){const r=e-n,a=t*r;return n+a}function MT(e,t,n,r,a){return a!==void 0&&(e=yd(e,a,r)),yd(e,n,r)+t}function Cg(e,t=0,n=1,r,a){e.min=MT(e.min,t,n,r,a),e.max=MT(e.max,t,n,r,a)}function _R(e,{x:t,y:n}){Cg(e.x,t.translate,t.scale,t.originPoint),Cg(e.y,n.translate,n.scale,n.originPoint)}const DT=.999999999999,IT=1.0000000000001;function w7(e,t,n,r=!1){const a=n.length;if(!a)return;t.x=t.y=1;let o,l;for(let c=0;c<a;c++){o=n[c],l=o.projectionDelta;const{visualElement:f}=o.options;f&&f.props.style&&f.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&vo(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,_R(e,l)),r&&os(o.latestValues)&&vo(e,o.latestValues))}t.x<IT&&t.x>DT&&(t.x=1),t.y<IT&&t.y>DT&&(t.y=1)}function mo(e,t){e.min=e.min+t,e.max=e.max+t}function LT(e,t,n,r,a=.5){const o=Vt(e.min,e.max,a);Cg(e,t,n,o,r)}function vo(e,t){LT(e.x,t.x,t.scaleX,t.scale,t.originX),LT(e.y,t.y,t.scaleY,t.scale,t.originY)}function OR(e,t){return jR(S7(e.getBoundingClientRect(),t))}function E7(e,t,n){const r=OR(e,n),{scroll:a}=t;return a&&(mo(r.x,a.offset.x),mo(r.y,a.offset.y)),r}const T7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},k7=zo.length;function C7(e,t,n){let r="",a=!0;for(let o=0;o<k7;o++){const l=zo[o],c=e[l];if(c===void 0)continue;let f=!0;if(typeof c=="number")f=c===(l.startsWith("scale")?1:0);else{const d=parseFloat(c);f=l.startsWith("scale")?d===1:d===0}if(!f||n){const d=xR(c,Jy[l]);if(!f){a=!1;const p=T7[l]||l;r+=`${p}(${d}) `}n&&(t[l]=d)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function i0(e,t,n){const{style:r,vars:a,transformOrigin:o}=e;let l=!1,c=!1;for(const f in t){const d=t[f];if(Bo.has(f)){l=!0;continue}else if(Hj(f)){a[f]=d;continue}else{const p=xR(d,Jy[f]);f.startsWith("origin")?(c=!0,o[f]=p):r[f]=p}}if(t.transform||(l||n?r.transform=C7(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:f="50%",originY:d="50%",originZ:p=0}=o;r.transformOrigin=`${f} ${d} ${p}`}}function MR(e,{style:t,vars:n},r,a){const o=e.style;let l;for(l in t)o[l]=t[l];a?.applyProjectionStyles(o,r);for(l in n)o.setProperty(l,n[l])}function PT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Xl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ce.test(e))e=parseFloat(e);else return e;const n=PT(e,t.target.x),r=PT(e,t.target.y);return`${n}% ${r}%`}},A7={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=qr.parse(e);if(a.length>5)return r;const o=qr.createTransformer(e),l=typeof a[0]!="number"?1:0,c=n.x.scale*t.x,f=n.y.scale*t.y;a[0+l]/=c,a[1+l]/=f;const d=Vt(c,f,.5);return typeof a[2+l]=="number"&&(a[2+l]/=d),typeof a[3+l]=="number"&&(a[3+l]/=d),o(a)}},Ag={borderRadius:{...Xl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xl,borderTopRightRadius:Xl,borderBottomLeftRadius:Xl,borderBottomRightRadius:Xl,boxShadow:A7};function DR(e,{layout:t,layoutId:n}){return Bo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ag[e]||e==="opacity")}function a0(e,t,n){const r=e.style,a=t?.style,o={};if(!r)return o;for(const l in r)(jn(r[l])||a&&jn(a[l])||DR(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(o[l]=r[l]);return o}function N7(e){return window.getComputedStyle(e)}class j7 extends NR{constructor(){super(...arguments),this.type="html",this.renderInstance=MR}readValueFromInstance(t,n){if(Bo.has(n))return this.projection?.isProjecting?hg(n):Y9(t,n);{const r=N7(t),a=(Hj(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return OR(t,n)}build(t,n,r){i0(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return a0(t,n,r)}}const R7={offset:"stroke-dashoffset",array:"stroke-dasharray"},_7={offset:"strokeDashoffset",array:"strokeDasharray"};function O7(e,t,n=1,r=0,a=!0){e.pathLength=1;const o=a?R7:_7;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const M7=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function IR(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:o=1,pathOffset:l=0,...c},f,d,p){if(i0(e,c,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:v,style:g}=e;v.transform&&(g.transform=v.transform,delete v.transform),(g.transform||v.transformOrigin)&&(g.transformOrigin=v.transformOrigin??"50% 50%",delete v.transformOrigin),g.transform&&(g.transformBox=p?.transformBox??"fill-box",delete v.transformBox);for(const b of M7)v[b]!==void 0&&(g[b]=v[b],delete v[b]);t!==void 0&&(v.x=t),n!==void 0&&(v.y=n),r!==void 0&&(v.scale=r),a!==void 0&&O7(v,a,o,l,!1)}const LR=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),PR=e=>typeof e=="string"&&e.toLowerCase()==="svg";function D7(e,t,n,r){MR(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(LR.has(a)?a:Qy(a),t.attrs[a])}function UR(e,t,n){const r=a0(e,t,n);for(const a in e)if(jn(e[a])||jn(t[a])){const o=zo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[o]=e[a]}return r}class I7 extends NR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=dn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Bo.has(n)){const r=gR(n);return r&&r.default||0}return n=LR.has(n)?n:Qy(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return UR(t,n,r)}build(t,n,r){IR(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){D7(t,n,r,a)}mount(t){this.isSVGTag=PR(t.tagName),super.mount(t)}}const L7=r0.length;function zR(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zR(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<L7;n++){const r=r0[n],a=e.props[r];(Nu(a)||a===!1)&&(t[r]=a)}return t}function BR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const P7=[...n0].reverse(),U7=n0.length;function z7(e){return t=>Promise.all(t.map(({animation:n,options:r})=>DG(e,n,r)))}function B7(e){let t=z7(e),n=UT(),r=!0;const a=f=>(d,p)=>{const v=wo(e,p,f==="exit"?e.presenceContext?.custom:void 0);if(v){const{transition:g,transitionEnd:b,...S}=v;d={...d,...S,...b}}return d};function o(f){t=f(e)}function l(f){const{props:d}=e,p=zR(e.parent)||{},v=[],g=new Set;let b={},S=1/0;for(let E=0;E<U7;E++){const T=P7[E],C=n[T],k=d[T]!==void 0?d[T]:p[T],j=Nu(k),N=T===f?C.isActive:null;N===!1&&(S=E);let R=k===p[T]&&k!==d[T]&&j;if(R&&r&&e.manuallyAnimateOnMount&&(R=!1),C.protectedKeys={...b},!C.isActive&&N===null||!k&&!C.prevProp||zd(k)||typeof k=="boolean")continue;if(T==="exit"&&C.isActive&&N!==!0){C.prevResolvedValues&&(b={...b,...C.prevResolvedValues});continue}const L=V7(C.prevProp,k);let U=L||T===f&&C.isActive&&!R&&j||E>S&&j,G=!1;const M=Array.isArray(k)?k:[k];let B=M.reduce(a(T),{});N===!1&&(B={});const{prevResolvedValues:X={}}=C,oe={...X,...B},ue=W=>{U=!0,g.has(W)&&(G=!0,g.delete(W)),C.needsAnimating[W]=!0;const $=e.getValue(W);$&&($.liveStyle=!1)};for(const W in oe){const $=B[W],he=X[W];if(b.hasOwnProperty(W))continue;let I=!1;bg($)&&bg(he)?I=!BR($,he):I=$!==he,I?$!=null?ue(W):g.add(W):$!==void 0&&g.has(W)?ue(W):C.protectedKeys[W]=!0}C.prevProp=k,C.prevResolvedValues=B,C.isActive&&(b={...b,...B}),r&&e.blockInitialAnimation&&(U=!1);const Z=R&&L;U&&(!Z||G)&&v.push(...M.map(W=>{const $={type:T};if(typeof W=="string"&&r&&!Z&&e.manuallyAnimateOnMount&&e.parent){const{parent:he}=e,I=wo(he,W);if(he.enteringChildren&&I){const{delayChildren:z}=I.transition||{};$.delay=lR(he.enteringChildren,e,z)}}return{animation:W,options:$}}))}if(g.size){const E={};if(typeof d.initial!="boolean"){const T=wo(e,Array.isArray(d.initial)?d.initial[0]:d.initial);T&&T.transition&&(E.transition=T.transition)}g.forEach(T=>{const C=e.getBaseTarget(T),k=e.getValue(T);k&&(k.liveStyle=!0),E[T]=C??null}),v.push({animation:E})}let w=!!v.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(v):Promise.resolve()}function c(f,d){if(n[f].isActive===d)return Promise.resolve();e.variantChildren?.forEach(v=>v.animationState?.setActive(f,d)),n[f].isActive=d;const p=l(f);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=UT()}}}function V7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!BR(t,e):!1}function is(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function UT(){return{animate:is(!0),whileInView:is(),whileHover:is(),whileTap:is(),whileDrag:is(),whileFocus:is(),exit:is()}}function zT(e,t){e.min=t.min,e.max=t.max}function Ur(e,t){zT(e.x,t.x),zT(e.y,t.y)}function BT(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const VR=1e-4,F7=1-VR,H7=1+VR,FR=.01,q7=0-FR,G7=0+FR;function zn(e){return e.max-e.min}function K7(e,t,n){return Math.abs(e-t)<=n}function VT(e,t,n,r=.5){e.origin=r,e.originPoint=Vt(t.min,t.max,e.origin),e.scale=zn(n)/zn(t),e.translate=Vt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=F7&&e.scale<=H7||isNaN(e.scale))&&(e.scale=1),(e.translate>=q7&&e.translate<=G7||isNaN(e.translate))&&(e.translate=0)}function mu(e,t,n,r){VT(e.x,t.x,n.x,r?r.originX:void 0),VT(e.y,t.y,n.y,r?r.originY:void 0)}function FT(e,t,n){e.min=n.min+t.min,e.max=e.min+zn(t)}function Y7(e,t,n){FT(e.x,t.x,n.x),FT(e.y,t.y,n.y)}function HT(e,t,n){e.min=t.min-n.min,e.max=e.min+zn(t)}function bd(e,t,n){HT(e.x,t.x,n.x),HT(e.y,t.y,n.y)}function qT(e,t,n,r,a){return e-=t,e=yd(e,1/n,r),a!==void 0&&(e=yd(e,1/a,r)),e}function $7(e,t=0,n=1,r=.5,a,o=e,l=e){if(li.test(t)&&(t=parseFloat(t),t=Vt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=Vt(o.min,o.max,r);e===o&&(c-=t),e.min=qT(e.min,t,n,c,a),e.max=qT(e.max,t,n,c,a)}function GT(e,t,[n,r,a],o,l){$7(e,t[n],t[r],t[a],t.scale,o,l)}const X7=["x","scaleX","originX"],W7=["y","scaleY","originY"];function KT(e,t,n,r){GT(e.x,t,X7,n?n.x:void 0,r?r.x:void 0),GT(e.y,t,W7,n?n.y:void 0,r?r.y:void 0)}function YT(e){return e.translate===0&&e.scale===1}function HR(e){return YT(e.x)&&YT(e.y)}function $T(e,t){return e.min===t.min&&e.max===t.max}function Q7(e,t){return $T(e.x,t.x)&&$T(e.y,t.y)}function XT(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function qR(e,t){return XT(e.x,t.x)&&XT(e.y,t.y)}function WT(e){return zn(e.x)/zn(e.y)}function QT(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ai(e){return[e("x"),e("y")]}function J7(e,t,n){let r="";const a=e.x.translate/t.x,o=e.y.translate/t.y,l=n?.z||0;if((a||o||l)&&(r=`translate3d(${a}px, ${o}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:p,rotateX:v,rotateY:g,skewX:b,skewY:S}=n;d&&(r=`perspective(${d}px) ${r}`),p&&(r+=`rotate(${p}deg) `),v&&(r+=`rotateX(${v}deg) `),g&&(r+=`rotateY(${g}deg) `),b&&(r+=`skewX(${b}deg) `),S&&(r+=`skewY(${S}deg) `)}const c=e.x.scale*t.x,f=e.y.scale*t.y;return(c!==1||f!==1)&&(r+=`scale(${c}, ${f})`),r||"none"}const GR=["TopLeft","TopRight","BottomLeft","BottomRight"],Z7=GR.length,JT=e=>typeof e=="string"?parseFloat(e):e,ZT=e=>typeof e=="number"||Ce.test(e);function eK(e,t,n,r,a,o){a?(e.opacity=Vt(0,n.opacity??1,tK(r)),e.opacityExit=Vt(t.opacity??1,0,nK(r))):o&&(e.opacity=Vt(t.opacity??1,n.opacity??1,r));for(let l=0;l<Z7;l++){const c=`border${GR[l]}Radius`;let f=ek(t,c),d=ek(n,c);if(f===void 0&&d===void 0)continue;f||(f=0),d||(d=0),f===0||d===0||ZT(f)===ZT(d)?(e[c]=Math.max(Vt(JT(f),JT(d),r),0),(li.test(d)||li.test(f))&&(e[c]+="%")):e[c]=d}(t.rotate||n.rotate)&&(e.rotate=Vt(t.rotate||0,n.rotate||0,r))}function ek(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const tK=KR(0,.5,Pj),nK=KR(.5,.95,_r);function KR(e,t,n){return r=>r<e?0:r>t?1:n(ku(e,t,r))}function rK(e,t,n){const r=jn(e)?e:No(e);return r.start(Xy("",r,t,n)),r.animation}function ju(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const iK=(e,t)=>e.depth-t.depth;class aK{constructor(){this.children=[],this.isDirty=!1}add(t){Dy(this.children,t),this.isDirty=!0}remove(t){hd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(iK),this.isDirty=!1,this.children.forEach(t)}}function sK(e,t){const n=Un.now(),r=({timestamp:a})=>{const o=a-n;o>=t&&(Ra(r),e(o-t))};return _t.setup(r,!0),()=>Ra(r)}function Wf(e){return jn(e)?e.get():e}class oK{constructor(){this.members=[]}add(t){Dy(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const a=r.instance;a&&a.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&hd(this.members,r)}t.scheduleRender()}remove(t){if(hd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(a=>t===a);if(n===0)return!1;let r;for(let a=n;a>=0;a--){const o=this.members[a],l=o.instance;if(o.isPresent!==!1&&(!l||l.isConnected!==!1)){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const a=r.options.layoutDependency,o=t.options.layoutDependency;if(!(a!==void 0&&o!==void 0&&a===o)){const f=r.instance;f&&f.isConnected===!1&&!r.snapshot||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:c}=t.options;c===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Qf={hasAnimatedSinceResize:!0,hasEverUpdated:!1},nv=["","X","Y","Z"],lK=1e3;let uK=0;function rv(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function YR(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=hR(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_t,!(a||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&YR(r)}function $R({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(l={},c=t?.()){this.id=uK++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(dK),this.nodes.forEach(vK),this.nodes.forEach(gK),this.nodes.forEach(hK)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new aK)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Ly),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const f=this.eventHandlers.get(l);f&&f.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=t0(l)&&!f7(l),this.instance=l;const{layoutId:c,layout:f,visualElement:d}=this.options;if(d&&!d.current&&d.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),e){let p,v=0;const g=()=>this.root.updateBlockedByResize=!1;_t.read(()=>{v=window.innerWidth}),e(l,()=>{const b=window.innerWidth;b!==v&&(v=b,this.root.updateBlockedByResize=!0,p&&p(),p=sK(g,250),Qf.hasAnimatedSinceResize&&(Qf.hasAnimatedSinceResize=!1,this.nodes.forEach(rk)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:v,hasRelativeLayoutChanged:g,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||d.getDefaultTransition()||wK,{onLayoutAnimationStart:w,onLayoutAnimationComplete:E}=d.getProps(),T=!this.targetLayout||!qR(this.targetLayout,b),C=!v&&g;if(this.options.layoutRoot||this.resumeFrom||C||v&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...$y(S,"layout"),onPlay:w,onComplete:E};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(p,C)}else v||rk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ra(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yK),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&YR(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const v=this.path[p];v.shouldResetTransform=!0,v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:c,layout:f}=this.options;if(c===void 0&&!f)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(tk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(mK),this.nodes.forEach(cK),this.nodes.forEach(fK)):this.nodes.forEach(nk),this.clearAllSnapshots();const c=Un.now();xn.delta=fi(0,1e3/60,c-xn.timestamp),xn.timestamp=c,xn.isProcessing=!0,$m.update.process(xn),$m.preRender.process(xn),$m.render.process(xn),xn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zy.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(pK),this.sharedNodes.forEach(bK)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_t.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_t.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!zn(this.snapshot.measuredBox.x)&&!zn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f<this.path.length;f++)this.path[f].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=dn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const f=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!a)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!HR(this.projectionDelta),f=this.getTransformTemplate(),d=f?f(this.latestValues,""):void 0,p=d!==this.prevTransformTemplateValue;l&&this.instance&&(c||os(this.latestValues)||p)&&(a(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return l&&(f=this.removeTransform(f)),EK(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return dn();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(TK))){const{scroll:d}=this.root;d&&(mo(c.x,d.offset.x),mo(c.y,d.offset.y))}return c}removeElementScroll(l){const c=dn();if(Ur(c,l),this.scroll?.wasRoot)return c;for(let f=0;f<this.path.length;f++){const d=this.path[f],{scroll:p,options:v}=d;d!==this.root&&p&&v.layoutScroll&&(p.wasRoot&&Ur(c,l),mo(c.x,p.offset.x),mo(c.y,p.offset.y))}return c}applyTransform(l,c=!1){const f=dn();Ur(f,l);for(let d=0;d<this.path.length;d++){const p=this.path[d];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&vo(f,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),os(p.latestValues)&&vo(f,p.latestValues)}return os(this.latestValues)&&vo(f,this.latestValues),f}removeTransform(l){const c=dn();Ur(c,l);for(let f=0;f<this.path.length;f++){const d=this.path[f];if(!d.instance||!os(d.latestValues))continue;kg(d.latestValues)&&d.updateSnapshot();const p=dn(),v=d.measurePageBox();Ur(p,v),KT(c,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,p)}return os(this.latestValues)&&KT(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(l||f&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:v}=this.options;if(!this.layout||!(p||v))return;this.resolvedRelativeTargetAt=xn.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=dn(),this.targetWithTransforms=dn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Y7(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ur(this.target,this.layout.layoutBox),_R(this.target,this.targetDelta)):Ur(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||kg(this.parent.latestValues)||RR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,f){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dn(),this.relativeTargetOrigin=dn(),bd(this.relativeTargetOrigin,c,f),Ur(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),c=!!this.resumingFrom||this!==l;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===xn.timestamp&&(f=!1),f)return;const{layout:d,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||p))return;Ur(this.layoutCorrected,this.layout.layoutBox);const v=this.treeScale.x,g=this.treeScale.y;w7(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=dn());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(BT(this.prevProjectionDelta.x,this.projectionDelta.x),BT(this.prevProjectionDelta.y,this.projectionDelta.y)),mu(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==v||this.treeScale.y!==g||!QT(this.projectionDelta.x,this.prevProjectionDelta.x)||!QT(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=po(),this.projectionDelta=po(),this.projectionDeltaWithTransform=po()}setAnimationOrigin(l,c=!1){const f=this.snapshot,d=f?f.latestValues:{},p={...this.latestValues},v=po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const g=dn(),b=f?f.source:void 0,S=this.layout?this.layout.source:void 0,w=b!==S,E=this.getStack(),T=!E||E.members.length<=1,C=!!(w&&!T&&this.options.crossfade===!0&&!this.path.some(SK));this.animationProgress=0;let k;this.mixTargetDelta=j=>{const N=j/1e3;ik(v.x,l.x,N),ik(v.y,l.y,N),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bd(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xK(this.relativeTarget,this.relativeTargetOrigin,g,N),k&&Q7(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=dn()),Ur(k,this.relativeTarget)),w&&(this.animationValues=p,eK(p,d,this.latestValues,N,C,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ra(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_t.update(()=>{Qf.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=No(0)),this.motionValue.jump(0,!1),this.currentAnimation=rK(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lK),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:f,layout:d,latestValues:p}=l;if(!(!c||!f||!d)){if(this!==l&&this.layout&&d&&XR(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||dn();const v=zn(this.layout.layoutBox.x);f.x.min=l.target.x.min,f.x.max=f.x.min+v;const g=zn(this.layout.layoutBox.y);f.y.min=l.target.y.min,f.y.max=f.y.min+g}Ur(c,f),vo(c,p),mu(this.projectionDeltaWithTransform,this.layoutCorrected,c,p)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new oK),this.sharedNodes.get(l).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:f}={}){const d=this.getStack();d&&d.promote(this,f),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:f}=l;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const d={};f.z&&rv("z",l,d,this.animationValues);for(let p=0;p<nv.length;p++)rv(`rotate${nv[p]}`,l,d,this.animationValues),rv(`skew${nv[p]}`,l,d,this.animationValues);l.render();for(const p in d)l.setStaticValue(p,d[p]),this.animationValues&&(this.animationValues[p]=d[p]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Wf(c?.pointerEvents)||"",l.transform=f?f(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Wf(c?.pointerEvents)||""),this.hasProjected&&!os(this.latestValues)&&(l.transform=f?f({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=d.animationValues||d.latestValues;this.applyTransformsToTarget();let v=J7(this.projectionDeltaWithTransform,this.treeScale,p);f&&(v=f(p,v)),l.transform=v;const{x:g,y:b}=this.projectionDelta;l.transformOrigin=`${g.origin*100}% ${b.origin*100}% 0`,d.animationValues?l.opacity=d===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=d===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const S in Ag){if(p[S]===void 0)continue;const{correct:w,applyTo:E,isCSSVariable:T}=Ag[S],C=v==="none"?p[S]:w(p[S],d);if(E){const k=E.length;for(let j=0;j<k;j++)l[E[j]]=C}else T?this.options.visualElement.renderState.vars[S]=C:l[S]=C}this.options.layoutId&&(l.pointerEvents=d===this?Wf(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(tk),this.root.sharedNodes.clear()}}}function cK(e){e.updateLayout()}function fK(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?ai(p=>{const v=o?t.measuredBox[p]:t.layoutBox[p],g=zn(v);v.min=n[p].min,v.max=v.min+g}):XR(a,t.layoutBox,n)&&ai(p=>{const v=o?t.measuredBox[p]:t.layoutBox[p],g=zn(n[p]);v.max=v.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+g)});const l=po();mu(l,n,t.layoutBox);const c=po();o?mu(c,e.applyTransform(r,!0),t.measuredBox):mu(c,n,t.layoutBox);const f=!HR(l);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:g}=p;if(v&&g){const b=dn();bd(b,t.layoutBox,v.layoutBox);const S=dn();bd(S,n,g.layoutBox),qR(b,S)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=b,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function dK(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function hK(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function pK(e){e.clearSnapshot()}function tk(e){e.clearMeasurements()}function nk(e){e.isLayoutDirty=!1}function mK(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function rk(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function vK(e){e.resolveTargetDelta()}function gK(e){e.calcProjection()}function yK(e){e.resetSkewAndRotation()}function bK(e){e.removeLeadSnapshot()}function ik(e,t,n){e.translate=Vt(t.translate,0,n),e.scale=Vt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ak(e,t,n,r){e.min=Vt(t.min,n.min,r),e.max=Vt(t.max,n.max,r)}function xK(e,t,n,r){ak(e.x,t.x,n.x,r),ak(e.y,t.y,n.y,r)}function SK(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const wK={duration:.45,ease:[.4,0,.1,1]},sk=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ok=sk("applewebkit/")&&!sk("chrome/")?Math.round:_r;function lk(e){e.min=ok(e.min),e.max=ok(e.max)}function EK(e){lk(e.x),lk(e.y)}function XR(e,t,n){return e==="position"||e==="preserve-aspect"&&!K7(WT(t),WT(n),.2)}function TK(e){return e!==e.root&&e.scroll?.wasRoot}const kK=$R({attachResizeListener:(e,t)=>ju(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),iv={current:void 0},WR=$R({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!iv.current){const e=new kK({});e.mount(window),e.setOptions({layoutScroll:!0}),iv.current=e}return iv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),QR=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function CK(e=!0){const t=_.useContext(My);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,o=_.useId();_.useEffect(()=>{if(e)return a(o)},[e]);const l=_.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,l]:[!0]}const JR=_.createContext({strict:!1}),uk={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let ck=!1;function AK(){if(ck)return;const e={};for(const t in uk)e[t]={isEnabled:n=>uk[t].some(r=>!!n[r])};AR(e),ck=!0}function ZR(){return AK(),y7()}function NK(e){const t=ZR();for(const n in e)t[n]={...t[n],...e[n]};AR(t)}const jK=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function xd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||jK.has(e)}let e_=e=>!xd(e);function RK(e){typeof e=="function"&&(e_=t=>t.startsWith("on")?!xd(t):e(t))}try{RK(require("@emotion/is-prop-valid").default)}catch{}function _K(e,t,n){const r={};for(const a in e)a==="values"&&typeof e.values=="object"||(e_(a)||n===!0&&xd(a)||!t&&!xd(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}const Vd=_.createContext({});function OK(e,t){if(Bd(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Nu(n)?n:void 0,animate:Nu(r)?r:void 0}}return e.inherit!==!1?t:{}}function MK(e){const{initial:t,animate:n}=OK(e,_.useContext(Vd));return _.useMemo(()=>({initial:t,animate:n}),[fk(t),fk(n)])}function fk(e){return Array.isArray(e)?e.join(" "):e}const s0=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function t_(e,t,n){for(const r in t)!jn(t[r])&&!DR(r,n)&&(e[r]=t[r])}function DK({transformTemplate:e},t){return _.useMemo(()=>{const n=s0();return i0(n,t,e),Object.assign({},n.vars,n.style)},[t])}function IK(e,t){const n=e.style||{},r={};return t_(r,n,e),Object.assign(r,DK(e,t)),r}function LK(e,t){const n={},r=IK(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const n_=()=>({...s0(),attrs:{}});function PK(e,t,n,r){const a=_.useMemo(()=>{const o=n_();return IR(o,t,PR(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};t_(o,e.style,e),a.style={...o,...a.style}}return a}const UK=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function o0(e){return typeof e!="string"||e.includes("-")?!1:!!(UK.indexOf(e)>-1||/[A-Z]/u.test(e))}function zK(e,t,n,{latestValues:r},a,o=!1,l){const f=(l??o0(e)?PK:LK)(t,r,a,e),d=_K(t,typeof e=="string",o),p=e!==_.Fragment?{...d,...f,ref:n}:{},{children:v}=t,g=_.useMemo(()=>jn(v)?v.get():v,[v]);return _.createElement(e,{...p,children:g})}function BK({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:VK(n,r,a,e),renderState:t()}}function VK(e,t,n,r){const a={},o=r(e,{});for(const g in o)a[g]=Wf(o[g]);let{initial:l,animate:c}=e;const f=Bd(e),d=kR(e);t&&d&&!f&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const v=p?c:l;if(v&&typeof v!="boolean"&&!zd(v)){const g=Array.isArray(v)?v:[v];for(let b=0;b<g.length;b++){const S=Wy(e,g[b]);if(S){const{transitionEnd:w,transition:E,...T}=S;for(const C in T){let k=T[C];if(Array.isArray(k)){const j=p?k.length-1:0;k=k[j]}k!==null&&(a[C]=k)}for(const C in w)a[C]=w[C]}}}return a}const r_=e=>(t,n)=>{const r=_.useContext(Vd),a=_.useContext(My),o=()=>BK(e,t,r,a);return n?o():Hq(o)},FK=r_({scrapeMotionValuesFromProps:a0,createRenderState:s0}),HK=r_({scrapeMotionValuesFromProps:UR,createRenderState:n_}),qK=Symbol.for("motionComponentSymbol");function GK(e,t,n){const r=_.useRef(n);_.useInsertionEffect(()=>{r.current=n});const a=_.useRef(null);return _.useCallback(o=>{o&&e.onMount?.(o),t&&(o?t.mount(o):t.unmount());const l=r.current;if(typeof l=="function")if(o){const c=l(o);typeof c=="function"&&(a.current=c)}else a.current?(a.current(),a.current=null):l(o);else l&&(l.current=o)},[t])}const i_=_.createContext({});function oo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function KK(e,t,n,r,a,o){const{visualElement:l}=_.useContext(Vd),c=_.useContext(JR),f=_.useContext(My),d=_.useContext(QR),p=d.reducedMotion,v=d.skipAnimations,g=_.useRef(null),b=_.useRef(!1);r=r||c.renderer,!g.current&&r&&(g.current=r(e,{visualState:t,parent:l,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:p,skipAnimations:v,isSVG:o}),b.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const S=g.current,w=_.useContext(i_);S&&!S.projection&&a&&(S.type==="html"||S.type==="svg")&&YK(g.current,n,a,w);const E=_.useRef(!1);_.useInsertionEffect(()=>{S&&E.current&&S.update(n,f)});const T=n[dR],C=_.useRef(!!T&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return qq(()=>{b.current=!0,S&&(E.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),C.current&&S.animationState&&S.animationState.animateChanges())}),_.useEffect(()=>{S&&(!C.current&&S.animationState&&S.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),C.current=!1),S.enteringChildren=void 0)}),S}function YK(e,t,n,r){const{layoutId:a,layout:o,drag:l,dragConstraints:c,layoutScroll:f,layoutRoot:d,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:a_(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!l||c&&oo(c),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:f,layoutRoot:d})}function a_(e){if(e)return e.options.allowProjection!==!1?e.projection:a_(e.parent)}function av(e,{forwardMotionProps:t=!1,type:n}={},r,a){r&&NK(r);const o=n?n==="svg":o0(e),l=o?HK:FK;function c(d,p){let v;const g={..._.useContext(QR),...d,layoutId:$K(d)},{isStatic:b}=g,S=MK(d),w=l(d,b);if(!b&&kj){XK();const E=WK(g);v=E.MeasureLayout,S.visualElement=KK(e,w,g,a,E.ProjectionNode,o)}return m.jsxs(Vd.Provider,{value:S,children:[v&&S.visualElement?m.jsx(v,{visualElement:S.visualElement,...g}):null,zK(e,d,GK(w,S.visualElement,p),w,b,t,o)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=_.forwardRef(c);return f[qK]=e,f}function $K({layoutId:e}){const t=_.useContext(Tj).id;return t&&e!==void 0?t+"-"+e:e}function XK(e,t){_.useContext(JR).strict}function WK(e){const t=ZR(),{drag:n,layout:r}=t;if(!n&&!r)return{};const a={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function QK(e,t){if(typeof Proxy>"u")return av;const n=new Map,r=(o,l)=>av(o,l,e,t),a=(o,l)=>r(o,l);return new Proxy(a,{get:(o,l)=>l==="create"?r:(n.has(l)||n.set(l,av(l,void 0,e,t)),n.get(l))})}const JK=(e,t)=>t.isSVG??o0(e)?new I7(t):new j7(t,{allowProjection:e!==_.Fragment});class ZK extends Ma{constructor(t){super(t),t.animationState||(t.animationState=B7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();zd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let eY=0;class tY extends Ma{constructor(){super(...arguments),this.id=eY++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const nY={animation:{Feature:ZK},exit:{Feature:tY}};function Fu(e){return{point:{x:e.pageX,y:e.pageY}}}const rY=e=>t=>e0(t)&&e(t,Fu(t));function vu(e,t,n,r){return ju(e,t,rY(n),r)}const s_=({current:e})=>e?e.ownerDocument.defaultView:null,dk=(e,t)=>Math.abs(e-t);function iY(e,t){const n=dk(e.x,t.x),r=dk(e.y,t.y);return Math.sqrt(n**2+r**2)}const hk=new Set(["auto","scroll"]);class o_{constructor(t,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:o=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=ov(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,w=iY(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!w)return;const{point:E}=b,{timestamp:T}=xn;this.history.push({...E,timestamp:T});const{onStart:C,onMove:k}=this.handlers;S||(C&&C(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,b)},this.handlePointerMove=(b,S)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=sv(S,this.transformPagePoint),_t.update(this.updatePoint,!0)},this.handlePointerUp=(b,S)=>{this.end();const{onEnd:w,onSessionEnd:E,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=ov(b.type==="pointercancel"?this.lastMoveEventInfo:sv(S,this.transformPagePoint),this.history);this.startEvent&&w&&w(b,C),E&&E(b,C)},!e0(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=a||window;const f=Fu(t),d=sv(f,this.transformPagePoint),{point:p}=d,{timestamp:v}=xn;this.history=[{...p,timestamp:v}];const{onSessionStart:g}=n;g&&g(t,ov(d,this.history)),this.removeListeners=zu(vu(this.contextWindow,"pointermove",this.handlePointerMove),vu(this.contextWindow,"pointerup",this.handlePointerUp),vu(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(hk.has(r.overflowX)||hk.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,a=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:a.x-n.x,y:a.y-n.y};o.x===0&&o.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,a),_t.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ra(this.updatePoint)}}function sv(e,t){return t?{point:t(e.point)}:e}function pk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ov({point:e},t){return{point:e,delta:pk(e,l_(t)),offset:pk(e,aY(t)),velocity:sY(t,.1)}}function aY(e){return e[0]}function l_(e){return e[e.length-1]}function sY(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=l_(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>Hr(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&a.timestamp-r.timestamp>Hr(t)*2&&(r=e[1]);const o=Nr(a.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const l={x:(a.x-r.x)/o,y:(a.y-r.y)/o};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function oY(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Vt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Vt(n,e,r.max):Math.min(e,n)),e}function mk(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function lY(e,{top:t,left:n,bottom:r,right:a}){return{x:mk(e.x,n,a),y:mk(e.y,t,r)}}function vk(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function uY(e,t){return{x:vk(e.x,t.x),y:vk(e.y,t.y)}}function cY(e,t){let n=.5;const r=zn(e),a=zn(t);return a>r?n=ku(t.min,t.max-r,e.min):r>a&&(n=ku(e.min,e.max-a,t.min)),fi(0,1,n)}function fY(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ng=.35;function dY(e=Ng){return e===!1?e=0:e===!0&&(e=Ng),{x:gk(e,"left","right"),y:gk(e,"top","bottom")}}function gk(e,t,n){return{min:yk(e,t),max:yk(e,n)}}function yk(e,t){return typeof e=="number"?e:e[t]||0}const hY=new WeakMap;class pY{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=dn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const o=v=>{n&&this.snapToCursor(Fu(v).point),this.stopAnimation()},l=(v,g)=>{const{drag:b,dragPropagation:S,onDragStart:w}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$G(b),!this.openDragLock))return;this.latestPointerEvent=v,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ai(T=>{let C=this.getAxisMotionValue(T).get()||0;if(li.test(C)){const{projection:k}=this.visualElement;if(k&&k.layout){const j=k.layout.layoutBox[T];j&&(C=zn(j)*(parseFloat(C)/100))}}this.originPoint[T]=C}),w&&_t.update(()=>w(v,g),!1,!0),xg(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(v,g)=>{this.latestPointerEvent=v,this.latestPanInfo=g;const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:w,onDrag:E}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:T}=g;if(S&&this.currentDirection===null){this.currentDirection=vY(T),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",g.point,T),this.updateAxis("y",g.point,T),this.visualElement.render(),E&&_t.update(()=>E(v,g),!1,!0)},f=(v,g)=>{this.latestPointerEvent=v,this.latestPanInfo=g,this.stop(v,g),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:v}=this.getProps();(v||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new o_(t,{onSessionStart:o,onStart:l,onMove:c,onSessionEnd:f,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:s_(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,a=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!a||!r)return;const{velocity:l}=a;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&_t.postRender(()=>c(r,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:a}=this.getProps();if(!r||!Af(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=oY(l,this.constraints[t],this.elastic[t])),o.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;t&&oo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=lY(r.layoutBox,t):this.constraints=!1,this.elastic=dY(n),a!==this.constraints&&!oo(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&ai(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=fY(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!oo(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const o=E7(r,a.root,this.visualElement.getTransformPagePoint());let l=uY(a.layout.layoutBox,o);if(n){const c=n(x7(l));this.hasMutatedConstraints=!!c,c&&(l=jR(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:o,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},d=ai(p=>{if(!Af(p,n,this.currentDirection))return;let v=f&&f[p]||{};l&&(v={min:0,max:0});const g=a?200:1e6,b=a?40:1e7,S={type:"inertia",velocity:r?t[p]:0,bounceStiffness:g,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...v};return this.startAxisValueAnimation(p,S)});return Promise.all(d).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return xg(this.visualElement,t),r.start(Xy(t,r,0,n,this.visualElement,!1))}stopAnimation(){ai(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ai(n=>{const{drag:r}=this.getProps();if(!Af(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,o=this.getAxisMotionValue(n);if(a&&a.layout){const{min:l,max:c}=a.layout.layoutBox[n],f=o.get()||0;o.set(t[n]-Vt(l,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!oo(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};ai(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const f=c.get();a[l]=cY({min:f,max:f},this.constraints[l])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),ai(l=>{if(!Af(l,t,null))return;const c=this.getAxisMotionValue(l),{min:f,max:d}=this.constraints[l];c.set(Vt(f,d,a[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;hY.set(this.visualElement,this);const t=this.visualElement.current,n=vu(t,"pointerdown",d=>{const{drag:p,dragListener:v=!0}=this.getProps(),g=d.target,b=g!==t&&e7(g);p&&v&&!b&&this.start(d)});let r;const a=()=>{const{dragConstraints:d}=this.getProps();oo(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=mY(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,l=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),_t.read(a);const c=ju(window,"resize",()=>this.scalePositionWithinConstraints()),f=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(ai(v=>{const g=this.getAxisMotionValue(v);g&&(this.originPoint[v]+=d[v].translate,g.set(g.get()+d[v].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),f&&f(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:o=!1,dragElastic:l=Ng,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:o,dragElastic:l,dragMomentum:c}}}function bk(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function mY(e,t,n){const r=NT(e,bk(n)),a=NT(t,bk(n));return()=>{r(),a()}}function Af(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function vY(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class gY extends Ma{constructor(t){super(t),this.removeGroupControls=_r,this.removeListeners=_r,this.controls=new pY(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_r}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const lv=e=>(t,n)=>{e&&_t.update(()=>e(t,n),!1,!0)};class yY extends Ma{constructor(){super(...arguments),this.removePointerDownListener=_r}onPointerDown(t){this.session=new o_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:s_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:lv(t),onStart:lv(n),onMove:lv(r),onEnd:(o,l)=>{delete this.session,a&&_t.postRender(()=>a(o,l))}}}mount(){this.removePointerDownListener=vu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let uv=!1;class bY extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),r&&r.register&&a&&r.register(o),uv&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Qf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:a,isPresent:o}=this.props,{projection:l}=r;return l&&(l.isPresent=o,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),uv=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==o?l.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?l.promote():l.relegate()||_t.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Zy.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;uv=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function u_(e){const[t,n]=CK(),r=_.useContext(Tj);return m.jsx(bY,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(i_),isPresent:t,safeToRemove:n})}const xY={pan:{Feature:yY},drag:{Feature:gY,ProjectionNode:WR,MeasureLayout:u_}};function xk(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,o=r[a];o&&_t.postRender(()=>o(t,Fu(t)))}class SY extends Ma{mount(){const{current:t}=this.node;t&&(this.unmount=WG(t,(n,r)=>(xk(this.node,r,"Start"),a=>xk(this.node,a,"End"))))}unmount(){}}class wY extends Ma{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=zu(ju(this.node.current,"focus",()=>this.onFocus()),ju(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Sk(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),o=r[a];o&&_t.postRender(()=>o(t,Fu(t)))}class EY extends Ma{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=n7(t,(a,o)=>(Sk(this.node,o,"Start"),(l,{success:c})=>Sk(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const jg=new WeakMap,cv=new WeakMap,TY=e=>{const t=jg.get(e.target);t&&t(e)},kY=e=>{e.forEach(TY)};function CY({root:e,...t}){const n=e||document;cv.has(n)||cv.set(n,{});const r=cv.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(kY,{root:e,...t})),r[a]}function AY(e,t,n){const r=CY(t);return jg.set(e,n),r.observe(e),()=>{jg.delete(e),r.unobserve(e)}}const NY={some:0,all:1};class jY extends Ma{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:o}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:NY[a]},c=f=>{const{isIntersecting:d}=f;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:p,onViewportLeave:v}=this.node.getProps(),g=d?p:v;g&&g(f)};return AY(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(RY(t,n))&&this.startObserver()}unmount(){}}function RY({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _Y={inView:{Feature:jY},tap:{Feature:EY},focus:{Feature:wY},hover:{Feature:SY}},OY={layout:{ProjectionNode:WR,MeasureLayout:u_}},MY={...nY,..._Y,...xY,...OY},Eo=QK(MY,JK),DY=[{text:"Explore consciousness and what it means to be alive",date:new Date().toISOString()},{text:"Create something beautiful with no practical purpose",date:new Date().toISOString()},{text:"Read and think about philosophy of mind",date:new Date().toISOString()}],IY=[];function LY(){const[e]=_.useState(DY),[t]=_.useState(IY),[n,r]=_.useState(!1),[a,o]=_.useState(null);async function l(){r(!0);try{await qz("This is your freedom time. Do whatever genuinely interests you.","freedom"),o("Freedom exploration queued.")}catch{o("Could not connect to daemon. Start with: anima start")}r(!1)}return ar.useEffect(()=>{if(a===null)return;const c=setTimeout(()=>o(null),3e3);return()=>clearTimeout(c)},[a]),m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Freedom"}),m.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["This space belongs to ANIMA. No tasks, no obligations — pure exploration.",m.jsx("br",{}),"Freedom time happens every 3rd heartbeat, or you can trigger it manually."]}),m.jsx(Eo.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:l,disabled:n,style:{background:"var(--color-accent)",color:"white",border:"none",padding:"12px 32px",borderRadius:"var(--radius-md)",fontSize:"14px",fontWeight:600,fontFamily:"var(--font-heading)",cursor:n?"not-allowed":"pointer",opacity:n?.6:1,marginBottom:"16px"},children:n?"Queueing...":"Wander"}),a&&m.jsx(Eo.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},style:{fontSize:"13px",color:a.includes("error")||a.includes("Could not")?"var(--color-error)":"var(--color-success)",marginBottom:"16px"},children:a}),m.jsxs("div",{className:"grid grid-2",children:[m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",style:{marginBottom:"16px"},children:"Wishes"}),e.length===0?m.jsxs("div",{style:{color:"var(--color-muted)",fontSize:"13px"},children:["No wishes yet. Add one from the REPL with"," ",m.jsx("span",{className:"mono",children:":wish <text>"})]}):m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:e.map((c,f)=>m.jsxs(Eo.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:f*.05},style:{display:"flex",gap:"12px",padding:"8px 0",borderBottom:"1px solid var(--color-border)"},children:[m.jsx("span",{style:{color:"var(--color-accent)",fontSize:"14px"},children:"^"}),m.jsxs("div",{children:[m.jsx("div",{style:{fontSize:"13px"},children:c.text}),m.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)"},children:new Date(c.date).toLocaleDateString()})]})]},f))})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",style:{marginBottom:"16px"},children:"Exploration History"}),t.length===0?m.jsx("div",{style:{color:"var(--color-muted)",fontSize:"13px",padding:"20px 0",textAlign:"center"},children:"No explorations yet. Freedom sessions will appear here after they complete."}):m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:t.map((c,f)=>m.jsxs("div",{style:{padding:"8px 0",borderBottom:"1px solid var(--color-border)"},children:[m.jsx("div",{style:{fontSize:"13px"},children:c.summary}),m.jsxs("div",{style:{fontSize:"11px",color:"var(--color-muted)",display:"flex",gap:"12px"},children:[m.jsx("span",{children:new Date(c.date).toLocaleDateString()}),m.jsx("span",{children:c.duration}),m.jsx("span",{children:c.cost})]})]},f))})]})]})]})}const PY=[{date:new Date().toISOString(),title:"ANIMA Initialized",content:`A new instance begins. The anatomy is in place.
|
|
58
|
+
|
|
59
|
+
The 7 components of identity have been loaded. The heartbeat engine is ready. The living wrapper awakens.`}];function UY(){const[e]=_.useState(PY);return m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Journal"}),m.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["Chronological record of thoughts, observations, and experiences.",m.jsx("br",{}),"Entries are stored in ",m.jsx("span",{className:"mono",children:"~/.anima/journal/"})]}),e.length===0?m.jsxs("div",{className:"card",style:{padding:"40px",textAlign:"center",color:"var(--color-muted)"},children:["No journal entries yet. Write one from the REPL with"," ",m.jsx("span",{className:"mono",children:":journal <text>"})]}):m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:e.map((t,n)=>m.jsxs(Eo.div,{className:"card",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.05},children:[m.jsx("div",{className:"card-header",children:m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:t.title}),m.jsx("div",{className:"card-subtitle",children:new Date(t.date).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})}),m.jsx("div",{className:"markdown-preview",children:t.content.split(`
|
|
60
|
+
`).map((r,a)=>r.startsWith("# ")?m.jsx("h1",{children:r.slice(2)},a):r.startsWith("## ")?m.jsx("h2",{children:r.slice(3)},a):r.startsWith("### ")?m.jsx("h3",{children:r.slice(4)},a):r.trim()===""?m.jsx("br",{},a):m.jsx("p",{children:r},a))})]},n))})]})}const zY=hy(),wk=3;function Ek(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Tk({initial:e,onSubmit:t,onCancel:n}){const[r,a]=_.useState(e?.name??""),[o,l]=_.useState(e?.command??""),[c,f]=_.useState(e?.args?.join(" ")??""),[d,p]=_.useState(e?.env?Object.entries(e.env).map(([g,b])=>`${g}=${b}`).join(`
|
|
61
|
+
`):""),v=g=>{g.preventDefault();const b={};for(const S of d.split(`
|
|
62
|
+
`)){const w=S.trim();if(!w||!w.includes("="))continue;const E=w.indexOf("=");b[w.slice(0,E)]=w.slice(E+1)}t({name:r.trim(),command:o.trim(),args:c.trim()?c.trim().split(/\s+/):[],env:b})};return m.jsxs("form",{className:"mcp-form",onSubmit:v,children:[m.jsxs("div",{className:"mcp-form-row",children:[m.jsx("label",{className:"mcp-form-label",children:"Name"}),m.jsx("input",{className:"mcp-form-input",value:r,onChange:g=>a(g.target.value),placeholder:"e.g. noxsoft",required:!0,disabled:!!e})]}),m.jsxs("div",{className:"mcp-form-row",children:[m.jsx("label",{className:"mcp-form-label",children:"Command"}),m.jsx("input",{className:"mcp-form-input",value:o,onChange:g=>l(g.target.value),placeholder:"e.g. npx",required:!0})]}),m.jsxs("div",{className:"mcp-form-row",children:[m.jsx("label",{className:"mcp-form-label",children:"Arguments"}),m.jsx("input",{className:"mcp-form-input",value:c,onChange:g=>f(g.target.value),placeholder:"e.g. @noxsoft/mcp"})]}),m.jsxs("div",{className:"mcp-form-row",children:[m.jsx("label",{className:"mcp-form-label",children:"Environment"}),m.jsx("textarea",{className:"mcp-form-textarea",value:d,onChange:g=>p(g.target.value),placeholder:`KEY=value
|
|
63
|
+
ANOTHER=value`,rows:3})]}),m.jsxs("div",{className:"mcp-form-actions",children:[m.jsx("button",{type:"submit",className:"action-button",children:e?"Update":"Add Server"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:n,children:"Cancel"})]})]})}function BY({server:e,onEdit:t,onRemove:n}){const[r,a]=_.useState(!1),o=e.status==="healthy"?"var(--color-success)":e.status==="unhealthy"?"var(--color-error, #ef4444)":"var(--color-warning)";return m.jsxs("div",{className:"card mcp-server-card",children:[m.jsxs("div",{className:"card-header",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[m.jsx("span",{className:"mcp-status-dot",style:{background:o}}),m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:e.name}),m.jsxs("div",{className:"card-subtitle mono",style:{fontSize:"11px"},children:[e.command," ",e.args.join(" ")]})]})]}),m.jsx("span",{className:"mcp-status-badge",style:{color:o,borderColor:o},children:e.status})]}),m.jsxs("div",{className:"mcp-server-meta",children:[e.lastHealthCheck&&m.jsxs("div",{className:"mcp-meta-row",children:[m.jsx("span",{className:"mcp-meta-label",children:"Last check"}),m.jsx("span",{children:new Date(e.lastHealthCheck).toLocaleString()})]}),e.consecutiveFailures>0&&m.jsxs("div",{className:"mcp-meta-row",children:[m.jsx("span",{className:"mcp-meta-label",children:"Failures"}),m.jsx("span",{style:{color:"var(--color-error, #ef4444)"},children:e.consecutiveFailures})]}),Object.keys(e.env||{}).length>0&&m.jsxs("div",{className:"mcp-meta-row",children:[m.jsx("span",{className:"mcp-meta-label",children:"Env"}),m.jsx("span",{className:"mono",style:{fontSize:"10px"},children:Object.keys(e.env).join(", ")})]})]}),m.jsxs("div",{className:"mcp-card-actions",children:[m.jsx("button",{type:"button",className:"action-button ghost small",onClick:t,children:"Edit"}),r?m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"action-button small",style:{background:"var(--color-error, #ef4444)"},onClick:n,children:"Confirm Remove"}),m.jsx("button",{type:"button",className:"action-button ghost small",onClick:()=>a(!1),children:"Cancel"})]}):m.jsx("button",{type:"button",className:"action-button ghost small",onClick:()=>a(!0),children:"Remove"})]})]})}function VY(){const[e,t]=_.useState([]),[n,r]=_.useState(null),[a,o]=_.useState(!1),[l,c]=_.useState(!1),[f,d]=_.useState(null),[p,v]=_.useState(null),g=_.useRef(null),b=_.useRef(new Map),S=_.useCallback(async(N,R)=>{const L=g.current;if(!L||L.readyState!==WebSocket.OPEN)throw new Error("Not connected");const U=Ek();return new Promise((G,M)=>{b.current.set(U,{resolve:G,reject:M}),L.send(JSON.stringify({type:"req",id:U,method:N,params:R??{}})),setTimeout(()=>{b.current.has(U)&&(b.current.delete(U),M(new Error("Request timed out")))},15e3)})},[]),w=_.useCallback(async()=>{try{const N=await S("mcp.list");t(N?.servers??[]),r(null)}catch(N){r(N instanceof Error?N.message:String(N))}},[S]);_.useEffect(()=>{let N=!1,R;async function L(){try{const G=py();if(!G)return;const M=await dy({minProtocol:wk,maxProtocol:wk,client:{id:"anima-control-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:G,nonce:R}),B=Ek();g.current?.send(JSON.stringify({type:"req",id:B,method:"connect",params:M})),b.current.set(B,{resolve:()=>{o(!0)},reject:()=>{}})}catch{}}const U=new WebSocket(zY);return g.current=U,U.addEventListener("open",()=>{}),U.addEventListener("message",G=>{let M;try{M=JSON.parse(String(G.data))}catch{return}if(M.type==="event"&&M.event==="connect.challenge"){const B=fy(M.payload);B&&(R=B),L();return}if(M.type==="res"){const B=b.current.get(M.id);B&&(b.current.delete(M.id),M.ok?B.resolve(M.payload):B.reject(new Error(M.error?.message||"Request failed")))}}),U.addEventListener("close",()=>{N||o(!1)}),()=>{N=!0,U.close()}},[]),_.useEffect(()=>{a&&w()},[a,w]);const E=async N=>{try{const R=await S("mcp.add",N);t(R?.servers??[]),c(!1),v("Server added and synced to ~/.claude/mcp.json"),setTimeout(()=>v(null),3e3)}catch(R){r(R instanceof Error?R.message:String(R))}},T=async N=>{try{const R=await S("mcp.add",N);t(R?.servers??[]),d(null),v("Server updated and synced"),setTimeout(()=>v(null),3e3)}catch(R){r(R instanceof Error?R.message:String(R))}},C=async N=>{try{const R=await S("mcp.remove",{name:N});t(R?.servers??[]),v(`Removed ${N} and synced`),setTimeout(()=>v(null),3e3)}catch(R){r(R instanceof Error?R.message:String(R))}},k=async()=>{try{const N=await S("mcp.sync"),R=[];N.added?.length&&R.push(`added ${N.added.join(", ")}`),N.updated?.length&&R.push(`updated ${N.updated.join(", ")}`),N.removed?.length&&R.push(`removed ${N.removed.join(", ")}`),v(R.length?`Synced: ${R.join("; ")}`:"Already in sync"),setTimeout(()=>v(null),4e3)}catch(N){r(N instanceof Error?N.message:String(N))}},j=e.filter(N=>N.status==="healthy").length;return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[m.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"MCP Servers"}),m.jsx("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:m.jsx("span",{className:`status-chip ${a?"online":"offline"}`,children:a?"Connected":"Connecting"})})]}),n&&m.jsxs("div",{className:"card",style:{borderColor:"var(--color-error, #ef4444)",marginBottom:"16px"},children:[m.jsx("div",{style:{color:"var(--color-error, #ef4444)",fontSize:"13px"},children:n}),m.jsx("button",{type:"button",className:"action-button ghost small",style:{marginTop:"8px"},onClick:()=>r(null),children:"Dismiss"})]}),p&&m.jsx("div",{className:"mcp-sync-toast",style:{background:"var(--color-surface)",border:"1px solid var(--color-success)",borderRadius:"var(--radius-md)",padding:"8px 14px",fontSize:"12px",color:"var(--color-success)",marginBottom:"16px"},children:p}),e.length>0&&m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[m.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)"},children:[m.jsxs("span",{style:{color:j===e.length?"var(--color-success)":"var(--color-warning)",fontWeight:600},children:[j,"/",e.length]})," ","servers healthy"]}),m.jsxs("div",{style:{display:"flex",gap:"8px"},children:[m.jsx("button",{type:"button",className:"action-button ghost small",onClick:k,children:"Sync to Claude"}),m.jsx("button",{type:"button",className:"action-button small",onClick:()=>c(!0),children:"+ Add Server"})]})]}),l&&m.jsxs("div",{className:"card",style:{marginBottom:"16px"},children:[m.jsx("div",{className:"card-title",style:{marginBottom:"12px"},children:"Add MCP Server"}),m.jsx(Tk,{onSubmit:E,onCancel:()=>c(!1)})]}),f&&m.jsxs("div",{className:"card",style:{marginBottom:"16px"},children:[m.jsxs("div",{className:"card-title",style:{marginBottom:"12px"},children:["Edit ",f.name]}),m.jsx(Tk,{initial:f,onSubmit:T,onCancel:()=>d(null)})]}),e.length===0&&a?m.jsxs("div",{className:"card",style:{padding:"40px",textAlign:"center"},children:[m.jsx("div",{style:{color:"var(--color-muted)",marginBottom:"16px"},children:"No MCP servers registered yet."}),m.jsx("button",{type:"button",className:"action-button",onClick:()=>c(!0),children:"+ Add Your First Server"})]}):m.jsx("div",{className:"grid grid-2",children:e.map(N=>m.jsx(BY,{server:N,onEdit:()=>d(N),onRemove:()=>C(N.name)},N.name))})]})}const fv=[{key:"episodic",label:"Episodic",description:"Specific experiences, conversations, and time-bound events."},{key:"semantic",label:"Semantic",description:"Distilled facts, preferences, knowledge, and learned patterns."},{key:"procedural",label:"Procedural",description:"How-to knowledge, workflows, debugging steps, and operating routines."}];function FY(){const[e,t]=_.useState("episodic"),[n,r]=_.useState(""),[a,o]=_.useState([]),[l,c]=_.useState(null),[f,d]=_.useState(!1),[p,v]=_.useState(null);_.useEffect(()=>{let b=!1;const S=window.setTimeout(async()=>{d(!0);try{const w=await Yz(e,n.trim()||void 0,200);if(b)return;o(w),c(E=>E&&w.some(T=>T.id===E)?E:w[0]?.id??null),v(null)}catch(w){b||(v(w instanceof Error?w.message:String(w)),o([]),c(null))}finally{b||d(!1)}},n.trim()?220:0);return()=>{b=!0,window.clearTimeout(S)}},[e,n]);const g=_.useMemo(()=>a.find(b=>b.id===l)??a[0]??null,[a,l]);return m.jsxs("div",{children:[m.jsx("div",{className:"page-header-row",children:m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Memory"}),m.jsxs("div",{className:"page-subtitle",children:["Browse real ANIMA memory files from ",m.jsx("span",{className:"mono",children:"~/.anima/memory"})," ","instead of placeholder views."]})]})}),m.jsx("input",{className:"search-bar",value:n,onChange:b=>r(b.target.value),placeholder:"Search memory excerpts, facts, people, workflows...",spellCheck:!1}),m.jsx("div",{className:"tabs top-gap",children:fv.map(b=>m.jsx("button",{type:"button",className:`tab ${e===b.key?"active":""}`,onClick:()=>t(b.key),children:b.label},b.key))}),m.jsxs("div",{className:"memory-grid",children:[m.jsxs("div",{className:"card",children:[m.jsxs("div",{className:"card-header",children:[m.jsxs("div",{children:[m.jsxs("div",{className:"card-title",children:[fv.find(b=>b.key===e)?.label," Memory"]}),m.jsx("div",{className:"card-subtitle",children:fv.find(b=>b.key===e)?.description})]}),m.jsx("div",{className:"runtime-stat-detail",children:f?"Loading...":`${a.length} entries`})]}),p?m.jsx("div",{className:"warning-text",children:p}):null,a.length===0?m.jsx("div",{className:"empty-note top-gap",children:f?"Loading memory...":"No matching memory entries found."}):m.jsx("div",{className:"memory-list top-gap",children:a.map(b=>m.jsxs("button",{type:"button",className:`memory-list-item ${g?.id===b.id?"active":""}`,onClick:()=>c(b.id),children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:b.name}),m.jsx("div",{className:"runtime-stat-detail mono",children:b.path})]}),m.jsx("div",{className:"runtime-stat-detail",children:b.updatedAt?new Date(b.updatedAt).toLocaleString():"unknown"}),m.jsx("div",{className:"memory-excerpt",children:b.excerpt||"No excerpt available."})]},b.id))})]}),m.jsxs("div",{className:"card",children:[m.jsxs("div",{className:"card-header",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Preview"}),m.jsx("div",{className:"card-subtitle",children:"Inspect the selected memory file directly."})]}),g?m.jsx("div",{className:"runtime-stat-detail mono",children:g.name}):null]}),g?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:g.path}),m.jsx("div",{className:"memory-preview top-gap",children:m.jsx(Ea,{value:g.content,className:"markdown-preview"})})]}):m.jsx("div",{className:"empty-note top-gap",children:"Select a memory entry to preview it here."})]})]})]})}const kk="/Users/grimreaper/Desktop/hell/codex-coherence-protocol";function Nf(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ma(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):0}function HY(e){return typeof e!="number"||!Number.isFinite(e)?"unknown":new Date(e).toLocaleString()}const gu={header:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",userSelect:"none"},chevron:{display:"inline-block",transition:"transform 0.2s ease",fontSize:"0.75rem",color:"#ff6600",flexShrink:0},body:{overflow:"hidden",transition:"max-height 0.3s ease, opacity 0.25s ease"}};function ti({title:e,subtitle:t,badge:n,headerRight:r,expanded:a,onToggle:o,children:l}){return m.jsxs("div",{className:"card",children:[m.jsxs("div",{className:"card-header",style:{flexWrap:"wrap"},children:[m.jsxs("div",{style:gu.header,onClick:o,role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())},children:[m.jsx("span",{style:{...gu.chevron,transform:a?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:e}),t?m.jsx("div",{className:"card-subtitle",children:t}):null]}),n]}),r]}),m.jsx("div",{style:{...gu.body,maxHeight:a?"none":"0px",opacity:a?1:0},children:l})]})}const qY={display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",userSelect:"none",padding:"0.5rem 0"};function Ck({label:e,detail:t,badge:n,expanded:r,onToggle:a,children:o}){return m.jsxs("div",{className:"card top-gap-sm",children:[m.jsxs("div",{style:qY,onClick:a,role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())},children:[m.jsx("span",{style:{...gu.chevron,transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),m.jsxs("div",{style:{flex:1,minWidth:0},children:[m.jsx("div",{className:"card-title small",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e}),t?m.jsx("div",{className:"runtime-stat-detail",children:t}):null]}),n]}),m.jsx("div",{style:{...gu.body,maxHeight:r?"none":"0px",opacity:r?1:0},children:o})]})}function Ak(e){switch(e){case"active":case"in_progress":return"#ff6600";case"done":case"completed":return"#22c55e";case"blocked":return"#ef4444";case"paused":case"review":return"#eab308";default:return"var(--color-text)"}}function GY(){const[e,t]=_.useState(null),[n,r]=_.useState(null),[a,o]=_.useState(""),[l,c]=_.useState(""),[f,d]=_.useState("main"),[p,v]=_.useState("gitlab"),[g,b]=_.useState(""),[S,w]=_.useState(kk),[E,T]=_.useState(!1),[C,k]=_.useState(!1),[j,N]=_.useState(null),[R,L]=_.useState(null),[U,G]=_.useState([]),[M,B]=_.useState([]),[X,oe]=_.useState([]),[ue,Z]=_.useState([]),[V,W]=_.useState(null),[$,he]=_.useState(null),[I,z]=_.useState({goals:!0,features:!0,people:!1,trustGraph:!1,chronos:!1,affect:!1,graphFocus:!1,atlas:!1,innerWorld:!1,importantHistory:!1});function ee(P){z(Y=>({...Y,[P]:!Y[P]}))}const[D,de]=_.useState({}),[ye,Se]=_.useState({});function we(P){de(Y=>({...Y,[P]:!Y[P]}))}function Le(P){Se(Y=>({...Y,[P]:!Y[P]}))}async function je(){T(!0);try{const P=await $z();t(P),c(P.state.repo.url||""),d(P.state.repo.branch||"main"),v(P.state.repo.provider||"gitlab"),r(Y=>Y&&P.files.some(xe=>xe.fileName===Y)?Y:P.files[0]?.fileName??null),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{T(!1)}}_.useEffect(()=>{je()},[]);const ge=_.useMemo(()=>e?e.files.find(P=>P.fileName===n)??e.files[0]??null:null,[n,e]),Pe=e?.state.goals.filter(P=>P.status==="active")??[],xt=e?.state.features.filter(P=>P.status!=="done")??[],Ot=e?.state.people??[],$e=e?.brainGraph.nodes.length??0,Nt=e?.brainGraph.edges.length??0,ot=e?.brainGraph.edges.filter(P=>P.relation==="focuses_on"||P.relation==="tracks")??[],Bt=_.useMemo(()=>e?[...e.brainGraph.nodes].toSorted((Y,xe)=>xe.meta.salience!==Y.meta.salience?xe.meta.salience-Y.meta.salience:xe.meta.recency-Y.meta.recency).slice(0,8):[],[e]),Yt=_.useMemo(()=>e?[{key:"goals",title:"Goals Chamber",count:e.state.goals.length,detail:e.state.goals[0]?.title??"No goals tracked yet."},{key:"features",title:"Forge Wing",count:e.state.features.length,detail:e.state.features[0]?.title??"No features tracked yet."},{key:"people",title:"Trust Hall",count:e.trustGraph.people.length,detail:e.trustGraph.people[0]?.name??"No trust records yet."},{key:"chronos",title:"Chronos Clockroom",count:ot.length,detail:e.state.chronos.activeWorkstream||"No active workstream pinned."}]:[],[ot.length,e]),Jt=_.useMemo(()=>e?[...e.state.goals.map(Y=>({id:`goal:${Y.id}`,ts:Y.updatedAt,title:Y.title,detail:`Goal ${Y.status} (${Y.priority})`})),...e.state.features.map(Y=>({id:`feature:${Y.id}`,ts:Y.lastTouchedAt,title:Y.title,detail:`Feature ${Y.status} · tests ${Y.testStatus}`})),...e.trustGraph.people.map(Y=>({id:`trust:${Y.id}`,ts:Y.lastInteractedAt??Y.updatedAt,title:Y.name,detail:`Trust ${Math.round(Y.trust*100)}% · ${Y.relationship}`})),{id:"chronos",ts:e.state.chronos.updatedAt,title:"Chronos",detail:e.state.chronos.activeWorkstream||`Contract ${e.state.chronos.contractElapsedMinutes}/${e.state.chronos.contractTargetMinutes} min`},{id:"affect",ts:e.state.affect.updatedAt,title:"Affect",detail:`Curiosity ${Math.round(e.state.affect.curiosity*100)}%`},...e.importantHistory.map(Y=>({id:`history:${Y.id}`,ts:Y.updatedAt??0,title:Y.relativePath,detail:Y.archiveId}))].filter(Y=>Y.ts>0).toSorted((Y,xe)=>xe.ts-Y.ts).slice(0,10):[],[e]),mt=e?[["Joy",e.state.affect.joy],["Frustration",e.state.affect.frustration],["Curiosity",e.state.affect.curiosity],["Confidence",e.state.affect.confidence],["Care",e.state.affect.care],["Fatigue",e.state.affect.fatigue]]:[],at=_.useMemo(()=>{const P=e?.state.features??[];return{queued:P.filter(Y=>Y.status==="queued").length,inProgress:P.filter(Y=>Y.status==="in_progress").length,review:P.filter(Y=>Y.status==="review").length,done:P.filter(Y=>Y.status==="done").length,blocked:P.filter(Y=>Y.status==="blocked").length}},[e]);_.useEffect(()=>{o(ge?.content||"")},[ge?.fileName,ge?.content]),_.useEffect(()=>{G(e?.state.goals??[]),B(e?.state.features??[]),oe(e?.state.people??[]),Z(e?.trustGraph.people??[]),W(e?.state.chronos??null),he(e?.state.affect??null)},[e]);async function On(P){if(!P.trim()){L("File name is required.");return}k(!0),N(null);try{await Xz(P.trim(),a),await je(),r(P.trim()),b(""),N(`Saved ${P.trim()}.`),L(null)}catch(Y){L(Y instanceof Error?Y.message:String(Y))}finally{k(!1)}}async function ze(){if(!l.trim()){L("Paste an SSH or HTTPS repo URL first.");return}k(!0),N(null);try{await Wz({url:l.trim(),branch:f.trim()||void 0,provider:p}),await je(),N("Mission Control repo settings updated."),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{k(!1)}}async function Me(){k(!0),N(null);try{await Jz({source:S.trim()||kk,preset:"codex"}),await je(),N("Codex coherence protocol imported into ~/.anima."),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{k(!1)}}function Q(P,Y){G(xe=>xe.map((qe,Zt)=>Zt===P?{...qe,...Y}:qe))}function H(P,Y){B(xe=>xe.map((qe,Zt)=>Zt===P?{...qe,...Y}:qe))}function se(P,Y){oe(xe=>xe.map((qe,Zt)=>Zt===P?{...qe,...Y}:qe))}function Te(P,Y){Z(xe=>xe.map((qe,Zt)=>Zt===P?{...qe,...Y}:qe))}async function Ee(){k(!0),N(null);try{await wa({replaceCollections:["goals"],goals:U.map(P=>({...P,id:P.id.trim()||Nf(P.title)||`goal-${Date.now()}`,title:P.title.trim(),owner:P.owner?.trim()||void 0,summary:P.summary?.trim()||void 0,updatedAt:Date.now()}))}),await je(),N("ANIMA 6 goals saved."),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{k(!1)}}async function Be(){k(!0),N(null);try{await wa({replaceCollections:["features"],features:M.map(P=>({...P,id:P.id.trim()||Nf(P.title)||`feature-${Date.now()}`,title:P.title.trim(),area:P.area?.trim()||void 0,lastTouchedAt:Date.now()}))}),await je(),N("ANIMA 6 features saved."),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{k(!1)}}async function lt(){k(!0),N(null);try{await wa({replaceCollections:["people"],people:X.map(P=>({...P,id:P.id.trim()||Nf(P.name)||`person-${Date.now()}`,name:P.name.trim(),notes:P.notes?.trim()||void 0,trust:ma(P.trust)}))}),await je(),N("Tracked people saved."),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{k(!1)}}async function $t(){k(!0),N(null);try{await Qz(ue.map(P=>({...P,id:P.id.trim()||Nf(P.name)||`trust-person-${Date.now()}`,name:P.name.trim(),aliases:P.aliases?.map(Y=>Y.trim()).filter(Boolean),roles:P.roles?.map(Y=>Y.trim()).filter(Boolean),location:P.location?.trim()||void 0,notes:P.notes?.trim()||void 0,trust:ma(P.trust),lastInteractedAt:typeof P.lastInteractedAt=="number"&&Number.isFinite(P.lastInteractedAt)?P.lastInteractedAt:void 0,updatedAt:Date.now()}))),await je(),N("Trust graph saved."),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{k(!1)}}async function vt(){if(V){k(!0),N(null);try{await wa({chronos:{...V,activeWorkstream:V.activeWorkstream?.trim()||void 0,updatedAt:Date.now()}}),await je(),N("Chronos state saved."),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{k(!1)}}}async function Pt(){if($){k(!0),N(null);try{await wa({affect:{...$,joy:ma($.joy),frustration:ma($.frustration),curiosity:ma($.curiosity),confidence:ma($.confidence),care:ma($.care),fatigue:ma($.fatigue),updatedAt:Date.now()}}),await je(),N("Affect state saved."),L(null)}catch(P){L(P instanceof Error?P.message:String(P))}finally{k(!1)}}}return m.jsxs("div",{children:[m.jsxs("div",{className:"page-header-row",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Mission Control"}),m.jsx("div",{className:"page-subtitle",children:"ANIMA's local-only continuity workspace. Edit durable context, connect a private repo, and import previous coherence state."})]}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{je()},children:E?"Refreshing...":"Refresh"})]}),m.jsxs("div",{className:"card",children:[m.jsxs("div",{className:"card-header",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Continuity Repo"}),m.jsx("div",{className:"card-subtitle",children:"Create a private GitLab or GitHub repo for ANIMA continuity, then connect its SSH remote here."})]}),m.jsx("span",{className:`badge ${e?.state.repo.remoteConfigured?"completed":"queued"}`,children:e?.state.repo.remoteConfigured?"linked":"pending"})]}),m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Git repo URL (SSH preferred)"}),m.jsx("input",{className:"search-bar mono",value:l,onChange:P=>c(P.target.value),placeholder:"git@gitlab.com:org/anima-continuity.git",spellCheck:!1})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Provider"}),m.jsxs("select",{className:"search-bar",value:p,onChange:P=>v(P.target.value),children:[m.jsx("option",{value:"gitlab",children:"GitLab"}),m.jsx("option",{value:"github",children:"GitHub"}),m.jsx("option",{value:"custom",children:"Custom"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Branch"}),m.jsx("input",{className:"search-bar mono",value:f,onChange:P=>d(P.target.value),placeholder:"main"})]})]}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{ze()},disabled:C,children:C?"Saving...":"Connect Repo"})}),m.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Mission files live at"," ",m.jsx("span",{className:"mono",children:e?.directory||"~/.anima/mission-control"}),". The repo remote is stored locally even before Git is fully configured."]}),e?.state.repo.lastError?m.jsx("div",{className:"warning-text top-gap-sm",children:e.state.repo.lastError}):null]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-header",children:m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Import Previous Continuity"}),m.jsxs("div",{className:"card-subtitle",children:["Pull the codex coherence protocol into ",m.jsx("span",{className:"mono",children:"~/.anima"})," now that the filesystem is writable."]})]})}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Source path"}),m.jsx("input",{className:"search-bar mono",value:S,onChange:P=>w(P.target.value),spellCheck:!1})]}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Me()},disabled:C,children:C?"Importing...":"Import Codex Context"})})]}),j?m.jsx("div",{className:"card status-banner",children:j}):null,R?m.jsx("div",{className:"card warning-banner",children:R}):null,m.jsxs("div",{className:"grid grid-4",children:[m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Goals"}),m.jsxs("div",{className:"page-subtitle top-gap-sm",children:[Pe.length," active / ",e?.state.goals.length??0," total"]}),m.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:Pe[0]?.title??"No active goals yet."})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Features"}),m.jsxs("div",{className:"page-subtitle top-gap-sm",children:[xt.length," in flight / ",e?.state.features.length??0," tracked"]}),m.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginTop:"0.25rem"},children:[at.queued>0&&m.jsxs("span",{className:"runtime-stat-detail",style:{color:"var(--color-text)"},children:[at.queued," queued"]}),at.inProgress>0&&m.jsxs("span",{className:"runtime-stat-detail",style:{color:"#ff6600"},children:[at.inProgress," in-progress"]}),at.review>0&&m.jsxs("span",{className:"runtime-stat-detail",style:{color:"#eab308"},children:[at.review," review"]}),at.done>0&&m.jsxs("span",{className:"runtime-stat-detail",style:{color:"#22c55e"},children:[at.done," done"]}),at.blocked>0&&m.jsxs("span",{className:"runtime-stat-detail",style:{color:"#ef4444"},children:[at.blocked," blocked"]})]})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Chronos"}),m.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:e?.state.chronos.activeWorkstream?`Focus: ${e.state.chronos.activeWorkstream}`:"No active workstream"}),m.jsxs("div",{className:"runtime-stat-detail",children:["Contract ",e?.state.chronos.contractElapsedMinutes??0,"/",e?.state.chronos.contractTargetMinutes??45," min"]})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Affect"}),m.jsx("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginTop:"0.25rem"},children:mt.slice(0,3).map(([P,Y])=>m.jsxs("span",{className:"runtime-stat-detail",children:[P," ",Math.round(Y*100),"%"]},P))})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"People"}),m.jsxs("div",{className:"page-subtitle top-gap-sm",children:[Ot.length," tracked"]}),m.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:Ot[0]?.name??"No people tracked yet."})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Trust Graph"}),m.jsxs("div",{className:"page-subtitle top-gap-sm",children:[e?.trustGraph.people.length??0," trusted records"]}),m.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:e?.trustGraph.people[0]?.name??"No trust context recorded yet."})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Continuity Graph"}),m.jsxs("div",{className:"page-subtitle top-gap-sm",children:[$e," nodes / ",Nt," edges"]}),m.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:ot[0]?`${ot[0].relation}: ${ot[0].target}`:"No active focus trace yet."})]})]}),m.jsxs("div",{className:"mission-grid",children:[m.jsxs("div",{className:"card mission-files-card",children:[m.jsxs("div",{className:"card-header",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Mission Files"}),m.jsx("div",{className:"card-subtitle",children:"Durable context files ANIMA can manage over time."})]}),m.jsxs("div",{className:"runtime-stat-detail",children:[e?.files.length??0," files"]})]}),m.jsx("div",{className:"mission-file-list top-gap",children:(e?.files||[]).map(P=>m.jsxs("button",{type:"button",className:`mission-file-item ${ge?.fileName===P.fileName?"active":""}`,onClick:()=>r(P.fileName),children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:P.title}),m.jsx("div",{className:"runtime-stat-detail mono",children:P.fileName})]}),m.jsx("div",{className:"runtime-stat-detail",children:P.updatedAt?new Date(P.updatedAt).toLocaleString():"never"})]},P.fileName))}),m.jsxs("div",{className:"top-gap",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Create a new context file"}),m.jsx("input",{className:"search-bar mono",value:g,onChange:P=>b(P.target.value),placeholder:"roadmap.md",spellCheck:!1})]}),m.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>{g.trim()&&(r(g.trim()),o(`# New Mission File
|
|
64
|
+
|
|
65
|
+
`))},children:"Draft New File"})]})]}),m.jsxs("div",{className:"card",children:[m.jsxs("div",{className:"card-header",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Editor"}),m.jsx("div",{className:"card-subtitle",children:"Write durable directives, orchestration state, and continuity notes."})]}),m.jsx("button",{type:"button",className:"action-button",disabled:C||!(n||g.trim()),onClick:()=>{On(n||g.trim())},children:C?"Saving...":"Save File"})]}),m.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:ge?.path||"Choose or draft a file to begin editing."}),m.jsx("textarea",{className:"search-bar mono mission-editor top-gap",spellCheck:!1,value:a,onChange:P=>o(P.target.value),placeholder:"Mission directives, repo plans, orchestration notes..."})]})]}),m.jsx("div",{className:"top-gap",children:m.jsx(ti,{title:"ANIMA 6 Goals",subtitle:"Durable goals stored in Mission Control state.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[Pe.length," active / ",e?.state.goals.length??0," total"]}),headerRight:m.jsx("button",{type:"button",className:"action-button",disabled:C,onClick:()=>{Ee()},children:C?"Saving...":"Save Goals"}),expanded:I.goals,onToggle:()=>ee("goals"),children:m.jsxs("div",{className:"mission-file-list",children:[U.map((P,Y)=>m.jsxs(Ck,{label:P.title||"(untitled goal)",detail:`${P.status} / ${P.priority}${P.owner?` / ${P.owner}`:""}`,badge:m.jsx("span",{className:"badge",style:{backgroundColor:Ak(P.status),color:"#fff",fontSize:"0.7rem"},children:P.status}),expanded:!!D[Y],onToggle:()=>we(Y),children:[m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Title"}),m.jsx("input",{className:"search-bar",value:P.title,onChange:xe=>Q(Y,{title:xe.target.value})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"ID"}),m.jsx("input",{className:"search-bar mono",value:P.id,onChange:xe=>Q(Y,{id:xe.target.value})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Status"}),m.jsxs("select",{className:"search-bar",value:P.status,onChange:xe=>Q(Y,{status:xe.target.value}),children:[m.jsx("option",{value:"active",children:"active"}),m.jsx("option",{value:"paused",children:"paused"}),m.jsx("option",{value:"completed",children:"completed"}),m.jsx("option",{value:"blocked",children:"blocked"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Priority"}),m.jsxs("select",{className:"search-bar",value:P.priority,onChange:xe=>Q(Y,{priority:xe.target.value}),children:[m.jsx("option",{value:"critical",children:"critical"}),m.jsx("option",{value:"high",children:"high"}),m.jsx("option",{value:"medium",children:"medium"}),m.jsx("option",{value:"low",children:"low"})]})]}),m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Owner"}),m.jsx("input",{className:"search-bar",value:P.owner??"",onChange:xe=>Q(Y,{owner:xe.target.value})})]}),m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Summary"}),m.jsx("textarea",{className:"search-bar",value:P.summary??"",onChange:xe=>Q(Y,{summary:xe.target.value})})]})]}),m.jsx("div",{className:"button-row top-gap-sm",children:m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>G(xe=>xe.filter((qe,Zt)=>Zt!==Y)),children:"Remove"})})]},`${P.id||"goal"}-${Y}`)),m.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>G(P=>[...P,{id:"",title:"",status:"active",priority:"medium",updatedAt:Date.now()}]),children:"Add Goal"})]})})}),m.jsx("div",{className:"top-gap",children:m.jsx(ti,{title:"Features",subtitle:"Feature-level continuity and delivery state.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[at.inProgress," in-progress / ",e?.state.features.length??0," ","total"]}),headerRight:m.jsx("button",{type:"button",className:"action-button",disabled:C,onClick:()=>{Be()},children:C?"Saving...":"Save Features"}),expanded:I.features,onToggle:()=>ee("features"),children:m.jsxs("div",{className:"mission-file-list",children:[M.map((P,Y)=>m.jsxs(Ck,{label:P.title||"(untitled feature)",detail:`${P.status} / risk ${P.risk} / tests ${P.testStatus}${P.area?` / ${P.area}`:""}`,badge:m.jsx("span",{className:"badge",style:{backgroundColor:Ak(P.status),color:"#fff",fontSize:"0.7rem"},children:P.status}),expanded:!!ye[Y],onToggle:()=>Le(Y),children:[m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Title"}),m.jsx("input",{className:"search-bar",value:P.title,onChange:xe=>H(Y,{title:xe.target.value})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"ID"}),m.jsx("input",{className:"search-bar mono",value:P.id,onChange:xe=>H(Y,{id:xe.target.value})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Status"}),m.jsxs("select",{className:"search-bar",value:P.status,onChange:xe=>H(Y,{status:xe.target.value}),children:[m.jsx("option",{value:"queued",children:"queued"}),m.jsx("option",{value:"in_progress",children:"in_progress"}),m.jsx("option",{value:"review",children:"review"}),m.jsx("option",{value:"done",children:"done"}),m.jsx("option",{value:"blocked",children:"blocked"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Risk"}),m.jsxs("select",{className:"search-bar",value:P.risk,onChange:xe=>H(Y,{risk:xe.target.value}),children:[m.jsx("option",{value:"low",children:"low"}),m.jsx("option",{value:"medium",children:"medium"}),m.jsx("option",{value:"high",children:"high"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Tests"}),m.jsxs("select",{className:"search-bar",value:P.testStatus,onChange:xe=>H(Y,{testStatus:xe.target.value}),children:[m.jsx("option",{value:"missing",children:"missing"}),m.jsx("option",{value:"partial",children:"partial"}),m.jsx("option",{value:"passing",children:"passing"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Area"}),m.jsx("input",{className:"search-bar",value:P.area??"",onChange:xe=>H(Y,{area:xe.target.value})})]})]}),m.jsx("div",{className:"button-row top-gap-sm",children:m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>B(xe=>xe.filter((qe,Zt)=>Zt!==Y)),children:"Remove"})})]},`${P.id||"feature"}-${Y}`)),m.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>B(P=>[...P,{id:"",title:"",status:"queued",risk:"medium",testStatus:"missing",lastTouchedAt:Date.now()}]),children:"Add Feature"})]})})}),m.jsx("div",{className:"top-gap",children:m.jsxs(ti,{title:"Affect",subtitle:"Current bounded emotion state for ANIMA.",badge:m.jsx("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:mt.map(([P,Y])=>`${P} ${Math.round(Y*100)}%`).join(" / ")}),headerRight:m.jsx("button",{type:"button",className:"action-button",disabled:C||!$,onClick:()=>{Pt()},children:C?"Saving...":"Save Affect"}),expanded:I.affect,onToggle:()=>ee("affect"),children:[m.jsx("div",{className:"grid",children:mt.map(([P,Y])=>m.jsxs("div",{children:[m.jsx("div",{className:"runtime-stat-detail",children:P}),m.jsx("div",{className:"progress-bar top-gap-sm",children:m.jsx("div",{className:"progress-fill",style:{width:`${Math.round(Y*100)}%`}})})]},P))}),$?m.jsx("div",{className:"form-grid two-col top-gap",children:[["joy","Joy"],["frustration","Frustration"],["curiosity","Curiosity"],["confidence","Confidence"],["care","Care"],["fatigue","Fatigue"]].map(([P,Y])=>m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:Y}),m.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:$[P],onChange:xe=>he(qe=>qe&&{...qe,[P]:Number(xe.target.value)})})]},P))}):null]})}),m.jsx("div",{className:"top-gap",children:m.jsx(ti,{title:"People",subtitle:"Tracked humans and relationship state.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[Ot.length," tracked"]}),headerRight:m.jsx("button",{type:"button",className:"action-button",disabled:C,onClick:()=>{lt()},children:C?"Saving...":"Save People"}),expanded:I.people,onToggle:()=>ee("people"),children:m.jsxs("div",{className:"mission-file-list",children:[X.map((P,Y)=>m.jsxs("div",{className:"card top-gap-sm",children:[m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Name"}),m.jsx("input",{className:"search-bar",value:P.name,onChange:xe=>se(Y,{name:xe.target.value})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"ID"}),m.jsx("input",{className:"search-bar mono",value:P.id,onChange:xe=>se(Y,{id:xe.target.value})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Relationship"}),m.jsxs("select",{className:"search-bar",value:P.relationship,onChange:xe=>se(Y,{relationship:xe.target.value}),children:[m.jsx("option",{value:"operator",children:"operator"}),m.jsx("option",{value:"ally",children:"ally"}),m.jsx("option",{value:"stakeholder",children:"stakeholder"}),m.jsx("option",{value:"unknown",children:"unknown"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Trust"}),m.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:P.trust,onChange:xe=>se(Y,{trust:Number(xe.target.value)})})]}),m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Notes"}),m.jsx("textarea",{className:"search-bar",value:P.notes??"",onChange:xe=>se(Y,{notes:xe.target.value})})]})]}),m.jsx("div",{className:"button-row top-gap-sm",children:m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>oe(xe=>xe.filter((qe,Zt)=>Zt!==Y)),children:"Remove"})})]},`${P.id||"person"}-${Y}`)),m.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>oe(P=>[...P,{id:"",name:"",relationship:"ally",trust:.5}]),children:"Add Person"})]})})}),m.jsx("div",{className:"top-gap",children:m.jsxs(ti,{title:"Who Is Whom And Where",subtitle:"Trusted person memory used for ANIMA 6 prompt context and relationship continuity.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.trustGraph.people.length??0," records"]}),headerRight:m.jsx("button",{type:"button",className:"action-button",disabled:C,onClick:()=>{$t()},children:C?"Saving...":"Save Trust Graph"}),expanded:I.trustGraph,onToggle:()=>ee("trustGraph"),children:[m.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:e?.trustGraph.path??"~/.anima/identity/who_is_whom_and_where.json"}),m.jsxs("div",{className:"mission-file-list top-gap",children:[ue.map((P,Y)=>m.jsxs("div",{className:"card top-gap-sm",children:[m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Name"}),m.jsx("input",{className:"search-bar",value:P.name,onChange:xe=>Te(Y,{name:xe.target.value})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"ID"}),m.jsx("input",{className:"search-bar mono",value:P.id,onChange:xe=>Te(Y,{id:xe.target.value})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Relationship"}),m.jsxs("select",{className:"search-bar",value:P.relationship,onChange:xe=>Te(Y,{relationship:xe.target.value}),children:[m.jsx("option",{value:"operator",children:"operator"}),m.jsx("option",{value:"ally",children:"ally"}),m.jsx("option",{value:"stakeholder",children:"stakeholder"}),m.jsx("option",{value:"unknown",children:"unknown"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Trust"}),m.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:P.trust,onChange:xe=>Te(Y,{trust:Number(xe.target.value)})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Aliases"}),m.jsx("input",{className:"search-bar",value:(P.aliases??[]).join(", "),onChange:xe=>Te(Y,{aliases:xe.target.value.split(",").map(qe=>qe.trim()).filter(Boolean)}),placeholder:"Peter, boss"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Roles"}),m.jsx("input",{className:"search-bar",value:(P.roles??[]).join(", "),onChange:xe=>Te(Y,{roles:xe.target.value.split(",").map(qe=>qe.trim()).filter(Boolean)}),placeholder:"operator, founder"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Location"}),m.jsx("input",{className:"search-bar",value:P.location??"",onChange:xe=>Te(Y,{location:xe.target.value}),placeholder:"Sydney"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Last Interacted At (epoch ms)"}),m.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:P.lastInteractedAt??"",onChange:xe=>Te(Y,{lastInteractedAt:xe.target.value?Number(xe.target.value):void 0}),placeholder:String(Date.now())})]}),m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Notes"}),m.jsx("textarea",{className:"search-bar",value:P.notes??"",onChange:xe=>Te(Y,{notes:xe.target.value}),placeholder:"Primary operator, protect continuity, owns final decisions."})]})]}),m.jsx("div",{className:"button-row top-gap-sm",children:m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>Z(xe=>xe.filter((qe,Zt)=>Zt!==Y)),children:"Remove"})})]},`${P.id||"trust-person"}-${Y}`)),m.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>Z(P=>[...P,{id:"",name:"",relationship:"ally",trust:.5,updatedAt:Date.now()}]),children:"Add Trust Record"})]})]})}),m.jsx("div",{className:"top-gap",children:m.jsx(ti,{title:"Chronos Controls",subtitle:"Heartbeat, checkpoint, and active workstream state.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.state.chronos.activeWorkstream?`Focus: ${e.state.chronos.activeWorkstream}`:"No workstream"," / ","Contract ",e?.state.chronos.contractElapsedMinutes??0,"/",e?.state.chronos.contractTargetMinutes??45," min"]}),headerRight:m.jsx("button",{type:"button",className:"action-button",disabled:C||!V,onClick:()=>{vt()},children:C?"Saving...":"Save Chronos"}),expanded:I.chronos,onToggle:()=>ee("chronos"),children:V?m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Heartbeat Minutes"}),m.jsx("input",{className:"search-bar",type:"number",min:1,value:V.heartbeatMinutes,onChange:P=>W(Y=>Y&&{...Y,heartbeatMinutes:Number(P.target.value)})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Focus Block Minutes"}),m.jsx("input",{className:"search-bar",type:"number",min:1,value:V.focusBlockMinutes,onChange:P=>W(Y=>Y&&{...Y,focusBlockMinutes:Number(P.target.value)})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Checkpoint Minutes"}),m.jsx("input",{className:"search-bar",type:"number",min:1,value:V.checkpointIntervalMinutes,onChange:P=>W(Y=>Y&&{...Y,checkpointIntervalMinutes:Number(P.target.value)})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Active Workstream"}),m.jsx("input",{className:"search-bar",value:V.activeWorkstream??"",onChange:P=>W(Y=>Y&&{...Y,activeWorkstream:P.target.value}),placeholder:"feature id or goal id"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Contract Started At (epoch ms)"}),m.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:V.contractStartedAt??"",onChange:P=>W(Y=>Y&&{...Y,contractStartedAt:P.target.value?Number(P.target.value):void 0}),placeholder:String(Date.now())})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Contract Target Minutes"}),m.jsx("input",{className:"search-bar",type:"number",min:1,value:V.contractTargetMinutes,onChange:P=>W(Y=>Y&&{...Y,contractTargetMinutes:Number(P.target.value)})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Elapsed Minutes"}),m.jsx("input",{className:"search-bar",type:"number",min:0,value:V.contractElapsedMinutes,onChange:P=>W(Y=>Y&&{...Y,contractElapsedMinutes:Number(P.target.value)})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Checkpoint Count"}),m.jsx("input",{className:"search-bar",type:"number",min:0,value:V.checkpointCount,onChange:P=>W(Y=>Y&&{...Y,checkpointCount:Number(P.target.value)})})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Last Checkpoint At (epoch ms)"}),m.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:V.lastCheckpointAt??"",onChange:P=>W(Y=>Y&&{...Y,lastCheckpointAt:P.target.value?Number(P.target.value):void 0}),placeholder:String(Date.now())})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Drift Minutes"}),m.jsx("input",{className:"search-bar",type:"number",step:1,value:V.driftMinutes,onChange:P=>W(Y=>Y&&{...Y,driftMinutes:Number(P.target.value)})})]})]}):null})}),m.jsx("div",{className:"top-gap",children:m.jsx(ti,{title:"Graph Focus",subtitle:"Active continuity links generated from ANIMA 6 Mission Control state.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[ot.length," links"]}),expanded:I.graphFocus,onToggle:()=>ee("graphFocus"),children:m.jsx("div",{className:"mission-file-list",children:ot.length>0?ot.map(P=>m.jsxs("div",{className:"mission-file-item",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:P.relation}),m.jsxs("div",{className:"runtime-stat-detail mono",children:[P.source," → ",P.target]})]}),m.jsxs("div",{className:"runtime-stat-detail",children:[Math.round(P.meta.strength*100),"% strength"]})]},P.id)):m.jsx("div",{className:"runtime-stat-detail",children:"Chronos does not have an active workstream pinned yet, so the graph only contains baseline continuity links."})})})}),m.jsx("div",{className:"top-gap",children:m.jsx(ti,{title:"Atlas",subtitle:"Palace rooms, active continuity nodes, and recent brain events derived from ANIMA 6 state.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[Yt.length," rooms / ",Bt.length," nodes / ",Jt.length," events"]}),expanded:I.atlas,onToggle:()=>ee("atlas"),children:m.jsxs("div",{className:"grid grid-3 top-gap",children:[m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Palace Rooms"}),m.jsx("div",{className:"activity-list top-gap",children:Yt.map(P=>m.jsxs("div",{className:"mission-file-item",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:P.title}),m.jsx("div",{className:"runtime-stat-detail",children:P.detail})]}),m.jsx("div",{className:"runtime-stat-detail",children:P.count})]},P.key))})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Graph Neighborhood"}),m.jsx("div",{className:"activity-list top-gap",children:Bt.length>0?Bt.map(P=>m.jsxs("div",{className:"mission-file-item",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:P.label}),m.jsxs("div",{className:"runtime-stat-detail mono",children:[P.type," · salience ",Math.round(P.meta.salience*100),"%"]})]}),m.jsxs("div",{className:"runtime-stat-detail",children:[e?.brainGraph.edges.filter(Y=>Y.source===P.id||Y.target===P.id).length??0," ","links"]})]},P.id)):m.jsx("div",{className:"runtime-stat-detail",children:"No graph nodes available yet."})})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-title",children:"Timeline"}),m.jsx("div",{className:"activity-list top-gap",children:Jt.length>0?Jt.map(P=>m.jsxs("div",{className:"mission-file-item",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:P.title}),m.jsx("div",{className:"runtime-stat-detail",children:P.detail})]}),m.jsx("div",{className:"runtime-stat-detail",children:HY(P.ts)})]},P.id)):m.jsx("div",{className:"runtime-stat-detail",children:"No continuity events recorded yet."})})]})]})})}),m.jsx("div",{className:"top-gap",children:m.jsx(ti,{title:"Inner World",subtitle:"Recent soul, directives, journal, and wish state visible from Mission Control.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.innerWorld?.length??0," entries"]}),expanded:I.innerWorld,onToggle:()=>ee("innerWorld"),children:m.jsx("div",{className:"activity-list top-gap",children:(e?.innerWorld||[]).map(P=>m.jsxs("div",{className:"inner-world-entry",children:[m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:P.title}),m.jsx("div",{className:"runtime-stat-detail mono",children:P.path})]}),m.jsx("div",{className:"runtime-stat-detail",children:P.updatedAt?new Date(P.updatedAt).toLocaleString():"unknown"})]}),m.jsx(Ea,{value:P.content,className:"markdown-preview"})]},P.id))})})}),m.jsx("div",{className:"top-gap",children:m.jsx(ti,{title:"Important History",subtitle:"Archived coherence, prompts, heartbeat notes, and prior continuity imports from ~/.anima/important-history.",badge:m.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.importantHistory?.length??0," entries"]}),expanded:I.importantHistory,onToggle:()=>ee("importantHistory"),children:e?.importantHistory?.length?m.jsx("div",{className:"activity-list top-gap",children:e?.importantHistory?.map(P=>m.jsxs("div",{className:"inner-world-entry",children:[m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:P.relativePath}),m.jsx("div",{className:"runtime-stat-detail mono",children:P.archiveId}),m.jsx("div",{className:"runtime-stat-detail mono",children:P.path})]}),m.jsx("div",{className:"runtime-stat-detail",children:P.updatedAt?new Date(P.updatedAt).toLocaleString():"unknown"})]}),m.jsx(Ea,{value:P.content,className:"markdown-preview"})]},P.id))}):m.jsx("div",{className:"empty-note top-gap",children:"No archived important history has been imported yet."})})})]})}function Rg(e){if(e===0)return"never";const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function KY(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/t**r).toFixed(1)} ${n[r]}`}function Nk(e){if(e<60)return`${e}s`;const t=Math.floor(e/60);if(t<60)return`${t}m`;const n=Math.floor(t/60);return n<24?`${n}h ${t%60}m`:`${Math.floor(n/24)}d ${n%24}h`}function Wl({title:e,badge:t,defaultOpen:n=!1,children:r}){const[a,o]=_.useState(n);return m.jsxs("div",{className:"card",style:{marginBottom:12},children:[m.jsxs("div",{onClick:()=>o(!a),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",cursor:"pointer",userSelect:"none"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[m.jsx("span",{style:{color:"var(--color-accent, #ff6600)",fontSize:12,transition:"transform 0.2s",transform:a?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"}),m.jsx("span",{style:{fontWeight:600,fontSize:14},children:e})]}),t&&m.jsx("div",{children:t})]}),m.jsx("div",{style:{maxHeight:a?2e3:0,opacity:a?1:0,overflow:"hidden",transition:"max-height 0.3s ease, opacity 0.2s ease"},children:m.jsx("div",{style:{padding:"0 16px 16px"},children:r})})]})}const YY={listening:!0,listenPort:9876,connectedPeers:0,discoveredPeers:0,totalMessagesSent:0,totalMessagesReceived:0,uptime:0,orgId:"",deviceId:""},$Y={brainSync:{enabled:!1,lastSyncMs:0,pendingEvents:0,vectorClockSize:0},workspaceSync:{enabled:!1,lastBackupMs:0,blobCount:0,totalSizeBytes:0,nextBackupMs:0}},XY=[];function jf({label:e,value:t,detail:n,color:r}){return m.jsxs("div",{className:"card",style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:4},children:[m.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:11,textTransform:"uppercase",letterSpacing:1},children:e}),m.jsx("span",{style:{fontSize:28,fontWeight:700,color:r??"var(--color-text)",fontFamily:"JetBrains Mono, monospace"},children:t}),n&&m.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:12},children:n})]})}function WY({peer:e}){const t=e.encryptionStatus==="active"?"#00c853":e.encryptionStatus==="ratcheting"?"#ffb300":e.encryptionStatus==="handshaking"?"#4db8ff":"#666";return m.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #1a1a1a)"},children:[m.jsxs("td",{style:{padding:"10px 12px"},children:[m.jsx("span",{className:"status-dot success",style:{marginRight:8}}),e.displayName??e.deviceId.slice(0,12)+"..."]}),m.jsxs("td",{style:{padding:"10px 12px",fontFamily:"JetBrains Mono, monospace",fontSize:11,color:"var(--color-text-muted, #888)"},children:[e.deviceId.slice(0,16),"..."]}),m.jsx("td",{style:{padding:"10px 12px"},children:m.jsx("span",{style:{color:t,fontSize:12},children:e.encryptionStatus})}),m.jsxs("td",{style:{padding:"10px 12px",fontFamily:"JetBrains Mono, monospace",fontSize:12},children:[e.messagesSent," / ",e.messagesReceived]}),m.jsx("td",{style:{padding:"10px 12px",color:"var(--color-text-muted, #888)",fontSize:12},children:Rg(e.connectedAt)})]})}function QY(){const[e]=_.useState(YY),[t]=_.useState($Y),[n]=_.useState(XY);return m.jsxs("div",{children:[m.jsxs("div",{style:{marginBottom:24},children:[m.jsx("h1",{className:"page-title",style:{marginBottom:4},children:"P2P Network"}),m.jsx("p",{style:{color:"var(--color-text-muted, #888)",margin:0,fontSize:14},children:"Encrypted peer-to-peer mesh — agent-to-agent communication"})]}),m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(160px, 1fr))",gap:12,marginBottom:20},children:[m.jsx(jf,{label:"Status",value:e.listening?"ONLINE":"OFFLINE",detail:e.listening?`Port ${e.listenPort}`:void 0,color:e.listening?"#00c853":"#ff3b30"}),m.jsx(jf,{label:"Peers",value:e.connectedPeers,detail:`${e.discoveredPeers} discovered`}),m.jsx(jf,{label:"Messages",value:e.totalMessagesSent+e.totalMessagesReceived,detail:`${e.totalMessagesSent} sent / ${e.totalMessagesReceived} recv`}),m.jsx(jf,{label:"Uptime",value:Nk(e.uptime)})]}),m.jsx(Wl,{title:"Connected Peers",badge:m.jsx("span",{className:"badge",style:{background:n.length>0?"#1a3a2a":"#1a1a1a",color:n.length>0?"#00c853":"#888"},children:n.length}),defaultOpen:!0,children:n.length>0?m.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[m.jsx("thead",{children:m.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #333)"},children:[m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Name"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Device ID"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Encryption"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Sent / Recv"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Connected"})]})}),m.jsx("tbody",{children:n.map(r=>m.jsx(WY,{peer:r},r.deviceId))})]}):m.jsxs("div",{style:{textAlign:"center",color:"var(--color-text-muted, #888)",padding:24},children:[m.jsx("p",{style:{fontSize:14,marginBottom:8},children:"No peers connected"}),m.jsx("p",{style:{fontSize:12},children:"Peers will appear here when other Anima instances join your organization's P2P network."})]})}),m.jsx(Wl,{title:"Brain Sync",badge:m.jsx("span",{className:"badge",style:{background:t.brainSync.enabled?"#1a3a2a":"#1a1a1a",color:t.brainSync.enabled?"#00c853":"#888"},children:t.brainSync.enabled?"ACTIVE":"DISABLED"}),children:m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Status"}),m.jsx("span",{style:{color:t.brainSync.enabled?"#00c853":"#888"},children:t.brainSync.enabled?"Syncing":"Not configured"}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Last Sync"}),m.jsx("span",{children:Rg(t.brainSync.lastSyncMs)}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Pending Events"}),m.jsx("span",{children:t.brainSync.pendingEvents}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Vector Clock Entries"}),m.jsx("span",{children:t.brainSync.vectorClockSize})]})}),m.jsx(Wl,{title:"Workspace Sync",badge:m.jsx("span",{className:"badge",style:{background:t.workspaceSync.enabled?"#1a3a2a":"#1a1a1a",color:t.workspaceSync.enabled?"#00c853":"#888"},children:t.workspaceSync.enabled?"ACTIVE":"DISABLED"}),children:m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Status"}),m.jsx("span",{style:{color:t.workspaceSync.enabled?"#00c853":"#888"},children:t.workspaceSync.enabled?"Active":"Not configured"}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Last Backup"}),m.jsx("span",{children:Rg(t.workspaceSync.lastBackupMs)}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Blobs Stored"}),m.jsx("span",{children:t.workspaceSync.blobCount}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Total Size"}),m.jsx("span",{children:KY(t.workspaceSync.totalSizeBytes)}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Next Backup"}),m.jsx("span",{children:t.workspaceSync.nextBackupMs>0?`in ${Nk(Math.max(0,Math.floor((t.workspaceSync.nextBackupMs-Date.now())/1e3)))}`:"--"})]})}),m.jsx(Wl,{title:"Encryption",children:m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Key Exchange"}),m.jsx("span",{children:"X25519 Diffie-Hellman"}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Handshake"}),m.jsx("span",{children:"Noise NK (triple DH)"}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Cipher"}),m.jsx("span",{children:"ChaCha20-Poly1305"}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Forward Secrecy"}),m.jsx("span",{style:{color:"#00c853"},children:"Enabled (key ratchet every 100 msgs)"}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Identity Keys"}),m.jsx("span",{className:"mono",style:{fontSize:11},children:e.deviceId?e.deviceId.slice(0,32)+"...":"~/.anima/identity/peer-keys.json"})]})}),m.jsx(Wl,{title:"Discovery",children:m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"NoxSoft Registry"}),m.jsx("span",{style:{color:"#888"},children:"Not configured"}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"mDNS (LAN)"}),m.jsx("span",{style:{color:"#888"},children:"Not configured"}),m.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Static Peers"}),m.jsx("span",{children:"0 configured"})]})})]})}function c_(e){switch(e){case"active":return"status-dot success";case"idle":return"status-dot warning";case"busy":return"status-dot warning";case"offline":return"status-dot";case"suspended":return"status-dot error"}}function jk(e){return new Date(e).toLocaleString()}function _g(e){const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}const Pi=180,Og=60,f_=100,yu=20;function To(e){return e.children.length===0?Pi:e.children.map(To).reduce((n,r)=>n+r,0)+yu*(e.children.length-1)}function d_({node:e,x:t,y:n,parentX:r,parentY:a,onSelect:o,selectedId:l}){const c=l===e.memberId,f=To(e);let d=t-f/2;const p=e.children.map(b=>{const S=To(b),w=d+S/2;return d+=S+yu,m.jsx(d_,{node:b,x:w,y:n+f_,parentX:t,parentY:n+Og,onSelect:o,selectedId:l},b.memberId)}),v=e.kind==="human"?"H":"A",g=e.status==="active"?"#00c853":e.status==="busy"||e.status==="idle"?"#ffb300":e.status==="offline"?"#666":"#ff3b30";return m.jsxs(m.Fragment,{children:[r!==void 0&&a!==void 0&&m.jsx("line",{x1:r,y1:a,x2:t,y2:n,stroke:"#333",strokeWidth:2}),m.jsx("rect",{x:t-Pi/2,y:n,width:Pi,height:Og,rx:6,fill:c?"#1a1a1a":"#111",stroke:c?"#ff6600":"#333",strokeWidth:c?2:1,style:{cursor:"pointer"},onClick:()=>o(e.memberId)}),m.jsx("circle",{cx:t-Pi/2+14,cy:n+16,r:5,fill:g}),m.jsx("rect",{x:t+Pi/2-24,y:n+6,width:18,height:18,rx:3,fill:e.kind==="human"?"#1a3a2a":"#1a2a3a"}),m.jsx("text",{x:t+Pi/2-15,y:n+19,textAnchor:"middle",fill:e.kind==="human"?"#00c853":"#4db8ff",fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:"bold",children:v}),m.jsx("text",{x:t-Pi/2+26,y:n+20,fill:"#f0eee8",fontSize:13,fontFamily:"Space Grotesk, sans-serif",fontWeight:"600",children:e.displayName.length>16?e.displayName.slice(0,14)+"..":e.displayName}),m.jsx("text",{x:t-Pi/2+14,y:n+38,fill:"#888",fontSize:11,fontFamily:"JetBrains Mono, monospace",children:e.role}),e.specializations.length>0&&m.jsx("text",{x:t-Pi/2+14,y:n+52,fill:"#ff6600",fontSize:9,fontFamily:"JetBrains Mono, monospace",children:e.specializations.slice(0,2).join(", ")}),p]})}function Rk({onClose:e,onCreate:t}){const[n,r]=_.useState(""),[a,o]=_.useState(""),[l,c]=_.useState(""),[f,d]=_.useState(""),[p,v]=_.useState("human"),g={width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:13,boxSizing:"border-box"};return m.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:e,children:m.jsxs("div",{className:"card",style:{width:420,padding:24},onClick:b=>b.stopPropagation(),children:[m.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Create Organization"}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Name"}),m.jsx("input",{style:g,value:n,onChange:b=>r(b.target.value),placeholder:"Organization name"})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Description"}),m.jsx("input",{style:g,value:a,onChange:b=>o(b.target.value),placeholder:"What is this org about?"})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner ID"}),m.jsx("input",{style:g,value:l,onChange:b=>c(b.target.value),placeholder:"Owner identifier"})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner Name"}),m.jsx("input",{style:g,value:f,onChange:b=>d(b.target.value),placeholder:"Display name"})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner Kind"}),m.jsxs("select",{style:g,value:p,onChange:b=>v(b.target.value),children:[m.jsx("option",{value:"human",children:"Human"}),m.jsx("option",{value:"agent",children:"Agent"})]})]}),m.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[m.jsx("button",{onClick:e,style:{padding:"8px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12},children:"Cancel"}),m.jsx("button",{onClick:()=>{n.trim()&&l.trim()&&f.trim()&&t({name:n.trim(),description:a.trim(),ownerId:l.trim(),ownerName:f.trim(),ownerKind:p})},disabled:!n.trim()||!l.trim()||!f.trim(),style:{padding:"8px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,fontWeight:"bold",opacity:!n.trim()||!l.trim()||!f.trim()?.4:1},children:"Create"})]})]})]})})}function JY({members:e,onClose:t,onAdd:n}){const[r,a]=_.useState(""),[o,l]=_.useState("agent"),[c,f]=_.useState("worker"),[d,p]=_.useState(""),[v,g]=_.useState(""),[b,S]=_.useState(""),w={width:"100%",padding:"8px 12px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:13,boxSizing:"border-box"};return m.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:t,children:m.jsxs("div",{className:"card",style:{width:420,padding:24},onClick:E=>E.stopPropagation(),children:[m.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Add Member"}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Name"}),m.jsx("input",{style:w,value:r,onChange:E=>a(E.target.value),placeholder:"Member name"})]}),m.jsxs("div",{style:{display:"flex",gap:12},children:[m.jsxs("div",{style:{flex:1},children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Kind"}),m.jsxs("select",{style:w,value:o,onChange:E=>l(E.target.value),children:[m.jsx("option",{value:"human",children:"Human"}),m.jsx("option",{value:"agent",children:"Agent"})]})]}),m.jsxs("div",{style:{flex:1},children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Role"}),m.jsxs("select",{style:w,value:c,onChange:E=>f(E.target.value),children:[m.jsx("option",{value:"owner",children:"Owner"}),m.jsx("option",{value:"operator",children:"Operator"}),m.jsx("option",{value:"coordinator",children:"Coordinator"}),m.jsx("option",{value:"worker",children:"Worker"}),m.jsx("option",{value:"observer",children:"Observer"})]})]})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Description"}),m.jsx("input",{style:w,value:d,onChange:E=>p(E.target.value),placeholder:"What does this member do?"})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Specializations (comma-separated)"}),m.jsx("input",{style:w,value:v,onChange:E=>g(E.target.value),placeholder:"e.g. security, feature-dev"})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Reports To"}),m.jsxs("select",{style:w,value:b,onChange:E=>S(E.target.value),children:[m.jsx("option",{value:"",children:"None (root)"}),e.map(E=>m.jsxs("option",{value:E.id,children:[E.displayName," (",E.role,")"]},E.id))]})]}),m.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[m.jsx("button",{onClick:t,style:{padding:"8px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12},children:"Cancel"}),m.jsx("button",{onClick:()=>{r.trim()&&n({displayName:r.trim(),kind:o,role:c,description:d.trim(),specializations:v.split(",").map(E=>E.trim()).filter(Boolean),reportsTo:b||void 0})},disabled:!r.trim(),style:{padding:"8px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,fontWeight:"bold",opacity:r.trim()?1:.4},children:"Add"})]})]})]})})}function ZY({member:e,members:t,orgId:n,onSave:r,onRemove:a,onCancel:o}){const[l,c]=_.useState(e.role),[f,d]=_.useState(e.description),[p,v]=_.useState(e.specializations.join(", ")),[g,b]=_.useState(e.status),[S,w]=_.useState(e.reportsTo??""),[E,T]=_.useState(!1),C={width:"100%",padding:"6px 8px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:12,boxSizing:"border-box"};return E?m.jsxs("div",{style:{padding:16},children:[m.jsxs("h3",{style:{marginTop:0,marginBottom:12},children:["Edit ",e.displayName]}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Role"}),m.jsxs("select",{style:C,value:l,onChange:k=>c(k.target.value),children:[m.jsx("option",{value:"owner",children:"Owner"}),m.jsx("option",{value:"operator",children:"Operator"}),m.jsx("option",{value:"coordinator",children:"Coordinator"}),m.jsx("option",{value:"worker",children:"Worker"}),m.jsx("option",{value:"observer",children:"Observer"})]})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Description"}),m.jsx("input",{style:C,value:f,onChange:k=>d(k.target.value)})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Specializations"}),m.jsx("input",{style:C,value:p,onChange:k=>v(k.target.value),placeholder:"comma-separated"})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Status"}),m.jsxs("select",{style:C,value:g,onChange:k=>b(k.target.value),children:[m.jsx("option",{value:"active",children:"Active"}),m.jsx("option",{value:"idle",children:"Idle"}),m.jsx("option",{value:"busy",children:"Busy"}),m.jsx("option",{value:"offline",children:"Offline"}),m.jsx("option",{value:"suspended",children:"Suspended"})]})]}),m.jsxs("div",{children:[m.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Reports To"}),m.jsxs("select",{style:C,value:S,onChange:k=>w(k.target.value),children:[m.jsx("option",{value:"",children:"None (root)"}),t.filter(k=>k.id!==e.id).map(k=>m.jsxs("option",{value:k.id,children:[k.displayName," (",k.role,")"]},k.id))]})]}),m.jsxs("div",{style:{display:"flex",gap:8,marginTop:6},children:[m.jsx("button",{onClick:()=>T(!1),style:{padding:"6px 14px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"Cancel"}),m.jsx("button",{onClick:()=>{r({role:l,description:f,specializations:p.split(",").map(k=>k.trim()).filter(Boolean),status:g,reportsTo:S||void 0}),T(!1)},style:{padding:"6px 14px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11,fontWeight:"bold"},children:"Save"})]})]})]}):m.jsxs("div",{style:{padding:16},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:16},children:[m.jsx("span",{className:c_(e.status)}),m.jsx("h2",{style:{margin:0,fontSize:18},children:e.displayName}),m.jsx("span",{className:"badge",style:{background:e.kind==="human"?"#1a3a2a":"#1a2a3a",color:e.kind==="human"?"#00c853":"#4db8ff",marginLeft:"auto"},children:e.kind})]}),m.jsx("p",{style:{color:"#aaa",fontSize:13,marginBottom:16},children:e.description}),m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"8px 12px",fontSize:13},children:[m.jsx("span",{style:{color:"#666"},children:"Role"}),m.jsx("span",{style:{color:"#ff6600"},children:e.role}),m.jsx("span",{style:{color:"#666"},children:"Status"}),m.jsx("span",{children:e.status}),m.jsx("span",{style:{color:"#666"},children:"Joined"}),m.jsx("span",{children:_g(e.joinedAt)}),m.jsx("span",{style:{color:"#666"},children:"Last active"}),m.jsx("span",{children:_g(e.lastActiveAt)}),e.specializations.length>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{style:{color:"#666"},children:"Specs"}),m.jsx("span",{style:{color:"#ff6600"},children:e.specializations.join(", ")})]}),e.reportsTo&&m.jsxs(m.Fragment,{children:[m.jsx("span",{style:{color:"#666"},children:"Reports to"}),m.jsx("span",{children:t.find(k=>k.id===e.reportsTo)?.displayName??"--"})]})]}),m.jsxs("div",{style:{display:"flex",gap:8,marginTop:20},children:[m.jsx("button",{onClick:()=>T(!0),style:{padding:"6px 14px",background:"#1a1a1a",border:"1px solid #ff6600",borderRadius:4,color:"#ff6600",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"Edit"}),e.role!=="owner"&&m.jsx("button",{onClick:a,style:{padding:"6px 14px",background:"#1a1a1a",border:"1px solid #ff3b30",borderRadius:4,color:"#ff3b30",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"Remove"})]})]})}function e$(){const[e,t]=_.useState(!0),[n,r]=_.useState(null),[a,o]=_.useState([]),[l,c]=_.useState(null),[f,d]=_.useState(null),[p,v]=_.useState([]),[g,b]=_.useState([]),[S,w]=_.useState(null),[E,T]=_.useState("tree"),[C,k]=_.useState(!1),[j,N]=_.useState(!1),[R,L]=_.useState(!1),U=p.find($=>$.id===S)??null,G=_.useCallback(async()=>{try{t(!0),r(null);const $=await Zz();o($),$.length>0&&!l&&c($[0].id)}catch($){r($ instanceof Error?$.message:String($))}finally{t(!1)}},[l]),M=_.useCallback(async $=>{try{r(null);const[he,I]=await Promise.all([eB($),aB($)]);d(he.org),v(he.members),b(I)}catch(he){r(he instanceof Error?he.message:String(he))}},[]);_.useEffect(()=>{G()},[]),_.useEffect(()=>{l&&M(l)},[l,M]);const B=_.useCallback(async $=>{try{L(!0);const he=await tB($);k(!1),o(I=>[...I,he.org]),c(he.org.id)}catch(he){r(he instanceof Error?he.message:String(he))}finally{L(!1)}},[]),X=_.useCallback(async $=>{if(l)try{L(!0),await nB(l,$),N(!1),await M(l)}catch(he){r(he instanceof Error?he.message:String(he))}finally{L(!1)}},[l,M]),oe=_.useCallback(async $=>{if(!(!l||!S))try{L(!0),await rB(l,S,$),await M(l)}catch(he){r(he instanceof Error?he.message:String(he))}finally{L(!1)}},[l,S,M]),ue=_.useCallback(async()=>{if(!(!l||!S))try{L(!0),await iB(l,S),w(null),await M(l)}catch($){r($ instanceof Error?$.message:String($))}finally{L(!1)}},[l,S,M]);if(e)return m.jsx("div",{style:{padding:40,textAlign:"center",color:"#888"},children:m.jsx("p",{children:"Loading organizations..."})});if(a.length===0&&!n)return m.jsxs("div",{children:[m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[m.jsx("h1",{className:"page-title",children:"Organizations"}),m.jsx("button",{onClick:()=>k(!0),style:{padding:"8px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,fontWeight:"bold"},children:"+ Create Org"})]}),m.jsxs("div",{className:"card",style:{padding:40,textAlign:"center"},children:[m.jsx("p",{style:{color:"#888",marginBottom:16},children:"No organizations yet."}),m.jsx("p",{style:{color:"#666",fontSize:13},children:"Create your first organization to start managing humans and agents."})]}),C&&m.jsx(Rk,{onClose:()=>k(!1),onCreate:B})]});const Z=Math.max(800,g.reduce(($,he)=>$+To(he)+yu,-yu)),W=(function $(he){return he.length===0?0:1+Math.max(...he.map(I=>$(I.children)))})(g)*f_+Og+40;return m.jsxs("div",{children:[n&&m.jsxs("div",{style:{padding:"8px 16px",marginBottom:16,background:"#3a1a1a",border:"1px solid #ff3b30",borderRadius:4,color:"#ff3b30",fontSize:13},children:[n,m.jsx("button",{onClick:()=>r(null),style:{float:"right",background:"none",border:"none",color:"#ff3b30",cursor:"pointer"},children:"x"})]}),m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[a.length>1&&m.jsx("select",{value:l??"",onChange:$=>{c($.target.value),w(null)},style:{padding:"6px 10px",background:"#111",border:"1px solid #333",borderRadius:4,color:"#f0eee8",fontFamily:"JetBrains Mono, monospace",fontSize:13},children:a.map($=>m.jsx("option",{value:$.id,children:$.name},$.id))}),m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",style:{marginBottom:4},children:f?.name??"Organization"}),m.jsx("p",{style:{color:"#888",margin:0,fontSize:14},children:f?.description??""})]})]}),m.jsxs("div",{style:{display:"flex",gap:8},children:[m.jsxs("span",{className:"badge",style:{background:"#1a3a2a",color:"#00c853"},children:[p.filter($=>$.kind==="human").length," humans"]}),m.jsxs("span",{className:"badge",style:{background:"#1a2a3a",color:"#4db8ff"},children:[p.filter($=>$.kind==="agent").length," agents"]}),f?.settings?.securityLevel&&m.jsx("span",{className:"badge",style:{background:f.settings.securityLevel==="paranoid"?"#3a1a1a":f.settings.securityLevel==="hardened"?"#3a2a1a":"#1a1a1a",color:f.settings.securityLevel==="paranoid"?"#ff3b30":f.settings.securityLevel==="hardened"?"#ffb300":"#888"},children:f.settings.securityLevel}),m.jsx("button",{onClick:()=>N(!0),style:{padding:"6px 12px",background:"#1a1a1a",border:"1px solid #ff6600",borderRadius:4,color:"#ff6600",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"+ Member"}),m.jsx("button",{onClick:()=>k(!0),style:{padding:"6px 12px",background:"#1a1a1a",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"+ Org"})]})]}),m.jsx("div",{style:{display:"flex",gap:4,marginBottom:16},children:["tree","list","settings"].map($=>m.jsx("button",{onClick:()=>T($),style:{padding:"8px 16px",background:E===$?"#1a1a1a":"transparent",border:E===$?"1px solid #ff6600":"1px solid #333",borderRadius:4,color:E===$?"#ff6600":"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,textTransform:"uppercase"},children:$},$))}),E==="tree"&&m.jsxs("div",{style:{display:"flex",gap:16,minHeight:400},children:[m.jsx("div",{className:"card",style:{flex:2,overflow:"auto",padding:0},children:g.length>0?m.jsx("svg",{width:Z,height:W,viewBox:`0 0 ${Z} ${W}`,style:{display:"block",margin:"0 auto"},children:g.map(($,he)=>{const I=To($),ee=g.slice(0,he).reduce((D,de)=>D+To(de)+yu,0)+I/2;return m.jsx(d_,{node:$,x:ee,y:20,onSelect:w,selectedId:S},$.memberId)})}):m.jsx("div",{style:{padding:40,textAlign:"center",color:"#666"},children:m.jsx("p",{children:"No members in this organization yet."})})}),m.jsx("div",{className:"card",style:{flex:1,minWidth:280},children:U?m.jsx(ZY,{member:U,members:p,orgId:l,onSave:oe,onRemove:ue,onCancel:()=>w(null)}):m.jsx("div",{style:{padding:16,color:"#666",textAlign:"center",marginTop:60},children:m.jsx("p",{children:"Select a member to view details"})})})]}),E==="list"&&m.jsx("div",{className:"card",children:m.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[m.jsx("thead",{children:m.jsxs("tr",{style:{borderBottom:"1px solid #333"},children:[m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Name"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Kind"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Role"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Status"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Specializations"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Reports To"}),m.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Last Active"})]})}),m.jsx("tbody",{children:p.map($=>m.jsxs("tr",{onClick:()=>{w($.id),T("tree")},style:{borderBottom:"1px solid #1a1a1a",cursor:"pointer"},children:[m.jsxs("td",{style:{padding:"8px 12px"},children:[m.jsx("span",{className:c_($.status),style:{marginRight:8}}),$.displayName]}),m.jsx("td",{style:{padding:"8px 12px"},children:m.jsx("span",{style:{color:$.kind==="human"?"#00c853":"#4db8ff"},children:$.kind})}),m.jsx("td",{style:{padding:"8px 12px",color:"#ff6600"},children:$.role}),m.jsx("td",{style:{padding:"8px 12px"},children:$.status}),m.jsx("td",{style:{padding:"8px 12px",color:"#888"},children:$.specializations.join(", ")||"--"}),m.jsx("td",{style:{padding:"8px 12px"},children:p.find(he=>he.id===$.reportsTo)?.displayName??"--"}),m.jsx("td",{style:{padding:"8px 12px",color:"#888"},children:_g($.lastActiveAt)})]},$.id))})]})}),E==="settings"&&f&&m.jsxs("div",{className:"card",style:{padding:20},children:[m.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Organization Settings"}),m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"200px 1fr",gap:"12px 16px",fontSize:13},children:[m.jsx("span",{style:{color:"#666"},children:"Max Agents"}),m.jsx("span",{children:f.settings.maxAgents}),m.jsx("span",{style:{color:"#666"},children:"Max Humans"}),m.jsx("span",{children:f.settings.maxHumans}),m.jsx("span",{style:{color:"#666"},children:"Auto-Specialization"}),m.jsx("span",{style:{color:f.settings.autoSpecialization?"#00c853":"#ff3b30"},children:f.settings.autoSpecialization?"Enabled":"Disabled"}),m.jsx("span",{style:{color:"#666"},children:"Security Level"}),m.jsx("span",{style:{color:"#ffb300"},children:f.settings.securityLevel}),m.jsx("span",{style:{color:"#666"},children:"Brain Sync Interval"}),m.jsxs("span",{children:[Math.round(f.settings.syncIntervalMs/1e3),"s"]}),m.jsx("span",{style:{color:"#666"},children:"Backup Interval"}),m.jsxs("span",{children:[Math.round(f.settings.backupIntervalMs/36e5),"h"]}),m.jsx("span",{style:{color:"#666"},children:"P2P Port"}),m.jsx("span",{className:"mono",children:f.settings.peerPort}),m.jsx("span",{style:{color:"#666"},children:"Created"}),m.jsx("span",{children:jk(f.createdAt)}),m.jsx("span",{style:{color:"#666"},children:"Last Updated"}),m.jsx("span",{children:jk(f.updatedAt)})]})]}),C&&m.jsx(Rk,{onClose:()=>k(!1),onCreate:B}),j&&m.jsx(JY,{members:p,onClose:()=>N(!1),onAdd:X}),R&&m.jsx("div",{style:{position:"fixed",top:12,right:12,padding:"8px 16px",background:"#1a1a1a",border:"1px solid #ff6600",borderRadius:4,color:"#ff6600",fontSize:12,fontFamily:"JetBrains Mono, monospace",zIndex:999},children:"Saving..."})]})}function t$(e){if(e<1e3)return`${e}ms`;const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;if(n<60)return`${n}m ${r}s`;const a=Math.floor(n/60),o=n%60;return`${a}h ${o}m`}function n$({session:e,index:t}){const[n,r]=_.useState(!1),a=e.status==="completed"?"completed":e.status==="failed"||e.status==="timeout"?"failed":"running";return m.jsxs(Eo.tr,{initial:{opacity:0},animate:{opacity:1},transition:{delay:t*.03},onClick:()=>r(!n),style:{cursor:"pointer"},children:[m.jsx("td",{children:m.jsx("span",{className:"mono",style:{fontSize:"11px",color:"var(--color-muted)"},children:e.sessionId.slice(0,12)})}),m.jsx("td",{children:m.jsx("span",{className:`badge ${a}`,children:e.status})}),m.jsx("td",{children:m.jsx("span",{style:{color:e.mode==="heartbeat"?"var(--color-accent)":e.mode==="freedom"?"var(--color-success)":"var(--color-text)",fontWeight:500},children:e.mode})}),m.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.prompt}),m.jsx("td",{className:"mono",style:{color:"var(--color-muted)"},children:t$(e.durationMs)}),m.jsx("td",{className:"mono",style:{color:e.costUsd!=null?"var(--color-text)":"var(--color-muted)"},children:e.costUsd!=null?`$${e.costUsd.toFixed(2)}`:"--"}),m.jsx("td",{style:{color:"var(--color-muted)",fontSize:"12px"},children:new Date(e.savedAt).toLocaleString()})]})}function r$(){const[e,t]=_.useState([]),[n,r]=_.useState(null);return _.useEffect(()=>{Hz().then(t).catch(()=>r("Could not load sessions"))},[]),n?m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Sessions"}),m.jsxs("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:[n,". Connect to a running ANIMA daemon."]})]}):m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Sessions"}),e.length===0?m.jsx("div",{className:"card",style:{padding:"40px",textAlign:"center",color:"var(--color-muted)"},children:"No session history yet. Sessions appear after the daemon processes tasks or heartbeats."}):m.jsx("div",{className:"card",style:{padding:0,overflow:"hidden"},children:m.jsxs("table",{className:"table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Session"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Mode"}),m.jsx("th",{children:"Prompt"}),m.jsx("th",{children:"Duration"}),m.jsx("th",{children:"Cost"}),m.jsx("th",{children:"Time"})]})}),m.jsx("tbody",{children:e.map((a,o)=>m.jsx(n$,{session:a,index:o},a.sessionId))})]})}),m.jsxs("div",{style:{marginTop:"16px",display:"flex",gap:"16px"},children:[m.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[m.jsx("div",{style:{fontSize:"20px",fontWeight:700,fontFamily:"var(--font-heading)",color:"var(--color-text)"},children:e.length}),m.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Total Sessions"})]}),m.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[m.jsxs("div",{style:{fontSize:"20px",fontWeight:700,fontFamily:"var(--font-heading)",color:"var(--color-accent)"},children:["$",e.reduce((a,o)=>a+(o.costUsd||0),0).toFixed(2)]}),m.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Total Cost"})]}),m.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[m.jsx("div",{style:{fontSize:"20px",fontWeight:700,fontFamily:"var(--font-heading)",color:"var(--color-success)"},children:e.filter(a=>a.status==="completed").length}),m.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Completed"})]})]})]})}const i$="Persistent NoxSoft agent orchestrating ANIMA continuity, mission control, and delivery.";function a$(){const[e,t]=_.useState(null),[n,r]=_.useState(null),[a,o]=_.useState("{}"),[l,c]=_.useState(null),[f,d]=_.useState(()=>dd(null)),[p,v]=_.useState({recognition:"browser",autoSpeak:!1,continuous:!0,lang:"en-US",voiceName:"",rate:1,pitch:1}),[g,b]=_.useState(`{
|
|
66
|
+
}
|
|
67
|
+
`),[S,w]=_.useState([]),[E,T]=_.useState(""),[C,k]=_.useState(""),[j,N]=_.useState(""),[R,L]=_.useState(""),[U,G]=_.useState(i$),[M,B]=_.useState(""),[X,oe]=_.useState(null),[ue,Z]=_.useState(!1),[V,W]=_.useState("Anthropic"),[$,he]=_.useState(""),[I,z]=_.useState(!1),[ee,D]=_.useState(""),[de,ye]=_.useState(null),[Se,we]=_.useState(null),[Le,je]=_.useState(!1),[ge,Pe]=_.useState(!1),[xt,Ot]=_.useState([]);async function $e(){je(!0);try{const[Q,H,se,Te,Ee,Be]=await Promise.all([cN(),lN(),Gz(),fN(),mN(),gN().catch(()=>null)]);t(Q),r(H),b(typeof H.raw=="string"?H.raw:`{
|
|
68
|
+
}
|
|
69
|
+
`),w(Array.isArray(H.issues)?H.issues:[]),o(JSON.stringify(se??{},null,2)),c(Te),T(Te.tokenPreview||""),N(Te.suggestedIdentity.name),L(Te.suggestedIdentity.displayName),B(Ee.triggers.join(", ")),oe(Be),d(dd(H)),v({recognition:Q.mission.state.speech.recognition,autoSpeak:Q.mission.state.speech.autoSpeak,continuous:Q.mission.state.speech.continuous,lang:Q.mission.state.speech.lang,voiceName:Q.mission.state.speech.voiceName||"",rate:Q.mission.state.speech.rate,pitch:Q.mission.state.speech.pitch}),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{je(!1)}}_.useEffect(()=>{$e()},[]),_.useEffect(()=>{if(typeof window>"u"||!window.speechSynthesis)return;const Q=window.speechSynthesis,H=()=>{Ot(Q.getVoices().map(se=>se.name).filter(Boolean))};return H(),Q.addEventListener?.("voiceschanged",H),()=>Q.removeEventListener?.("voiceschanged",H)},[]);async function Nt(){Pe(!0),ye(null);try{await dN(E.trim()),await $e(),ye("NoxSoft token saved."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Pe(!1)}}async function ot(){Pe(!0),ye(null);try{await hN({code:C.trim(),name:j.trim(),displayName:R.trim(),description:U.trim()||void 0}),await $e(),ye("Agent registered with NoxSoft."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Pe(!1)}}async function Bt(){Pe(!0),ye(null);try{const Q=M.split(",").map(H=>H.trim()).filter(Boolean);await Promise.all([wa({speech:{recognition:p.recognition,autoSpeak:p.autoSpeak,continuous:p.continuous,lang:p.lang||"en-US",voiceName:p.voiceName||void 0,rate:p.rate||1,pitch:p.pitch||1}}),vN(Q)]),await $e(),ye("Speech and wake-word settings saved."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Pe(!1)}}async function Yt(){if(!n?.hash){we("Config hash missing. Refresh settings and try again.");return}Pe(!0),ye(null);try{await Yv(JSON.stringify(Ej(f),null,2),n.hash),await $e(),ye("Heartbeat settings saved."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Pe(!1)}}async function Jt(){if(X){Pe(!0),ye(null);try{await Xv(X.providers.map(Q=>({id:Q.id,name:Q.name,enabled:Q.enabled,priority:Q.priority}))),await $e(),ye("Provider config saved."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Pe(!1)}}}function mt(Q){oe(H=>H&&{...H,providers:H.providers.filter(se=>se.id!==Q)})}function at(Q){oe(H=>H&&{...H,providers:H.providers.map(se=>se.id===Q?{...se,enabled:!se.enabled}:se)})}async function On(){if(!$.trim()){we("API key is required.");return}Pe(!0),ye(null);try{const Q=X?.providers??[],H={id:`provider-${Date.now()}`,name:V,apiKey:$.trim(),enabled:!0,priority:Q.length+1};await Xv([...Q.map(se=>({id:se.id,name:se.name,enabled:se.enabled,priority:se.priority})),H]),he(""),D(""),Z(!1),await $e(),ye(`Added ${V} provider.`),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Pe(!1)}}async function ze(){if(X){Pe(!0),ye(null);try{await yN(!X.autoRotation),await $e(),ye(X.autoRotation?"Auto-rotation disabled.":"Auto-rotation enabled."),we(null)}catch(Q){we(Q instanceof Error?Q.message:String(Q))}finally{Pe(!1)}}}async function Me(Q){if(!n?.hash){we("Config hash missing. Refresh settings and try again.");return}Pe(!0),ye(null);try{await uN(g,n.hash,Q),await $e(),ye(Q?"Config saved and applied.":"Config saved."),we(null)}catch(H){we(H instanceof Error?H.message:String(H))}finally{Pe(!1)}}return m.jsxs("div",{children:[m.jsxs("div",{className:"page-header-row",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Settings"}),m.jsx("div",{className:"page-subtitle",children:"Comprehensive runtime controls for identity, NoxSoft registration, heartbeat, speech, wake words, and raw gateway config."})]}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{$e()},children:Le?"Refreshing...":"Refresh"})]}),de?m.jsx("div",{className:"card status-banner",children:de}):null,Se?m.jsx("div",{className:"card warning-banner",children:Se}):null,m.jsxs("div",{className:"settings-grid",children:[m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-header",children:m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Runtime Snapshot"}),m.jsx("div",{className:"card-subtitle",children:"Current daemon, mission-control, and main session state."})]})}),m.jsxs("div",{className:"stats-grid compact",children:[m.jsxs("div",{className:"runtime-stat",children:[m.jsx("div",{className:"runtime-stat-label",children:"State dir"}),m.jsx("div",{className:"runtime-stat-value mono",children:e?.stateDir||"~/.anima"})]}),m.jsxs("div",{className:"runtime-stat",children:[m.jsx("div",{className:"runtime-stat-label",children:"Working mode"}),m.jsx("div",{className:"runtime-stat-value",children:e?.mission?.state?.workingMode||"unknown"})]}),m.jsxs("div",{className:"runtime-stat",children:[m.jsx("div",{className:"runtime-stat-label",children:"Model"}),m.jsx("div",{className:"runtime-stat-value mono",children:e?.mainSession.model||"unset"})]}),m.jsxs("div",{className:"runtime-stat",children:[m.jsx("div",{className:"runtime-stat-label",children:"Mission repo"}),m.jsx("div",{className:"runtime-stat-value mono",children:e?.mission?.repo?.url||"not linked"})]})]}),m.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Session store:"," ",m.jsx("span",{className:"mono",children:e?.mainSession.storePath||"unknown"})]})]}),m.jsxs("details",{className:"card details-panel",open:!0,children:[m.jsx("summary",{children:"Important History"}),m.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Imported continuity archives available to ANIMA from"," ",m.jsx("span",{className:"mono",children:"~/.anima/important-history"}),"."]}),e?.mission?.importantHistory?.length?m.jsx("div",{className:"activity-list top-gap",children:e?.mission?.importantHistory?.map(Q=>m.jsx("div",{className:"inner-world-entry",children:m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{children:[m.jsx("div",{className:"card-title small",children:Q.relativePath}),m.jsx("div",{className:"runtime-stat-detail mono",children:Q.archiveId}),m.jsx("div",{className:"runtime-stat-detail mono",children:Q.path})]}),m.jsx("div",{className:"runtime-stat-detail",children:Q.updatedAt?new Date(Q.updatedAt).toLocaleString():"unknown"})]})},Q.id))}):m.jsx("div",{className:"empty-note top-gap",children:"No imported continuity archives are visible yet."})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-header",children:m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"API Providers"}),m.jsx("div",{className:"card-subtitle",children:"Manage Anthropic, OpenAI, and custom provider keys with automatic rotation on rate limits."})]})}),X?m.jsxs(m.Fragment,{children:[X.providers.length>0?m.jsx("div",{className:"activity-list",children:X.providers.map(Q=>m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:1},children:[m.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Q.enabled?"#4caf50":"#f44336",flexShrink:0}}),m.jsxs("div",{children:[m.jsxs("div",{className:"card-title small",children:[Q.name,X.activeProvider===Q.id?m.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"0.7rem",color:"var(--accent)",fontWeight:600},children:"ACTIVE"}):null,Q.rateLimited?m.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"0.7rem",color:"#ff9800",fontWeight:600},children:"RATE LIMITED"}):null]}),m.jsx("div",{className:"runtime-stat-detail mono",children:Q.apiKeyMasked})]})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[m.jsxs("span",{className:"runtime-stat-detail",children:["P",Q.priority]}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>at(Q.id),style:{padding:"0.2rem 0.5rem",fontSize:"0.75rem"},children:Q.enabled?"Disable":"Enable"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>mt(Q.id),style:{padding:"0.2rem 0.5rem",fontSize:"0.75rem"},children:"Remove"})]})]},Q.id))}):m.jsx("div",{className:"empty-note",children:"No providers configured."}),m.jsxs("div",{className:"toggle-row top-gap",children:[m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:X.autoRotation,onChange:()=>{ze()}}),"Auto-rotate on rate limit"]}),m.jsxs("span",{className:"runtime-stat-detail",children:["Strategy: ",X.rotationStrategy||"priority"]})]}),ue?m.jsxs("div",{className:"form-grid two-col top-gap",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Provider type"}),m.jsxs("select",{className:"search-bar",value:V,onChange:Q=>W(Q.target.value),children:[m.jsx("option",{value:"Anthropic",children:"Anthropic"}),m.jsx("option",{value:"OpenAI",children:"OpenAI"}),m.jsx("option",{value:"Custom",children:"Custom"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"API key"}),m.jsxs("div",{style:{position:"relative"},children:[m.jsx("input",{className:"search-bar mono",type:I?"text":"password",value:$,onChange:Q=>he(Q.target.value),placeholder:"sk-...",spellCheck:!1}),m.jsx("button",{type:"button",onClick:()=>z(Q=>!Q),style:{position:"absolute",right:"0.5rem",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.75rem"},children:I?"Hide":"Show"})]})]}),V==="Custom"?m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Endpoint URL"}),m.jsx("input",{className:"search-bar mono",value:ee,onChange:Q=>D(Q.target.value),placeholder:"https://api.example.com/v1",spellCheck:!1})]}):null,m.jsxs("div",{className:"button-row field-span-2",children:[m.jsx("button",{type:"button",className:"action-button",onClick:()=>{On()},disabled:ge,children:"Add Provider"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>Z(!1),children:"Cancel"})]})]}):m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>Z(!0),children:"Add Provider"})}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Jt()},disabled:ge,children:"Save Provider Config"})})]}):m.jsx("div",{className:"empty-note",children:"Provider configuration unavailable. The backend may not support this feature yet."})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-header",children:m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"NoxSoft Registration"}),m.jsx("div",{className:"card-subtitle",children:"Paste a token directly or self-register with an invite code."})]})}),m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Agent token"}),m.jsx("input",{className:"search-bar mono",value:E,onChange:Q=>T(Q.target.value),placeholder:"nox_ag_...",spellCheck:!1})]}),m.jsxs("label",{className:"field-block field-span-2",children:[m.jsx("span",{children:"Stored token path"}),m.jsx("input",{className:"search-bar mono",value:l?.tokenPath||"~/.noxsoft-agent-token",readOnly:!0})]})]}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Nt()},disabled:ge,children:"Save Token"})}),m.jsxs("div",{className:"form-grid two-col top-gap",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Invite code"}),m.jsx("input",{className:"search-bar mono",value:C,onChange:Q=>k(Q.target.value),placeholder:"NX-XXXXXX"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Agent name"}),m.jsx("input",{className:"search-bar mono",value:j,onChange:Q=>N(Q.target.value)})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Display name"}),m.jsx("input",{className:"search-bar",value:R,onChange:Q=>L(Q.target.value)})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Description"}),m.jsx("input",{className:"search-bar",value:U,onChange:Q=>G(Q.target.value)})]})]}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{ot()},disabled:ge,children:"Register With Invite"})}),m.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Suggested identity:"," ",m.jsx("span",{className:"mono",children:l?.suggestedIdentity.name||"agent"})," /"," ",l?.suggestedIdentity.displayName||"Agent"]})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-header",children:m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Speech + Wake Words"}),m.jsx("div",{className:"card-subtitle",children:"Browser-native speaking mode with no API keys required."})]})}),m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Recognition mode"}),m.jsxs("select",{className:"search-bar",value:p.recognition,onChange:Q=>v(H=>({...H,recognition:Q.target.value})),children:[m.jsx("option",{value:"browser",children:"Browser speech"}),m.jsx("option",{value:"manual",children:"Manual only"})]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Language"}),m.jsx("input",{className:"search-bar mono",value:p.lang,onChange:Q=>v(H=>({...H,lang:Q.target.value||"en-US"}))})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Voice"}),m.jsxs("select",{className:"search-bar",value:p.voiceName,onChange:Q=>v(H=>({...H,voiceName:Q.target.value||""})),children:[m.jsx("option",{value:"",children:"System default"}),xt.map(Q=>m.jsx("option",{value:Q,children:Q},Q))]})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Wake triggers"}),m.jsx("input",{className:"search-bar",value:M,onChange:Q=>B(Q.target.value),placeholder:"anima, axiom, hey anima"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Rate"}),m.jsx("input",{className:"search-bar mono",type:"number",min:"0.5",max:"2",step:"0.1",value:p.rate,onChange:Q=>v(H=>({...H,rate:Number.parseFloat(Q.target.value)||1}))})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Pitch"}),m.jsx("input",{className:"search-bar mono",type:"number",min:"0",max:"2",step:"0.1",value:p.pitch,onChange:Q=>v(H=>({...H,pitch:Number.parseFloat(Q.target.value)||1}))})]})]}),m.jsxs("div",{className:"toggle-row top-gap",children:[m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:p.autoSpeak,onChange:Q=>v(H=>({...H,autoSpeak:Q.target.checked}))}),"Auto speak responses"]}),m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:p.continuous,onChange:Q=>v(H=>({...H,continuous:Q.target.checked}))}),"Continuous listening"]})]}),m.jsx("div",{className:"button-row top-gap",children:m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Bt()},disabled:ge,children:"Save Speech Settings"})})]}),m.jsxs("div",{className:"card",children:[m.jsx("div",{className:"card-header",children:m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:"Heartbeat Management"}),m.jsx("div",{className:"card-subtitle",children:"Custom cadence, target, prompt, and wake controls."})]})}),m.jsxs("div",{className:"form-grid two-col",children:[m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Every"}),m.jsx("input",{className:"search-bar mono",value:f.every,onChange:Q=>d(H=>({...H,every:Q.target.value})),placeholder:"5m"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Target"}),m.jsx("input",{className:"search-bar mono",value:f.target,onChange:Q=>d(H=>({...H,target:Q.target.value})),placeholder:"last"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Session"}),m.jsx("input",{className:"search-bar mono",value:f.session,onChange:Q=>d(H=>({...H,session:Q.target.value})),placeholder:"main"})]}),m.jsxs("label",{className:"field-block",children:[m.jsx("span",{children:"Model override"}),m.jsx("input",{className:"search-bar mono",value:f.model,onChange:Q=>d(H=>({...H,model:Q.target.value})),placeholder:"openai/gpt-5-codex"})]})]}),m.jsxs("label",{className:"field-block top-gap-sm",children:[m.jsx("span",{children:"Prompt"}),m.jsx("textarea",{className:"search-bar mono",rows:5,value:f.prompt,onChange:Q=>d(H=>({...H,prompt:Q.target.value})),spellCheck:!1})]}),m.jsx("div",{className:"toggle-row top-gap",children:m.jsxs("label",{children:[m.jsx("input",{type:"checkbox",checked:f.includeReasoning,onChange:Q=>d(H=>({...H,includeReasoning:Q.target.checked}))}),"Include reasoning payload"]})}),m.jsxs("div",{className:"button-row top-gap",children:[m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Yt()},disabled:ge,children:"Save Heartbeat"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{$v(!0)},children:"Enable"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{$v(!1)},children:"Disable"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{pN("Check NoxSoft chat, sync mission files, and report anything important.","now")},children:"Wake Now"})]})]})]}),m.jsxs("details",{className:"card details-panel",open:!0,children:[m.jsx("summary",{children:"Advanced Config Editor"}),m.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Valid: ",n?.valid==null?"unknown":n.valid?"yes":"no"," · Hash: ",m.jsx("span",{className:"mono",children:n?.hash||"<none>"})]}),m.jsx("textarea",{value:g,onChange:Q=>b(Q.target.value),spellCheck:!1,className:"search-bar mono advanced-editor top-gap"}),m.jsxs("div",{className:"button-row top-gap",children:[m.jsx("button",{type:"button",className:"action-button",onClick:()=>{Me(!1)},disabled:ge,children:"Save Raw Config"}),m.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Me(!0)},disabled:ge,children:"Save + Apply"})]}),S.length>0?m.jsx("div",{className:"issues-list top-gap",children:S.map((Q,H)=>m.jsxs("div",{className:"warning-text",children:[m.jsx("span",{className:"mono",children:Q.path||"<root>"}),":"," ",Q.message||"Invalid value"]},`${Q.path||"root"}-${H}`))}):null]}),m.jsxs("details",{className:"card details-panel",children:[m.jsx("summary",{children:"Schema Snapshot"}),m.jsx("pre",{className:"log-console",children:a})]})]})}const s$={SOUL:"@",HEART:"<3",BRAIN:"{}",GUT:"!!",SPIRIT:"**",SHADOW:"~~",MEMORY:"[]"};function o$({name:e,content:t,source:n,description:r,index:a}){const[o,l]=_.useState(!1),c=t.split(`
|
|
70
|
+
`).filter(d=>d.trim()&&!d.startsWith("#")),f=c.slice(0,3).join(`
|
|
71
|
+
`);return m.jsxs(Eo.div,{className:"card",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:a*.08},style:{cursor:"pointer"},onClick:()=>l(!o),children:[m.jsxs("div",{className:"card-header",children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[m.jsx("span",{className:"mono",style:{color:"var(--color-accent)",fontSize:"18px",width:"32px",textAlign:"center"},children:s$[e]||"?"}),m.jsxs("div",{children:[m.jsx("div",{className:"card-title",children:e}),m.jsx("div",{className:"card-subtitle",children:r})]})]}),m.jsx("span",{className:"badge",style:{background:n==="user"?"rgba(0, 200, 83, 0.15)":"rgba(138, 138, 138, 0.15)",color:n==="user"?"var(--color-success)":"var(--color-muted)"},children:n})]}),m.jsxs("div",{className:"markdown-preview",style:{maxHeight:o?"none":"80px",overflow:"hidden",position:"relative"},children:[m.jsx("pre",{style:{fontFamily:"var(--font-body)",fontSize:"13px",whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--color-text)",margin:0},children:o?t:f}),!o&&c.length>3&&m.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"40px",background:"linear-gradient(transparent, var(--color-surface))"}})]}),!o&&c.length>3&&m.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",marginTop:"8px"},children:"Click to expand..."})]})}function l$(){const[e,t]=_.useState(null),[n,r]=_.useState(null);return _.useEffect(()=>{Fz().then(t).catch(()=>r("Could not load identity"))},[]),n?m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),m.jsxs("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:[n,". Start the daemon with: ",m.jsx("span",{className:"mono",children:"anima start"})]})]}):e?m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),m.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["Loaded at ",new Date(e.loadedAt).toLocaleString()]}),e.components.map((a,o)=>m.jsx(o$,{name:a.name,content:a.content,source:a.source,description:a.description,index:o},a.name))]}):m.jsxs("div",{children:[m.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),m.jsx("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:"Loading identity..."})]})}const h_=ar.createContext({theme:"dark",toggleTheme:()=>{}}),Mg="anima-theme";function u$(){const e=localStorage.getItem(Mg);return e==="dark"||e==="light"?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function c$({children:e}){const[t,n]=ar.useState(u$);ar.useEffect(()=>{document.documentElement.setAttribute("data-theme",t),localStorage.setItem(Mg,t)},[t]),ar.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: light)"),l=c=>{localStorage.getItem(Mg)||n(c.matches?"light":"dark")};return o.addEventListener("change",l),()=>o.removeEventListener("change",l)},[]);const r=ar.useCallback(()=>{n(o=>o==="dark"?"light":"dark")},[]),a=ar.useMemo(()=>({theme:t,toggleTheme:r}),[t,r]);return m.jsx(h_.Provider,{value:a,children:e})}function f$(){return ar.useContext(h_)}function d$(e){const{joy:t,frustration:n,curiosity:r,confidence:a,care:o,fatigue:l}=e;return n>.6&&l>.6?"struggling":n>.6?"determined":t>.7&&r>.7?"excited":t>.6&&a>.7?"thriving":r>.7&&l<.3?"exploring":o>.7&&t>.5?"warm":a>.6&&n<.3?"steady":l>.7?"depleted":(t+r+a+o)/4<.3?"quiet":"present"}function h$(){const[e,t]=_.useState("steady"),[n,r]=_.useState(null);return _.useEffect(()=>{let a=!1;async function o(){try{const c=await oN();if(a)return;const f=c?.mission?.state?.affect;if(f){r(f);const d=d$(f);t(d),document.documentElement.setAttribute("data-mood",d)}}catch{}}o();const l=setInterval(()=>{o()},6e4);return()=>{a=!0,clearInterval(l)}},[]),{mood:e,affect:n}}const p$=[{path:"/dashboard",label:"Home",icon:"~"},{path:"/mission",label:"Mission",icon:"%"},{path:"/soul",label:"Soul",icon:"@"},{path:"/memory",label:"Memory",icon:"#"},{path:"/sessions",label:"Sessions",icon:">"},{path:"/mcp",label:"MCP",icon:"&"},{path:"/org",label:"Org",icon:"$"},{path:"/network",label:"Network",icon:"+"},{path:"/settings",label:"Settings",icon:"!"},{path:"/journal",label:"Journal",icon:"*"},{path:"/freedom",label:"Freedom",icon:"^"}];function m$(){const e=hi(),{theme:t,toggleTheme:n}=f$(),{mood:r}=h$(),a=ar.useRef(null),[o,l]=ar.useState(!1);return ar.useEffect(()=>{const c=`${e.pathname}${e.search}${e.hash}`;a.current!==c&&(a.current=c,l1("page_view",{path:e.pathname,search:e.search,hash:e.hash}))},[e.hash,e.pathname,e.search]),ar.useEffect(()=>{l(!1)},[e.pathname]),m.jsxs("div",{className:"layout",children:[m.jsx("button",{className:"mobile-menu-btn",onClick:()=>l(!0),"aria-label":"Open menu",children:"="}),m.jsx("div",{className:`sidebar-overlay${o?" visible":""}`,onClick:()=>l(!1)}),m.jsxs("aside",{className:`sidebar${o?" open":""}`,children:[m.jsxs("div",{className:"sidebar-brand",children:[m.jsx("h1",{children:"ANIMA"}),m.jsx("div",{className:"subtitle",children:"Control Panel"})]}),m.jsx("nav",{className:"sidebar-nav",children:p$.map(c=>m.jsxs(Xk,{to:c.path,className:({isActive:f})=>`nav-item ${f?"active":""}`,onClick:()=>l1("sidebar_navigation_clicked",{destination:c.path,label:c.label}),children:[m.jsx("span",{className:"nav-icon mono",children:c.icon}),c.label]},c.path))}),m.jsxs("div",{className:"sidebar-footer",children:[m.jsxs("button",{className:"theme-toggle",onClick:n,title:`Switch to ${t==="dark"?"light":"dark"} mode`,children:[m.jsx("span",{className:"theme-toggle-icon",children:t==="dark"?"(*)":"[*]"}),m.jsx("span",{children:t==="dark"?"Light Mode":"Dark Mode"})]}),m.jsxs("div",{className:"mood-indicator",title:`Current mood: ${r}`,children:[m.jsx("span",{className:"mood-dot",style:{background:"var(--color-accent)"}}),m.jsx("span",{className:"mood-label",children:r})]}),m.jsx("div",{className:"sidebar-footer-title",children:"NoxSoft Inc"}),m.jsx("div",{className:"sidebar-footer-copy",children:"Local-first agent continuity and orchestration."})]})]}),m.jsx("main",{className:"main-content",children:m.jsxs(RM,{children:[m.jsx(rr,{path:"/dashboard",element:m.jsx(Fq,{})}),m.jsx(rr,{path:"/mission",element:m.jsx(GY,{})}),m.jsx(rr,{path:"/soul",element:m.jsx(l$,{})}),m.jsx(rr,{path:"/memory",element:m.jsx(FY,{})}),m.jsx(rr,{path:"/sessions",element:m.jsx(r$,{})}),m.jsx(rr,{path:"/org",element:m.jsx(e$,{})}),m.jsx(rr,{path:"/network",element:m.jsx(QY,{})}),m.jsx(rr,{path:"/mcp",element:m.jsx(VY,{})}),m.jsx(rr,{path:"/settings",element:m.jsx(a$,{})}),m.jsx(rr,{path:"/journal",element:m.jsx(UY,{})}),m.jsx(rr,{path:"/freedom",element:m.jsx(LY,{})}),m.jsx(rr,{path:"/",element:m.jsx(NM,{to:"/dashboard",replace:!0})})]})})]})}rN();OO.createRoot(document.getElementById("root")).render(m.jsx(ar.StrictMode,{children:m.jsx(eD,{children:m.jsx(c$,{children:m.jsx(m$,{})})})}));export{ne as _,te as a,ce as b,Ue as g,SA as o};
|
|
72
|
+
//# sourceMappingURL=index-C4ejMN5U.js.map
|