@noxsoft/anima 7.0.0 → 7.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/{accounts-COxGcLGB.js → accounts-BDDwy6Zf.js} +3 -3
  3. package/dist/{accounts-DIES085e.js → accounts-BNxfCMUW.js} +5 -5
  4. package/dist/{accounts-B_2nt5Cd.js → accounts-BzjBXZYp.js} +2 -2
  5. package/dist/{accounts-TUsfghIW.js → accounts-PpT_kved.js} +11 -11
  6. package/dist/{acp-cli-CWgqDQQH.js → acp-cli-B4F3SojX.js} +12 -12
  7. package/dist/{acp-cli-D0wfP8-l.js → acp-cli-CtTTCUan.js} +15 -15
  8. package/dist/{active-listener-BKtsWhsb.js → active-listener-C3NdbMQD.js} +4 -4
  9. package/dist/{active-listener-gGCoq55D.js → active-listener-D78ohfOc.js} +6 -6
  10. package/dist/{active-listener-D2r8IO7g.js → active-listener-Z1MbDSH8.js} +4 -4
  11. package/dist/{agent-paths-niQrLbGc.js → agent-paths-DRAU6-8h.js} +2 -2
  12. package/dist/{agent-scope-Dm8IL1Ks.js → agent-scope-B1FoYHfj.js} +3 -3
  13. package/dist/{agent-scope-CxBzAozu.js → agent-scope-CENGF2NR.js} +2 -2
  14. package/dist/{agent-scope-CXxC8FFX.js → agent-scope-DQ0N_hof.js} +2 -2
  15. package/dist/{agent-scope-ByIGrCTT.js → agent-scope-DpgOQfBp.js} +2 -2
  16. package/dist/{agent-DuW0onwk.js → agent-viQL5eva.js} +18 -18
  17. package/dist/{agent-BoAAHGEA.js → agent-xPFmA8jO.js} +14 -14
  18. package/dist/{agents-BUXkSDns.js → agents-Cf9QArEB.js} +20 -20
  19. package/dist/{agents.config-BR5JLtud.js → agents.config-DrViQjgD.js} +1 -1
  20. package/dist/{agents.config-Br4ULmK0.js → agents.config-sfN0WxRg.js} +1 -1
  21. package/dist/{anthropic-direct-runner-DizCei79.js → anthropic-direct-runner-BNiXWmel.js} +257 -21
  22. package/dist/{anthropic-direct-runner-OjcTAH6g.js → anthropic-direct-runner-BgFOZS8B.js} +257 -21
  23. package/dist/{audit-DDz7UOIx.js → audit-CupURkPI.js} +15 -15
  24. package/dist/{audit-B05W5ckN.js → audit-jddM3B16.js} +13 -13
  25. package/dist/{auth-Cp__MMeO.js → auth-Bw3NUKcg.js} +2 -2
  26. package/dist/{auth-DsC5pZ_0.js → auth-CuGlMw6p.js} +2 -2
  27. package/dist/{auth-choice-B1iGnjuE.js → auth-choice-D3Gi-WXq.js} +7 -7
  28. package/dist/{auth-choice-HF9x6xk2.js → auth-choice-DmkqIhe6.js} +7 -7
  29. package/dist/{auth-health-Cc8-vy8y.js → auth-health-CIbz_YRs.js} +1 -1
  30. package/dist/{auth-health-Dhr8p2SD.js → auth-health-CPmz2ZaM.js} +1 -1
  31. package/dist/{auth-profiles-DKu7ZUzl.js → auth-profiles-D0T20ZZX.js} +4 -4
  32. package/dist/{auth-profiles-C-LuhW6c.js → auth-profiles-XI2YBb-w.js} +3 -3
  33. package/dist/{auth-profiles-Brxz2ojJ.js → auth-profiles-fjGcjhZ4.js} +5 -5
  34. package/dist/{auth-profiles-DtWUl1-k.js → auth-profiles-jK6n3-Cc.js} +4 -4
  35. package/dist/{auth-store-Bd0GoqEL.js → auth-store-B4pR_KvR.js} +3 -3
  36. package/dist/{auth-store-BEfSfCbW.js → auth-store-ChpmVcla.js} +3 -3
  37. package/dist/{auth-store-Jvgz2_l1.js → auth-store-CqgKZB5l.js} +2 -2
  38. package/dist/{auth-store-BpYI9t_y.js → auth-store-po566wly.js} +3 -3
  39. package/dist/{banner-Dpa5d1If.js → banner-C_CFUih5.js} +2 -2
  40. package/dist/{bonjour-discovery-D3HFfTyG.js → bonjour-discovery-B8gxGE91.js} +2 -2
  41. package/dist/{bonjour-discovery-Co-b97Dz.js → bonjour-discovery-CZGDX9Ac.js} +2 -2
  42. package/dist/build-info.json +3 -3
  43. package/dist/bundled/boot-md/handler.js +23 -23
  44. package/dist/bundled/bootstrap-extra-files/handler.js +3 -3
  45. package/dist/bundled/session-memory/handler.js +22 -22
  46. package/dist/{call-CDPbPDAr.js → call-Bn9iKzhX.js} +4 -4
  47. package/dist/{call-B4lhqS6H.js → call-CPfxv8yg.js} +5 -5
  48. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  49. package/dist/{catalog-CsXv59Tq.js → catalog-BqTvQqiq.js} +2 -2
  50. package/dist/{catalog-B-TAbJ2o.js → catalog-yCaNFdQz.js} +2 -2
  51. package/dist/{channel-web-C5mzsaa3.js → channel-web-CfKNWfmp.js} +14 -14
  52. package/dist/{channels-status-issues-WkG3Tmxk.js → channels-status-issues-4XxYhQ8S.js} +4 -4
  53. package/dist/{channels-status-issues-CklLFAsD.js → channels-status-issues-BhtWH-p2.js} +4 -4
  54. package/dist/{chrome-CmxIwwsr.js → chrome-CN17GbZN.js} +2 -2
  55. package/dist/{chrome-BaU-H9m7.js → chrome-CVb9kRv_.js} +3 -3
  56. package/dist/{chrome-DLUBPBPz.js → chrome-D1Jm1Bdq.js} +9 -9
  57. package/dist/{chrome-B8EnYGj1.js → chrome-Nb2mFwWK.js} +2 -2
  58. package/dist/{chunk-B4Kx-ocg.js → chunk-B5s6o9xI.js} +3 -3
  59. package/dist/{chunk-DJXDX69U.js → chunk-CTS4rIMF.js} +3 -3
  60. package/dist/{chunk-CFSle8n5.js → chunk-DXTTGmeb.js} +1 -1
  61. package/dist/{chunk-Cy0Bj0F3.js → chunk-isZGJq82.js} +1 -1
  62. package/dist/{clack-prompter-0JW5kry0.js → clack-prompter-ChmRN__Q.js} +5 -5
  63. package/dist/{clack-prompter-fZSmnHda.js → clack-prompter-CpLhDhPM.js} +5 -5
  64. package/dist/cli/daemon-cli.js +1 -1
  65. package/dist/{cli-Cuq4bIg4.js → cli-BzTZ8Gnp.js} +46 -46
  66. package/dist/{cli-X9ikywQ3.js → cli-DLYU8BVw.js} +47 -47
  67. package/dist/{client-CfLiulzK.js → client-DNDzi0CF.js} +3 -3
  68. package/dist/{client-BWkoTfOH.js → client-DOTb2PN6.js} +2 -2
  69. package/dist/{command-format-kLw3YIIu.js → command-format-JgYolX96.js} +1 -1
  70. package/dist/{command-registry-9V4uqrBV.js → command-registry-BQiM7sYY.js} +14 -14
  71. package/dist/{commands-Mekaw9WG.js → commands-CymFClS1.js} +2 -2
  72. package/dist/{common-DT_obM-k.js → common-C36MniDL.js} +2 -2
  73. package/dist/{common-Bf_TG87Y.js → common-Coq2knq6.js} +2 -2
  74. package/dist/{common-BCW6hLGI.js → common-c4ZysSLq.js} +2 -2
  75. package/dist/{common-CqIa2poH.js → common-fIXNXke2.js} +2 -2
  76. package/dist/{completion-cli-DNWDwhab.js → completion-cli-BP8IIlzX.js} +4 -4
  77. package/dist/{completion-cli-BtvcR-U5.js → completion-cli-DW87AQgF.js} +3 -3
  78. package/dist/{config-ZYN8tezd.js → config-C7s14LLE.js} +24 -6
  79. package/dist/{config-BrVuTQ8R.js → config-DmsfUvB0.js} +24 -6
  80. package/dist/{config-CweTwOtr.js → config-LS-6Xgqo.js} +25 -7
  81. package/dist/{config-DaD4FsAn.js → config-MZ5clMl4.js} +25 -7
  82. package/dist/config-cli-BAj5hoD-.js +15 -0
  83. package/dist/config-cli-C6WtFt5S.js +11 -0
  84. package/dist/{config-guard-C4b2dksv.js → config-guard-BAVhoqm4.js} +5 -5
  85. package/dist/{config-guard-CWhoBtB3.js → config-guard-Em1kJe5K.js} +19 -19
  86. package/dist/{configure-B2Mfnwy_.js → configure-CHPG13jf.js} +24 -24
  87. package/dist/{configure-SnvMHZPD.js → configure-Dd6zJb-q.js} +72 -72
  88. package/dist/{configure-ZWxixuRA.js → configure-DeLC66Op.js} +25 -25
  89. package/dist/{configure-lkozxQed.js → configure-i6y1krRa.js} +75 -75
  90. package/dist/{context-mdxDsO1v.js → context-C22AMgsc.js} +10 -2
  91. package/dist/{control-service-5YtMvm7D.js → control-service-BGnqY7vv.js} +5 -5
  92. package/dist/{control-service-3CI4vt1h.js → control-service-DxuB_IUw.js} +4 -4
  93. package/dist/control-ui/assets/{index-D4wqLVMN.js → index-XnQwXlLu.js} +2 -2
  94. package/dist/control-ui/assets/{index-D4wqLVMN.js.map → index-XnQwXlLu.js.map} +1 -1
  95. package/dist/control-ui/assets/index-tpHK2r2n.js +73 -0
  96. package/dist/control-ui/assets/index-tpHK2r2n.js.map +1 -0
  97. package/dist/control-ui/assets/{observers-B7MfWiIZ.js → observers-DqhQeBfm.js} +2 -2
  98. package/dist/control-ui/assets/{observers-B7MfWiIZ.js.map → observers-DqhQeBfm.js.map} +1 -1
  99. package/dist/control-ui/index.html +1 -1
  100. package/dist/{cron-cli-D9XrF-Gx.js → cron-cli-3VJy8n6n.js} +14 -14
  101. package/dist/{cron-cli-Cht6Itx6.js → cron-cli-C_B6qK9W.js} +16 -16
  102. package/dist/{daemon-cli-CrdPhSxr.js → daemon-cli-B0IaAuYH.js} +15 -15
  103. package/dist/{daemon-cli-9zrnYRjh.js → daemon-cli-BsY7ZPql.js} +17 -17
  104. package/dist/daemon-cli.js +19 -1
  105. package/dist/{daemon-runtime-BrUj88ZO.js → daemon-runtime-BoIX72LK.js} +2 -2
  106. package/dist/{daemon-runtime-DCqwraWR.js → daemon-runtime-DSPDxySK.js} +3 -3
  107. package/dist/{deliver-d-CaN0uL.js → deliver-BJ0JgwhN.js} +11 -11
  108. package/dist/{deliver-BKzX3YoN.js → deliver-BknvuSJz.js} +6 -6
  109. package/dist/{deliver-C1L5nO0K.js → deliver-D86kSZGn.js} +7 -7
  110. package/dist/{deliver-B-dPbUIs.js → deliver-bdH5itRb.js} +11 -11
  111. package/dist/{delivery-queue-BKQk1j0k.js → delivery-queue-B6Y3ea25.js} +1 -1
  112. package/dist/{deps-BKLIBKjK.js → deps-oUYlT5Sq.js} +1 -1
  113. package/dist/{diagnostics-BhSwKIcN.js → diagnostics-CXoISuYV.js} +1 -1
  114. package/dist/{diagnostics-Cu9pZAFn.js → diagnostics-aUz0rVDl.js} +1 -1
  115. package/dist/{dispatcher-BQQugU-7.js → dispatcher-DpEzmU7s.js} +2 -2
  116. package/dist/{dispatcher-DzwzLQRk.js → dispatcher-DwlzWX2u.js} +2 -2
  117. package/dist/{dns-cli-V2bo6vSt.js → dns-cli-D8tgv6zY.js} +10 -10
  118. package/dist/{dns-cli-C8KIX4P3.js → dns-cli-DawPrcXI.js} +12 -12
  119. package/dist/{docs-cli-D2cVJxjP.js → docs-cli-Bsx7Yd3w.js} +6 -6
  120. package/dist/{docs-cli-Bt-YV3xs.js → docs-cli-DnrE1Tqw.js} +7 -7
  121. package/dist/{doctor-D7kKyUVk.js → doctor-BNJ_edyo.js} +36 -36
  122. package/dist/{doctor-DmCnZ-jF.js → doctor-DY5SmosG.js} +38 -38
  123. package/dist/{doctor-completion-B9SBdMoR.js → doctor-completion-B6lgyLsC.js} +2 -2
  124. package/dist/{doctor-completion-BBvW4_J9.js → doctor-completion-mLt2Eo9P.js} +3 -3
  125. package/dist/{doctor-config-flow-Dxy7RIm0.js → doctor-config-flow-CvJDaN8t.js} +8 -8
  126. package/dist/{doctor-config-flow-Bgl0Cc20.js → doctor-config-flow-D7SJ61Ak.js} +6 -6
  127. package/dist/{engine-zmn3SOYa.js → engine-BDwYEVKi.js} +1 -1
  128. package/dist/{engine-DpbYPop7.js → engine-BrJ7eiEh.js} +2 -2
  129. package/dist/entry.js +18 -2
  130. package/dist/{env-DlTia1B4.js → env-ByZjwIJR.js} +1 -1
  131. package/dist/{exec-DUzVF5_D.js → exec-4nfFrGP7.js} +1 -1
  132. package/dist/{exec-BylR5qWS.js → exec-ChPERQB-.js} +1 -1
  133. package/dist/{exec-BtBJICHE.js → exec-CigQCGkt.js} +1 -1
  134. package/dist/{exec-C6tXfeqA.js → exec-Dn2S9A7x.js} +1 -1
  135. package/dist/{exec-approvals-cli-DYZVBnqS.js → exec-approvals-cli-DmdfF4o_.js} +17 -17
  136. package/dist/{exec-approvals-cli-CN2WeH7y.js → exec-approvals-cli-c5UsPAU1.js} +19 -19
  137. package/dist/extensionAPI.js +21 -21
  138. package/dist/{gateway-cli-iumkTohn.js → gateway-cli-C4FwPHzu.js} +95 -95
  139. package/dist/{gateway-cli-CEM1vBuk.js → gateway-cli-CkFzsHGb.js} +93 -93
  140. package/dist/{gateway-rpc-Cj_h2sVM.js → gateway-rpc-CgeNTQUV.js} +3 -3
  141. package/dist/{gateway-rpc-CnXMGsxp.js → gateway-rpc-DpVHyNFu.js} +3 -3
  142. package/dist/{gmail-setup-utils-BIXtKTpT.js → gmail-setup-utils-JWsjxDBV.js} +4 -4
  143. package/dist/{gmail-setup-utils-DaJoXV_3.js → gmail-setup-utils-lTV5KDPF.js} +3 -3
  144. package/dist/{health-Cndq9b7A.js → health-C6rAUaME.js} +13 -13
  145. package/dist/{health-B5N6_UOf.js → health-DrokrOLQ.js} +13 -13
  146. package/dist/{health-format-BLnFZCH_.js → health-format-CTOsgiTE.js} +2 -2
  147. package/dist/{health-format-D-JJ5_S4.js → health-format-CzNDrJ8Z.js} +2 -2
  148. package/dist/{heartbeat-visibility-BQL13ZBH.js → heartbeat-visibility-DZOi_4uV.js} +1 -1
  149. package/dist/{heartbeat-visibility-CwcYugaR.js → heartbeat-visibility-XbT4yJ3S.js} +1 -1
  150. package/dist/{help-format-ZKxl6UCb.js → help-format-D4k6gkpr.js} +1 -1
  151. package/dist/{help-format-Dt-I_Mls.js → help-format-DgCbU9Ow.js} +1 -1
  152. package/dist/{hooks-cli-DSlPBQSY.js → hooks-cli-CBDm7Rjw.js} +50 -50
  153. package/dist/{hooks-cli-BZcvdIwE.js → hooks-cli-DVNU2Cp_.js} +53 -53
  154. package/dist/{hooks-status-DdweuSIj.js → hooks-status-BQ7M6bIq.js} +3 -3
  155. package/dist/{hooks-status-DqfJDvYl.js → hooks-status-BlfmlpC0.js} +3 -3
  156. package/dist/{image-ops-Ct3GueyT.js → image-ops-flDr58qn.js} +2 -2
  157. package/dist/{image-ops-BdrMmiG4.js → image-ops-vj06APeW.js} +2 -2
  158. package/dist/index.js +62 -62
  159. package/dist/{installs-a4Vz_J08.js → installs-BeTulUkL.js} +4 -4
  160. package/dist/{installs-Bi6UipiE.js → installs-D1t93Dvw.js} +4 -4
  161. package/dist/{lifecycle-core-BTICG85s.js → lifecycle-core-DmxyMl5D.js} +5 -5
  162. package/dist/{lifecycle-core-B8PI1NZJ.js → lifecycle-core-OpMLwiRd.js} +3 -3
  163. package/dist/{links-DcilUrqq.js → links-NDZcSjct.js} +1 -1
  164. package/dist/{links-BjjDMNIq.js → links-RNygAKHu.js} +1 -1
  165. package/dist/llm-slug-generator.js +22 -22
  166. package/dist/{loader-C87TLS4J.js → loader-5Xm3Jxa-.js} +1 -1
  167. package/dist/{logging-Chc1Sj6N.js → logging-B0-OIfnO.js} +1 -1
  168. package/dist/{logging-_rCcBkls.js → logging-CX0bU2da.js} +2 -2
  169. package/dist/{login-DKkQ3Czu.js → login-BegD27g3.js} +5 -5
  170. package/dist/{login-MzVPMRxL.js → login-CSaeXIuW.js} +7 -7
  171. package/dist/{login-BTOKtSQN.js → login-WPS724ji.js} +5 -5
  172. package/dist/{login-qr-BGbHImRb.js → login-qr-BVzUWR4o.js} +8 -8
  173. package/dist/{login-qr-CxRI-tE2.js → login-qr-C0eNn9SV.js} +12 -12
  174. package/dist/{login-qr-OUAGpDsU.js → login-qr-DLLfBALk.js} +9 -9
  175. package/dist/{login-qr-BjpDVBJE.js → login-qr-updBsqHf.js} +10 -10
  176. package/dist/{login-BEaBOSnw.js → login-zlt00-k4.js} +6 -6
  177. package/dist/{logs-cli-BiAJbjnq.js → logs-cli-BDQoLnjr.js} +15 -15
  178. package/dist/{logs-cli-Bc6IOyHA.js → logs-cli-BPljn0BF.js} +14 -14
  179. package/dist/{manager-BYu34CX3.js → manager-B-8JFgek.js} +27 -11
  180. package/dist/{manager-C6L_DH0O.js → manager-CE4cPrH2.js} +7 -7
  181. package/dist/{manager-D8VCuzru.js → manager-DPojhf1D.js} +9 -9
  182. package/dist/{manager-b_aZwo00.js → manager-kKsAUV03.js} +27 -11
  183. package/dist/{manifest-registry-W_OfCIRP.js → manifest-registry-BAebAG4I.js} +1 -1
  184. package/dist/{manifest-registry-qF960vMH.js → manifest-registry-Cwvk5hu8.js} +1 -1
  185. package/dist/{memory-cli-B0kKl-9T.js → memory-cli-BJmQIQSw.js} +11 -11
  186. package/dist/{memory-cli-DLtBA6r5.js → memory-cli-DMJqELwh.js} +10 -10
  187. package/dist/{message-channel-CMsexA3K.js → message-channel-CfwNj8mC.js} +1 -1
  188. package/dist/{message-channel-DIHHKJhk.js → message-channel-qmDI9YoO.js} +1 -1
  189. package/dist/{model-auth-KpsOXKDc.js → model-auth-BCdRf282.js} +19 -3
  190. package/dist/{model-auth-CHB3EySM.js → model-auth-Bs6eoQ1l.js} +19 -3
  191. package/dist/{model-selection-CLcoOT3e.js → model-selection-BhIAjo3P.js} +1 -1
  192. package/dist/{model-selection-DjsJGv1R.js → model-selection-CVcwboE_.js} +1 -1
  193. package/dist/{model-selection-CY6r_3wt.js → model-selection-CeZMza3d.js} +1 -1
  194. package/dist/{model-selection-DcO3qJOu.js → model-selection-f7lJs3PI.js} +1 -1
  195. package/dist/{models-CdNeYfSp.js → models-DxRmPLiS.js} +97 -50
  196. package/dist/{models-cli-D7eSsPuk.js → models-cli-B9KClY_f.js} +137 -82
  197. package/dist/{models-cli-fTZXo1zx.js → models-cli-BFZLSACV.js} +66 -58
  198. package/dist/{node-cli-DU_oREff.js → node-cli-BetF7Xgf.js} +26 -26
  199. package/dist/{node-cli-BmuVEJ1C.js → node-cli-CLeoh03V.js} +25 -25
  200. package/dist/{node-service-qZXF7T7A.js → node-service-FcwxyU8p.js} +1 -1
  201. package/dist/{node-service-cOoW5hLa.js → node-service-zrXojq7t.js} +1 -1
  202. package/dist/{note-CeLGcHqv.js → note-BTIeG9az.js} +1 -1
  203. package/dist/{note-iMYVGjpA.js → note-D_tpPSPO.js} +2 -2
  204. package/dist/{noxsoft-bootstrap-CrlkSFzd.js → noxsoft-bootstrap-CPS7t3Sk.js} +3 -3
  205. package/dist/{noxsoft-bootstrap-C4dSx7K_.js → noxsoft-bootstrap-CqygYIJa.js} +2 -2
  206. package/dist/{npm-registry-spec-jf7Mowdn.js → npm-registry-spec-BeX9-fmS.js} +1 -1
  207. package/dist/{npm-registry-spec-Br4B4I_3.js → npm-registry-spec-DB6xqMfu.js} +1 -1
  208. package/dist/{onboard-C5K37NvY.js → onboard-BZORsTGE.js} +18 -18
  209. package/dist/{onboard-D-6QCnTi.js → onboard-Doq7UgRV.js} +19 -19
  210. package/dist/{onboard-channels-BsCq32Hn.js → onboard-channels-BREQ8Tyw.js} +9 -9
  211. package/dist/{onboard-channels-bx6oelzj.js → onboard-channels-CpM1Nwqf.js} +8 -8
  212. package/dist/{onboard-helpers-CJ3HzoUO.js → onboard-helpers-rHLFiSIc.js} +7 -7
  213. package/dist/{onboard-helpers-CFudIoX4.js → onboard-helpers-uf70JxTj.js} +9 -9
  214. package/dist/{onboarding-BeuMAyic.js → onboarding-BGXbXgds.js} +21 -21
  215. package/dist/{onboarding-CX1vIkcB.js → onboarding-DQplq13s.js} +22 -22
  216. package/dist/{orchestrator-C1nWKIJS.js → orchestrator-B2rNfH4K.js} +5 -4
  217. package/dist/{orchestrator-C2ypFiPL.js → orchestrator-CERtu86A.js} +6 -5
  218. package/dist/{outbound-Bmft-5um.js → outbound-Bii3QonX.js} +4 -4
  219. package/dist/{outbound-C577aWZp.js → outbound-BpcyR1eA.js} +4 -4
  220. package/dist/{outbound-fPqdCDR4.js → outbound-C1WShhf8.js} +4 -4
  221. package/dist/{outbound-DW2eod1S.js → outbound-DKY6oeyQ.js} +4 -4
  222. package/dist/{outbound-send-deps-Y9AxHeLG.js → outbound-send-deps-CtiCh8EY.js} +1 -1
  223. package/dist/{parse-timeout-D4UO8pY_.js → parse-timeout-Bp5yQ1yW.js} +3 -3
  224. package/dist/{parse-timeout-C4WLf3Qy.js → parse-timeout-Cn7M8c5R.js} +3 -3
  225. package/dist/{path-env-DLQPf9qj.js → path-env-BAjR_Xf_.js} +1 -1
  226. package/dist/{paths-DMk3Q7yD.js → paths-BM1wivAU.js} +1 -1
  227. package/dist/{paths-CAQJvbeZ.js → paths-BqA7F6bT.js} +2 -2
  228. package/dist/{paths-Q6h5HODL.js → paths-DAbvPUdJ.js} +1 -1
  229. package/dist/{pi-auth-json-B_lKNFK6.js → pi-auth-json-BhkzZgQz.js} +5 -5
  230. package/dist/{pi-auth-json-BmdBnmlZ.js → pi-auth-json-CM3QDr9_.js} +6 -6
  231. package/dist/{pi-auth-json-WTvcP2gz.js → pi-auth-json-Dry5jXVt.js} +6 -6
  232. package/dist/{pi-auth-json-DkYqdjrV.js → pi-auth-json-qHO_AF3h.js} +6 -6
  233. package/dist/{pi-embedded-D15iww51.js → pi-embedded-CrzqUkHv.js} +548 -67
  234. package/dist/{pi-embedded-DR8Pfd05.js → pi-embedded-Dn3Ip_VN.js} +552 -71
  235. package/dist/{pi-embedded-helpers-BZ9GspxK.js → pi-embedded-helpers-BPtBCnl-.js} +1 -1
  236. package/dist/{pi-embedded-helpers-D2SLlgS4.js → pi-embedded-helpers-BSFtS9Fl.js} +1 -1
  237. package/dist/{pi-tools.policy-WdTAfqbV.js → pi-tools.policy-DuWNVoem.js} +6 -6
  238. package/dist/{pi-tools.policy-D2FusuQa.js → pi-tools.policy-DyckzpRL.js} +7 -7
  239. package/dist/{plugin-auto-enable-DhuD30Je.js → plugin-auto-enable-Btd2iEwF.js} +5 -5
  240. package/dist/{plugin-auto-enable-CtYcdTju.js → plugin-auto-enable-DvYJhgJ2.js} +5 -5
  241. package/dist/{plugin-registry-Do2D1nDk.js → plugin-registry-BOuDey4w.js} +4 -4
  242. package/dist/{plugin-registry-ME2FQAi-.js → plugin-registry-ChWHnegS.js} +4 -4
  243. package/dist/plugin-sdk/agents/local-model-installer.d.ts +11 -0
  244. package/dist/plugin-sdk/agents/openai-direct-runner.d.ts +2 -1
  245. package/dist/plugin-sdk/config/types.agent-defaults.d.ts +40 -0
  246. package/dist/plugin-sdk/config/types.models.d.ts +1 -1
  247. package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +13 -0
  248. package/dist/plugin-sdk/config/zod-schema.agents.d.ts +13 -0
  249. package/dist/plugin-sdk/config/zod-schema.core.d.ts +6 -6
  250. package/dist/plugin-sdk/config/zod-schema.d.ts +15 -2
  251. package/dist/plugin-sdk/index.js +19 -1
  252. package/dist/plugin-sdk/infra/architecture-awareness.d.ts +47 -0
  253. package/dist/{plugins-DYcg0qBW.js → plugins-BqPGs8w-.js} +1 -1
  254. package/dist/{plugins-BOMS6J5A.js → plugins-C8FLxXbd.js} +1 -1
  255. package/dist/{plugins-cli-CoVt2ewg.js → plugins-cli-CbOP5ml6.js} +51 -51
  256. package/dist/{plugins-cli-CVFzwdmI.js → plugins-cli-dH6LKRQM.js} +53 -53
  257. package/dist/{polls-DFISjV7H.js → polls-aumqIVob.js} +5 -5
  258. package/dist/{ports-BGLuwt2Z.js → ports--opAW6yN.js} +2 -2
  259. package/dist/{ports-q535r1PZ.js → ports-B20JTuiL.js} +2 -2
  260. package/dist/{ports-B_f42zcA.js → ports-C4ACB4MP.js} +2 -2
  261. package/dist/{ports-DaVrZDUq.js → ports-D6bjtvhF.js} +2 -2
  262. package/dist/{program-context-DP3qjW7A.js → program-context-7yQclqBT.js} +35 -35
  263. package/dist/{program-8rF4C_wd.js → program-pWHcYdeO.js} +58 -58
  264. package/dist/{progress-glCgu57m.js → progress-BveMw0-_.js} +1 -1
  265. package/dist/{progress-CVLvQV_t.js → progress-qMmjCvh9.js} +1 -1
  266. package/dist/{prompt-style-BI53UVgE.js → prompt-style-DWuEFbBO.js} +1 -1
  267. package/dist/{prompt-style-D6SRiiTV.js → prompt-style-zgo1vAG1.js} +1 -1
  268. package/dist/{prompts-BmgT_kkv.js → prompts-C4v0DSTU.js} +6 -6
  269. package/dist/{prompts-Bq4QGFQM.js → prompts-D6Xc1Ddb.js} +4 -4
  270. package/dist/{pw-ai-DxNrJcCA.js → pw-ai-2XnGTARu.js} +3 -3
  271. package/dist/{pw-ai-CB-zeR7h.js → pw-ai-BUnz28XN.js} +5 -5
  272. package/dist/{pw-ai-C_1-7IgH.js → pw-ai-CRnDr120.js} +3 -3
  273. package/dist/{pw-ai-B4u5FDqO.js → pw-ai-Dq14LFsx.js} +6 -6
  274. package/dist/{qmd-manager-C_XBZ_bT.js → qmd-manager-6nqaD-q9.js} +5 -5
  275. package/dist/{qmd-manager-CO795NK4.js → qmd-manager-B6-V0aC1.js} +6 -6
  276. package/dist/{qmd-manager-CpNYgSrx.js → qmd-manager-BNL9Pl2G.js} +6 -6
  277. package/dist/{qmd-manager-Q0OSDQ-e.js → qmd-manager-CpynR-al.js} +5 -5
  278. package/dist/{register.agent-BIrXCVtQ.js → register.agent-BMxuTqFN.js} +68 -68
  279. package/dist/{register.agent-DnkOx0U8.js → register.agent-BO6_QTx6.js} +65 -65
  280. package/dist/{register.anima-B36rTHUt.js → register.anima-5SAY6OxG.js} +6 -6
  281. package/dist/{register.anima-DXT9bM9A.js → register.anima-CLGhoqmw.js} +8 -8
  282. package/dist/register.configure-Bz9pap1L.js +106 -0
  283. package/dist/register.configure-dMfZ1zcY.js +107 -0
  284. package/dist/register.maintenance-CL2eIgmC.js +102 -0
  285. package/dist/register.maintenance-k1dBbjUg.js +103 -0
  286. package/dist/{register.message-CD7xV-jz.js → register.message-Cqlz-6uM.js} +52 -52
  287. package/dist/{register.message-Brtushvp.js → register.message-Cz34rs9W.js} +50 -50
  288. package/dist/{register.onboard-23Mra3LN.js → register.onboard-Cmh46n62.js} +70 -70
  289. package/dist/{register.onboard-6CbODzQ6.js → register.onboard-_4FOFCA2.js} +67 -67
  290. package/dist/{register.setup-CqQw13Ky.js → register.setup-CHgH1mdn.js} +70 -70
  291. package/dist/{register.setup-DlVH7FKe.js → register.setup-CKY65php.js} +67 -67
  292. package/dist/{register.status-health-sessions-CduFjFDB.js → register.status-health-sessions-CNX6wp0V.js} +60 -60
  293. package/dist/{register.status-health-sessions-CxtgPKu9.js → register.status-health-sessions-DNvtWNtb.js} +63 -63
  294. package/dist/{register.subclis-CtANqD5P.js → register.subclis-Br8nY-dd.js} +23 -23
  295. package/dist/{reply-93fMzde1.js → reply-DqXPXQ20.js} +322 -77
  296. package/dist/{reply-prefix-B7Fb3fO8.js → reply-prefix-CZy4g8SY.js} +1 -1
  297. package/dist/{reply-prefix-BzdhJDqP.js → reply-prefix-DuANpRN_.js} +1 -1
  298. package/dist/{routes-CWCAc8uJ.js → routes-CAjh83-X.js} +6 -6
  299. package/dist/{routes-FT0Us8Md.js → routes-DTjggbOR.js} +6 -6
  300. package/dist/{run-CF3kHOGH.js → run-0F-ZU2kW.js} +2251 -217
  301. package/dist/{run-Cq_iTGK_.js → run-Bu-fwhic.js} +2256 -222
  302. package/dist/{run-main-BiIRcc6s.js → run-main-BcC_mt4v.js} +72 -72
  303. package/dist/{runtime-guard-D14Z_QY6.js → runtime-guard-Ccc4Qj4K.js} +1 -1
  304. package/dist/{runtime-guard-DdP10b7Q.js → runtime-guard-E3CIN3Xo.js} +1 -1
  305. package/dist/{sandbox-D-N7M7lp.js → sandbox-DSHSoUHO.js} +6 -6
  306. package/dist/{sandbox-cli-CQKz2I1X.js → sandbox-cli-BiO-r7eU.js} +22 -22
  307. package/dist/{sandbox-cli-DHNFlTo-.js → sandbox-cli-D6ikivGS.js} +22 -22
  308. package/dist/{sandbox-pBHlfFdB.js → sandbox-mSWYRXFm.js} +6 -6
  309. package/dist/{security-cli-Bdi7MuP6.js → security-cli-Bqq5Klnm.js} +25 -25
  310. package/dist/{security-cli-C3aI09uy.js → security-cli-CcBxjHGL.js} +25 -25
  311. package/dist/{semantic-CQApJNO_.js → semantic-CPfLgc8S.js} +1 -1
  312. package/dist/{semantic-9rgWUrz3.js → semantic-DLW1Sflk.js} +1 -1
  313. package/dist/{semantic-C1UN3bb9.js → semantic-jL8x-DTZ.js} +1 -1
  314. package/dist/{server-context-Yx4pgBqJ.js → server-context-DTlBzMyD.js} +7 -7
  315. package/dist/{server-context-Clykq0XU.js → server-context-EPPcxp2p.js} +8 -8
  316. package/dist/{server-node-events-B3Serk9L.js → server-node-events-BGWQiInn.js} +52 -52
  317. package/dist/{server-node-events-DgvKcH5q.js → server-node-events-BuxYvQ0t.js} +50 -50
  318. package/dist/{service-4VfZwSv1.js → service-BoUEkrUm.js} +1 -1
  319. package/dist/{service-audit-KzOtcw_V.js → service-audit-B_BC6-F8.js} +3 -3
  320. package/dist/{service-audit-Bwpoc2LD.js → service-audit-CjH8ed-j.js} +3 -3
  321. package/dist/{service-Dd1DfPia.js → service-ho_k2vjr.js} +1 -1
  322. package/dist/{session-jljC5QVG.js → session-B4wJoEqn.js} +4 -4
  323. package/dist/{session-CSmfU0D3.js → session-BF7WjlT0.js} +1 -1
  324. package/dist/{session-BMDpwIJu.js → session-BnOV0y0e.js} +6 -6
  325. package/dist/{session-C_d9uvLf.js → session-CSgjW31i.js} +5 -5
  326. package/dist/{session-BiA6jrcs.js → session-DO_miKel.js} +1 -1
  327. package/dist/{session-5YO_H-Ra.js → session-DcRzV4l4.js} +1 -1
  328. package/dist/{session-BzrnfWQ2.js → session-DlMsi6dM.js} +5 -5
  329. package/dist/{session-cost-usage-DnxtnK1E.js → session-cost-usage-BNvno_kS.js} +1 -1
  330. package/dist/{sessions-C_3wTmSA.js → sessions-B2NwIaNC.js} +6 -6
  331. package/dist/{sessions-BOzeFzuL.js → sessions-DBQx8E1H.js} +5 -5
  332. package/dist/{sessions-BmE5Z_1i.js → sessions-DxAfgPEp.js} +6 -6
  333. package/dist/{settings-cli-CZdlEmNi.js → settings-cli-CHwTEE6P.js} +72 -72
  334. package/dist/{settings-cli-DsDqNpW_.js → settings-cli-DsUKlq8R.js} +74 -74
  335. package/dist/{setup-token-Lee4gM5w.js → setup-token-BX6QI7ce.js} +26 -26
  336. package/dist/{setup-token-C8Gg1P6T.js → setup-token-CU5mami5.js} +26 -26
  337. package/dist/{shared-C-rqLtIT.js → shared-BFzq0XE1.js} +2 -2
  338. package/dist/{shared-7KwLAyAq.js → shared-D3ZAXqdo.js} +3 -3
  339. package/dist/{shell-env-CMI9f7-7.js → shell-env-BR7Sbtw1.js} +1 -1
  340. package/dist/{shell-env-HkVWMh--.js → shell-env-BZ2Wha1e.js} +1 -1
  341. package/dist/{shell-env-iPnSIi-t.js → shell-env-Bgk3WFTi.js} +1 -1
  342. package/dist/{skills-DtoVe1dS.js → skills-BT0Lx09M.js} +2 -2
  343. package/dist/{skills-4v6-kw0C.js → skills-DjVFhlQY.js} +3 -3
  344. package/dist/{skills-cli-BoasNTpZ.js → skills-cli-BX5pL-D4.js} +15 -15
  345. package/dist/{skills-cli-TeAq3fRG.js → skills-cli-wKTnuQos.js} +14 -14
  346. package/dist/{skills-install-D6_qpRjW.js → skills-install-CVWWsOf2.js} +4 -4
  347. package/dist/{skills-install-Qw2oU8L8.js → skills-install-Ye1kjpCv.js} +4 -4
  348. package/dist/{skills-status-DuLjkX2E.js → skills-status-BUKnQ3ek.js} +2 -2
  349. package/dist/{skills-status-CvH7AUoY.js → skills-status-BmZufjT1.js} +3 -3
  350. package/dist/{soul-Bt8UNmTq.js → soul-C0oc6fbP.js} +1 -1
  351. package/dist/{soul-D9k5zulC.js → soul-DEsrpMAk.js} +1 -1
  352. package/dist/{soul-BiIdv3Wp.js → soul-Doq8As4R.js} +1 -1
  353. package/dist/{soul-DQSYs-4l.js → soul-DyLtQVJh.js} +1 -1
  354. package/dist/{sqlite-BMMt7osH.js → sqlite-CFCo1Ghe.js} +2 -2
  355. package/dist/{sqlite-Cm6OqTQB.js → sqlite-DVkTX4wZ.js} +1 -1
  356. package/dist/{sqlite-CZ1vD4VS.js → sqlite-DrhFRoal.js} +2 -2
  357. package/dist/{sqlite-CpAJt-JS.js → sqlite-M5Ot9X4U.js} +1 -1
  358. package/dist/start-C-gTbKUz.js +158 -0
  359. package/dist/start-DZKfWnpD.js +157 -0
  360. package/dist/{status-COc4xMti.js → status-BN6HYR8t.js} +4 -4
  361. package/dist/{status-C_NBOv_V.js → status-BimVB8cj.js} +4 -4
  362. package/dist/{status-uakoP719.js → status-CSkpd-tb.js} +27 -27
  363. package/dist/{status-BO5BIf81.js → status-D1zupVBm.js} +24 -24
  364. package/dist/{status.update-B6Tdpk07.js → status.update-HKMS5T9H.js} +2 -2
  365. package/dist/{status.update-E9dSFk_b.js → status.update-oapjZPr_.js} +3 -3
  366. package/dist/{subagent-registry-fLI7QDKe.js → subagent-registry-D87n8mHd.js} +318 -81
  367. package/dist/{subsystem-D1AJZPgG.js → subsystem-CkjVkxc4.js} +17 -1
  368. package/dist/{subsystem-D-Xta-sj.js → subsystem-CyrIA90F.js} +17 -1
  369. package/dist/{subsystem-BAADN1B8.js → subsystem-DLVQ9bjX.js} +17 -1
  370. package/dist/{system-cli-DoLzi2Sn.js → system-cli-BRPiBm4G.js} +13 -13
  371. package/dist/{system-cli-CP7JrhR0.js → system-cli-DaNHLGRC.js} +15 -15
  372. package/dist/{systemd-6iLWJxQQ.js → systemd-CS58NHpx.js} +2 -2
  373. package/dist/{systemd-hints-C5Kfh4GW.js → systemd-hints-7HkQ202-.js} +1 -1
  374. package/dist/{systemd-linger-CxGmIy_5.js → systemd-linger-BMNvTAmy.js} +2 -2
  375. package/dist/{systemd-linger-BVwGXVS0.js → systemd-linger-C9PGBtXs.js} +2 -2
  376. package/dist/{systemd-Bx76sJ3M.js → systemd-zYTszfyU.js} +2 -2
  377. package/dist/{table-Blmz7glr.js → table-Bea_v9UU.js} +2 -2
  378. package/dist/{table-Bt7rSYC6.js → table-ohGAZZLQ.js} +1 -1
  379. package/dist/{tokens-CmlI2hSz.js → tokens-BelyD23F.js} +1 -1
  380. package/dist/{tokens-SP2Q7i59.js → tokens-nliOJNMv.js} +1 -1
  381. package/dist/{tool-images-C6cKHTbj.js → tool-images-BEiRPCYM.js} +2 -2
  382. package/dist/{tool-images-2qproko3.js → tool-images-BH8q2ZMq.js} +2 -2
  383. package/dist/{tool-images-D1HuaGdS.js → tool-images-DJrhuxOM.js} +1 -1
  384. package/dist/{tool-images-CgDT0Xzv.js → tool-images-dAVG0qoz.js} +2 -2
  385. package/dist/{tui-r4qpJhNk.js → tui-DnzqtbW3.js} +9 -9
  386. package/dist/{tui-C2eLfbhA.js → tui-FJlF9b--.js} +8 -8
  387. package/dist/{tui-cli-cLSYBQu9.js → tui-cli-BtLvABYH.js} +27 -27
  388. package/dist/{tui-cli-BgcbCtgc.js → tui-cli-Cm3G2SAN.js} +26 -26
  389. package/dist/{update-DA91za97.js → update-Cpvsdq3a.js} +3 -3
  390. package/dist/{update-CqKpX3cX.js → update-DrQkwR-M.js} +3 -3
  391. package/dist/{update-cli-DEe62XGU.js → update-cli-DpKplMO0.js} +79 -79
  392. package/dist/{update-cli-D3Ujz_cW.js → update-cli-DueHX0OM.js} +83 -83
  393. package/dist/{update-runner-DZfnquWO.js → update-runner-C7CjKcMp.js} +5 -5
  394. package/dist/{update-runner-DUl-g4mB.js → update-runner-DtqDU0xF.js} +5 -5
  395. package/dist/{utils-D1VGbO3C.js → utils-BNuEYQIN.js} +1 -1
  396. package/dist/{utils-CLYlhJuc.js → utils-CkCznJhR.js} +1 -1
  397. package/dist/{web-Di8j762D.js → web-Br9HCEvC.js} +54 -54
  398. package/dist/{web-DzSlI8A6.js → web-BxkEMATs.js} +25 -25
  399. package/dist/{web-C-cK9OCd.js → web-CPHrMWsv.js} +24 -24
  400. package/dist/web-HXy7rlIW.js +65 -0
  401. package/dist/{webhooks-cli-k3QMf7Rs.js → webhooks-cli-CdoaCUQ5.js} +11 -11
  402. package/dist/{webhooks-cli-vlEfXEKm.js → webhooks-cli-D65dKr5L.js} +12 -12
  403. package/dist/{whatsapp-actions-Hr-W8vjY.js → whatsapp-actions--CtxOhlj.js} +12 -12
  404. package/dist/{whatsapp-actions-C0tlEdLy.js → whatsapp-actions--eONuB4M.js} +14 -14
  405. package/dist/{whatsapp-actions-BJn-z76S.js → whatsapp-actions-BM0a0V4y.js} +17 -17
  406. package/dist/{whatsapp-actions-6fPRKwPV.js → whatsapp-actions-Bhz79Fgg.js} +11 -11
  407. package/dist/{widearea-dns-CtU9Fx7K.js → widearea-dns-D2VSHQ7y.js} +1 -1
  408. package/dist/{widearea-dns-CHAT20aR.js → widearea-dns-DlJrNJOg.js} +1 -1
  409. package/dist/{workspace-BFIZCnGo.js → workspace-D6JhsXVL.js} +1 -1
  410. package/dist/{ws-log-CUobU2tD.js → ws-log-Cvz4xRCD.js} +1 -1
  411. package/dist/{ws-log-CG6cvCZW.js → ws-log-DwsFDY7m.js} +1 -1
  412. package/package.json +8 -2
  413. package/scripts/install-local-qwen3-coder.sh +7 -0
  414. package/templates/HEART.md +32 -10
  415. package/templates/SOUL.md +37 -8
  416. package/templates/profiles/architect.profile.json5 +36 -0
  417. package/templates/profiles/builder.profile.json5 +36 -0
  418. package/templates/profiles/coordinator.profile.json5 +36 -0
  419. package/templates/profiles/guardian.profile.json5 +36 -0
  420. package/templates/profiles/researcher.profile.json5 +36 -0
  421. package/dist/config-cli-DfHE3KG-.js +0 -15
  422. package/dist/config-cli-fleq7-gq.js +0 -11
  423. package/dist/control-ui/assets/index-DIEQjjCN.js +0 -73
  424. package/dist/control-ui/assets/index-DIEQjjCN.js.map +0 -1
  425. package/dist/register.configure-CuzJxZmk.js +0 -107
  426. package/dist/register.configure-DCpvHX3m.js +0 -106
  427. package/dist/register.maintenance-CcxBFfv5.js +0 -103
  428. package/dist/register.maintenance-Dla0H12S.js +0 -102
  429. package/dist/start-CK6urvnN.js +0 -158
  430. package/dist/start-Cs1aPMq2.js +0 -157
  431. package/dist/web-Dybw4K7C.js +0 -65
@@ -0,0 +1,73 @@
1
+ function CO(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 Oo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var em={exports:{}},zl={};var QS;function kO(){if(QS)return zl;QS=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 zl.Fragment=t,zl.jsx=n,zl.jsxs=n,zl}var JS;function AO(){return JS||(JS=1,em.exports=kO()),em.exports}var d=AO(),tm={exports:{}},Fe={};var ZS;function jO(){if(ZS)return Fe;ZS=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"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function b(U){return U===null||typeof U!="object"?null:(U=v&&U[v]||U["@@iterator"],typeof U=="function"?U:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function T(U,ee,P){this.props=U,this.context=ee,this.refs=E,this.updater=P||S}T.prototype.isReactComponent={},T.prototype.setState=function(U,ee){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,ee,"setState")},T.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function k(){}k.prototype=T.prototype;function C(U,ee,P){this.props=U,this.context=ee,this.refs=E,this.updater=P||S}var N=C.prototype=new k;N.constructor=C,w(N,T.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function _(){}var I={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function V(U,ee,P){var ue=P.ref;return{$$typeof:e,type:U,key:ee,ref:ue!==void 0?ue:null,props:P}}function D(U,ee){return V(U.type,ee,U.props)}function q(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function G(U){var ee={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(P){return ee[P]})}var Z=/\/+/g;function ce(U,ee){return typeof U=="object"&&U!==null&&U.key!=null?G(""+U.key):ee.toString(36)}function J(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(_,_):(U.status="pending",U.then(function(ee){U.status==="pending"&&(U.status="fulfilled",U.value=ee)},function(ee){U.status==="pending"&&(U.status="rejected",U.reason=ee)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function B(U,ee,P,ue,me){var Se=typeof U;(Se==="undefined"||Se==="boolean")&&(U=null);var we=!1;if(U===null)we=!0;else switch(Se){case"bigint":case"string":case"number":we=!0;break;case"object":switch(U.$$typeof){case e:case t:we=!0;break;case m:return we=U._init,B(we(U._payload),ee,P,ue,me)}}if(we)return me=me(U),we=ue===""?"."+ce(U,0):ue,j(me)?(P="",we!=null&&(P=we.replace(Z,"$&/")+"/"),B(me,ee,P,"",function(ve){return ve})):me!=null&&(q(me)&&(me=D(me,P+(me.key==null||U&&U.key===me.key?"":(""+me.key).replace(Z,"$&/")+"/")+we)),ee.push(me)),1;we=0;var Ue=ue===""?".":ue+":";if(j(U))for(var Ne=0;Ne<U.length;Ne++)ue=U[Ne],Se=Ue+ce(ue,Ne),we+=B(ue,ee,P,Se,me);else if(Ne=b(U),typeof Ne=="function")for(U=Ne.call(U),Ne=0;!(ue=U.next()).done;)ue=ue.value,Se=Ue+ce(ue,Ne++),we+=B(ue,ee,P,Se,me);else if(Se==="object"){if(typeof U.then=="function")return B(J(U),ee,P,ue,me);throw ee=String(U),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return we}function X(U,ee,P){if(U==null)return U;var ue=[],me=0;return B(U,ue,"","",function(Se){return ee.call(P,Se,me++)}),ue}function le(U){if(U._status===-1){var ee=U._result;ee=ee(),ee.then(function(P){(U._status===0||U._status===-1)&&(U._status=1,U._result=P)},function(P){(U._status===0||U._status===-1)&&(U._status=2,U._result=P)}),U._status===-1&&(U._status=0,U._result=ee)}if(U._status===1)return U._result.default;throw U._result}var ye=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},M={map:X,forEach:function(U,ee,P){X(U,function(){ee.apply(this,arguments)},P)},count:function(U){var ee=0;return X(U,function(){ee++}),ee},toArray:function(U){return X(U,function(ee){return ee})||[]},only:function(U){if(!q(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Fe.Activity=g,Fe.Children=M,Fe.Component=T,Fe.Fragment=n,Fe.Profiler=a,Fe.PureComponent=C,Fe.StrictMode=r,Fe.Suspense=f,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(U){return I.H.useMemoCache(U)}},Fe.cache=function(U){return function(){return U.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(U,ee,P){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var ue=w({},U.props),me=U.key;if(ee!=null)for(Se in ee.key!==void 0&&(me=""+ee.key),ee)!L.call(ee,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&ee.ref===void 0||(ue[Se]=ee[Se]);var Se=arguments.length-2;if(Se===1)ue.children=P;else if(1<Se){for(var we=Array(Se),Ue=0;Ue<Se;Ue++)we[Ue]=arguments[Ue+2];ue.children=we}return V(U.type,me,ue)},Fe.createContext=function(U){return U={$$typeof:l,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},Fe.createElement=function(U,ee,P){var ue,me={},Se=null;if(ee!=null)for(ue in ee.key!==void 0&&(Se=""+ee.key),ee)L.call(ee,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(me[ue]=ee[ue]);var we=arguments.length-2;if(we===1)me.children=P;else if(1<we){for(var Ue=Array(we),Ne=0;Ne<we;Ne++)Ue[Ne]=arguments[Ne+2];me.children=Ue}if(U&&U.defaultProps)for(ue in we=U.defaultProps,we)me[ue]===void 0&&(me[ue]=we[ue]);return V(U,Se,me)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(U){return{$$typeof:c,render:U}},Fe.isValidElement=q,Fe.lazy=function(U){return{$$typeof:m,_payload:{_status:-1,_result:U},_init:le}},Fe.memo=function(U,ee){return{$$typeof:h,type:U,compare:ee===void 0?null:ee}},Fe.startTransition=function(U){var ee=I.T,P={};I.T=P;try{var ue=U(),me=I.S;me!==null&&me(P,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(_,ye)}catch(Se){ye(Se)}finally{ee!==null&&P.types!==null&&(ee.types=P.types),I.T=ee}},Fe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Fe.use=function(U){return I.H.use(U)},Fe.useActionState=function(U,ee,P){return I.H.useActionState(U,ee,P)},Fe.useCallback=function(U,ee){return I.H.useCallback(U,ee)},Fe.useContext=function(U){return I.H.useContext(U)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(U,ee){return I.H.useDeferredValue(U,ee)},Fe.useEffect=function(U,ee){return I.H.useEffect(U,ee)},Fe.useEffectEvent=function(U){return I.H.useEffectEvent(U)},Fe.useId=function(){return I.H.useId()},Fe.useImperativeHandle=function(U,ee,P){return I.H.useImperativeHandle(U,ee,P)},Fe.useInsertionEffect=function(U,ee){return I.H.useInsertionEffect(U,ee)},Fe.useLayoutEffect=function(U,ee){return I.H.useLayoutEffect(U,ee)},Fe.useMemo=function(U,ee){return I.H.useMemo(U,ee)},Fe.useOptimistic=function(U,ee){return I.H.useOptimistic(U,ee)},Fe.useReducer=function(U,ee,P){return I.H.useReducer(U,ee,P)},Fe.useRef=function(U){return I.H.useRef(U)},Fe.useState=function(U){return I.H.useState(U)},Fe.useSyncExternalStore=function(U,ee,P){return I.H.useSyncExternalStore(U,ee,P)},Fe.useTransition=function(){return I.H.useTransition()},Fe.version="19.2.4",Fe}var ew;function Bv(){return ew||(ew=1,tm.exports=jO()),tm.exports}var R=Bv();const cr=Oo(R);var nm={exports:{}},Ul={},rm={exports:{}},im={};var tw;function NO(){return tw||(tw=1,(function(e){function t(B,X){var le=B.length;B.push(X);e:for(;0<le;){var ye=le-1>>>1,M=B[ye];if(0<a(M,X))B[ye]=X,B[le]=M,le=ye;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var X=B[0],le=B.pop();if(le!==X){B[0]=le;e:for(var ye=0,M=B.length,U=M>>>1;ye<U;){var ee=2*(ye+1)-1,P=B[ee],ue=ee+1,me=B[ue];if(0>a(P,le))ue<M&&0>a(me,P)?(B[ye]=me,B[ue]=le,ye=ue):(B[ye]=P,B[ee]=le,ye=ee);else if(ue<M&&0>a(me,le))B[ye]=me,B[ue]=le,ye=ue;else break e}}return X}function a(B,X){var le=B.sortIndex-X.sortIndex;return le!==0?le:B.id-X.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=[],h=[],m=1,g=null,v=3,b=!1,S=!1,w=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function N(B){for(var X=n(h);X!==null;){if(X.callback===null)r(h);else if(X.startTime<=B)r(h),X.sortIndex=X.expirationTime,t(f,X);else break;X=n(h)}}function j(B){if(w=!1,N(B),!S)if(n(f)!==null)S=!0,_||(_=!0,G());else{var X=n(h);X!==null&&J(j,X.startTime-B)}}var _=!1,I=-1,L=5,V=-1;function D(){return E?!0:!(e.unstable_now()-V<L)}function q(){if(E=!1,_){var B=e.unstable_now();V=B;var X=!0;try{e:{S=!1,w&&(w=!1,k(I),I=-1),b=!0;var le=v;try{t:{for(N(B),g=n(f);g!==null&&!(g.expirationTime>B&&D());){var ye=g.callback;if(typeof ye=="function"){g.callback=null,v=g.priorityLevel;var M=ye(g.expirationTime<=B);if(B=e.unstable_now(),typeof M=="function"){g.callback=M,N(B),X=!0;break t}g===n(f)&&r(f),N(B)}else r(f);g=n(f)}if(g!==null)X=!0;else{var U=n(h);U!==null&&J(j,U.startTime-B),X=!1}}break e}finally{g=null,v=le,b=!1}X=void 0}}finally{X?G():_=!1}}}var G;if(typeof C=="function")G=function(){C(q)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ce=Z.port2;Z.port1.onmessage=q,G=function(){ce.postMessage(null)}}else G=function(){T(q,0)};function J(B,X){I=T(function(){B(e.unstable_now())},X)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(B){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var le=v;v=X;try{return B()}finally{v=le}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(B,X){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var le=v;v=B;try{return X()}finally{v=le}},e.unstable_scheduleCallback=function(B,X,le){var ye=e.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?ye+le:ye):le=ye,B){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=le+M,B={id:m++,callback:X,priorityLevel:B,startTime:le,expirationTime:M,sortIndex:-1},le>ye?(B.sortIndex=le,t(h,B),n(f)===null&&B===n(h)&&(w?(k(I),I=-1):w=!0,J(j,le-ye))):(B.sortIndex=M,t(f,B),S||b||(S=!0,_||(_=!0,G()))),B},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(B){var X=v;return function(){var le=v;v=X;try{return B.apply(this,arguments)}finally{v=le}}}})(im)),im}var nw;function RO(){return nw||(nw=1,rm.exports=NO()),rm.exports}var am={exports:{}},Rn={};var rw;function _O(){if(rw)return Rn;rw=1;var e=Bv();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" 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,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:f,containerInfo:h,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Rn.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(f,h,null,m)},Rn.flushSync=function(f){var h=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=m,r.d.f()}},Rn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Rn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Rn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=c(m,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Rn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=c(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Rn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=c(m,h.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Rn.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=c(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Rn.requestFormReset=function(f){r.d.r(f)},Rn.unstable_batchedUpdates=function(f,h){return f(h)},Rn.useFormState=function(f,h,m){return l.H.useFormState(f,h,m)},Rn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Rn.version="19.2.4",Rn}var iw;function OO(){if(iw)return am.exports;iw=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(),am.exports=_O(),am.exports}var aw;function MO(){if(aw)return Ul;aw=1;var e=RO(),t=Bv(),n=OO();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 h(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,p=s;;){var y=u.return;if(y===null)break;var x=y.alternate;if(x===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===u)return f(y),i;if(x===p)return f(y),s;x=x.sibling}throw Error(r(188))}if(u.return!==p.return)u=y,p=x;else{for(var A=!1,O=y.child;O;){if(O===u){A=!0,u=y,p=x;break}if(O===p){A=!0,p=y,u=x;break}O=O.sibling}if(!A){for(O=x.child;O;){if(O===u){A=!0,u=x,p=y;break}if(O===p){A=!0,p=x,u=y;break}O=O.sibling}if(!A)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function m(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=m(i),s!==null)return s;i=i.sibling}return null}var g=Object.assign,v=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"),k=Symbol.for("react.consumer"),C=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function G(i){return i===null||typeof i!="object"?null:(i=q&&i[q]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Symbol.for("react.client.reference");function ce(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Z?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 j:return"Suspense";case _:return"SuspenseList";case V:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case C:return i.displayName||"Context";case k:return(i._context.displayName||"Context")+".Consumer";case N:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case I:return s=i.displayName||null,s!==null?s:ce(i.type)||"Memo";case L:s=i._payload,i=i._init;try{return ce(i(s))}catch{}}return null}var J=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ye=[],M=-1;function U(i){return{current:i}}function ee(i){0>M||(i.current=ye[M],ye[M]=null,M--)}function P(i,s){M++,ye[M]=i.current,i.current=s}var ue=U(null),me=U(null),Se=U(null),we=U(null);function Ue(i,s){switch(P(Se,s),P(me,i),P(ue,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?xS(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=xS(s),i=SS(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}ee(ue),P(ue,i)}function Ne(){ee(ue),ee(me),ee(Se)}function ve(i){i.memoizedState!==null&&P(we,i);var s=ue.current,u=SS(s,i.type);s!==u&&(P(me,i),P(ue,u))}function Pe(i){me.current===i&&(ee(ue),ee(me)),we.current===i&&(ee(we),Dl._currentValue=le)}var pt,Zt;function We(i){if(pt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);pt=s&&s[1]||"",Zt=-1<u.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+pt+i+Zt}var mt=!1;function gt(i,s){if(!i||mt)return"";mt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(oe){var ae=oe}Reflect.construct(i,[],ge)}else{try{ge.call()}catch(oe){ae=oe}i.call(ge.prototype)}}else{try{throw Error()}catch(oe){ae=oe}(ge=i())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(oe){if(oe&&ae&&typeof oe.stack=="string")return[oe.stack,ae.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=p.DetermineComponentFrameRoot(),A=x[0],O=x[1];if(A&&O){var F=A.split(`
4
+ `),ie=O.split(`
5
+ `);for(y=p=0;p<F.length&&!F[p].includes("DetermineComponentFrameRoot");)p++;for(;y<ie.length&&!ie[y].includes("DetermineComponentFrameRoot");)y++;if(p===F.length||y===ie.length)for(p=F.length-1,y=ie.length-1;1<=p&&0<=y&&F[p]!==ie[y];)y--;for(;1<=p&&0<=y;p--,y--)if(F[p]!==ie[y]){if(p!==1||y!==1)do if(p--,y--,0>y||F[p]!==ie[y]){var fe=`
6
+ `+F[p].replace(" at new "," at ");return i.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",i.displayName)),fe}while(1<=p&&0<=y);break}}}finally{mt=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?We(u):""}function Gt(i,s){switch(i.tag){case 26:case 27:case 5:return We(i.type);case 16:return We("Lazy");case 13:return i.child!==s&&s!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("SuspenseList");case 0:case 15:return gt(i.type,!1);case 11:return gt(i.type.render,!1);case 1:return gt(i.type,!0);case 31:return We("Activity");default:return""}}function _t(i){try{var s="",u=null;do s+=Gt(i,u),u=i,i=i.return;while(i);return s}catch(p){return`
7
+ Error generating stack: `+p.message+`
8
+ `+p.stack}}var Ft=Object.prototype.hasOwnProperty,vt=e.unstable_scheduleCallback,dt=e.unstable_cancelCallback,Ln=e.unstable_shouldYield,Le=e.unstable_requestPaint,Me=e.unstable_now,W=e.unstable_getCurrentPriorityLevel,H=e.unstable_ImmediatePriority,se=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Te=e.unstable_LowPriority,Ve=e.unstable_IdlePriority,st=e.log,Xt=e.unstable_setDisableYieldValue,Ot=null,St=null;function z(i){if(typeof st=="function"&&Xt(i),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Ot,i)}catch{}}var Y=Math.clz32?Math.clz32:en,xe=Math.log,He=Math.LN2;function en(i){return i>>>=0,i===0?32:31-(xe(i)/He|0)|0}var Dr=256,Oa=262144,Ir=4194304;function Pt(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 Bi(i,s,u){var p=i.pendingLanes;if(p===0)return 0;var y=0,x=i.suspendedLanes,A=i.pingedLanes;i=i.warmLanes;var O=p&134217727;return O!==0?(p=O&~x,p!==0?y=Pt(p):(A&=O,A!==0?y=Pt(A):u||(u=O&~i,u!==0&&(y=Pt(u))))):(O=p&~x,O!==0?y=Pt(O):A!==0?y=Pt(A):u||(u=p&~i,u!==0&&(y=Pt(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 Ma(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function qo(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 Go(){var i=Ir;return Ir<<=1,(Ir&62914560)===0&&(Ir=4194304),i}function Ko(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function cn(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function $u(i,s,u,p,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),ge=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 oe=ae[fe];oe!==null&&(oe.lane&=-536870913)}u&=~ge}p!==0&&$o(i,p,0),x!==0&&y===0&&i.tag!==0&&(i.suspendedLanes|=x&~(A&~s))}function $o(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-Y(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|u&261930}function Da(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var p=31-Y(u),y=1<<p;y&s|i[p]&s&&(i[p]|=s),u&=~y}}function Ia(i,s){var u=s&-s;return u=(u&42)!==0?1:Yo(u),(u&(i.suspendedLanes|s))!==0?0:u}function Yo(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 Wo(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Yu(){var i=X.p;return i!==0?i:(i=window.event,i===void 0?32:qS(i.type))}function Wu(i,s){var u=X.p;try{return X.p=i,s()}finally{X.p=u}}var Pr=Math.random().toString(36).slice(2),dn="__reactFiber$"+Pr,Nn="__reactProps$"+Pr,Fi="__reactContainer$"+Pr,Xo="__reactEvents$"+Pr,$f="__reactListeners$"+Pr,Xu="__reactHandles$"+Pr,Qu="__reactResources$"+Pr,Pa="__reactMarker$"+Pr;function $(i){delete i[dn],delete i[Nn],delete i[Xo],delete i[$f],delete i[Xu]}function he(i){var s=i[dn];if(s)return s;for(var u=i.parentNode;u;){if(s=u[Fi]||u[dn]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=jS(i);i!==null;){if(u=i[dn])return u;i=jS(i)}return s}i=u,u=i.parentNode}return null}function Ye(i){if(i=i[dn]||i[Fi]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function nt(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Lt(i){var s=i[Qu];return s||(s=i[Qu]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function wt(i){i[Pa]=!0}var Zn=new Set,er={};function fn(i,s){pi(i,s),pi(i+"Capture",s)}function pi(i,s){for(er[i]=s,i=0;i<s.length;i++)Zn.add(s[i])}var La=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]*$"),Ge={},yt={};function ft(i){return Ft.call(yt,i)?!0:Ft.call(Ge,i)?!1:La.test(i)?yt[i]=!0:(Ge[i]=!0,!1)}function jt(i,s,u){if(ft(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function gn(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 yn(i,s,u,p){if(p===null)i.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+p)}}function tn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Wr(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function za(i,s,u){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,x=p.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:p.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function mi(i){if(!i._valueTracker){var s=Wr(i)?"checked":"value";i._valueTracker=za(i,s,""+i[s])}}function Ua(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return i&&(p=Wr(i)?i.checked?"true":"false":i.value),i=p,i!==u?(s.setValue(i),!0):!1}function Ba(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 b2=/[\n"\\]/g;function pr(i){return i.replace(b2,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Yf(i,s,u,p,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=""+tn(s)):i.value!==""+tn(s)&&(i.value=""+tn(s)):A!=="submit"&&A!=="reset"||i.removeAttribute("value"),s!=null?Wf(i,A,tn(s)):u!=null?Wf(i,A,tn(u)):p!=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=""+tn(O):i.removeAttribute("name")}function p0(i,s,u,p,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)){mi(i);return}u=u!=null?""+tn(u):"",s=s!=null?""+tn(s):u,O||s===i.value||(i.value=s),i.defaultValue=s}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=O?i.checked:!!p,i.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.name=A),mi(i)}function Wf(i,s,u){s==="number"&&Ba(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Es(i,s,u,p){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&&p&&(i[u].defaultSelected=!0)}else{for(u=""+tn(u),s=null,y=0;y<i.length;y++){if(i[y].value===u){i[y].selected=!0,p&&(i[y].defaultSelected=!0);return}s!==null||i[y].disabled||(s=i[y])}s!==null&&(s.selected=!0)}}function m0(i,s,u){if(s!=null&&(s=""+tn(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+tn(u):""}function g0(i,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(r(92));if(J(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=tn(s),i.defaultValue=u,p=i.textContent,p===u&&p!==""&&p!==null&&(i.value=p),mi(i)}function Ts(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var x2=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 v0(i,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":p?i.setProperty(s,u):typeof u!="number"||u===0||x2.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function y0(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var y in s)p=s[y],s.hasOwnProperty(y)&&u[y]!==p&&v0(i,y,p)}else for(var x in s)s.hasOwnProperty(x)&&v0(i,x,s[x])}function Xf(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 S2=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"]]),w2=/^[\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 Ju(i){return w2.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function gi(){}var Qf=null;function Jf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Cs=null,ks=null;function b0(i){var s=Ye(i);if(s&&(i=s.stateNode)){var u=i[Nn]||null;e:switch(i=s.stateNode,s.type){case"input":if(Yf(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="'+pr(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==i&&p.form===i.form){var y=p[Nn]||null;if(!y)throw Error(r(90));Yf(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===i.form&&Ua(p)}break e;case"textarea":m0(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Es(i,!!u.multiple,s,!1)}}}var Zf=!1;function x0(i,s,u){if(Zf)return i(s,u);Zf=!0;try{var p=i(s);return p}finally{if(Zf=!1,(Cs!==null||ks!==null)&&(Uc(),Cs&&(s=Cs,i=ks,ks=Cs=null,b0(s),i)))for(s=0;s<i.length;s++)b0(i[s])}}function Qo(i,s){var u=i.stateNode;if(u===null)return null;var p=u[Nn]||null;if(p===null)return null;u=p[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":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var vi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eh=!1;if(vi)try{var Jo={};Object.defineProperty(Jo,"passive",{get:function(){eh=!0}}),window.addEventListener("test",Jo,Jo),window.removeEventListener("test",Jo,Jo)}catch{eh=!1}var Vi=null,th=null,Zu=null;function S0(){if(Zu)return Zu;var i,s=th,u=s.length,p,y="value"in Vi?Vi.value:Vi.textContent,x=y.length;for(i=0;i<u&&s[i]===y[i];i++);var A=u-i;for(p=1;p<=A&&s[u-p]===y[x-p];p++);return Zu=y.slice(i,1<p?1-p:void 0)}function ec(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 tc(){return!0}function w0(){return!1}function qn(i){function s(u,p,y,x,A){this._reactName=u,this._targetInst=y,this.type=p,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)?tc:w0,this.isPropagationStopped=w0,this}return g(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=tc)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=tc)},persist:function(){},isPersistent:tc}),s}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nc=qn(Fa),Zo=g({},Fa,{view:0,detail:0}),E2=qn(Zo),nh,rh,el,rc=g({},Zo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ah,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!==el&&(el&&i.type==="mousemove"?(nh=i.screenX-el.screenX,rh=i.screenY-el.screenY):rh=nh=0,el=i),nh)},movementY:function(i){return"movementY"in i?i.movementY:rh}}),E0=qn(rc),T2=g({},rc,{dataTransfer:0}),C2=qn(T2),k2=g({},Zo,{relatedTarget:0}),ih=qn(k2),A2=g({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),j2=qn(A2),N2=g({},Fa,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),R2=qn(N2),_2=g({},Fa,{data:0}),T0=qn(_2),O2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M2={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"},D2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I2(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=D2[i])?!!s[i]:!1}function ah(){return I2}var P2=g({},Zo,{key:function(i){if(i.key){var s=O2[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=ec(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?M2[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ah,charCode:function(i){return i.type==="keypress"?ec(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ec(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),L2=qn(P2),z2=g({},rc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),C0=qn(z2),U2=g({},Zo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ah}),B2=qn(U2),F2=g({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),V2=qn(F2),H2=g({},rc,{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}),q2=qn(H2),G2=g({},Fa,{newState:0,oldState:0}),K2=qn(G2),$2=[9,13,27,32],sh=vi&&"CompositionEvent"in window,tl=null;vi&&"documentMode"in document&&(tl=document.documentMode);var Y2=vi&&"TextEvent"in window&&!tl,k0=vi&&(!sh||tl&&8<tl&&11>=tl),A0=" ",j0=!1;function N0(i,s){switch(i){case"keyup":return $2.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function R0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var As=!1;function W2(i,s){switch(i){case"compositionend":return R0(s);case"keypress":return s.which!==32?null:(j0=!0,A0);case"textInput":return i=s.data,i===A0&&j0?null:i;default:return null}}function X2(i,s){if(As)return i==="compositionend"||!sh&&N0(i,s)?(i=S0(),Zu=th=Vi=null,As=!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 k0&&s.locale!=="ko"?null:s.data;default:return null}}var Q2={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 _0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!Q2[i.type]:s==="textarea"}function O0(i,s,u,p){Cs?ks?ks.push(p):ks=[p]:Cs=p,s=Kc(s,"onChange"),0<s.length&&(u=new nc("onChange","change",null,u,p),i.push({event:u,listeners:s}))}var nl=null,rl=null;function J2(i){pS(i,0)}function ic(i){var s=nt(i);if(Ua(s))return i}function M0(i,s){if(i==="change")return s}var D0=!1;if(vi){var oh;if(vi){var lh="oninput"in document;if(!lh){var I0=document.createElement("div");I0.setAttribute("oninput","return;"),lh=typeof I0.oninput=="function"}oh=lh}else oh=!1;D0=oh&&(!document.documentMode||9<document.documentMode)}function P0(){nl&&(nl.detachEvent("onpropertychange",L0),rl=nl=null)}function L0(i){if(i.propertyName==="value"&&ic(rl)){var s=[];O0(s,rl,i,Jf(i)),x0(J2,s)}}function Z2(i,s,u){i==="focusin"?(P0(),nl=s,rl=u,nl.attachEvent("onpropertychange",L0)):i==="focusout"&&P0()}function e_(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ic(rl)}function t_(i,s){if(i==="click")return ic(s)}function n_(i,s){if(i==="input"||i==="change")return ic(s)}function r_(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var tr=typeof Object.is=="function"?Object.is:r_;function il(i,s){if(tr(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!Ft.call(s,y)||!tr(i[y],s[y]))return!1}return!0}function z0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function U0(i,s){var u=z0(i);i=0;for(var p;u;){if(u.nodeType===3){if(p=i+u.textContent.length,i<=s&&p>=s)return{node:u,offset:s-i};i=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=z0(u)}}function B0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?B0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function F0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Ba(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=Ba(i.document)}return s}function uh(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 i_=vi&&"documentMode"in document&&11>=document.documentMode,js=null,ch=null,al=null,dh=!1;function V0(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;dh||js==null||js!==Ba(p)||(p=js,"selectionStart"in p&&uh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),al&&il(al,p)||(al=p,p=Kc(ch,"onSelect"),0<p.length&&(s=new nc("onSelect","select",null,s,u),i.push({event:s,listeners:p}),s.target=js)))}function Va(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var Ns={animationend:Va("Animation","AnimationEnd"),animationiteration:Va("Animation","AnimationIteration"),animationstart:Va("Animation","AnimationStart"),transitionrun:Va("Transition","TransitionRun"),transitionstart:Va("Transition","TransitionStart"),transitioncancel:Va("Transition","TransitionCancel"),transitionend:Va("Transition","TransitionEnd")},fh={},H0={};vi&&(H0=document.createElement("div").style,"AnimationEvent"in window||(delete Ns.animationend.animation,delete Ns.animationiteration.animation,delete Ns.animationstart.animation),"TransitionEvent"in window||delete Ns.transitionend.transition);function Ha(i){if(fh[i])return fh[i];if(!Ns[i])return i;var s=Ns[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in H0)return fh[i]=s[u];return i}var q0=Ha("animationend"),G0=Ha("animationiteration"),K0=Ha("animationstart"),a_=Ha("transitionrun"),s_=Ha("transitionstart"),o_=Ha("transitioncancel"),$0=Ha("transitionend"),Y0=new Map,hh="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(" ");hh.push("scrollEnd");function Lr(i,s){Y0.set(i,s),fn(s,[i])}var ac=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)},mr=[],Rs=0,ph=0;function sc(){for(var i=Rs,s=ph=Rs=0;s<i;){var u=mr[s];mr[s++]=null;var p=mr[s];mr[s++]=null;var y=mr[s];mr[s++]=null;var x=mr[s];if(mr[s++]=null,p!==null&&y!==null){var A=p.pending;A===null?y.next=y:(y.next=A.next,A.next=y),p.pending=y}x!==0&&W0(u,y,x)}}function oc(i,s,u,p){mr[Rs++]=i,mr[Rs++]=s,mr[Rs++]=u,mr[Rs++]=p,ph|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function mh(i,s,u,p){return oc(i,s,u,p),lc(i)}function qa(i,s){return oc(i,null,null,s),lc(i)}function W0(i,s,u){i.lanes|=u;var p=i.alternate;p!==null&&(p.lanes|=u);for(var y=!1,x=i.return;x!==null;)x.childLanes|=u,p=x.alternate,p!==null&&(p.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,p=i[y],p===null?i[y]=[s]:p.push(s),s.lane=u|536870912),x):null}function lc(i){if(50<Al)throw Al=0,Tp=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var _s={};function l_(i,s,u,p){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=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(i,s,u,p){return new l_(i,s,u,p)}function gh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function yi(i,s){var u=i.alternate;return u===null?(u=nr(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 X0(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 uc(i,s,u,p,y,x){var A=0;if(p=i,typeof i=="function")gh(i)&&(A=1);else if(typeof i=="string")A=hO(i,u,ue.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case V:return i=nr(31,u,s,y),i.elementType=V,i.lanes=x,i;case w:return Ga(u.children,y,x,s);case E:A=8,y|=24;break;case T:return i=nr(12,u,s,y|2),i.elementType=T,i.lanes=x,i;case j:return i=nr(13,u,s,y),i.elementType=j,i.lanes=x,i;case _:return i=nr(19,u,s,y),i.elementType=_,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case C:A=10;break e;case k:A=9;break e;case N:A=11;break e;case I:A=14;break e;case L:A=16,p=null;break e}A=29,u=Error(r(130,i===null?"null":typeof i,"")),p=null}return s=nr(A,u,s,y),s.elementType=i,s.type=p,s.lanes=x,s}function Ga(i,s,u,p){return i=nr(7,i,p,s),i.lanes=u,i}function vh(i,s,u){return i=nr(6,i,null,s),i.lanes=u,i}function Q0(i){var s=nr(18,null,null,0);return s.stateNode=i,s}function yh(i,s,u){return s=nr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var J0=new WeakMap;function gr(i,s){if(typeof i=="object"&&i!==null){var u=J0.get(i);return u!==void 0?u:(s={value:i,source:s,stack:_t(s)},J0.set(i,s),s)}return{value:i,source:s,stack:_t(s)}}var Os=[],Ms=0,cc=null,sl=0,vr=[],yr=0,Hi=null,Xr=1,Qr="";function bi(i,s){Os[Ms++]=sl,Os[Ms++]=cc,cc=i,sl=s}function Z0(i,s,u){vr[yr++]=Xr,vr[yr++]=Qr,vr[yr++]=Hi,Hi=i;var p=Xr;i=Qr;var y=32-Y(p)-1;p&=~(1<<y),u+=1;var x=32-Y(s)+y;if(30<x){var A=y-y%5;x=(p&(1<<A)-1).toString(32),p>>=A,y-=A,Xr=1<<32-Y(s)+y|u<<y|p,Qr=x+i}else Xr=1<<x|u<<y|p,Qr=i}function bh(i){i.return!==null&&(bi(i,1),Z0(i,1,0))}function xh(i){for(;i===cc;)cc=Os[--Ms],Os[Ms]=null,sl=Os[--Ms],Os[Ms]=null;for(;i===Hi;)Hi=vr[--yr],vr[yr]=null,Qr=vr[--yr],vr[yr]=null,Xr=vr[--yr],vr[yr]=null}function eb(i,s){vr[yr++]=Xr,vr[yr++]=Qr,vr[yr++]=Hi,Xr=s.id,Qr=s.overflow,Hi=i}var bn=null,zt=null,rt=!1,qi=null,br=!1,Sh=Error(r(519));function Gi(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ol(gr(s,i)),Sh}function tb(i){var s=i.stateNode,u=i.type,p=i.memoizedProps;switch(s[dn]=i,s[Nn]=p,u){case"dialog":Qe("cancel",s),Qe("close",s);break;case"iframe":case"object":case"embed":Qe("load",s);break;case"video":case"audio":for(u=0;u<Nl.length;u++)Qe(Nl[u],s);break;case"source":Qe("error",s);break;case"img":case"image":case"link":Qe("error",s),Qe("load",s);break;case"details":Qe("toggle",s);break;case"input":Qe("invalid",s),p0(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Qe("invalid",s);break;case"textarea":Qe("invalid",s),g0(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||yS(s.textContent,u)?(p.popover!=null&&(Qe("beforetoggle",s),Qe("toggle",s)),p.onScroll!=null&&Qe("scroll",s),p.onScrollEnd!=null&&Qe("scrollend",s),p.onClick!=null&&(s.onclick=gi),s=!0):s=!1,s||Gi(i,!0)}function nb(i){for(bn=i.return;bn;)switch(bn.tag){case 5:case 31:case 13:br=!1;return;case 27:case 3:br=!0;return;default:bn=bn.return}}function Ds(i){if(i!==bn)return!1;if(!rt)return nb(i),rt=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||Up(i.type,i.memoizedProps)),u=!u),u&&zt&&Gi(i),nb(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));zt=AS(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));zt=AS(i)}else s===27?(s=zt,aa(i.type)?(i=qp,qp=null,zt=i):zt=s):zt=bn?Sr(i.stateNode.nextSibling):null;return!0}function Ka(){zt=bn=null,rt=!1}function wh(){var i=qi;return i!==null&&(Yn===null?Yn=i:Yn.push.apply(Yn,i),qi=null),i}function ol(i){qi===null?qi=[i]:qi.push(i)}var Eh=U(null),$a=null,xi=null;function Ki(i,s,u){P(Eh,s._currentValue),s._currentValue=u}function Si(i){i._currentValue=Eh.current,ee(Eh)}function Th(i,s,u){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===u)break;i=i.return}}function Ch(i,s,u,p){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),Th(x.return,u,i),p||(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),Th(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 Is(i,s,u,p){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;tr(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(Dl):i=[Dl])}y=y.return}i!==null&&Ch(s,i,u,p),s.flags|=262144}function dc(i){for(i=i.firstContext;i!==null;){if(!tr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ya(i){$a=i,xi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function xn(i){return rb($a,i)}function fc(i,s){return $a===null&&Ya(i),rb(i,s)}function rb(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},xi===null){if(i===null)throw Error(r(308));xi=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else xi=xi.next=s;return u}var u_=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},c_=e.unstable_scheduleCallback,d_=e.unstable_NormalPriority,nn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kh(){return{controller:new u_,data:new Map,refCount:0}}function ll(i){i.refCount--,i.refCount===0&&c_(d_,function(){i.controller.abort()})}var ul=null,Ah=0,Ps=0,Ls=null;function f_(i,s){if(ul===null){var u=ul=[];Ah=0,Ps=Rp(),Ls={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Ah++,s.then(ib,ib),s}function ib(){if(--Ah===0&&ul!==null){Ls!==null&&(Ls.status="fulfilled");var i=ul;ul=null,Ps=0,Ls=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function h_(i,s){var u=[],p={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var y=0;y<u.length;y++)(0,u[y])(s)},function(y){for(p.status="rejected",p.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),p}var ab=B.S;B.S=function(i,s){Vx=Me(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&f_(i,s),ab!==null&&ab(i,s)};var Wa=U(null);function jh(){var i=Wa.current;return i!==null?i:Nt.pooledCache}function hc(i,s){s===null?P(Wa,Wa.current):P(Wa,s.pool)}function sb(){var i=jh();return i===null?null:{parent:nn._currentValue,pool:i}}var zs=Error(r(460)),Nh=Error(r(474)),pc=Error(r(542)),mc={then:function(){}};function ob(i){return i=i.status,i==="fulfilled"||i==="rejected"}function lb(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(gi,gi),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,cb(i),i;default:if(typeof s.status=="string")s.then(gi,gi);else{if(i=Nt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(p){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=p}},function(p){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,cb(i),i}throw Qa=s,zs}}function Xa(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Qa=u,zs):u}}var Qa=null;function ub(){if(Qa===null)throw Error(r(459));var i=Qa;return Qa=null,i}function cb(i){if(i===zs||i===pc)throw Error(r(483))}var Us=null,cl=0;function gc(i){var s=cl;return cl+=1,Us===null&&(Us=[]),lb(Us,i,s)}function dl(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function vc(i,s){throw s.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function db(i){function s(Q,K){if(i){var re=Q.deletions;re===null?(Q.deletions=[K],Q.flags|=16):re.push(K)}}function u(Q,K){if(!i)return null;for(;K!==null;)s(Q,K),K=K.sibling;return null}function p(Q){for(var K=new Map;Q!==null;)Q.key!==null?K.set(Q.key,Q):K.set(Q.index,Q),Q=Q.sibling;return K}function y(Q,K){return Q=yi(Q,K),Q.index=0,Q.sibling=null,Q}function x(Q,K,re){return Q.index=re,i?(re=Q.alternate,re!==null?(re=re.index,re<K?(Q.flags|=67108866,K):re):(Q.flags|=67108866,K)):(Q.flags|=1048576,K)}function A(Q){return i&&Q.alternate===null&&(Q.flags|=67108866),Q}function O(Q,K,re,pe){return K===null||K.tag!==6?(K=vh(re,Q.mode,pe),K.return=Q,K):(K=y(K,re),K.return=Q,K)}function F(Q,K,re,pe){var Oe=re.type;return Oe===w?fe(Q,K,re.props.children,pe,re.key):K!==null&&(K.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===L&&Xa(Oe)===K.type)?(K=y(K,re.props),dl(K,re),K.return=Q,K):(K=uc(re.type,re.key,re.props,null,Q.mode,pe),dl(K,re),K.return=Q,K)}function ie(Q,K,re,pe){return K===null||K.tag!==4||K.stateNode.containerInfo!==re.containerInfo||K.stateNode.implementation!==re.implementation?(K=yh(re,Q.mode,pe),K.return=Q,K):(K=y(K,re.children||[]),K.return=Q,K)}function fe(Q,K,re,pe,Oe){return K===null||K.tag!==7?(K=Ga(re,Q.mode,pe,Oe),K.return=Q,K):(K=y(K,re),K.return=Q,K)}function ge(Q,K,re){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=vh(""+K,Q.mode,re),K.return=Q,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return re=uc(K.type,K.key,K.props,null,Q.mode,re),dl(re,K),re.return=Q,re;case S:return K=yh(K,Q.mode,re),K.return=Q,K;case L:return K=Xa(K),ge(Q,K,re)}if(J(K)||G(K))return K=Ga(K,Q.mode,re,null),K.return=Q,K;if(typeof K.then=="function")return ge(Q,gc(K),re);if(K.$$typeof===C)return ge(Q,fc(Q,K),re);vc(Q,K)}return null}function ae(Q,K,re,pe){var Oe=K!==null?K.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Oe!==null?null:O(Q,K,""+re,pe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===Oe?F(Q,K,re,pe):null;case S:return re.key===Oe?ie(Q,K,re,pe):null;case L:return re=Xa(re),ae(Q,K,re,pe)}if(J(re)||G(re))return Oe!==null?null:fe(Q,K,re,pe,null);if(typeof re.then=="function")return ae(Q,K,gc(re),pe);if(re.$$typeof===C)return ae(Q,K,fc(Q,re),pe);vc(Q,re)}return null}function oe(Q,K,re,pe,Oe){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return Q=Q.get(re)||null,O(K,Q,""+pe,Oe);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case b:return Q=Q.get(pe.key===null?re:pe.key)||null,F(K,Q,pe,Oe);case S:return Q=Q.get(pe.key===null?re:pe.key)||null,ie(K,Q,pe,Oe);case L:return pe=Xa(pe),oe(Q,K,re,pe,Oe)}if(J(pe)||G(pe))return Q=Q.get(re)||null,fe(K,Q,pe,Oe,null);if(typeof pe.then=="function")return oe(Q,K,re,gc(pe),Oe);if(pe.$$typeof===C)return oe(Q,K,re,fc(K,pe),Oe);vc(K,pe)}return null}function Ce(Q,K,re,pe){for(var Oe=null,lt=null,je=K,Ke=K=0,tt=null;je!==null&&Ke<re.length;Ke++){je.index>Ke?(tt=je,je=null):tt=je.sibling;var ut=ae(Q,je,re[Ke],pe);if(ut===null){je===null&&(je=tt);break}i&&je&&ut.alternate===null&&s(Q,je),K=x(ut,K,Ke),lt===null?Oe=ut:lt.sibling=ut,lt=ut,je=tt}if(Ke===re.length)return u(Q,je),rt&&bi(Q,Ke),Oe;if(je===null){for(;Ke<re.length;Ke++)je=ge(Q,re[Ke],pe),je!==null&&(K=x(je,K,Ke),lt===null?Oe=je:lt.sibling=je,lt=je);return rt&&bi(Q,Ke),Oe}for(je=p(je);Ke<re.length;Ke++)tt=oe(je,Q,Ke,re[Ke],pe),tt!==null&&(i&&tt.alternate!==null&&je.delete(tt.key===null?Ke:tt.key),K=x(tt,K,Ke),lt===null?Oe=tt:lt.sibling=tt,lt=tt);return i&&je.forEach(function(ca){return s(Q,ca)}),rt&&bi(Q,Ke),Oe}function Ie(Q,K,re,pe){if(re==null)throw Error(r(151));for(var Oe=null,lt=null,je=K,Ke=K=0,tt=null,ut=re.next();je!==null&&!ut.done;Ke++,ut=re.next()){je.index>Ke?(tt=je,je=null):tt=je.sibling;var ca=ae(Q,je,ut.value,pe);if(ca===null){je===null&&(je=tt);break}i&&je&&ca.alternate===null&&s(Q,je),K=x(ca,K,Ke),lt===null?Oe=ca:lt.sibling=ca,lt=ca,je=tt}if(ut.done)return u(Q,je),rt&&bi(Q,Ke),Oe;if(je===null){for(;!ut.done;Ke++,ut=re.next())ut=ge(Q,ut.value,pe),ut!==null&&(K=x(ut,K,Ke),lt===null?Oe=ut:lt.sibling=ut,lt=ut);return rt&&bi(Q,Ke),Oe}for(je=p(je);!ut.done;Ke++,ut=re.next())ut=oe(je,Q,Ke,ut.value,pe),ut!==null&&(i&&ut.alternate!==null&&je.delete(ut.key===null?Ke:ut.key),K=x(ut,K,Ke),lt===null?Oe=ut:lt.sibling=ut,lt=ut);return i&&je.forEach(function(TO){return s(Q,TO)}),rt&&bi(Q,Ke),Oe}function Ct(Q,K,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;K!==null;){if(K.key===Oe){if(Oe=re.type,Oe===w){if(K.tag===7){u(Q,K.sibling),pe=y(K,re.props.children),pe.return=Q,Q=pe;break e}}else if(K.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===L&&Xa(Oe)===K.type){u(Q,K.sibling),pe=y(K,re.props),dl(pe,re),pe.return=Q,Q=pe;break e}u(Q,K);break}else s(Q,K);K=K.sibling}re.type===w?(pe=Ga(re.props.children,Q.mode,pe,re.key),pe.return=Q,Q=pe):(pe=uc(re.type,re.key,re.props,null,Q.mode,pe),dl(pe,re),pe.return=Q,Q=pe)}return A(Q);case S:e:{for(Oe=re.key;K!==null;){if(K.key===Oe)if(K.tag===4&&K.stateNode.containerInfo===re.containerInfo&&K.stateNode.implementation===re.implementation){u(Q,K.sibling),pe=y(K,re.children||[]),pe.return=Q,Q=pe;break e}else{u(Q,K);break}else s(Q,K);K=K.sibling}pe=yh(re,Q.mode,pe),pe.return=Q,Q=pe}return A(Q);case L:return re=Xa(re),Ct(Q,K,re,pe)}if(J(re))return Ce(Q,K,re,pe);if(G(re)){if(Oe=G(re),typeof Oe!="function")throw Error(r(150));return re=Oe.call(re),Ie(Q,K,re,pe)}if(typeof re.then=="function")return Ct(Q,K,gc(re),pe);if(re.$$typeof===C)return Ct(Q,K,fc(Q,re),pe);vc(Q,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,K!==null&&K.tag===6?(u(Q,K.sibling),pe=y(K,re),pe.return=Q,Q=pe):(u(Q,K),pe=vh(re,Q.mode,pe),pe.return=Q,Q=pe),A(Q)):u(Q,K)}return function(Q,K,re,pe){try{cl=0;var Oe=Ct(Q,K,re,pe);return Us=null,Oe}catch(je){if(je===zs||je===pc)throw je;var lt=nr(29,je,null,Q.mode);return lt.lanes=pe,lt.return=Q,lt}}}var Ja=db(!0),fb=db(!1),$i=!1;function Rh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _h(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 Yi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Wi(i,s,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(ht&2)!==0){var y=p.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s,s=lc(i),W0(i,null,u),s}return oc(i,p,s,u),lc(i)}function fl(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,Da(i,u)}}function Oh(i,s){var u=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,u===p)){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:p.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:p.shared,callbacks:p.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var Mh=!1;function hl(){if(Mh){var i=Ls;if(i!==null)throw i}}function pl(i,s,u,p){Mh=!1;var y=i.updateQueue;$i=!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 ge=y.baseState;A=0,fe=ie=F=null,O=x;do{var ae=O.lane&-536870913,oe=ae!==O.lane;if(oe?(et&ae)===ae:(p&ae)===ae){ae!==0&&ae===Ps&&(Mh=!0),fe!==null&&(fe=fe.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Ce=i,Ie=O;ae=s;var Ct=u;switch(Ie.tag){case 1:if(Ce=Ie.payload,typeof Ce=="function"){ge=Ce.call(Ct,ge,ae);break e}ge=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Ie.payload,ae=typeof Ce=="function"?Ce.call(Ct,ge,ae):Ce,ae==null)break e;ge=g({},ge,ae);break e;case 2:$i=!0}}ae=O.callback,ae!==null&&(i.flags|=64,oe&&(i.flags|=8192),oe=y.callbacks,oe===null?y.callbacks=[ae]:oe.push(ae))}else oe={lane:ae,tag:O.tag,payload:O.payload,callback:O.callback,next:null},fe===null?(ie=fe=oe,F=ge):fe=fe.next=oe,A|=ae;if(O=O.next,O===null){if(O=y.shared.pending,O===null)break;oe=O,O=oe.next,oe.next=null,y.lastBaseUpdate=oe,y.shared.pending=null}}while(!0);fe===null&&(F=ge),y.baseState=F,y.firstBaseUpdate=ie,y.lastBaseUpdate=fe,x===null&&(y.shared.lanes=0),ea|=A,i.lanes=A,i.memoizedState=ge}}function hb(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function pb(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)hb(u[i],s)}var Bs=U(null),yc=U(0);function mb(i,s){i=Ri,P(yc,i),P(Bs,s),Ri=i|s.baseLanes}function Dh(){P(yc,Ri),P(Bs,Bs.current)}function Ih(){Ri=yc.current,ee(Bs),ee(yc)}var rr=U(null),xr=null;function Xi(i){var s=i.alternate;P(Qt,Qt.current&1),P(rr,i),xr===null&&(s===null||Bs.current!==null||s.memoizedState!==null)&&(xr=i)}function Ph(i){P(Qt,Qt.current),P(rr,i),xr===null&&(xr=i)}function gb(i){i.tag===22?(P(Qt,Qt.current),P(rr,i),xr===null&&(xr=i)):Qi()}function Qi(){P(Qt,Qt.current),P(rr,rr.current)}function ir(i){ee(rr),xr===i&&(xr=null),ee(Qt)}var Qt=U(0);function bc(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Vp(u)||Hp(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 wi=0,qe=null,Et=null,rn=null,xc=!1,Fs=!1,Za=!1,Sc=0,ml=0,Vs=null,p_=0;function Kt(){throw Error(r(321))}function Lh(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!tr(i[u],s[u]))return!1;return!0}function zh(i,s,u,p,y,x){return wi=x,qe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,B.H=i===null||i.memoizedState===null?Zb:Zh,Za=!1,x=u(p,y),Za=!1,Fs&&(x=yb(s,u,p,y)),vb(i),x}function vb(i){B.H=yl;var s=Et!==null&&Et.next!==null;if(wi=0,rn=Et=qe=null,xc=!1,ml=0,Vs=null,s)throw Error(r(300));i===null||an||(i=i.dependencies,i!==null&&dc(i)&&(an=!0))}function yb(i,s,u,p){qe=i;var y=0;do{if(Fs&&(Vs=null),ml=0,Fs=!1,25<=y)throw Error(r(301));if(y+=1,rn=Et=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}B.H=ex,x=s(u,p)}while(Fs);return x}function m_(){var i=B.H,s=i.useState()[0];return s=typeof s.then=="function"?gl(s):s,i=i.useState()[0],(Et!==null?Et.memoizedState:null)!==i&&(qe.flags|=1024),s}function Uh(){var i=Sc!==0;return Sc=0,i}function Bh(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Fh(i){if(xc){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}xc=!1}wi=0,rn=Et=qe=null,Fs=!1,ml=Sc=0,Vs=null}function zn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?qe.memoizedState=rn=i:rn=rn.next=i,rn}function Jt(){if(Et===null){var i=qe.alternate;i=i!==null?i.memoizedState:null}else i=Et.next;var s=rn===null?qe.memoizedState:rn.next;if(s!==null)rn=s,Et=i;else{if(i===null)throw qe.alternate===null?Error(r(467)):Error(r(310));Et=i,i={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},rn===null?qe.memoizedState=rn=i:rn=rn.next=i}return rn}function wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gl(i){var s=ml;return ml+=1,Vs===null&&(Vs=[]),i=lb(Vs,i,s),s=qe,(rn===null?s.memoizedState:rn.next)===null&&(s=s.alternate,B.H=s===null||s.memoizedState===null?Zb:Zh),i}function Ec(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return gl(i);if(i.$$typeof===C)return xn(i)}throw Error(r(438,String(i)))}function Vh(i){var s=null,u=qe.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=qe.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=wc(),qe.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),p=0;p<i;p++)u[p]=D;return s.index++,u}function Ei(i,s){return typeof s=="function"?s(i):s}function Tc(i){var s=Jt();return Hh(s,Et,i)}function Hh(i,s,u){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var y=i.baseQueue,x=p.pending;if(x!==null){if(y!==null){var A=y.next;y.next=x.next,x.next=A}s.baseQueue=y=x,p.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 ge=ie.lane&-536870913;if(ge!==ie.lane?(et&ge)===ge:(wi&ge)===ge){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}),ge===Ps&&(fe=!0);else if((wi&ae)===ae){ie=ie.next,ae===Ps&&(fe=!0);continue}else ge={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},F===null?(O=F=ge,A=x):F=F.next=ge,qe.lanes|=ae,ea|=ae;ge=ie.action,Za&&u(x,ge),x=ie.hasEagerState?ie.eagerState:u(x,ge)}else ae={lane:ge,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,qe.lanes|=ge,ea|=ge;ie=ie.next}while(ie!==null&&ie!==s);if(F===null?A=x:F.next=O,!tr(x,i.memoizedState)&&(an=!0,fe&&(u=Ls,u!==null)))throw u;i.memoizedState=x,i.baseState=A,i.baseQueue=F,p.lastRenderedState=x}return y===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function qh(i){var s=Jt(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=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);tr(x,s.memoizedState)||(an=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,p]}function bb(i,s,u){var p=qe,y=Jt(),x=rt;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var A=!tr((Et||y).memoizedState,u);if(A&&(y.memoizedState=u,an=!0),y=y.queue,$h(wb.bind(null,p,y,i),[i]),y.getSnapshot!==s||A||rn!==null&&rn.memoizedState.tag&1){if(p.flags|=2048,Hs(9,{destroy:void 0},Sb.bind(null,p,y,u,s),null),Nt===null)throw Error(r(349));x||(wi&127)!==0||xb(p,s,u)}return u}function xb(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=qe.updateQueue,s===null?(s=wc(),qe.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function Sb(i,s,u,p){s.value=u,s.getSnapshot=p,Eb(s)&&Tb(i)}function wb(i,s,u){return u(function(){Eb(s)&&Tb(i)})}function Eb(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!tr(i,u)}catch{return!0}}function Tb(i){var s=qa(i,2);s!==null&&Wn(s,i,2)}function Gh(i){var s=zn();if(typeof i=="function"){var u=i;if(i=u(),Za){z(!0);try{u()}finally{z(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:i},s}function Cb(i,s,u,p){return i.baseState=u,Hh(i,Et,typeof p=="function"?p:Ei)}function g_(i,s,u,p,y){if(Ac(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)}};B.T!==null?u(!0):x.isTransition=!1,p(x),u=s.pending,u===null?(x.next=s.pending=x,kb(s,x)):(x.next=u.next,s.pending=u.next=x)}}function kb(i,s){var u=s.action,p=s.payload,y=i.state;if(s.isTransition){var x=B.T,A={};B.T=A;try{var O=u(y,p),F=B.S;F!==null&&F(A,O),Ab(i,s,O)}catch(ie){Kh(i,s,ie)}finally{x!==null&&A.types!==null&&(x.types=A.types),B.T=x}}else try{x=u(y,p),Ab(i,s,x)}catch(ie){Kh(i,s,ie)}}function Ab(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){jb(i,s,p)},function(p){return Kh(i,s,p)}):jb(i,s,u)}function jb(i,s,u){s.status="fulfilled",s.value=u,Nb(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,kb(i,u)))}function Kh(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,Nb(s),s=s.next;while(s!==p)}i.action=null}function Nb(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Rb(i,s){return s}function _b(i,s){if(rt){var u=Nt.formState;if(u!==null){e:{var p=qe;if(rt){if(zt){t:{for(var y=zt,x=br;y.nodeType!==8;){if(!x){y=null;break t}if(y=Sr(y.nextSibling),y===null){y=null;break t}}x=y.data,y=x==="F!"||x==="F"?y:null}if(y){zt=Sr(y.nextSibling),p=y.data==="F!";break e}}Gi(p)}p=!1}p&&(s=u[0])}}return u=zn(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rb,lastRenderedState:s},u.queue=p,u=Xb.bind(null,qe,p),p.dispatch=u,p=Gh(!1),x=Jh.bind(null,qe,!1,p.queue),p=zn(),y={state:s,dispatch:null,action:i,pending:null},p.queue=y,u=g_.bind(null,qe,y,x,u),y.dispatch=u,p.memoizedState=i,[s,u,!1]}function Ob(i){var s=Jt();return Mb(s,Et,i)}function Mb(i,s,u){if(s=Hh(i,s,Rb)[0],i=Tc(Ei)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=gl(s)}catch(A){throw A===zs?pc:A}else p=s;s=Jt();var y=s.queue,x=y.dispatch;return u!==s.memoizedState&&(qe.flags|=2048,Hs(9,{destroy:void 0},v_.bind(null,y,u),null)),[p,x,i]}function v_(i,s){i.action=s}function Db(i){var s=Jt(),u=Et;if(u!==null)return Mb(s,u,i);Jt(),s=s.memoizedState,u=Jt();var p=u.queue.dispatch;return u.memoizedState=i,[s,p,!1]}function Hs(i,s,u,p){return i={tag:i,create:u,deps:p,inst:s,next:null},s=qe.updateQueue,s===null&&(s=wc(),qe.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(p=u.next,u.next=i,i.next=p,s.lastEffect=i),i}function Ib(){return Jt().memoizedState}function Cc(i,s,u,p){var y=zn();qe.flags|=i,y.memoizedState=Hs(1|s,{destroy:void 0},u,p===void 0?null:p)}function kc(i,s,u,p){var y=Jt();p=p===void 0?null:p;var x=y.memoizedState.inst;Et!==null&&p!==null&&Lh(p,Et.memoizedState.deps)?y.memoizedState=Hs(s,x,u,p):(qe.flags|=i,y.memoizedState=Hs(1|s,x,u,p))}function Pb(i,s){Cc(8390656,8,i,s)}function $h(i,s){kc(2048,8,i,s)}function y_(i){qe.flags|=4;var s=qe.updateQueue;if(s===null)s=wc(),qe.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function Lb(i){var s=Jt().memoizedState;return y_({ref:s,nextImpl:i}),function(){if((ht&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function zb(i,s){return kc(4,2,i,s)}function Ub(i,s){return kc(4,4,i,s)}function Bb(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 Fb(i,s,u){u=u!=null?u.concat([i]):null,kc(4,4,Bb.bind(null,s,i),u)}function Yh(){}function Vb(i,s){var u=Jt();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&Lh(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function Hb(i,s){var u=Jt();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&Lh(s,p[1]))return p[0];if(p=i(),Za){z(!0);try{i()}finally{z(!1)}}return u.memoizedState=[p,s],p}function Wh(i,s,u){return u===void 0||(wi&1073741824)!==0&&(et&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=qx(),qe.lanes|=i,ea|=i,u)}function qb(i,s,u,p){return tr(u,s)?u:Bs.current!==null?(i=Wh(i,u,p),tr(i,s)||(an=!0),i):(wi&42)===0||(wi&1073741824)!==0&&(et&261930)===0?(an=!0,i.memoizedState=u):(i=qx(),qe.lanes|=i,ea|=i,s)}function Gb(i,s,u,p,y){var x=X.p;X.p=x!==0&&8>x?x:8;var A=B.T,O={};B.T=O,Jh(i,!1,s,u);try{var F=y(),ie=B.S;if(ie!==null&&ie(O,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var fe=h_(F,p);vl(i,s,fe,or(i))}else vl(i,s,p,or(i))}catch(ge){vl(i,s,{then:function(){},status:"rejected",reason:ge},or())}finally{X.p=x,A!==null&&O.types!==null&&(A.types=O.types),B.T=A}}function b_(){}function Xh(i,s,u,p){if(i.tag!==5)throw Error(r(476));var y=Kb(i).queue;Gb(i,y,s,le,u===null?b_:function(){return $b(i),u(p)})}function Kb(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:le},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function $b(i){var s=Kb(i);s.next===null&&(s=i.alternate.memoizedState),vl(i,s.next.queue,{},or())}function Qh(){return xn(Dl)}function Yb(){return Jt().memoizedState}function Wb(){return Jt().memoizedState}function x_(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=or();i=Yi(u);var p=Wi(s,i,u);p!==null&&(Wn(p,s,u),fl(p,s,u)),s={cache:kh()},i.payload=s;return}s=s.return}}function S_(i,s,u){var p=or();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ac(i)?Qb(s,u):(u=mh(i,s,u,p),u!==null&&(Wn(u,i,p),Jb(u,s,p)))}function Xb(i,s,u){var p=or();vl(i,s,u,p)}function vl(i,s,u,p){var y={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Ac(i))Qb(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,tr(O,A))return oc(i,s,y,0),Nt===null&&sc(),!1}catch{}if(u=mh(i,s,y,p),u!==null)return Wn(u,i,p),Jb(u,s,p),!0}return!1}function Jh(i,s,u,p){if(p={lane:2,revertLane:Rp(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Ac(i)){if(s)throw Error(r(479))}else s=mh(i,u,p,2),s!==null&&Wn(s,i,2)}function Ac(i){var s=i.alternate;return i===qe||s!==null&&s===qe}function Qb(i,s){Fs=xc=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function Jb(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,Da(i,u)}}var yl={readContext:xn,use:Ec,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};yl.useEffectEvent=Kt;var Zb={readContext:xn,use:Ec,useCallback:function(i,s){return zn().memoizedState=[i,s===void 0?null:s],i},useContext:xn,useEffect:Pb,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,Cc(4194308,4,Bb.bind(null,s,i),u)},useLayoutEffect:function(i,s){return Cc(4194308,4,i,s)},useInsertionEffect:function(i,s){Cc(4,2,i,s)},useMemo:function(i,s){var u=zn();s=s===void 0?null:s;var p=i();if(Za){z(!0);try{i()}finally{z(!1)}}return u.memoizedState=[p,s],p},useReducer:function(i,s,u){var p=zn();if(u!==void 0){var y=u(s);if(Za){z(!0);try{u(s)}finally{z(!1)}}}else y=s;return p.memoizedState=p.baseState=y,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:y},p.queue=i,i=i.dispatch=S_.bind(null,qe,i),[p.memoizedState,i]},useRef:function(i){var s=zn();return i={current:i},s.memoizedState=i},useState:function(i){i=Gh(i);var s=i.queue,u=Xb.bind(null,qe,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Yh,useDeferredValue:function(i,s){var u=zn();return Wh(u,i,s)},useTransition:function(){var i=Gh(!1);return i=Gb.bind(null,qe,i.queue,!0,!1),zn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var p=qe,y=zn();if(rt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),Nt===null)throw Error(r(349));(et&127)!==0||xb(p,s,u)}y.memoizedState=u;var x={value:u,getSnapshot:s};return y.queue=x,Pb(wb.bind(null,p,x,i),[i]),p.flags|=2048,Hs(9,{destroy:void 0},Sb.bind(null,p,x,u,s),null),u},useId:function(){var i=zn(),s=Nt.identifierPrefix;if(rt){var u=Qr,p=Xr;u=(p&~(1<<32-Y(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Sc++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=p_++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Qh,useFormState:_b,useActionState:_b,useOptimistic:function(i){var s=zn();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Jh.bind(null,qe,!0,u),u.dispatch=s,[i,s]},useMemoCache:Vh,useCacheRefresh:function(){return zn().memoizedState=x_.bind(null,qe)},useEffectEvent:function(i){var s=zn(),u={impl:i};return s.memoizedState=u,function(){if((ht&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Zh={readContext:xn,use:Ec,useCallback:Vb,useContext:xn,useEffect:$h,useImperativeHandle:Fb,useInsertionEffect:zb,useLayoutEffect:Ub,useMemo:Hb,useReducer:Tc,useRef:Ib,useState:function(){return Tc(Ei)},useDebugValue:Yh,useDeferredValue:function(i,s){var u=Jt();return qb(u,Et.memoizedState,i,s)},useTransition:function(){var i=Tc(Ei)[0],s=Jt().memoizedState;return[typeof i=="boolean"?i:gl(i),s]},useSyncExternalStore:bb,useId:Yb,useHostTransitionStatus:Qh,useFormState:Ob,useActionState:Ob,useOptimistic:function(i,s){var u=Jt();return Cb(u,Et,i,s)},useMemoCache:Vh,useCacheRefresh:Wb};Zh.useEffectEvent=Lb;var ex={readContext:xn,use:Ec,useCallback:Vb,useContext:xn,useEffect:$h,useImperativeHandle:Fb,useInsertionEffect:zb,useLayoutEffect:Ub,useMemo:Hb,useReducer:qh,useRef:Ib,useState:function(){return qh(Ei)},useDebugValue:Yh,useDeferredValue:function(i,s){var u=Jt();return Et===null?Wh(u,i,s):qb(u,Et.memoizedState,i,s)},useTransition:function(){var i=qh(Ei)[0],s=Jt().memoizedState;return[typeof i=="boolean"?i:gl(i),s]},useSyncExternalStore:bb,useId:Yb,useHostTransitionStatus:Qh,useFormState:Db,useActionState:Db,useOptimistic:function(i,s){var u=Jt();return Et!==null?Cb(u,Et,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Vh,useCacheRefresh:Wb};ex.useEffectEvent=Lb;function ep(i,s,u,p){s=i.memoizedState,u=u(p,s),u=u==null?s:g({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var tp={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=or(),y=Yi(p);y.payload=s,u!=null&&(y.callback=u),s=Wi(i,y,p),s!==null&&(Wn(s,i,p),fl(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=or(),y=Yi(p);y.tag=1,y.payload=s,u!=null&&(y.callback=u),s=Wi(i,y,p),s!==null&&(Wn(s,i,p),fl(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=or(),p=Yi(u);p.tag=2,s!=null&&(p.callback=s),s=Wi(i,p,u),s!==null&&(Wn(s,i,u),fl(s,i,u))}};function tx(i,s,u,p,y,x,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,x,A):s.prototype&&s.prototype.isPureReactComponent?!il(u,p)||!il(y,x):!0}function nx(i,s,u,p){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==i&&tp.enqueueReplaceState(s,s.state,null)}function es(i,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(i=i.defaultProps){u===s&&(u=g({},u));for(var y in i)u[y]===void 0&&(u[y]=i[y])}return u}function rx(i){ac(i)}function ix(i){console.error(i)}function ax(i){ac(i)}function jc(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function sx(i,s,u){try{var p=i.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function np(i,s,u){return u=Yi(u),u.tag=3,u.payload={element:null},u.callback=function(){jc(i,s)},u}function ox(i){return i=Yi(i),i.tag=3,i}function lx(i,s,u,p){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var x=p.value;i.payload=function(){return y(x)},i.callback=function(){sx(s,u,p)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(i.callback=function(){sx(s,u,p),typeof y!="function"&&(ta===null?ta=new Set([this]):ta.add(this));var O=p.stack;this.componentDidCatch(p.value,{componentStack:O!==null?O:""})})}function w_(i,s,u,p,y){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&Is(s,u,y,!0),u=rr.current,u!==null){switch(u.tag){case 31:case 13:return xr===null?Bc():u.alternate===null&&$t===0&&($t=3),u.flags&=-257,u.flags|=65536,u.lanes=y,p===mc?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),Ap(i,p,y)),!1;case 22:return u.flags|=65536,p===mc?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),Ap(i,p,y)),!1}throw Error(r(435,u.tag))}return Ap(i,p,y),Bc(),!1}if(rt)return s=rr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=y,p!==Sh&&(i=Error(r(422),{cause:p}),ol(gr(i,u)))):(p!==Sh&&(s=Error(r(423),{cause:p}),ol(gr(s,u))),i=i.current.alternate,i.flags|=65536,y&=-y,i.lanes|=y,p=gr(p,u),y=np(i.stateNode,p,y),Oh(i,y),$t!==4&&($t=2)),!1;var x=Error(r(520),{cause:p});if(x=gr(x,u),kl===null?kl=[x]:kl.push(x),$t!==4&&($t=2),s===null)return!0;p=gr(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=y&-y,u.lanes|=i,i=np(u.stateNode,p,i),Oh(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"&&(ta===null||!ta.has(x))))return u.flags|=65536,y&=-y,u.lanes|=y,y=ox(y),lx(y,i,u,p),Oh(u,y),!1}u=u.return}while(u!==null);return!1}var rp=Error(r(461)),an=!1;function Sn(i,s,u,p){s.child=i===null?fb(s,null,u,p):Ja(s,i.child,u,p)}function ux(i,s,u,p,y){u=u.render;var x=s.ref;if("ref"in p){var A={};for(var O in p)O!=="ref"&&(A[O]=p[O])}else A=p;return Ya(s),p=zh(i,s,u,A,x,y),O=Uh(),i!==null&&!an?(Bh(i,s,y),Ti(i,s,y)):(rt&&O&&bh(s),s.flags|=1,Sn(i,s,p,y),s.child)}function cx(i,s,u,p,y){if(i===null){var x=u.type;return typeof x=="function"&&!gh(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,dx(i,s,x,p,y)):(i=uc(u.type,null,p,s,s.mode,y),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,!dp(i,y)){var A=x.memoizedProps;if(u=u.compare,u=u!==null?u:il,u(A,p)&&i.ref===s.ref)return Ti(i,s,y)}return s.flags|=1,i=yi(x,p),i.ref=s.ref,i.return=s,s.child=i}function dx(i,s,u,p,y){if(i!==null){var x=i.memoizedProps;if(il(x,p)&&i.ref===s.ref)if(an=!1,s.pendingProps=p=x,dp(i,y))(i.flags&131072)!==0&&(an=!0);else return s.lanes=i.lanes,Ti(i,s,y)}return ip(i,s,u,p,y)}function fx(i,s,u,p){var y=p.children,x=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,i!==null){for(p=s.child=i.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~x}else p=0,s.child=null;return hx(i,s,x,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&hc(s,x!==null?x.cachePool:null),x!==null?mb(s,x):Dh(),gb(s);else return p=s.lanes=536870912,hx(i,s,x!==null?x.baseLanes|u:u,u,p)}else x!==null?(hc(s,x.cachePool),mb(s,x),Qi(),s.memoizedState=null):(i!==null&&hc(s,null),Dh(),Qi());return Sn(i,s,y,u),s.child}function bl(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function hx(i,s,u,p,y){var x=jh();return x=x===null?null:{parent:nn._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},i!==null&&hc(s,null),Dh(),gb(s),i!==null&&Is(i,s,p,!0),s.childLanes=y,null}function Nc(i,s){return s=_c({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function px(i,s,u){return Ja(s,i.child,null,u),i=Nc(s,s.pendingProps),i.flags|=2,ir(s),s.memoizedState=null,i}function E_(i,s,u){var p=s.pendingProps,y=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(rt){if(p.mode==="hidden")return i=Nc(s,p),s.lanes=536870912,bl(null,i);if(Ph(s),(i=zt)?(i=kS(i,br),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Hi!==null?{id:Xr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},u=Q0(i),u.return=s,s.child=u,bn=s,zt=null)):i=null,i===null)throw Gi(s);return s.lanes=536870912,null}return Nc(s,p)}var x=i.memoizedState;if(x!==null){var A=x.dehydrated;if(Ph(s),y)if(s.flags&256)s.flags&=-257,s=px(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(an||Is(i,s,u,!1),y=(u&i.childLanes)!==0,an||y){if(p=Nt,p!==null&&(A=Ia(p,u),A!==0&&A!==x.retryLane))throw x.retryLane=A,qa(i,A),Wn(p,i,A),rp;Bc(),s=px(i,s,u)}else i=x.treeContext,zt=Sr(A.nextSibling),bn=s,rt=!0,qi=null,br=!1,i!==null&&eb(s,i),s=Nc(s,p),s.flags|=4096;return s}return i=yi(i.child,{mode:p.mode,children:p.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Rc(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 ip(i,s,u,p,y){return Ya(s),u=zh(i,s,u,p,void 0,y),p=Uh(),i!==null&&!an?(Bh(i,s,y),Ti(i,s,y)):(rt&&p&&bh(s),s.flags|=1,Sn(i,s,u,y),s.child)}function mx(i,s,u,p,y,x){return Ya(s),s.updateQueue=null,u=yb(s,p,u,y),vb(i),p=Uh(),i!==null&&!an?(Bh(i,s,x),Ti(i,s,x)):(rt&&p&&bh(s),s.flags|=1,Sn(i,s,u,x),s.child)}function gx(i,s,u,p,y){if(Ya(s),s.stateNode===null){var x=_s,A=u.contextType;typeof A=="object"&&A!==null&&(x=xn(A)),x=new u(p,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=tp,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=p,x.state=s.memoizedState,x.refs={},Rh(s),A=u.contextType,x.context=typeof A=="object"&&A!==null?xn(A):_s,x.state=s.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(ep(s,u,A,p),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&&tp.enqueueReplaceState(x,x.state,null),pl(s,p,x,y),hl(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(i===null){x=s.stateNode;var O=s.memoizedProps,F=es(u,O);x.props=F;var ie=x.context,fe=u.contextType;A=_s,typeof fe=="object"&&fe!==null&&(A=xn(fe));var ge=u.getDerivedStateFromProps;fe=typeof ge=="function"||typeof x.getSnapshotBeforeUpdate=="function",O=s.pendingProps!==O,fe||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O||ie!==A)&&nx(s,x,p,A),$i=!1;var ae=s.memoizedState;x.state=ae,pl(s,p,x,y),hl(),ie=s.memoizedState,O||ae!==ie||$i?(typeof ge=="function"&&(ep(s,u,ge,p),ie=s.memoizedState),(F=$i||tx(s,u,F,p,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=p,s.memoizedState=ie),x.props=p,x.state=ie,x.context=A,p=F):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{x=s.stateNode,_h(i,s),A=s.memoizedProps,fe=es(u,A),x.props=fe,ge=s.pendingProps,ae=x.context,ie=u.contextType,F=_s,typeof ie=="object"&&ie!==null&&(F=xn(ie)),O=u.getDerivedStateFromProps,(ie=typeof O=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A!==ge||ae!==F)&&nx(s,x,p,F),$i=!1,ae=s.memoizedState,x.state=ae,pl(s,p,x,y),hl();var oe=s.memoizedState;A!==ge||ae!==oe||$i||i!==null&&i.dependencies!==null&&dc(i.dependencies)?(typeof O=="function"&&(ep(s,u,O,p),oe=s.memoizedState),(fe=$i||tx(s,u,fe,p,ae,oe,F)||i!==null&&i.dependencies!==null&&dc(i.dependencies))?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(p,oe,F),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(p,oe,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=p,s.memoizedState=oe),x.props=p,x.state=oe,x.context=F,p=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),p=!1)}return x=p,Rc(i,s),p=(s.flags&128)!==0,x||p?(x=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,i!==null&&p?(s.child=Ja(s,i.child,null,y),s.child=Ja(s,null,u,y)):Sn(i,s,u,y),s.memoizedState=x.state,i=s.child):i=Ti(i,s,y),i}function vx(i,s,u,p){return Ka(),s.flags|=256,Sn(i,s,u,p),s.child}var ap={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function sp(i){return{baseLanes:i,cachePool:sb()}}function op(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=sr),i}function yx(i,s,u){var p=s.pendingProps,y=!1,x=(s.flags&128)!==0,A;if((A=x)||(A=i!==null&&i.memoizedState===null?!1:(Qt.current&2)!==0),A&&(y=!0,s.flags&=-129),A=(s.flags&32)!==0,s.flags&=-33,i===null){if(rt){if(y?Xi(s):Qi(),(i=zt)?(i=kS(i,br),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Hi!==null?{id:Xr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},u=Q0(i),u.return=s,s.child=u,bn=s,zt=null)):i=null,i===null)throw Gi(s);return Hp(i)?s.lanes=32:s.lanes=536870912,null}var O=p.children;return p=p.fallback,y?(Qi(),y=s.mode,O=_c({mode:"hidden",children:O},y),p=Ga(p,y,u,null),O.return=s,p.return=s,O.sibling=p,s.child=O,p=s.child,p.memoizedState=sp(u),p.childLanes=op(i,A,u),s.memoizedState=ap,bl(null,p)):(Xi(s),lp(s,O))}var F=i.memoizedState;if(F!==null&&(O=F.dehydrated,O!==null)){if(x)s.flags&256?(Xi(s),s.flags&=-257,s=up(i,s,u)):s.memoizedState!==null?(Qi(),s.child=i.child,s.flags|=128,s=null):(Qi(),O=p.fallback,y=s.mode,p=_c({mode:"visible",children:p.children},y),O=Ga(O,y,u,null),O.flags|=2,p.return=s,O.return=s,p.sibling=O,s.child=p,Ja(s,i.child,null,u),p=s.child,p.memoizedState=sp(u),p.childLanes=op(i,A,u),s.memoizedState=ap,s=bl(null,p));else if(Xi(s),Hp(O)){if(A=O.nextSibling&&O.nextSibling.dataset,A)var ie=A.dgst;A=ie,p=Error(r(419)),p.stack="",p.digest=A,ol({value:p,source:null,stack:null}),s=up(i,s,u)}else if(an||Is(i,s,u,!1),A=(u&i.childLanes)!==0,an||A){if(A=Nt,A!==null&&(p=Ia(A,u),p!==0&&p!==F.retryLane))throw F.retryLane=p,qa(i,p),Wn(A,i,p),rp;Vp(O)||Bc(),s=up(i,s,u)}else Vp(O)?(s.flags|=192,s.child=i.child,s=null):(i=F.treeContext,zt=Sr(O.nextSibling),bn=s,rt=!0,qi=null,br=!1,i!==null&&eb(s,i),s=lp(s,p.children),s.flags|=4096);return s}return y?(Qi(),O=p.fallback,y=s.mode,F=i.child,ie=F.sibling,p=yi(F,{mode:"hidden",children:p.children}),p.subtreeFlags=F.subtreeFlags&65011712,ie!==null?O=yi(ie,O):(O=Ga(O,y,u,null),O.flags|=2),O.return=s,p.return=s,p.sibling=O,s.child=p,bl(null,p),p=s.child,O=i.child.memoizedState,O===null?O=sp(u):(y=O.cachePool,y!==null?(F=nn._currentValue,y=y.parent!==F?{parent:F,pool:F}:y):y=sb(),O={baseLanes:O.baseLanes|u,cachePool:y}),p.memoizedState=O,p.childLanes=op(i,A,u),s.memoizedState=ap,bl(i.child,p)):(Xi(s),u=i.child,i=u.sibling,u=yi(u,{mode:"visible",children:p.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 lp(i,s){return s=_c({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function _c(i,s){return i=nr(22,i,null,s),i.lanes=0,i}function up(i,s,u){return Ja(s,i.child,null,u),i=lp(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function bx(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),Th(i.return,s,u)}function cp(i,s,u,p,y,x){var A=i.memoizedState;A===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y,treeForkCount:x}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=p,A.tail=u,A.tailMode=y,A.treeForkCount=x)}function xx(i,s,u){var p=s.pendingProps,y=p.revealOrder,x=p.tail;p=p.children;var A=Qt.current,O=(A&2)!==0;if(O?(A=A&1|2,s.flags|=128):A&=1,P(Qt,A),Sn(i,s,p,u),p=rt?sl:0,!O&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&bx(i,u,s);else if(i.tag===19)bx(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&&bc(i)===null&&(y=u),u=u.sibling;u=y,u===null?(y=s.child,s.child=null):(y=u.sibling,u.sibling=null),cp(s,!1,y,u,x,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=s.child,s.child=null;y!==null;){if(i=y.alternate,i!==null&&bc(i)===null){s.child=y;break}i=y.sibling,y.sibling=u,u=y,y=i}cp(s,!0,u,null,x,p);break;case"together":cp(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function Ti(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),ea|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(Is(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=yi(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=yi(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function dp(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&dc(i)))}function T_(i,s,u){switch(s.tag){case 3:Ue(s,s.stateNode.containerInfo),Ki(s,nn,i.memoizedState.cache),Ka();break;case 27:case 5:ve(s);break;case 4:Ue(s,s.stateNode.containerInfo);break;case 10:Ki(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Ph(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(Xi(s),s.flags|=128,null):(u&s.child.childLanes)!==0?yx(i,s,u):(Xi(s),i=Ti(i,s,u),i!==null?i.sibling:null);Xi(s);break;case 19:var y=(i.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(Is(i,s,u,!1),p=(u&s.childLanes)!==0),y){if(p)return xx(i,s,u);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),P(Qt,Qt.current),p)break;return null;case 22:return s.lanes=0,fx(i,s,u,s.pendingProps);case 24:Ki(s,nn,i.memoizedState.cache)}return Ti(i,s,u)}function Sx(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)an=!0;else{if(!dp(i,u)&&(s.flags&128)===0)return an=!1,T_(i,s,u);an=(i.flags&131072)!==0}else an=!1,rt&&(s.flags&1048576)!==0&&Z0(s,sl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(i=Xa(s.elementType),s.type=i,typeof i=="function")gh(i)?(p=es(i,p),s.tag=1,s=gx(null,s,i,p,u)):(s.tag=0,s=ip(null,s,i,p,u));else{if(i!=null){var y=i.$$typeof;if(y===N){s.tag=11,s=ux(null,s,i,p,u);break e}else if(y===I){s.tag=14,s=cx(null,s,i,p,u);break e}}throw s=ce(i)||i,Error(r(306,s,""))}}return s;case 0:return ip(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,y=es(p,s.pendingProps),gx(i,s,p,y,u);case 3:e:{if(Ue(s,s.stateNode.containerInfo),i===null)throw Error(r(387));p=s.pendingProps;var x=s.memoizedState;y=x.element,_h(i,s),pl(s,p,null,u);var A=s.memoizedState;if(p=A.cache,Ki(s,nn,p),p!==x.cache&&Ch(s,[nn],u,!0),hl(),p=A.element,x.isDehydrated)if(x={element:p,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=vx(i,s,p,u);break e}else if(p!==y){y=gr(Error(r(424)),s),ol(y),s=vx(i,s,p,u);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,zt=Sr(i.firstChild),bn=s,rt=!0,qi=null,br=!0,u=fb(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ka(),p===y){s=Ti(i,s,u);break e}Sn(i,s,p,u)}s=s.child}return s;case 26:return Rc(i,s),i===null?(u=OS(s.type,null,s.pendingProps,null))?s.memoizedState=u:rt||(u=s.type,i=s.pendingProps,p=$c(Se.current).createElement(u),p[dn]=s,p[Nn]=i,wn(p,u,i),wt(p),s.stateNode=p):s.memoizedState=OS(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ve(s),i===null&&rt&&(p=s.stateNode=NS(s.type,s.pendingProps,Se.current),bn=s,br=!0,y=zt,aa(s.type)?(qp=y,zt=Sr(p.firstChild)):zt=y),Sn(i,s,s.pendingProps.children,u),Rc(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&rt&&((y=p=zt)&&(p=eO(p,s.type,s.pendingProps,br),p!==null?(s.stateNode=p,bn=s,zt=Sr(p.firstChild),br=!1,y=!0):y=!1),y||Gi(s)),ve(s),y=s.type,x=s.pendingProps,A=i!==null?i.memoizedProps:null,p=x.children,Up(y,x)?p=null:A!==null&&Up(y,A)&&(s.flags|=32),s.memoizedState!==null&&(y=zh(i,s,m_,null,null,u),Dl._currentValue=y),Rc(i,s),Sn(i,s,p,u),s.child;case 6:return i===null&&rt&&((i=u=zt)&&(u=tO(u,s.pendingProps,br),u!==null?(s.stateNode=u,bn=s,zt=null,i=!0):i=!1),i||Gi(s)),null;case 13:return yx(i,s,u);case 4:return Ue(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=Ja(s,null,p,u):Sn(i,s,p,u),s.child;case 11:return ux(i,s,s.type,s.pendingProps,u);case 7:return Sn(i,s,s.pendingProps,u),s.child;case 8:return Sn(i,s,s.pendingProps.children,u),s.child;case 12:return Sn(i,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,Ki(s,s.type,p.value),Sn(i,s,p.children,u),s.child;case 9:return y=s.type._context,p=s.pendingProps.children,Ya(s),y=xn(y),p=p(y),s.flags|=1,Sn(i,s,p,u),s.child;case 14:return cx(i,s,s.type,s.pendingProps,u);case 15:return dx(i,s,s.type,s.pendingProps,u);case 19:return xx(i,s,u);case 31:return E_(i,s,u);case 22:return fx(i,s,u,s.pendingProps);case 24:return Ya(s),p=xn(nn),i===null?(y=jh(),y===null&&(y=Nt,x=kh(),y.pooledCache=x,x.refCount++,x!==null&&(y.pooledCacheLanes|=u),y=x),s.memoizedState={parent:p,cache:y},Rh(s),Ki(s,nn,y)):((i.lanes&u)!==0&&(_h(i,s),pl(s,null,null,u),hl()),y=i.memoizedState,x=s.memoizedState,y.parent!==p?(y={parent:p,cache:p},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),Ki(s,nn,p)):(p=x.cache,Ki(s,nn,p),p!==y.cache&&Ch(s,[nn],u,!0))),Sn(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ci(i){i.flags|=4}function fp(i,s,u,p,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(Yx())i.flags|=8192;else throw Qa=mc,Nh}else i.flags&=-16777217}function wx(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!LS(s))if(Yx())i.flags|=8192;else throw Qa=mc,Nh}function Oc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Go():536870912,i.lanes|=s,$s|=s)}function xl(i,s){if(!rt)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 p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function Ut(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,p=0;if(s)for(var y=i.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=i,y=y.sibling;else for(y=i.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=i,y=y.sibling;return i.subtreeFlags|=p,i.childLanes=u,s}function C_(i,s,u){var p=s.pendingProps;switch(xh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(s),null;case 1:return Ut(s),null;case 3:return u=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),Si(nn),Ne(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Ds(s)?Ci(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,wh())),Ut(s),null;case 26:var y=s.type,x=s.memoizedState;return i===null?(Ci(s),x!==null?(Ut(s),wx(s,x)):(Ut(s),fp(s,y,null,p,u))):x?x!==i.memoizedState?(Ci(s),Ut(s),wx(s,x)):(Ut(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&Ci(s),Ut(s),fp(s,y,i,p,u)),null;case 27:if(Pe(s),u=Se.current,y=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Ci(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Ut(s),null}i=ue.current,Ds(s)?tb(s):(i=NS(y,p,u),s.stateNode=i,Ci(s))}return Ut(s),null;case 5:if(Pe(s),y=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Ci(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Ut(s),null}if(x=ue.current,Ds(s))tb(s);else{var A=$c(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 p.is=="string"?A.createElement("select",{is:p.is}):A.createElement("select"),p.multiple?x.multiple=!0:p.size&&(x.size=p.size);break;default:x=typeof p.is=="string"?A.createElement(y,{is:p.is}):A.createElement(y)}}x[dn]=s,x[Nn]=p;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(wn(x,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Ci(s)}}return Ut(s),fp(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==p&&Ci(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(r(166));if(i=Se.current,Ds(s)){if(i=s.stateNode,u=s.memoizedProps,p=null,y=bn,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}i[dn]=s,i=!!(i.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||yS(i.nodeValue,u)),i||Gi(s,!0)}else i=$c(i).createTextNode(p),i[dn]=s,s.stateNode=i}return Ut(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(p=Ds(s),u!==null){if(i===null){if(!p)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[dn]=s}else Ka(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ut(s),i=!1}else u=wh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(ir(s),s):(ir(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Ut(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(y=Ds(s),p!==null&&p.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[dn]=s}else Ka(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ut(s),y=!1}else y=wh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(ir(s),s):(ir(s),null)}return ir(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,i=i!==null&&i.memoizedState!==null,u&&(p=s.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),x=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(x=p.memoizedState.cachePool.pool),x!==y&&(p.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),Oc(s,s.updateQueue),Ut(s),null);case 4:return Ne(),i===null&&Dp(s.stateNode.containerInfo),Ut(s),null;case 10:return Si(s.type),Ut(s),null;case 19:if(ee(Qt),p=s.memoizedState,p===null)return Ut(s),null;if(y=(s.flags&128)!==0,x=p.rendering,x===null)if(y)xl(p,!1);else{if($t!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(x=bc(i),x!==null){for(s.flags|=128,xl(p,!1),i=x.updateQueue,s.updateQueue=i,Oc(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)X0(u,i),u=u.sibling;return P(Qt,Qt.current&1|2),rt&&bi(s,p.treeForkCount),s.child}i=i.sibling}p.tail!==null&&Me()>Lc&&(s.flags|=128,y=!0,xl(p,!1),s.lanes=4194304)}else{if(!y)if(i=bc(x),i!==null){if(s.flags|=128,y=!0,i=i.updateQueue,s.updateQueue=i,Oc(s,i),xl(p,!0),p.tail===null&&p.tailMode==="hidden"&&!x.alternate&&!rt)return Ut(s),null}else 2*Me()-p.renderingStartTime>Lc&&u!==536870912&&(s.flags|=128,y=!0,xl(p,!1),s.lanes=4194304);p.isBackwards?(x.sibling=s.child,s.child=x):(i=p.last,i!==null?i.sibling=x:s.child=x,p.last=x)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=Me(),i.sibling=null,u=Qt.current,P(Qt,y?u&1|2:u&1),rt&&bi(s,p.treeForkCount),i):(Ut(s),null);case 22:case 23:return ir(s),Ih(),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(Ut(s),s.subtreeFlags&6&&(s.flags|=8192)):Ut(s),u=s.updateQueue,u!==null&&Oc(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),i!==null&&ee(Wa),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Si(nn),Ut(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function k_(i,s){switch(xh(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Si(nn),Ne(),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(ir(s),s.alternate===null)throw Error(r(340));Ka()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(ir(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ka()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return ee(Qt),null;case 4:return Ne(),null;case 10:return Si(s.type),null;case 22:case 23:return ir(s),Ih(),i!==null&&ee(Wa),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Si(nn),null;case 25:return null;default:return null}}function Ex(i,s){switch(xh(s),s.tag){case 3:Si(nn),Ne();break;case 26:case 27:case 5:Pe(s);break;case 4:Ne();break;case 31:s.memoizedState!==null&&ir(s);break;case 13:ir(s);break;case 19:ee(Qt);break;case 10:Si(s.type);break;case 22:case 23:ir(s),Ih(),i!==null&&ee(Wa);break;case 24:Si(nn)}}function Sl(i,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&i)===i){p=void 0;var x=u.create,A=u.inst;p=x(),A.destroy=p}u=u.next}while(u!==y)}}catch(O){xt(s,s.return,O)}}function Ji(i,s,u){try{var p=s.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var x=y.next;p=x;do{if((p.tag&i)===i){var A=p.inst,O=A.destroy;if(O!==void 0){A.destroy=void 0,y=s;var F=u,ie=O;try{ie()}catch(fe){xt(y,F,fe)}}}p=p.next}while(p!==x)}}catch(fe){xt(s,s.return,fe)}}function Tx(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{pb(s,u)}catch(p){xt(i,i.return,p)}}}function Cx(i,s,u){u.props=es(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){xt(i,s,p)}}function wl(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof u=="function"?i.refCleanup=u(p):u.current=p}}catch(y){xt(i,s,y)}}function Jr(i,s){var u=i.ref,p=i.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(y){xt(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){xt(i,s,y)}else u.current=null}function kx(i){var s=i.type,u=i.memoizedProps,p=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(y){xt(i,i.return,y)}}function hp(i,s,u){try{var p=i.stateNode;Y_(p,i.type,u,s),p[Nn]=s}catch(y){xt(i,i.return,y)}}function Ax(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&aa(i.type)||i.tag===4}function pp(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Ax(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&&aa(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 mp(i,s,u){var p=i.tag;if(p===5||p===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=gi));else if(p!==4&&(p===27&&aa(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(mp(i,s,u),i=i.sibling;i!==null;)mp(i,s,u),i=i.sibling}function Mc(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(p!==4&&(p===27&&aa(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Mc(i,s,u),i=i.sibling;i!==null;)Mc(i,s,u),i=i.sibling}function jx(i){var s=i.stateNode,u=i.memoizedProps;try{for(var p=i.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);wn(s,p,u),s[dn]=i,s[Nn]=u}catch(x){xt(i,i.return,x)}}var ki=!1,sn=!1,gp=!1,Nx=typeof WeakSet=="function"?WeakSet:Set,vn=null;function A_(i,s){if(i=i.containerInfo,Lp=ed,i=F0(i),uh(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,x=p.focusNode;p=p.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var A=0,O=-1,F=-1,ie=0,fe=0,ge=i,ae=null;t:for(;;){for(var oe;ge!==u||y!==0&&ge.nodeType!==3||(O=A+y),ge!==x||p!==0&&ge.nodeType!==3||(F=A+p),ge.nodeType===3&&(A+=ge.nodeValue.length),(oe=ge.firstChild)!==null;)ae=ge,ge=oe;for(;;){if(ge===i)break t;if(ae===u&&++ie===y&&(O=A),ae===x&&++fe===p&&(F=A),(oe=ge.nextSibling)!==null)break;ge=ae,ae=ge.parentNode}ge=oe}u=O===-1||F===-1?null:{start:O,end:F}}else u=null}u=u||{start:0,end:0}}else u=null;for(zp={focusedElem:i,selectionRange:u},ed=!1,vn=s;vn!==null;)if(s=vn,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,vn=i;else for(;vn!==null;){switch(s=vn,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,p=u.stateNode;try{var Ce=es(u.type,y);i=p.getSnapshotBeforeUpdate(Ce,x),p.__reactInternalSnapshotBeforeUpdate=i}catch(Ie){xt(u,u.return,Ie)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Fp(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Fp(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,vn=i;break}vn=s.return}}function Rx(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:ji(i,u),p&4&&Sl(5,u);break;case 1:if(ji(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(A){xt(u,u.return,A)}else{var y=es(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(y,s,i.__reactInternalSnapshotBeforeUpdate)}catch(A){xt(u,u.return,A)}}p&64&&Tx(u),p&512&&wl(u,u.return);break;case 3:if(ji(i,u),p&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{pb(i,s)}catch(A){xt(u,u.return,A)}}break;case 27:s===null&&p&4&&jx(u);case 26:case 5:ji(i,u),s===null&&p&4&&kx(u),p&512&&wl(u,u.return);break;case 12:ji(i,u);break;case 31:ji(i,u),p&4&&Mx(i,u);break;case 13:ji(i,u),p&4&&Dx(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=P_.bind(null,u),nO(i,u))));break;case 22:if(p=u.memoizedState!==null||ki,!p){s=s!==null&&s.memoizedState!==null||sn,y=ki;var x=sn;ki=p,(sn=s)&&!x?Ni(i,u,(u.subtreeFlags&8772)!==0):ji(i,u),ki=y,sn=x}break;case 30:break;default:ji(i,u)}}function _x(i){var s=i.alternate;s!==null&&(i.alternate=null,_x(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&$(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 Vt=null,Gn=!1;function Ai(i,s,u){for(u=u.child;u!==null;)Ox(i,s,u),u=u.sibling}function Ox(i,s,u){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Ot,u)}catch{}switch(u.tag){case 26:sn||Jr(u,s),Ai(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:sn||Jr(u,s);var p=Vt,y=Gn;aa(u.type)&&(Vt=u.stateNode,Gn=!1),Ai(i,s,u),_l(u.stateNode),Vt=p,Gn=y;break;case 5:sn||Jr(u,s);case 6:if(p=Vt,y=Gn,Vt=null,Ai(i,s,u),Vt=p,Gn=y,Vt!==null)if(Gn)try{(Vt.nodeType===9?Vt.body:Vt.nodeName==="HTML"?Vt.ownerDocument.body:Vt).removeChild(u.stateNode)}catch(x){xt(u,s,x)}else try{Vt.removeChild(u.stateNode)}catch(x){xt(u,s,x)}break;case 18:Vt!==null&&(Gn?(i=Vt,TS(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),to(i)):TS(Vt,u.stateNode));break;case 4:p=Vt,y=Gn,Vt=u.stateNode.containerInfo,Gn=!0,Ai(i,s,u),Vt=p,Gn=y;break;case 0:case 11:case 14:case 15:Ji(2,u,s),sn||Ji(4,u,s),Ai(i,s,u);break;case 1:sn||(Jr(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&Cx(u,s,p)),Ai(i,s,u);break;case 21:Ai(i,s,u);break;case 22:sn=(p=sn)||u.memoizedState!==null,Ai(i,s,u),sn=p;break;default:Ai(i,s,u)}}function Mx(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{to(i)}catch(u){xt(s,s.return,u)}}}function Dx(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{to(i)}catch(u){xt(s,s.return,u)}}function j_(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Nx),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Nx),s;default:throw Error(r(435,i.tag))}}function Dc(i,s){var u=j_(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var y=L_.bind(null,i,p);p.then(y,y)}})}function Kn(i,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p],x=i,A=s,O=A;e:for(;O!==null;){switch(O.tag){case 27:if(aa(O.type)){Vt=O.stateNode,Gn=!1;break e}break;case 5:Vt=O.stateNode,Gn=!1;break e;case 3:case 4:Vt=O.stateNode.containerInfo,Gn=!0;break e}O=O.return}if(Vt===null)throw Error(r(160));Ox(x,A,y),Vt=null,Gn=!1,x=y.alternate,x!==null&&(x.return=null),y.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Ix(s,i),s=s.sibling}var zr=null;function Ix(i,s){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Kn(s,i),$n(i),p&4&&(Ji(3,i,i.return),Sl(3,i),Ji(5,i,i.return));break;case 1:Kn(s,i),$n(i),p&512&&(sn||u===null||Jr(u,u.return)),p&64&&ki&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var y=zr;if(Kn(s,i),$n(i),p&512&&(sn||u===null||Jr(u,u.return)),p&4){var x=u!==null?u.memoizedState:null;if(p=i.memoizedState,u===null)if(p===null)if(i.stateNode===null){e:{p=i.type,u=i.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":x=y.getElementsByTagName("title")[0],(!x||x[Pa]||x[dn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=y.createElement(p),y.head.insertBefore(x,y.querySelector("head > title"))),wn(x,p,u),x[dn]=i,wt(x),p=x;break e;case"link":var A=IS("link","href",y).get(p+(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(p),wn(x,p,u),y.head.appendChild(x);break;case"meta":if(A=IS("meta","content",y).get(p+(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(p),wn(x,p,u),y.head.appendChild(x);break;default:throw Error(r(468,p))}x[dn]=i,wt(x),p=x}i.stateNode=p}else PS(y,i.type,i.stateNode);else i.stateNode=DS(y,p,i.memoizedProps);else x!==p?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,p===null?PS(y,i.type,i.stateNode):DS(y,p,i.memoizedProps)):p===null&&i.stateNode!==null&&hp(i,i.memoizedProps,u.memoizedProps)}break;case 27:Kn(s,i),$n(i),p&512&&(sn||u===null||Jr(u,u.return)),u!==null&&p&4&&hp(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Kn(s,i),$n(i),p&512&&(sn||u===null||Jr(u,u.return)),i.flags&32){y=i.stateNode;try{Ts(y,"")}catch(Ce){xt(i,i.return,Ce)}}p&4&&i.stateNode!=null&&(y=i.memoizedProps,hp(i,y,u!==null?u.memoizedProps:y)),p&1024&&(gp=!0);break;case 6:if(Kn(s,i),$n(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,u=i.stateNode;try{u.nodeValue=p}catch(Ce){xt(i,i.return,Ce)}}break;case 3:if(Xc=null,y=zr,zr=Yc(s.containerInfo),Kn(s,i),zr=y,$n(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{to(s.containerInfo)}catch(Ce){xt(i,i.return,Ce)}gp&&(gp=!1,Px(i));break;case 4:p=zr,zr=Yc(i.stateNode.containerInfo),Kn(s,i),$n(i),zr=p;break;case 12:Kn(s,i),$n(i);break;case 31:Kn(s,i),$n(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Dc(i,p)));break;case 13:Kn(s,i),$n(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Pc=Me()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Dc(i,p)));break;case 22:y=i.memoizedState!==null;var F=u!==null&&u.memoizedState!==null,ie=ki,fe=sn;if(ki=ie||y,sn=fe||F,Kn(s,i),sn=fe,ki=ie,$n(i),p&8192)e:for(s=i.stateNode,s._visibility=y?s._visibility&-2:s._visibility|1,y&&(u===null||F||ki||sn||ts(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 ge=F.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;O.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ce){xt(F,F.return,Ce)}}}else if(s.tag===6){if(u===null){F=s;try{F.stateNode.nodeValue=y?"":F.memoizedProps}catch(Ce){xt(F,F.return,Ce)}}}else if(s.tag===18){if(u===null){F=s;try{var oe=F.stateNode;y?CS(oe,!0):CS(F.stateNode,!1)}catch(Ce){xt(F,F.return,Ce)}}}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}p&4&&(p=i.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Dc(i,u))));break;case 19:Kn(s,i),$n(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Dc(i,p)));break;case 30:break;case 21:break;default:Kn(s,i),$n(i)}}function $n(i){var s=i.flags;if(s&2){try{for(var u,p=i.return;p!==null;){if(Ax(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,x=pp(i);Mc(i,x,y);break;case 5:var A=u.stateNode;u.flags&32&&(Ts(A,""),u.flags&=-33);var O=pp(i);Mc(i,O,A);break;case 3:case 4:var F=u.stateNode.containerInfo,ie=pp(i);mp(i,ie,F);break;default:throw Error(r(161))}}catch(fe){xt(i,i.return,fe)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Px(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Px(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function ji(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Rx(i,s.alternate,s),s=s.sibling}function ts(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:Ji(4,s,s.return),ts(s);break;case 1:Jr(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&Cx(s,s.return,u),ts(s);break;case 27:_l(s.stateNode);case 26:case 5:Jr(s,s.return),ts(s);break;case 22:s.memoizedState===null&&ts(s);break;case 30:ts(s);break;default:ts(s)}i=i.sibling}}function Ni(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,y=i,x=s,A=x.flags;switch(x.tag){case 0:case 11:case 15:Ni(y,x,u),Sl(4,x);break;case 1:if(Ni(y,x,u),p=x,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ie){xt(p,p.return,ie)}if(p=x,y=p.updateQueue,y!==null){var O=p.stateNode;try{var F=y.shared.hiddenCallbacks;if(F!==null)for(y.shared.hiddenCallbacks=null,y=0;y<F.length;y++)hb(F[y],O)}catch(ie){xt(p,p.return,ie)}}u&&A&64&&Tx(x),wl(x,x.return);break;case 27:jx(x);case 26:case 5:Ni(y,x,u),u&&p===null&&A&4&&kx(x),wl(x,x.return);break;case 12:Ni(y,x,u);break;case 31:Ni(y,x,u),u&&A&4&&Mx(y,x);break;case 13:Ni(y,x,u),u&&A&4&&Dx(y,x);break;case 22:x.memoizedState===null&&Ni(y,x,u),wl(x,x.return);break;case 30:break;default:Ni(y,x,u)}s=s.sibling}}function vp(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&&ll(u))}function yp(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ll(i))}function Ur(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Lx(i,s,u,p),s=s.sibling}function Lx(i,s,u,p){var y=s.flags;switch(s.tag){case 0:case 11:case 15:Ur(i,s,u,p),y&2048&&Sl(9,s);break;case 1:Ur(i,s,u,p);break;case 3:Ur(i,s,u,p),y&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ll(i)));break;case 12:if(y&2048){Ur(i,s,u,p),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){xt(s,s.return,F)}}else Ur(i,s,u,p);break;case 31:Ur(i,s,u,p);break;case 13:Ur(i,s,u,p);break;case 23:break;case 22:x=s.stateNode,A=s.alternate,s.memoizedState!==null?x._visibility&2?Ur(i,s,u,p):El(i,s):x._visibility&2?Ur(i,s,u,p):(x._visibility|=2,qs(i,s,u,p,(s.subtreeFlags&10256)!==0||!1)),y&2048&&vp(A,s);break;case 24:Ur(i,s,u,p),y&2048&&yp(s.alternate,s);break;default:Ur(i,s,u,p)}}function qs(i,s,u,p,y){for(y=y&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=i,A=s,O=u,F=p,ie=A.flags;switch(A.tag){case 0:case 11:case 15:qs(x,A,O,F,y),Sl(8,A);break;case 23:break;case 22:var fe=A.stateNode;A.memoizedState!==null?fe._visibility&2?qs(x,A,O,F,y):El(x,A):(fe._visibility|=2,qs(x,A,O,F,y)),y&&ie&2048&&vp(A.alternate,A);break;case 24:qs(x,A,O,F,y),y&&ie&2048&&yp(A.alternate,A);break;default:qs(x,A,O,F,y)}s=s.sibling}}function El(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,p=s,y=p.flags;switch(p.tag){case 22:El(u,p),y&2048&&vp(p.alternate,p);break;case 24:El(u,p),y&2048&&yp(p.alternate,p);break;default:El(u,p)}s=s.sibling}}var Tl=8192;function Gs(i,s,u){if(i.subtreeFlags&Tl)for(i=i.child;i!==null;)zx(i,s,u),i=i.sibling}function zx(i,s,u){switch(i.tag){case 26:Gs(i,s,u),i.flags&Tl&&i.memoizedState!==null&&pO(u,zr,i.memoizedState,i.memoizedProps);break;case 5:Gs(i,s,u);break;case 3:case 4:var p=zr;zr=Yc(i.stateNode.containerInfo),Gs(i,s,u),zr=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=Tl,Tl=16777216,Gs(i,s,u),Tl=p):Gs(i,s,u));break;default:Gs(i,s,u)}}function Ux(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 Cl(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];vn=p,Fx(p,i)}Ux(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Bx(i),i=i.sibling}function Bx(i){switch(i.tag){case 0:case 11:case 15:Cl(i),i.flags&2048&&Ji(9,i,i.return);break;case 3:Cl(i);break;case 12:Cl(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Ic(i)):Cl(i);break;default:Cl(i)}}function Ic(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];vn=p,Fx(p,i)}Ux(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:Ji(8,s,s.return),Ic(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Ic(s));break;default:Ic(s)}i=i.sibling}}function Fx(i,s){for(;vn!==null;){var u=vn;switch(u.tag){case 0:case 11:case 15:Ji(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:ll(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,vn=p;else e:for(u=i;vn!==null;){p=vn;var y=p.sibling,x=p.return;if(_x(p),p===u){vn=null;break e}if(y!==null){y.return=x,vn=y;break e}vn=x}}}var N_={getCacheForType:function(i){var s=xn(nn),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return xn(nn).controller.signal}},R_=typeof WeakMap=="function"?WeakMap:Map,ht=0,Nt=null,Xe=null,et=0,bt=0,ar=null,Zi=!1,Ks=!1,bp=!1,Ri=0,$t=0,ea=0,ns=0,xp=0,sr=0,$s=0,kl=null,Yn=null,Sp=!1,Pc=0,Vx=0,Lc=1/0,zc=null,ta=null,hn=0,na=null,Ys=null,_i=0,wp=0,Ep=null,Hx=null,Al=0,Tp=null;function or(){return(ht&2)!==0&&et!==0?et&-et:B.T!==null?Rp():Yu()}function qx(){if(sr===0)if((et&536870912)===0||rt){var i=Oa;Oa<<=1,(Oa&3932160)===0&&(Oa=262144),sr=i}else sr=536870912;return i=rr.current,i!==null&&(i.flags|=32),sr}function Wn(i,s,u){(i===Nt&&(bt===2||bt===9)||i.cancelPendingCommit!==null)&&(Ws(i,0),ra(i,et,sr,!1)),cn(i,u),((ht&2)===0||i!==Nt)&&(i===Nt&&((ht&2)===0&&(ns|=u),$t===4&&ra(i,et,sr,!1)),Zr(i))}function Gx(i,s,u){if((ht&6)!==0)throw Error(r(327));var p=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Ma(i,s),y=p?M_(i,s):kp(i,s,!0),x=p;do{if(y===0){Ks&&!p&&ra(i,s,0,!1);break}else{if(u=i.current.alternate,x&&!__(u)){y=kp(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=kl;var F=O.current.memoizedState.isDehydrated;if(F&&(Ws(O,A).flags|=256),A=kp(O,A,!1),A!==2){if(bp&&!F){O.errorRecoveryDisabledLanes|=x,ns|=x,y=4;break e}x=Yn,Yn=y,x!==null&&(Yn===null?Yn=x:Yn.push.apply(Yn,x))}y=A}if(x=!1,y!==2)continue}}if(y===1){Ws(i,0),ra(i,s,0,!0);break}e:{switch(p=i,x=y,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:ra(p,s,sr,!Zi);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(y=Pc+300-Me(),10<y)){if(ra(p,s,sr,!Zi),Bi(p,0,!0)!==0)break e;_i=s,p.timeoutHandle=wS(Kx.bind(null,p,u,Yn,zc,Sp,s,sr,ns,$s,Zi,x,"Throttled",-0,0),y);break e}Kx(p,u,Yn,zc,Sp,s,sr,ns,$s,Zi,x,null,-0,0)}}break}while(!0);Zr(i)}function Kx(i,s,u,p,y,x,A,O,F,ie,fe,ge,ae,oe){if(i.timeoutHandle=-1,ge=s.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gi},zx(s,x,ge);var Ce=(x&62914560)===x?Pc-Me():(x&4194048)===x?Vx-Me():0;if(Ce=mO(ge,Ce),Ce!==null){_i=x,i.cancelPendingCommit=Ce(eS.bind(null,i,s,x,u,p,y,A,O,F,fe,ge,null,ae,oe)),ra(i,x,A,!ie);return}}eS(i,s,x,u,p,y,A,O,F)}function __(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 p=0;p<u.length;p++){var y=u[p],x=y.getSnapshot;y=y.value;try{if(!tr(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 ra(i,s,u,p){s&=~xp,s&=~ns,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var y=s;0<y;){var x=31-Y(y),A=1<<x;p[x]=-1,y&=~A}u!==0&&$o(i,u,s)}function Uc(){return(ht&6)===0?(jl(0),!1):!0}function Cp(){if(Xe!==null){if(bt===0)var i=Xe.return;else i=Xe,xi=$a=null,Fh(i),Us=null,cl=0,i=Xe;for(;i!==null;)Ex(i.alternate,i),i=i.return;Xe=null}}function Ws(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,Q_(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),_i=0,Cp(),Nt=i,Xe=u=yi(i.current,null),et=s,bt=0,ar=null,Zi=!1,Ks=Ma(i,s),bp=!1,$s=sr=xp=ns=ea=$t=0,Yn=kl=null,Sp=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var y=31-Y(p),x=1<<y;s|=i[y],p&=~x}return Ri=s,sc(),u}function $x(i,s){qe=null,B.H=yl,s===zs||s===pc?(s=ub(),bt=3):s===Nh?(s=ub(),bt=4):bt=s===rp?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ar=s,Xe===null&&($t=1,jc(i,gr(s,i.current)))}function Yx(){var i=rr.current;return i===null?!0:(et&4194048)===et?xr===null:(et&62914560)===et||(et&536870912)!==0?i===xr:!1}function Wx(){var i=B.H;return B.H=yl,i===null?yl:i}function Xx(){var i=B.A;return B.A=N_,i}function Bc(){$t=4,Zi||(et&4194048)!==et&&rr.current!==null||(Ks=!0),(ea&134217727)===0&&(ns&134217727)===0||Nt===null||ra(Nt,et,sr,!1)}function kp(i,s,u){var p=ht;ht|=2;var y=Wx(),x=Xx();(Nt!==i||et!==s)&&(zc=null,Ws(i,s)),s=!1;var A=$t;e:do try{if(bt!==0&&Xe!==null){var O=Xe,F=ar;switch(bt){case 8:Cp(),A=6;break e;case 3:case 2:case 9:case 6:rr.current===null&&(s=!0);var ie=bt;if(bt=0,ar=null,Xs(i,O,F,ie),u&&Ks){A=0;break e}break;default:ie=bt,bt=0,ar=null,Xs(i,O,F,ie)}}O_(),A=$t;break}catch(fe){$x(i,fe)}while(!0);return s&&i.shellSuspendCounter++,xi=$a=null,ht=p,B.H=y,B.A=x,Xe===null&&(Nt=null,et=0,sc()),A}function O_(){for(;Xe!==null;)Qx(Xe)}function M_(i,s){var u=ht;ht|=2;var p=Wx(),y=Xx();Nt!==i||et!==s?(zc=null,Lc=Me()+500,Ws(i,s)):Ks=Ma(i,s);e:do try{if(bt!==0&&Xe!==null){s=Xe;var x=ar;t:switch(bt){case 1:bt=0,ar=null,Xs(i,s,x,1);break;case 2:case 9:if(ob(x)){bt=0,ar=null,Jx(s);break}s=function(){bt!==2&&bt!==9||Nt!==i||(bt=7),Zr(i)},x.then(s,s);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:ob(x)?(bt=0,ar=null,Jx(s)):(bt=0,ar=null,Xs(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?LS(A):O.stateNode.complete){bt=0,ar=null;var F=O.sibling;if(F!==null)Xe=F;else{var ie=O.return;ie!==null?(Xe=ie,Fc(ie)):Xe=null}break t}}bt=0,ar=null,Xs(i,s,x,5);break;case 6:bt=0,ar=null,Xs(i,s,x,6);break;case 8:Cp(),$t=6;break e;default:throw Error(r(462))}}D_();break}catch(fe){$x(i,fe)}while(!0);return xi=$a=null,B.H=p,B.A=y,ht=u,Xe!==null?0:(Nt=null,et=0,sc(),$t)}function D_(){for(;Xe!==null&&!Ln();)Qx(Xe)}function Qx(i){var s=Sx(i.alternate,i,Ri);i.memoizedProps=i.pendingProps,s===null?Fc(i):Xe=s}function Jx(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=mx(u,s,s.pendingProps,s.type,void 0,et);break;case 11:s=mx(u,s,s.pendingProps,s.type.render,s.ref,et);break;case 5:Fh(s);default:Ex(u,s),s=Xe=X0(s,Ri),s=Sx(u,s,Ri)}i.memoizedProps=i.pendingProps,s===null?Fc(i):Xe=s}function Xs(i,s,u,p){xi=$a=null,Fh(s),Us=null,cl=0;var y=s.return;try{if(w_(i,y,s,u,et)){$t=1,jc(i,gr(u,i.current)),Xe=null;return}}catch(x){if(y!==null)throw Xe=y,x;$t=1,jc(i,gr(u,i.current)),Xe=null;return}s.flags&32768?(rt||p===1?i=!0:Ks||(et&536870912)!==0?i=!1:(Zi=i=!0,(p===2||p===9||p===3||p===6)&&(p=rr.current,p!==null&&p.tag===13&&(p.flags|=16384))),Zx(s,i)):Fc(s)}function Fc(i){var s=i;do{if((s.flags&32768)!==0){Zx(s,Zi);return}i=s.return;var u=C_(s.alternate,s,Ri);if(u!==null){Xe=u;return}if(s=s.sibling,s!==null){Xe=s;return}Xe=s=i}while(s!==null);$t===0&&($t=5)}function Zx(i,s){do{var u=k_(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);$t=6,Xe=null}function eS(i,s,u,p,y,x,A,O,F){i.cancelPendingCommit=null;do Vc();while(hn!==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|=ph,$u(i,u,x,A,O,F),i===Nt&&(Xe=Nt=null,et=0),Ys=s,na=i,_i=u,wp=x,Ep=y,Hx=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,z_(Ee,function(){return aS(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=B.T,B.T=null,y=X.p,X.p=2,A=ht,ht|=4;try{A_(i,s,u)}finally{ht=A,X.p=y,B.T=p}}hn=1,tS(),nS(),rS()}}function tS(){if(hn===1){hn=0;var i=na,s=Ys,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=B.T,B.T=null;var p=X.p;X.p=2;var y=ht;ht|=4;try{Ix(s,i);var x=zp,A=F0(i.containerInfo),O=x.focusedElem,F=x.selectionRange;if(A!==O&&O&&O.ownerDocument&&B0(O.ownerDocument.documentElement,O)){if(F!==null&&uh(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 ge=O.ownerDocument||document,ae=ge&&ge.defaultView||window;if(ae.getSelection){var oe=ae.getSelection(),Ce=O.textContent.length,Ie=Math.min(F.start,Ce),Ct=F.end===void 0?Ie:Math.min(F.end,Ce);!oe.extend&&Ie>Ct&&(A=Ct,Ct=Ie,Ie=A);var Q=U0(O,Ie),K=U0(O,Ct);if(Q&&K&&(oe.rangeCount!==1||oe.anchorNode!==Q.node||oe.anchorOffset!==Q.offset||oe.focusNode!==K.node||oe.focusOffset!==K.offset)){var re=ge.createRange();re.setStart(Q.node,Q.offset),oe.removeAllRanges(),Ie>Ct?(oe.addRange(re),oe.extend(K.node,K.offset)):(re.setEnd(K.node,K.offset),oe.addRange(re))}}}}for(ge=[],oe=O;oe=oe.parentNode;)oe.nodeType===1&&ge.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<ge.length;O++){var pe=ge[O];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}ed=!!Lp,zp=Lp=null}finally{ht=y,X.p=p,B.T=u}}i.current=s,hn=2}}function nS(){if(hn===2){hn=0;var i=na,s=Ys,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=B.T,B.T=null;var p=X.p;X.p=2;var y=ht;ht|=4;try{Rx(i,s.alternate,s)}finally{ht=y,X.p=p,B.T=u}}hn=3}}function rS(){if(hn===4||hn===3){hn=0,Le();var i=na,s=Ys,u=_i,p=Hx;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?hn=5:(hn=0,Ys=na=null,iS(i,i.pendingLanes));var y=i.pendingLanes;if(y===0&&(ta=null),Wo(u),s=s.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Ot,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=B.T,y=X.p,X.p=2,B.T=null;try{for(var x=i.onRecoverableError,A=0;A<p.length;A++){var O=p[A];x(O.value,{componentStack:O.stack})}}finally{B.T=s,X.p=y}}(_i&3)!==0&&Vc(),Zr(i),y=i.pendingLanes,(u&261930)!==0&&(y&42)!==0?i===Tp?Al++:(Al=0,Tp=i):Al=0,jl(0)}}function iS(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,ll(s)))}function Vc(){return tS(),nS(),rS(),aS()}function aS(){if(hn!==5)return!1;var i=na,s=wp;wp=0;var u=Wo(_i),p=B.T,y=X.p;try{X.p=32>u?32:u,B.T=null,u=Ep,Ep=null;var x=na,A=_i;if(hn=0,Ys=na=null,_i=0,(ht&6)!==0)throw Error(r(331));var O=ht;if(ht|=4,Bx(x.current),Lx(x,x.current,A,u),ht=O,jl(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Ot,x)}catch{}return!0}finally{X.p=y,B.T=p,iS(i,s)}}function sS(i,s,u){s=gr(u,s),s=np(i.stateNode,s,2),i=Wi(i,s,2),i!==null&&(cn(i,2),Zr(i))}function xt(i,s,u){if(i.tag===3)sS(i,i,u);else for(;s!==null;){if(s.tag===3){sS(s,i,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(ta===null||!ta.has(p))){i=gr(u,i),u=ox(2),p=Wi(s,u,2),p!==null&&(lx(u,p,s,i),cn(p,2),Zr(p));break}}s=s.return}}function Ap(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new R_;var y=new Set;p.set(s,y)}else y=p.get(s),y===void 0&&(y=new Set,p.set(s,y));y.has(u)||(bp=!0,y.add(u),i=I_.bind(null,i,s,u),s.then(i,i))}function I_(i,s,u){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Nt===i&&(et&u)===u&&($t===4||$t===3&&(et&62914560)===et&&300>Me()-Pc?(ht&2)===0&&Ws(i,0):xp|=u,$s===et&&($s=0)),Zr(i)}function oS(i,s){s===0&&(s=Go()),i=qa(i,s),i!==null&&(cn(i,s),Zr(i))}function P_(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),oS(i,u)}function L_(i,s){var u=0;switch(i.tag){case 31:case 13:var p=i.stateNode,y=i.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(s),oS(i,u)}function z_(i,s){return vt(i,s)}var Hc=null,Qs=null,jp=!1,qc=!1,Np=!1,ia=0;function Zr(i){i!==Qs&&i.next===null&&(Qs===null?Hc=Qs=i:Qs=Qs.next=i),qc=!0,jp||(jp=!0,B_())}function jl(i,s){if(!Np&&qc){Np=!0;do for(var u=!1,p=Hc;p!==null;){if(i!==0){var y=p.pendingLanes;if(y===0)var x=0;else{var A=p.suspendedLanes,O=p.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,dS(p,x))}else x=et,x=Bi(p,p===Nt?x:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(x&3)===0||Ma(p,x)||(u=!0,dS(p,x));p=p.next}while(u);Np=!1}}function U_(){lS()}function lS(){qc=jp=!1;var i=0;ia!==0&&X_()&&(i=ia);for(var s=Me(),u=null,p=Hc;p!==null;){var y=p.next,x=uS(p,s);x===0?(p.next=null,u===null?Hc=y:u.next=y,y===null&&(Qs=u)):(u=p,(i!==0||(x&3)!==0)&&(qc=!0)),p=y}hn!==0&&hn!==5||jl(i),ia!==0&&(ia=0)}function uS(i,s){for(var u=i.suspendedLanes,p=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&p)!==0)&&(y[A]=qo(O,s)):F<=s&&(i.expiredLanes|=O),x&=~O}if(s=Nt,u=et,u=Bi(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,u===0||i===s&&(bt===2||bt===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&dt(p),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Ma(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(p!==null&&dt(p),Wo(u)){case 2:case 8:u=se;break;case 32:u=Ee;break;case 268435456:u=Ve;break;default:u=Ee}return p=cS.bind(null,i),u=vt(u,p),i.callbackPriority=s,i.callbackNode=u,s}return p!==null&&p!==null&&dt(p),i.callbackPriority=2,i.callbackNode=null,2}function cS(i,s){if(hn!==0&&hn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Vc()&&i.callbackNode!==u)return null;var p=et;return p=Bi(i,i===Nt?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(Gx(i,p,s),uS(i,Me()),i.callbackNode!=null&&i.callbackNode===u?cS.bind(null,i):null)}function dS(i,s){if(Vc())return null;Gx(i,s,!0)}function B_(){J_(function(){(ht&6)!==0?vt(H,U_):lS()})}function Rp(){if(ia===0){var i=Ps;i===0&&(i=Dr,Dr<<=1,(Dr&261888)===0&&(Dr=256)),ia=i}return ia}function fS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ju(""+i)}function hS(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 F_(i,s,u,p,y){if(s==="submit"&&u&&u.stateNode===y){var x=fS((y[Nn]||null).action),A=p.submitter;A&&(s=(s=A[Nn]||null)?fS(s.formAction):A.getAttribute("formAction"),s!==null&&(x=s,A=null));var O=new nc("action","action",null,p,y);i.push({event:O,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ia!==0){var F=A?hS(y,A):new FormData(y);Xh(u,{pending:!0,data:F,method:y.method,action:x},null,F)}}else typeof x=="function"&&(O.preventDefault(),F=A?hS(y,A):new FormData(y),Xh(u,{pending:!0,data:F,method:y.method,action:x},x,F))},currentTarget:y}]})}}for(var _p=0;_p<hh.length;_p++){var Op=hh[_p],V_=Op.toLowerCase(),H_=Op[0].toUpperCase()+Op.slice(1);Lr(V_,"on"+H_)}Lr(q0,"onAnimationEnd"),Lr(G0,"onAnimationIteration"),Lr(K0,"onAnimationStart"),Lr("dblclick","onDoubleClick"),Lr("focusin","onFocus"),Lr("focusout","onBlur"),Lr(a_,"onTransitionRun"),Lr(s_,"onTransitionStart"),Lr(o_,"onTransitionCancel"),Lr($0,"onTransitionEnd"),pi("onMouseEnter",["mouseout","mouseover"]),pi("onMouseLeave",["mouseout","mouseover"]),pi("onPointerEnter",["pointerout","pointerover"]),pi("onPointerLeave",["pointerout","pointerover"]),fn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fn("onBeforeInput",["compositionend","keypress","textInput","paste"]),fn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nl="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(" "),q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nl));function pS(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var p=i[u],y=p.event;p=p.listeners;e:{var x=void 0;if(s)for(var A=p.length-1;0<=A;A--){var O=p[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){ac(fe)}y.currentTarget=null,x=F}else for(A=0;A<p.length;A++){if(O=p[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){ac(fe)}y.currentTarget=null,x=F}}}}function Qe(i,s){var u=s[Xo];u===void 0&&(u=s[Xo]=new Set);var p=i+"__bubble";u.has(p)||(mS(s,i,2,!1),u.add(p))}function Mp(i,s,u){var p=0;s&&(p|=4),mS(u,i,p,s)}var Gc="_reactListening"+Math.random().toString(36).slice(2);function Dp(i){if(!i[Gc]){i[Gc]=!0,Zn.forEach(function(u){u!=="selectionchange"&&(q_.has(u)||Mp(u,!1,i),Mp(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Gc]||(s[Gc]=!0,Mp("selectionchange",!1,s))}}function mS(i,s,u,p){switch(qS(s)){case 2:var y=yO;break;case 8:y=bO;break;default:y=Wp}u=y.bind(null,s,u,i),y=void 0,!eh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),p?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 Ip(i,s,u,p,y){var x=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var O=p.stateNode.containerInfo;if(O===y)break;if(A===4)for(A=p.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=he(O),A===null)return;if(F=A.tag,F===5||F===6||F===26||F===27){p=x=A;continue e}O=O.parentNode}}p=p.return}x0(function(){var ie=x,fe=Jf(u),ge=[];e:{var ae=Y0.get(i);if(ae!==void 0){var oe=nc,Ce=i;switch(i){case"keypress":if(ec(u)===0)break e;case"keydown":case"keyup":oe=L2;break;case"focusin":Ce="focus",oe=ih;break;case"focusout":Ce="blur",oe=ih;break;case"beforeblur":case"afterblur":oe=ih;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":oe=E0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=C2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=B2;break;case q0:case G0:case K0:oe=j2;break;case $0:oe=V2;break;case"scroll":case"scrollend":oe=E2;break;case"wheel":oe=q2;break;case"copy":case"cut":case"paste":oe=R2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=C0;break;case"toggle":case"beforetoggle":oe=K2}var Ie=(s&4)!==0,Ct=!Ie&&(i==="scroll"||i==="scrollend"),Q=Ie?ae!==null?ae+"Capture":null:ae;Ie=[];for(var K=ie,re;K!==null;){var pe=K;if(re=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||re===null||Q===null||(pe=Qo(K,Q),pe!=null&&Ie.push(Rl(K,pe,re))),Ct)break;K=K.return}0<Ie.length&&(ae=new oe(ae,Ce,null,u,fe),ge.push({event:ae,listeners:Ie}))}}if((s&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",oe=i==="mouseout"||i==="pointerout",ae&&u!==Qf&&(Ce=u.relatedTarget||u.fromElement)&&(he(Ce)||Ce[Fi]))break e;if((oe||ae)&&(ae=fe.window===fe?fe:(ae=fe.ownerDocument)?ae.defaultView||ae.parentWindow:window,oe?(Ce=u.relatedTarget||u.toElement,oe=ie,Ce=Ce?he(Ce):null,Ce!==null&&(Ct=o(Ce),Ie=Ce.tag,Ce!==Ct||Ie!==5&&Ie!==27&&Ie!==6)&&(Ce=null)):(oe=null,Ce=ie),oe!==Ce)){if(Ie=E0,pe="onMouseLeave",Q="onMouseEnter",K="mouse",(i==="pointerout"||i==="pointerover")&&(Ie=C0,pe="onPointerLeave",Q="onPointerEnter",K="pointer"),Ct=oe==null?ae:nt(oe),re=Ce==null?ae:nt(Ce),ae=new Ie(pe,K+"leave",oe,u,fe),ae.target=Ct,ae.relatedTarget=re,pe=null,he(fe)===ie&&(Ie=new Ie(Q,K+"enter",Ce,u,fe),Ie.target=re,Ie.relatedTarget=Ct,pe=Ie),Ct=pe,oe&&Ce)t:{for(Ie=G_,Q=oe,K=Ce,re=0,pe=Q;pe;pe=Ie(pe))re++;pe=0;for(var Oe=K;Oe;Oe=Ie(Oe))pe++;for(;0<re-pe;)Q=Ie(Q),re--;for(;0<pe-re;)K=Ie(K),pe--;for(;re--;){if(Q===K||K!==null&&Q===K.alternate){Ie=Q;break t}Q=Ie(Q),K=Ie(K)}Ie=null}else Ie=null;oe!==null&&gS(ge,ae,oe,Ie,!1),Ce!==null&&Ct!==null&&gS(ge,Ct,Ce,Ie,!0)}}e:{if(ae=ie?nt(ie):window,oe=ae.nodeName&&ae.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ae.type==="file")var lt=M0;else if(_0(ae))if(D0)lt=n_;else{lt=e_;var je=Z2}else oe=ae.nodeName,!oe||oe.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ie&&Xf(ie.elementType)&&(lt=M0):lt=t_;if(lt&&(lt=lt(i,ie))){O0(ge,lt,u,fe);break e}je&&je(i,ae,ie),i==="focusout"&&ie&&ae.type==="number"&&ie.memoizedProps.value!=null&&Wf(ae,"number",ae.value)}switch(je=ie?nt(ie):window,i){case"focusin":(_0(je)||je.contentEditable==="true")&&(js=je,ch=ie,al=null);break;case"focusout":al=ch=js=null;break;case"mousedown":dh=!0;break;case"contextmenu":case"mouseup":case"dragend":dh=!1,V0(ge,u,fe);break;case"selectionchange":if(i_)break;case"keydown":case"keyup":V0(ge,u,fe)}var Ke;if(sh)e:{switch(i){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else As?N0(i,u)&&(tt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(tt="onCompositionStart");tt&&(k0&&u.locale!=="ko"&&(As||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&As&&(Ke=S0()):(Vi=fe,th="value"in Vi?Vi.value:Vi.textContent,As=!0)),je=Kc(ie,tt),0<je.length&&(tt=new T0(tt,i,null,u,fe),ge.push({event:tt,listeners:je}),Ke?tt.data=Ke:(Ke=R0(u),Ke!==null&&(tt.data=Ke)))),(Ke=Y2?W2(i,u):X2(i,u))&&(tt=Kc(ie,"onBeforeInput"),0<tt.length&&(je=new T0("onBeforeInput","beforeinput",null,u,fe),ge.push({event:je,listeners:tt}),je.data=Ke)),F_(ge,i,ie,u,fe)}pS(ge,s)})}function Rl(i,s,u){return{instance:i,listener:s,currentTarget:u}}function Kc(i,s){for(var u=s+"Capture",p=[];i!==null;){var y=i,x=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||x===null||(y=Qo(i,u),y!=null&&p.unshift(Rl(i,y,x)),y=Qo(i,s),y!=null&&p.push(Rl(i,y,x))),i.tag===3)return p;i=i.return}return[]}function G_(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function gS(i,s,u,p,y){for(var x=s._reactName,A=[];u!==null&&u!==p;){var O=u,F=O.alternate,ie=O.stateNode;if(O=O.tag,F!==null&&F===p)break;O!==5&&O!==26&&O!==27||ie===null||(F=ie,y?(ie=Qo(u,x),ie!=null&&A.unshift(Rl(u,ie,F))):y||(ie=Qo(u,x),ie!=null&&A.push(Rl(u,ie,F)))),u=u.return}A.length!==0&&i.push({event:s,listeners:A})}var K_=/\r\n?/g,$_=/\u0000|\uFFFD/g;function vS(i){return(typeof i=="string"?i:""+i).replace(K_,`
9
+ `).replace($_,"")}function yS(i,s){return s=vS(s),vS(i)===s}function Tt(i,s,u,p,y,x){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||Ts(i,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&Ts(i,""+p);break;case"className":gn(i,"class",p);break;case"tabIndex":gn(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":gn(i,u,p);break;case"style":y0(i,p,x);break;case"data":if(s!=="object"){gn(i,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=Ju(""+p),i.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="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"&&Tt(i,s,"name",y.name,y,null),Tt(i,s,"formEncType",y.formEncType,y,null),Tt(i,s,"formMethod",y.formMethod,y,null),Tt(i,s,"formTarget",y.formTarget,y,null)):(Tt(i,s,"encType",y.encType,y,null),Tt(i,s,"method",y.method,y,null),Tt(i,s,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=Ju(""+p),i.setAttribute(u,p);break;case"onClick":p!=null&&(i.onclick=gi);break;case"onScroll":p!=null&&Qe("scroll",i);break;case"onScrollEnd":p!=null&&Qe("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}u=Ju(""+p),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":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""+p):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":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":p===!0?i.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,p):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(u,p):i.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(u):i.setAttribute(u,p);break;case"popover":Qe("beforetoggle",i),Qe("toggle",i),jt(i,"popover",p);break;case"xlinkActuate":yn(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":yn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":yn(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":yn(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":yn(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":yn(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":yn(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":yn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":yn(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":jt(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=S2.get(u)||u,jt(i,u,p))}}function Pp(i,s,u,p,y,x){switch(u){case"style":y0(i,p,x);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof p=="string"?Ts(i,p):(typeof p=="number"||typeof p=="bigint")&&Ts(i,""+p);break;case"onScroll":p!=null&&Qe("scroll",i);break;case"onScrollEnd":p!=null&&Qe("scrollend",i);break;case"onClick":p!=null&&(i.onclick=gi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!er.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[Nn]||null,x=x!=null?x[u]:null,typeof x=="function"&&i.removeEventListener(s,x,y),typeof p=="function")){typeof x!="function"&&x!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,p,y);break e}u in i?i[u]=p:p===!0?i.setAttribute(u,""):jt(i,u,p)}}}function wn(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",i),Qe("load",i);var p=!1,y=!1,x;for(x in u)if(u.hasOwnProperty(x)){var A=u[x];if(A!=null)switch(x){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Tt(i,s,x,A,u,null)}}y&&Tt(i,s,"srcSet",u.srcSet,u,null),p&&Tt(i,s,"src",u.src,u,null);return;case"input":Qe("invalid",i);var O=x=A=y=null,F=null,ie=null;for(p in u)if(u.hasOwnProperty(p)){var fe=u[p];if(fe!=null)switch(p){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:Tt(i,s,p,fe,u,null)}}p0(i,x,O,F,ie,A,y,!1);return;case"select":Qe("invalid",i),p=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":p=O;default:Tt(i,s,y,O,u,null)}s=x,u=A,i.multiple=!!p,s!=null?Es(i,!!p,s,!1):u!=null&&Es(i,!!p,u,!0);return;case"textarea":Qe("invalid",i),x=y=p=null;for(A in u)if(u.hasOwnProperty(A)&&(O=u[A],O!=null))switch(A){case"value":p=O;break;case"defaultValue":y=O;break;case"children":x=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:Tt(i,s,A,O,u,null)}g0(i,p,y,x);return;case"option":for(F in u)u.hasOwnProperty(F)&&(p=u[F],p!=null)&&(F==="selected"?i.selected=p&&typeof p!="function"&&typeof p!="symbol":Tt(i,s,F,p,u,null));return;case"dialog":Qe("beforetoggle",i),Qe("toggle",i),Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":Qe("load",i);break;case"video":case"audio":for(p=0;p<Nl.length;p++)Qe(Nl[p],i);break;case"image":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"embed":case"source":case"link":Qe("error",i),Qe("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)&&(p=u[ie],p!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Tt(i,s,ie,p,u,null)}return;default:if(Xf(s)){for(fe in u)u.hasOwnProperty(fe)&&(p=u[fe],p!==void 0&&Pp(i,s,fe,p,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(p=u[O],p!=null&&Tt(i,s,O,p,u,null))}function Y_(i,s,u,p){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(oe in u){var ge=u[oe];if(u.hasOwnProperty(oe)&&ge!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":F=ge;default:p.hasOwnProperty(oe)||Tt(i,s,oe,null,p,ge)}}for(var ae in p){var oe=p[ae];if(ge=u[ae],p.hasOwnProperty(ae)&&(oe!=null||ge!=null))switch(ae){case"type":x=oe;break;case"name":y=oe;break;case"checked":ie=oe;break;case"defaultChecked":fe=oe;break;case"value":A=oe;break;case"defaultValue":O=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,s));break;default:oe!==ge&&Tt(i,s,ae,oe,p,ge)}}Yf(i,A,O,F,ie,fe,x,y);return;case"select":oe=A=O=ae=null;for(x in u)if(F=u[x],u.hasOwnProperty(x)&&F!=null)switch(x){case"value":break;case"multiple":oe=F;default:p.hasOwnProperty(x)||Tt(i,s,x,null,p,F)}for(y in p)if(x=p[y],F=u[y],p.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&&Tt(i,s,y,x,p,F)}s=O,u=A,p=oe,ae!=null?Es(i,!!u,ae,!1):!!p!=!!u&&(s!=null?Es(i,!!u,s,!0):Es(i,!!u,u?[]:"",!1));return;case"textarea":oe=ae=null;for(O in u)if(y=u[O],u.hasOwnProperty(O)&&y!=null&&!p.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:Tt(i,s,O,null,p,y)}for(A in p)if(y=p[A],x=u[A],p.hasOwnProperty(A)&&(y!=null||x!=null))switch(A){case"value":ae=y;break;case"defaultValue":oe=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==x&&Tt(i,s,A,y,p,x)}m0(i,ae,oe);return;case"option":for(var Ce in u)ae=u[Ce],u.hasOwnProperty(Ce)&&ae!=null&&!p.hasOwnProperty(Ce)&&(Ce==="selected"?i.selected=!1:Tt(i,s,Ce,null,p,ae));for(F in p)ae=p[F],oe=u[F],p.hasOwnProperty(F)&&ae!==oe&&(ae!=null||oe!=null)&&(F==="selected"?i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":Tt(i,s,F,ae,p,oe));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&&!p.hasOwnProperty(Ie)&&Tt(i,s,Ie,null,p,ae);for(ie in p)if(ae=p[ie],oe=u[ie],p.hasOwnProperty(ie)&&ae!==oe&&(ae!=null||oe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,s));break;default:Tt(i,s,ie,ae,p,oe)}return;default:if(Xf(s)){for(var Ct in u)ae=u[Ct],u.hasOwnProperty(Ct)&&ae!==void 0&&!p.hasOwnProperty(Ct)&&Pp(i,s,Ct,void 0,p,ae);for(fe in p)ae=p[fe],oe=u[fe],!p.hasOwnProperty(fe)||ae===oe||ae===void 0&&oe===void 0||Pp(i,s,fe,ae,p,oe);return}}for(var Q in u)ae=u[Q],u.hasOwnProperty(Q)&&ae!=null&&!p.hasOwnProperty(Q)&&Tt(i,s,Q,null,p,ae);for(ge in p)ae=p[ge],oe=u[ge],!p.hasOwnProperty(ge)||ae===oe||ae==null&&oe==null||Tt(i,s,ge,ae,p,oe)}function bS(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function W_(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var y=u[p],x=y.transferSize,A=y.initiatorType,O=y.duration;if(x&&O&&bS(A)){for(A=0,O=y.responseEnd,p+=1;p<u.length;p++){var F=u[p],ie=F.startTime;if(ie>O)break;var fe=F.transferSize,ge=F.initiatorType;fe&&bS(ge)&&(F=F.responseEnd,A+=fe*(F<O?1:(O-ie)/(F-ie)))}if(--p,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 Lp=null,zp=null;function $c(i){return i.nodeType===9?i:i.ownerDocument}function xS(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 SS(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 Up(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 Bp=null;function X_(){var i=window.event;return i&&i.type==="popstate"?i===Bp?!1:(Bp=i,!0):(Bp=null,!1)}var wS=typeof setTimeout=="function"?setTimeout:void 0,Q_=typeof clearTimeout=="function"?clearTimeout:void 0,ES=typeof Promise=="function"?Promise:void 0,J_=typeof queueMicrotask=="function"?queueMicrotask:typeof ES<"u"?function(i){return ES.resolve(null).then(i).catch(Z_)}:wS;function Z_(i){setTimeout(function(){throw i})}function aa(i){return i==="head"}function TS(i,s){var u=s,p=0;do{var y=u.nextSibling;if(i.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(p===0){i.removeChild(y),to(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")_l(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,_l(u);for(var x=u.firstChild;x;){var A=x.nextSibling,O=x.nodeName;x[Pa]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=A}}else u==="body"&&_l(i.ownerDocument.body);u=y}while(u);to(s)}function CS(i,s){var u=i;i=0;do{var p=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||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=p}while(u)}function Fp(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":Fp(u),$(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function eO(i,s,u,p){for(;i.nodeType===1;){var y=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[Pa])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=Sr(i.nextSibling),i===null)break}return null}function tO(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Sr(i.nextSibling),i===null))return null;return i}function kS(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Sr(i.nextSibling),i===null))return null;return i}function Vp(i){return i.data==="$?"||i.data==="$~"}function Hp(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function nO(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function Sr(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 qp=null;function AS(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return Sr(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function jS(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 NS(i,s,u){switch(s=$c(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 _l(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);$(i)}var wr=new Map,RS=new Set;function Yc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Oi=X.d;X.d={f:rO,r:iO,D:aO,C:sO,L:oO,m:lO,X:cO,S:uO,M:dO};function rO(){var i=Oi.f(),s=Uc();return i||s}function iO(i){var s=Ye(i);s!==null&&s.tag===5&&s.type==="form"?$b(s):Oi.r(i)}var Js=typeof document>"u"?null:document;function _S(i,s,u){var p=Js;if(p&&typeof s=="string"&&s){var y=pr(s);y='link[rel="'+i+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),RS.has(y)||(RS.add(y),i={rel:i,crossOrigin:u,href:s},p.querySelector(y)===null&&(s=p.createElement("link"),wn(s,"link",i),wt(s),p.head.appendChild(s)))}}function aO(i){Oi.D(i),_S("dns-prefetch",i,null)}function sO(i,s){Oi.C(i,s),_S("preconnect",i,s)}function oO(i,s,u){Oi.L(i,s,u);var p=Js;if(p&&i&&s){var y='link[rel="preload"][as="'+pr(s)+'"]';s==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+pr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+pr(u.imageSizes)+'"]')):y+='[href="'+pr(i)+'"]';var x=y;switch(s){case"style":x=Zs(i);break;case"script":x=eo(i)}wr.has(x)||(i=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),wr.set(x,i),p.querySelector(y)!==null||s==="style"&&p.querySelector(Ol(x))||s==="script"&&p.querySelector(Ml(x))||(s=p.createElement("link"),wn(s,"link",i),wt(s),p.head.appendChild(s)))}}function lO(i,s){Oi.m(i,s);var u=Js;if(u&&i){var p=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+pr(p)+'"][href="'+pr(i)+'"]',x=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=eo(i)}if(!wr.has(x)&&(i=g({rel:"modulepreload",href:i},s),wr.set(x,i),u.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ml(x)))return}p=u.createElement("link"),wn(p,"link",i),wt(p),u.head.appendChild(p)}}}function uO(i,s,u){Oi.S(i,s,u);var p=Js;if(p&&i){var y=Lt(p).hoistableStyles,x=Zs(i);s=s||"default";var A=y.get(x);if(!A){var O={loading:0,preload:null};if(A=p.querySelector(Ol(x)))O.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},u),(u=wr.get(x))&&Gp(i,u);var F=A=p.createElement("link");wt(F),wn(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,Wc(A,s,p)}A={type:"stylesheet",instance:A,count:1,state:O},y.set(x,A)}}}function cO(i,s){Oi.X(i,s);var u=Js;if(u&&i){var p=Lt(u).hoistableScripts,y=eo(i),x=p.get(y);x||(x=u.querySelector(Ml(y)),x||(i=g({src:i,async:!0},s),(s=wr.get(y))&&Kp(i,s),x=u.createElement("script"),wt(x),wn(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(y,x))}}function dO(i,s){Oi.M(i,s);var u=Js;if(u&&i){var p=Lt(u).hoistableScripts,y=eo(i),x=p.get(y);x||(x=u.querySelector(Ml(y)),x||(i=g({src:i,async:!0,type:"module"},s),(s=wr.get(y))&&Kp(i,s),x=u.createElement("script"),wt(x),wn(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(y,x))}}function OS(i,s,u,p){var y=(y=Se.current)?Yc(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=Zs(u.href),u=Lt(y).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Zs(u.href);var x=Lt(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(Ol(i)))&&!x._p&&(A.instance=x,A.state.loading=5),wr.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},wr.set(i,u),x||fO(y,i,u,A.state))),s&&p===null)throw Error(r(528,""));return A}if(s&&p!==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=eo(u),u=Lt(y).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Zs(i){return'href="'+pr(i)+'"'}function Ol(i){return'link[rel="stylesheet"]['+i+"]"}function MS(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function fO(i,s,u,p){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=i.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),wn(s,"link",u),wt(s),i.head.appendChild(s))}function eo(i){return'[src="'+pr(i)+'"]'}function Ml(i){return"script[async]"+i}function DS(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+pr(u.href)+'"]');if(p)return s.instance=p,wt(p),p;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),wt(p),wn(p,"style",y),Wc(p,u.precedence,i),s.instance=p;case"stylesheet":y=Zs(u.href);var x=i.querySelector(Ol(y));if(x)return s.state.loading|=4,s.instance=x,wt(x),x;p=MS(u),(y=wr.get(y))&&Gp(p,y),x=(i.ownerDocument||i).createElement("link"),wt(x);var A=x;return A._p=new Promise(function(O,F){A.onload=O,A.onerror=F}),wn(x,"link",p),s.state.loading|=4,Wc(x,u.precedence,i),s.instance=x;case"script":return x=eo(u.src),(y=i.querySelector(Ml(x)))?(s.instance=y,wt(y),y):(p=u,(y=wr.get(x))&&(p=g({},u),Kp(p,y)),i=i.ownerDocument||i,y=i.createElement("script"),wt(y),wn(y,"link",p),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&&(p=s.instance,s.state.loading|=4,Wc(p,u.precedence,i));return s.instance}function Wc(i,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,x=y,A=0;A<p.length;A++){var O=p[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 Gp(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Kp(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Xc=null;function IS(i,s,u){if(Xc===null){var p=new Map,y=Xc=new Map;y.set(u,p)}else y=Xc,p=y.get(u),p||(p=new Map,y.set(u,p));if(p.has(i))return p;for(p.set(i,null),u=u.getElementsByTagName(i),y=0;y<u.length;y++){var x=u[y];if(!(x[Pa]||x[dn]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var A=x.getAttribute(s)||"";A=i+A;var O=p.get(A);O?O.push(x):p.set(A,[x])}}return p}function PS(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function hO(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 LS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function pO(i,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Zs(p.href),x=s.querySelector(Ol(y));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Qc.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=x,wt(x);return}x=s.ownerDocument||s,p=MS(p),(y=wr.get(y))&&Gp(p,y),x=x.createElement("link"),wt(x);var A=x;A._p=new Promise(function(O,F){A.onload=O,A.onerror=F}),wn(x,"link",p),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=Qc.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var $p=0;function mO(i,s){return i.stylesheets&&i.count===0&&Zc(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var p=setTimeout(function(){if(i.stylesheets&&Zc(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+s);0<i.imgBytes&&$p===0&&($p=62500*W_());var y=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Zc(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>$p?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function Qc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Jc=null;function Zc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Jc=new Map,s.forEach(gO,i),Jc=null,Qc.call(i))}function gO(i,s){if(!(s.state.loading&4)){var u=Jc.get(i);if(u)var p=u.get(null);else{u=new Map,Jc.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),p=A)}p&&u.set(null,p)}y=s.instance,A=y.getAttribute("data-precedence"),x=u.get(A)||p,x===p&&u.set(null,y),u.set(A,y),this.count++,p=Qc.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),x?x.parentNode.insertBefore(y,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(y,i.firstChild)),s.state.loading|=4}}var Dl={$$typeof:C,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function vO(i,s,u,p,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=Ko(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ko(0),this.hiddenUpdates=Ko(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=x,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function zS(i,s,u,p,y,x,A,O,F,ie,fe,ge){return i=new vO(i,s,u,A,F,ie,fe,ge,O),s=1,x===!0&&(s|=24),x=nr(3,null,null,s),i.current=x,x.stateNode=i,s=kh(),s.refCount++,i.pooledCache=s,s.refCount++,x.memoizedState={element:p,isDehydrated:u,cache:s},Rh(x),i}function US(i){return i?(i=_s,i):_s}function BS(i,s,u,p,y,x){y=US(y),p.context===null?p.context=y:p.pendingContext=y,p=Yi(s),p.payload={element:u},x=x===void 0?null:x,x!==null&&(p.callback=x),u=Wi(i,p,s),u!==null&&(Wn(u,i,s),fl(u,i,s))}function FS(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Yp(i,s){FS(i,s),(i=i.alternate)&&FS(i,s)}function VS(i){if(i.tag===13||i.tag===31){var s=qa(i,67108864);s!==null&&Wn(s,i,67108864),Yp(i,67108864)}}function HS(i){if(i.tag===13||i.tag===31){var s=or();s=Yo(s);var u=qa(i,s);u!==null&&Wn(u,i,s),Yp(i,s)}}var ed=!0;function yO(i,s,u,p){var y=B.T;B.T=null;var x=X.p;try{X.p=2,Wp(i,s,u,p)}finally{X.p=x,B.T=y}}function bO(i,s,u,p){var y=B.T;B.T=null;var x=X.p;try{X.p=8,Wp(i,s,u,p)}finally{X.p=x,B.T=y}}function Wp(i,s,u,p){if(ed){var y=Xp(p);if(y===null)Ip(i,s,p,td,u),GS(i,p);else if(SO(y,i,s,u,p))p.stopPropagation();else if(GS(i,p),s&4&&-1<xO.indexOf(i)){for(;y!==null;){var x=Ye(y);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var A=Pt(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}Zr(x),(ht&6)===0&&(Lc=Me()+500,jl(0))}}break;case 31:case 13:O=qa(x,2),O!==null&&Wn(O,x,2),Uc(),Yp(x,2)}if(x=Xp(p),x===null&&Ip(i,s,p,td,u),x===y)break;y=x}y!==null&&p.stopPropagation()}else Ip(i,s,p,null,u)}}function Xp(i){return i=Jf(i),Qp(i)}var td=null;function Qp(i){if(td=null,i=he(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 td=i,null}function qS(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(W()){case H:return 2;case se:return 8;case Ee:case Te:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var Jp=!1,sa=null,oa=null,la=null,Il=new Map,Pl=new Map,ua=[],xO="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 GS(i,s){switch(i){case"focusin":case"focusout":sa=null;break;case"dragenter":case"dragleave":oa=null;break;case"mouseover":case"mouseout":la=null;break;case"pointerover":case"pointerout":Il.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pl.delete(s.pointerId)}}function Ll(i,s,u,p,y,x){return i===null||i.nativeEvent!==x?(i={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:x,targetContainers:[y]},s!==null&&(s=Ye(s),s!==null&&VS(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),i)}function SO(i,s,u,p,y){switch(s){case"focusin":return sa=Ll(sa,i,s,u,p,y),!0;case"dragenter":return oa=Ll(oa,i,s,u,p,y),!0;case"mouseover":return la=Ll(la,i,s,u,p,y),!0;case"pointerover":var x=y.pointerId;return Il.set(x,Ll(Il.get(x)||null,i,s,u,p,y)),!0;case"gotpointercapture":return x=y.pointerId,Pl.set(x,Ll(Pl.get(x)||null,i,s,u,p,y)),!0}return!1}function KS(i){var s=he(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,Wu(i.priority,function(){HS(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,Wu(i.priority,function(){HS(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 nd(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=Xp(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);Qf=p,u.target.dispatchEvent(p),Qf=null}else return s=Ye(u),s!==null&&VS(s),i.blockedOn=u,!1;s.shift()}return!0}function $S(i,s,u){nd(i)&&u.delete(s)}function wO(){Jp=!1,sa!==null&&nd(sa)&&(sa=null),oa!==null&&nd(oa)&&(oa=null),la!==null&&nd(la)&&(la=null),Il.forEach($S),Pl.forEach($S)}function rd(i,s){i.blockedOn===s&&(i.blockedOn=null,Jp||(Jp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,wO)))}var id=null;function YS(i){id!==i&&(id=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){id===i&&(id=null);for(var s=0;s<i.length;s+=3){var u=i[s],p=i[s+1],y=i[s+2];if(typeof p!="function"){if(Qp(p||u)===null)continue;break}var x=Ye(u);x!==null&&(i.splice(s,3),s-=3,Xh(x,{pending:!0,data:y,method:u.method,action:p},p,y))}}))}function to(i){function s(F){return rd(F,i)}sa!==null&&rd(sa,i),oa!==null&&rd(oa,i),la!==null&&rd(la,i),Il.forEach(s),Pl.forEach(s);for(var u=0;u<ua.length;u++){var p=ua[u];p.blockedOn===i&&(p.blockedOn=null)}for(;0<ua.length&&(u=ua[0],u.blockedOn===null);)KS(u),u.blockedOn===null&&ua.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var y=u[p],x=u[p+1],A=y[Nn]||null;if(typeof x=="function")A||YS(u);else if(A){var O=null;if(x&&x.hasAttribute("formAction")){if(y=x,A=x[Nn]||null)O=A.formAction;else if(Qp(y)!==null)continue}else O=A.action;typeof O=="function"?u[p+1]=O:(u.splice(p,3),p-=3),YS(u)}}}function WS(){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),p||setTimeout(u,20)}function u(){if(!p&&!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 p=!1,y=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),y!==null&&(y(),y=null)}}}function Zp(i){this._internalRoot=i}ad.prototype.render=Zp.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=or();BS(u,p,i,s,null,null)},ad.prototype.unmount=Zp.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;BS(i.current,2,null,i,null,null),Uc(),s[Fi]=null}};function ad(i){this._internalRoot=i}ad.prototype.unstable_scheduleHydration=function(i){if(i){var s=Yu();i={blockedOn:null,target:i,priority:s};for(var u=0;u<ua.length&&s!==0&&s<ua[u].priority;u++);ua.splice(u,0,i),u===0&&KS(i)}};var XS=t.version;if(XS!=="19.2.4")throw Error(r(527,XS,"19.2.4"));X.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=h(s),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var EO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sd.isDisabled&&sd.supportsFiber)try{Ot=sd.inject(EO),St=sd}catch{}}return Ul.createRoot=function(i,s){if(!a(i))throw Error(r(299));var u=!1,p="",y=rx,x=ix,A=ax;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=zS(i,1,!1,null,null,u,p,null,y,x,A,WS),i[Fi]=s.current,Dp(i),new Zp(s)},Ul.hydrateRoot=function(i,s,u){if(!a(i))throw Error(r(299));var p=!1,y="",x=rx,A=ix,O=ax,F=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!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=zS(i,1,!0,s,u??null,p,y,F,x,A,O,WS),s.context=US(null),u=s.current,p=or(),p=Yo(p),y=Yi(p),y.callback=null,Wi(u,y,p),u=p,s.current.lanes=u,cn(s,u),Zr(s),i[Fi]=s.current,Dp(i),new ad(s)},Ul.version="19.2.4",Ul}var sw;function DO(){if(sw)return nm.exports;sw=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(),nm.exports=MO(),nm.exports}var IO=DO();const PO=Oo(IO);var ow="popstate";function lw(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function LO(e={}){function t(r,a){let o=a.state?.masked,{pathname:l,search:c,hash:f}=o||r.location;return gg("",{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:Eu(a)}return UO(t,n,null,e)}function Ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $r(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function zO(){return Math.random().toString(36).substring(2,10)}function uw(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 gg(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Mo(t):t,state:n,key:t&&t.key||r||zO(),unstable_mask:a}}function Eu({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 Mo(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 UO(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,c="POP",f=null,h=m();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function m(){return(l.state||{idx:null}).idx}function g(){c="POP";let E=m(),T=E==null?null:E-h;h=E,f&&f({action:c,location:w.location,delta:T})}function v(E,T){c="PUSH";let k=lw(E)?E:gg(w.location,E,T);h=m()+1;let C=uw(k,h),N=w.createHref(k.unstable_mask||k);try{l.pushState(C,"",N)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(N)}o&&f&&f({action:c,location:w.location,delta:1})}function b(E,T){c="REPLACE";let k=lw(E)?E:gg(w.location,E,T);h=m();let C=uw(k,h),N=w.createHref(k.unstable_mask||k);l.replaceState(C,"",N),o&&f&&f({action:c,location:w.location,delta:0})}function S(E){return BO(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(ow,g),f=E,()=>{a.removeEventListener(ow,g),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:v,replace:b,go(E){return l.go(E)}};return w}function BO(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ht(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Eu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function IC(e,t,n="/"){return FO(e,t,n,!1)}function FO(e,t,n,r){let a=typeof t=="string"?Mo(t):t,o=Li(a.pathname||"/",n);if(o==null)return null;let l=PC(e);VO(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let h=ZO(o);c=QO(l[f],h,r)}return c}function PC(e,t=[],n=[],r="",a=!1){let o=(l,c,f=a,h)=>{let m={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;Ht(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=si([r,m.relativePath]),v=n.concat(m);l.children&&l.children.length>0&&(Ht(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),PC(l.children,t,v,g,f)),!(l.path==null&&!l.index)&&t.push({path:g,score:WO(g,l.index),routesMeta:v})};return e.forEach((l,c)=>{if(l.path===""||!l.path?.includes("?"))o(l,c);else for(let f of LC(l.path))o(l,c,!0,f)}),t}function LC(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=LC(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 VO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:XO(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var HO=/^:[\w-]+$/,qO=3,GO=2,KO=1,$O=10,YO=-2,cw=e=>e==="*";function WO(e,t){let n=e.split("/"),r=n.length;return n.some(cw)&&(r+=YO),t&&(r+=GO),n.filter(a=>!cw(a)).reduce((a,o)=>a+(HO.test(o)?qO:o===""?KO:$O),r)}function XO(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 QO(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",l=[];for(let c=0;c<r.length;++c){let f=r[c],h=c===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=tf({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},m),v=f.route;if(!g&&h&&n&&!r[r.length-1].route.index&&(g=tf({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(a,g.params),l.push({params:a,pathname:si([o,g.pathname]),pathnameBase:rM(si([o,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(o=si([o,g.pathnameBase]))}return l}function tf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=JO(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((h,{paramName:m,isOptional:g},v)=>{if(m==="*"){let S=c[v]||"";l=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const b=c[v];return g&&!b?h[m]=void 0:h[m]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:l,pattern:e}}function JO(e,t=!1,n=!0){$r(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,h,m)=>{if(r.push({paramName:c,isOptional:f!=null}),f){let g=m.charAt(h+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 ZO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $r(!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 Li(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 eM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function tM(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Mo(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=dw(n.substring(1),"/"):o=dw(n,t)):o=t,{pathname:o,search:iM(r),hash:aM(a)}}function dw(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 sm(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 nM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fv(e){let t=nM(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function kf(e,t,n,r=!1){let a;typeof e=="string"?a=Mo(e):(a={...e},Ht(!a.pathname||!a.pathname.includes("?"),sm("?","pathname","search",a)),Ht(!a.pathname||!a.pathname.includes("#"),sm("#","pathname","hash",a)),Ht(!a.search||!a.search.includes("#"),sm("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,c;if(l==null)c=n;else{let g=t.length-1;if(!r&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}c=g>=0?t[g]:"/"}let f=tM(a,c),h=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||m)&&(f.pathname+="/"),f}var si=e=>e.join("/").replace(/\/\/+/g,"/"),rM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),iM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,aM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,sM=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 oM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function lM(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var zC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function UC(e,t){let n=e;if(typeof n!="string"||!eM.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(zC)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),c=Li(l.pathname,t);l.origin===o.origin&&c!=null?n=c+l.search+l.hash:a=!0}catch{$r(!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 BC=["POST","PUT","PATCH","DELETE"];new Set(BC);var uM=["GET",...BC];new Set(uM);var Do=R.createContext(null);Do.displayName="DataRouter";var Af=R.createContext(null);Af.displayName="DataRouterState";var cM=R.createContext(!1),FC=R.createContext({isTransitioning:!1});FC.displayName="ViewTransition";var dM=R.createContext(new Map);dM.displayName="Fetchers";var fM=R.createContext(null);fM.displayName="Await";var hr=R.createContext(null);hr.displayName="Navigation";var Du=R.createContext(null);Du.displayName="Location";var di=R.createContext({outlet:null,matches:[],isDataRoute:!1});di.displayName="Route";var Vv=R.createContext(null);Vv.displayName="RouteError";var VC="REACT_ROUTER_ERROR",hM="REDIRECT",pM="ROUTE_ERROR_RESPONSE";function mM(e){if(e.startsWith(`${VC}:${hM}:{`))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 gM(e){if(e.startsWith(`${VC}:${pM}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new sM(t.status,t.statusText,t.data)}catch{}}function vM(e,{relative:t}={}){Ht(Io(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=R.useContext(hr),{hash:a,pathname:o,search:l}=Iu(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:si([n,o])),r.createHref({pathname:c,search:l,hash:a})}function Io(){return R.useContext(Du)!=null}function fi(){return Ht(Io(),"useLocation() may be used only in the context of a <Router> component."),R.useContext(Du).location}var HC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qC(e){R.useContext(hr).static||R.useLayoutEffect(e)}function GC(){let{isDataRoute:e}=R.useContext(di);return e?RM():yM()}function yM(){Ht(Io(),"useNavigate() may be used only in the context of a <Router> component.");let e=R.useContext(Do),{basename:t,navigator:n}=R.useContext(hr),{matches:r}=R.useContext(di),{pathname:a}=fi(),o=JSON.stringify(Fv(r)),l=R.useRef(!1);return qC(()=>{l.current=!0}),R.useCallback((f,h={})=>{if($r(l.current,HC),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=kf(f,JSON.parse(o),a,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:si([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,o,a,e])}R.createContext(null);function Iu(e,{relative:t}={}){let{matches:n}=R.useContext(di),{pathname:r}=fi(),a=JSON.stringify(Fv(n));return R.useMemo(()=>kf(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function bM(e,t){return KC(e,t)}function KC(e,t,n){Ht(Io(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=R.useContext(hr),{matches:a}=R.useContext(di),o=a[a.length-1],l=o?o.params:{},c=o?o.pathname:"/",f=o?o.pathnameBase:"/",h=o&&o.route;{let E=h&&h.path||"";YC(c,!h||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 m=fi(),g;if(t){let E=typeof t=="string"?Mo(t):t;Ht(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.`),g=E}else g=m;let v=g.pathname||"/",b=v;if(f!=="/"){let E=f.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(E.length).join("/")}let S=IC(e,{pathname:b});$r(h||S!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),$r(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 "${g.pathname}${g.search}${g.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=TM(S&&S.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:si([f,r.encodeLocation?r.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:si([f,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),a,n);return t&&w?R.createElement(Du.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},w):w}function xM(){let e=NM(),t=oM(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=R.createElement(R.Fragment,null,R.createElement("p",null,"💿 Hey developer 👋"),R.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",R.createElement("code",{style:o},"ErrorBoundary")," or"," ",R.createElement("code",{style:o},"errorElement")," prop on your route.")),R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},t),n?R.createElement("pre",{style:a},n):null,l)}var SM=R.createElement(xM,null),$C=class extends R.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=gM(e.digest);n&&(e=n)}let t=e!==void 0?R.createElement(di.Provider,{value:this.props.routeContext},R.createElement(Vv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?R.createElement(wM,{error:e},t):t}};$C.contextType=cM;var om=new WeakMap;function wM({children:e,error:t}){let{basename:n}=R.useContext(hr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=mM(t.digest);if(r){let a=om.get(t);if(a)throw a;let o=UC(r.location,n);if(zC&&!om.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 om.set(t,l),l}return R.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function EM({routeContext:e,match:t,children:n}){let r=R.useContext(Do);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),R.createElement(di.Provider,{value:e},n)}function TM(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 m=a.findIndex(g=>g.route.id&&o?.[g.route.id]!==void 0);Ht(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,m+1))}let l=!1,c=-1;if(n&&r){l=r.renderFallback;for(let m=0;m<a.length;m++){let g=a[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=m),g.route.id){let{loaderData:v,errors:b}=r,S=g.route.loader&&!v.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||S){n.isStatic&&(l=!0),c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}}let f=n?.onError,h=r&&f?(m,g)=>{f(m,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:lM(r.matches),errorInfo:g})}:void 0;return a.reduceRight((m,g,v)=>{let b,S=!1,w=null,E=null;r&&(b=o&&g.route.id?o[g.route.id]:void 0,w=g.route.errorElement||SM,l&&(c<0&&v===0?(YC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,E=null):c===v&&(S=!0,E=g.route.hydrateFallbackElement||null)));let T=t.concat(a.slice(0,v+1)),k=()=>{let C;return b?C=w:S?C=E:g.route.Component?C=R.createElement(g.route.Component,null):g.route.element?C=g.route.element:C=m,R.createElement(EM,{match:g,routeContext:{outlet:m,matches:T,isDataRoute:r!=null},children:C})};return r&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?R.createElement($C,{location:r.location,revalidation:r.revalidation,component:w,error:b,children:k(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:h}):k()},null)}function Hv(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function CM(e){let t=R.useContext(Do);return Ht(t,Hv(e)),t}function kM(e){let t=R.useContext(Af);return Ht(t,Hv(e)),t}function AM(e){let t=R.useContext(di);return Ht(t,Hv(e)),t}function qv(e){let t=AM(e),n=t.matches[t.matches.length-1];return Ht(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function jM(){return qv("useRouteId")}function NM(){let e=R.useContext(Vv),t=kM("useRouteError"),n=qv("useRouteError");return e!==void 0?e:t.errors?.[n]}function RM(){let{router:e}=CM("useNavigate"),t=qv("useNavigate"),n=R.useRef(!1);return qC(()=>{n.current=!0}),R.useCallback(async(a,o={})=>{$r(n.current,HC),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var fw={};function YC(e,t,n){!t&&!fw[e]&&(fw[e]=!0,$r(!1,n))}R.memo(_M);function _M({routes:e,future:t,state:n,isStatic:r,onError:a}){return KC(e,void 0,{state:n,isStatic:r,onError:a})}function OM({to:e,replace:t,state:n,relative:r}){Ht(Io(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=R.useContext(hr);$r(!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}=R.useContext(di),{pathname:l}=fi(),c=GC(),f=kf(e,Fv(o),l,r==="path"),h=JSON.stringify(f);return R.useEffect(()=>{c(JSON.parse(h),{replace:t,state:n,relative:r})},[c,h,r,t,n]),null}function En(e){Ht(!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 MM({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){Ht(!Io(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=R.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[c,a,o,l]);typeof n=="string"&&(n=Mo(n));let{pathname:h="/",search:m="",hash:g="",state:v=null,key:b="default",unstable_mask:S}=n,w=R.useMemo(()=>{let E=Li(h,c);return E==null?null:{location:{pathname:E,search:m,hash:g,state:v,key:b,unstable_mask:S},navigationType:r}},[c,h,m,g,v,b,r,S]);return $r(w!=null,`<Router basename="${c}"> is not able to match the URL "${h}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:R.createElement(hr.Provider,{value:f},R.createElement(Du.Provider,{children:t,value:w}))}function DM({children:e,location:t}){return bM(vg(e),t)}function vg(e,t=[]){let n=[];return R.Children.forEach(e,(r,a)=>{if(!R.isValidElement(r))return;let o=[...t,a];if(r.type===R.Fragment){n.push.apply(n,vg(r.props.children,o));return}Ht(r.type===En,`[${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>`),Ht(!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=vg(r.props.children,o)),n.push(l)}),n}var Md="get",Dd="application/x-www-form-urlencoded";function jf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function IM(e){return jf(e)&&e.tagName.toLowerCase()==="button"}function PM(e){return jf(e)&&e.tagName.toLowerCase()==="form"}function LM(e){return jf(e)&&e.tagName.toLowerCase()==="input"}function zM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function UM(e,t){return e.button===0&&(!t||t==="_self")&&!zM(e)}var od=null;function BM(){if(od===null)try{new FormData(document.createElement("form"),0),od=!1}catch{od=!0}return od}var FM=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lm(e){return e!=null&&!FM.has(e)?($r(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dd}"`),null):e}function VM(e,t){let n,r,a,o,l;if(PM(e)){let c=e.getAttribute("action");r=c?Li(c,t):null,n=e.getAttribute("method")||Md,a=lm(e.getAttribute("enctype"))||Dd,o=new FormData(e)}else if(IM(e)||LM(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?Li(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Md,a=lm(e.getAttribute("formenctype"))||lm(c.getAttribute("enctype"))||Dd,o=new FormData(c,e),!BM()){let{name:h,type:m,value:g}=e;if(m==="image"){let v=h?`${h}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else h&&o.append(h,g)}}else{if(jf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Md,r=null,a=Dd,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 Gv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function HM(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&&Li(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function qM(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 GM(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 KM(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await qM(o,n);return l.links?l.links():[]}return[]}));return XM(r.flat(1).filter(GM).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function hw(e,t,n,r,a,o){let l=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,c=(f,h)=>n[h].pathname!==f.pathname||n[h].route.path?.endsWith("*")&&n[h].params["*"]!==f.params["*"];return o==="assets"?t.filter((f,h)=>l(f,h)||c(f,h)):o==="data"?t.filter((f,h)=>{let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(l(f,h)||c(f,h))return!0;if(f.route.shouldRevalidate){let g=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 g=="boolean")return g}return!0}):[]}function $M(e,t,{includeHydrateFallback:n}={}){return YM(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 YM(e){return[...new Set(e)]}function WM(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function XM(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(WM(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function WC(){let e=R.useContext(Do);return Gv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function QM(){let e=R.useContext(Af);return Gv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Kv=R.createContext(void 0);Kv.displayName="FrameworkContext";function XC(){let e=R.useContext(Kv);return Gv(e,"You must render this element inside a <HydratedRouter> element"),e}function JM(e,t){let n=R.useContext(Kv),[r,a]=R.useState(!1),[o,l]=R.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:h,onMouseLeave:m,onTouchStart:g}=t,v=R.useRef(null);R.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=T=>{T.forEach(k=>{l(k.isIntersecting)})},E=new IntersectionObserver(w,{threshold:.5});return v.current&&E.observe(v.current),()=>{E.disconnect()}}},[e]),R.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,v,{}]:[o,v,{onFocus:Bl(c,b),onBlur:Bl(f,S),onMouseEnter:Bl(h,b),onMouseLeave:Bl(m,S),onTouchStart:Bl(g,b)}]:[!1,v,{}]}function Bl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ZM({page:e,...t}){let{router:n}=WC(),r=R.useMemo(()=>IC(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?R.createElement(tD,{page:e,matches:r,...t}):null}function eD(e){let{manifest:t,routeModules:n}=XC(),[r,a]=R.useState([]);return R.useEffect(()=>{let o=!1;return KM(e,t,n).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,n]),r}function tD({page:e,matches:t,...n}){let r=fi(),{future:a,manifest:o,routeModules:l}=XC(),{basename:c}=WC(),{loaderData:f,matches:h}=QM(),m=R.useMemo(()=>hw(e,t,h,o,r,"data"),[e,t,h,o,r]),g=R.useMemo(()=>hw(e,t,h,o,r,"assets"),[e,t,h,o,r]),v=R.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,E=!1;if(t.forEach(k=>{let C=o.routes[k.route.id];!C||!C.hasLoader||(!m.some(N=>N.route.id===k.route.id)&&k.route.id in f&&l[k.route.id]?.shouldRevalidate||C.hasClientLoader?E=!0:w.add(k.route.id))}),w.size===0)return[];let T=HM(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return E&&w.size>0&&T.searchParams.set("_routes",t.filter(k=>w.has(k.route.id)).map(k=>k.route.id).join(",")),[T.pathname+T.search]},[c,a.unstable_trailingSlashAwareDataRequests,f,r,o,m,t,e,l]),b=R.useMemo(()=>$M(g,o),[g,o]),S=eD(g);return R.createElement(R.Fragment,null,v.map(w=>R.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),b.map(w=>R.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:E})=>R.createElement("link",{key:w,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function nD(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var rD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rD&&(window.__reactRouterVersion="7.13.1")}catch{}function iD({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=R.useRef();a.current==null&&(a.current=LO({window:r,v5Compat:!0}));let o=a.current,[l,c]=R.useState({action:o.action,location:o.location}),f=R.useCallback(h=>{n===!1?c(h):R.startTransition(()=>c(h))},[n]);return R.useLayoutEffect(()=>o.listen(f),[o,f]),R.createElement(MM,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var QC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,JC=R.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:l,unstable_mask:c,state:f,target:h,to:m,preventScrollReset:g,viewTransition:v,unstable_defaultShouldRevalidate:b,...S},w){let{basename:E,navigator:T,unstable_useTransitions:k}=R.useContext(hr),C=typeof m=="string"&&QC.test(m),N=UC(m,E);m=N.to;let j=vM(m,{relative:a}),_=fi(),I=null;if(c){let J=kf(c,[],_.unstable_mask?_.unstable_mask.pathname:"/",!0);E!=="/"&&(J.pathname=J.pathname==="/"?E:si([E,J.pathname])),I=T.createHref(J)}let[L,V,D]=JM(r,S),q=oD(m,{replace:l,unstable_mask:c,state:f,target:h,preventScrollReset:g,relative:a,viewTransition:v,unstable_defaultShouldRevalidate:b,unstable_useTransitions:k});function G(J){t&&t(J),J.defaultPrevented||q(J)}let Z=!(N.isExternal||o),ce=R.createElement("a",{...S,...D,href:(Z?I:void 0)||N.absoluteURL||j,onClick:Z?G:t,ref:nD(w,V),target:h,"data-discover":!C&&n==="render"?"true":void 0});return L&&!C?R.createElement(R.Fragment,null,ce,R.createElement(ZM,{page:j})):ce});JC.displayName="Link";var ZC=R.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:l,viewTransition:c,children:f,...h},m){let g=Iu(l,{relative:h.relative}),v=fi(),b=R.useContext(Af),{navigator:S,basename:w}=R.useContext(hr),E=b!=null&&fD(g)&&c===!0,T=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,k=v.pathname,C=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(k=k.toLowerCase(),C=C?C.toLowerCase():null,T=T.toLowerCase()),C&&w&&(C=Li(C,w)||C);const N=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let j=k===T||!a&&k.startsWith(T)&&k.charAt(N)==="/",_=C!=null&&(C===T||!a&&C.startsWith(T)&&C.charAt(T.length)==="/"),I={isActive:j,isPending:_,isTransitioning:E},L=j?t:void 0,V;typeof r=="function"?V=r(I):V=[r,j?"active":null,_?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let D=typeof o=="function"?o(I):o;return R.createElement(JC,{...h,"aria-current":L,className:V,ref:m,style:D,to:l,viewTransition:c},typeof f=="function"?f(I):f)});ZC.displayName="NavLink";var aD=R.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:l=Md,action:c,onSubmit:f,relative:h,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:v,...b},S)=>{let{unstable_useTransitions:w}=R.useContext(hr),E=cD(),T=dD(c,{relative:h}),k=l.toLowerCase()==="get"?"get":"post",C=typeof c=="string"&&QC.test(c),N=j=>{if(f&&f(j),j.defaultPrevented)return;j.preventDefault();let _=j.nativeEvent.submitter,I=_?.getAttribute("formmethod")||l,L=()=>E(_||j.currentTarget,{fetcherKey:t,method:I,navigate:n,replace:a,state:o,relative:h,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:v});w&&n!==!1?R.startTransition(()=>L()):L()};return R.createElement("form",{ref:S,method:k,action:T,onSubmit:r?f:N,...b,"data-discover":!C&&e==="render"?"true":void 0})});aD.displayName="Form";function sD(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ek(e){let t=R.useContext(Do);return Ht(t,sD(e)),t}function oD(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:o,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let m=GC(),g=fi(),v=Iu(e,{relative:l});return R.useCallback(b=>{if(UM(b,t)){b.preventDefault();let S=n!==void 0?n:Eu(g)===Eu(v),w=()=>m(e,{replace:S,unstable_mask:r,state:a,preventScrollReset:o,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:f});h?R.startTransition(()=>w()):w()}},[g,m,v,n,r,a,t,e,o,l,c,f,h])}var lD=0,uD=()=>`__${String(++lD)}__`;function cD(){let{router:e}=ek("useSubmit"),{basename:t}=R.useContext(hr),n=jM(),r=e.fetch,a=e.navigate;return R.useCallback(async(o,l={})=>{let{action:c,method:f,encType:h,formData:m,body:g}=VM(o,t);if(l.navigate===!1){let v=l.fetcherKey||uD();await r(v,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||f,formEncType:l.encType||h,flushSync:l.flushSync})}else await a(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||f,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function dD(e,{relative:t}={}){let{basename:n}=R.useContext(hr),r=R.useContext(di);Ht(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...Iu(e||".",{relative:t})},l=fi();if(e==null){o.search=l.search;let c=new URLSearchParams(o.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(g=>g).forEach(g=>c.append("index",g));let m=c.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:si([n,o.pathname])),Eu(o)}function fD(e,{relative:t}={}){let n=R.useContext(FC);Ht(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ek("useViewTransitionState"),a=Iu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Li(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Li(n.nextLocation.pathname,r)||n.nextLocation.pathname;return tf(a.pathname,l)!=null||tf(a.pathname,o)!=null}var yg=function(e,t){return yg=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])},yg(e,t)};function Mr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var de=function(){return de=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},de.apply(this,arguments)};function nf(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(m){try{h(r.next(m))}catch(g){l(g)}}function f(m){try{h(r.throw(m))}catch(g){l(g)}}function h(m){m.done?o(m.value):a(m.value).then(c,f)}h((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(h){return function(m){return f([h,m])}}function f(h){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,h[0]&&(n=0)),n;)try{if(r=1,a&&(o=h[0]&2?a.return:h[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,h[1])).done)return o;switch(a=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return n.label++,{value:h[1],done:!1};case 5:n.label++,a=h[1],h=[0];continue;case 7:h=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){n=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){n.label=h[1];break}if(h[0]===6&&n.label<o[1]){n.label=o[1],o=h;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(h);break}o[2]&&n.ops.pop(),n.trys.pop();continue}h=t.call(e,n)}catch(m){h=[6,m],a=0}finally{r=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[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 Je(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 wa;(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"})(wa||(wa={}));var dr;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(dr||(dr={}));var pw="-",Nf="AMP",hD="".concat(Nf,"_unsent"),tk="$default_instance",$v="https://api2.amplitude.com/2/httpapi",nk="https://api.eu.amplitude.com/2/httpapi",rk="https://api2.amplitude.com/batch",ik="https://api.eu.amplitude.com/batch",pD="utm_campaign",mD="utm_content",gD="utm_id",vD="utm_medium",yD="utm_source",bD="utm_term",mw="dclid",gw="fbclid",vw="gbraid",yw="gclid",bw="ko_click_id",xw="li_fat_id",Sw="msclkid",ww="rdt_cid",Ew="ttclid",Tw="twclid",Cw="wbraid",Rf={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},rf=["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"],xD=["authorization","cookie","set-cookie"],SD=1e3,bg=function(e){if(Object.keys(e).length>SD)return!1;for(var t in e){var n=e[t];if(!ak(t,n))return!1}return!0},ak=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&&bg(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 bg(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},su=(function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return de({},this._properties)},e.prototype.set=function(t,n){return this._safeSet(Dt.SET,t,n),this},e.prototype.setOnce=function(t,n){return this._safeSet(Dt.SET_ONCE,t,n),this},e.prototype.append=function(t,n){return this._safeSet(Dt.APPEND,t,n),this},e.prototype.prepend=function(t,n){return this._safeSet(Dt.PREPEND,t,n),this},e.prototype.postInsert=function(t,n){return this._safeSet(Dt.POSTINSERT,t,n),this},e.prototype.preInsert=function(t,n){return this._safeSet(Dt.PREINSERT,t,n),this},e.prototype.remove=function(t,n){return this._safeSet(Dt.REMOVE,t,n),this},e.prototype.add=function(t,n){return this._safeSet(Dt.ADD,t,n),this},e.prototype.unset=function(t){return this._safeSet(Dt.UNSET,t,pw),this},e.prototype.clearAll=function(){return this._properties={},this._properties[Dt.CLEAR_ALL]=pw,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[Dt.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:t===Dt.ADD?typeof r=="number":t!==Dt.UNSET&&t!==Dt.REMOVE?ak(n,r):!0},e})(),Dt;(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"})(Dt||(Dt={}));var wD=[Dt.CLEAR_ALL,Dt.UNSET,Dt.SET,Dt.SET_ONCE,Dt.ADD,Dt.APPEND,Dt.PREPEND,Dt.PREINSERT,Dt.POSTINSERT,Dt.REMOVE],ED="Event tracked successfully",TD="Unexpected error occurred",CD="Event rejected due to exceeded retry count",kD="Event skipped due to optOut config",AD="Event rejected due to missing API key",jD="Invalid API key",ND="Client not initialized",Yt;(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"})(Yt||(Yt={}));var xo=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Yt.Unknown),{event:e,code:t,message:n}},ze=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},RD=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,Na)},kw=Je([],Ae(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),Na=function(e){var t,n=ze();if(!(!((t=n?.crypto)===null||t===void 0)&&t.getRandomValues))return RD(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Je([],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(kw[c]):kw[c]}).join("")},_D=(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=Na(),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,h,m,g,v,b,S,w,E,T,k,C,N,j;return te(this,function(_){switch(_.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(I){return I.type==="before"}),_.label=1;case 1:_.trys.push([1,6,7,8]),c=_e(l),f=c.next(),_.label=2;case 2:return f.done?[3,5]:(b=f.value,b.execute?[4,b.execute(de({},r))]:[3,4]);case 3:if(S=_.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))),_.label=4;case 4:return f=c.next(),[3,2];case 5:return[3,8];case 6:return h=_.sent(),k={error:h},[3,8];case 7:try{f&&!f.done&&(C=c.return)&&C.call(c)}finally{if(k)throw k.error}return[7];case 8:m=this.plugins.filter(function(I){return I.type==="enrichment"||I.type===void 0}),_.label=9;case 9:_.trys.push([9,14,15,16]),g=_e(m),v=g.next(),_.label=10;case 10:return v.done?[3,13]:(b=v.value,b.execute?[4,b.execute(de({},r))]:[3,12]);case 11:if(S=_.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))),_.label=12;case 12:return v=g.next(),[3,10];case 13:return[3,16];case 14:return w=_.sent(),N={error:w},[3,16];case 15:try{v&&!v.done&&(j=g.return)&&j.call(g)}finally{if(N)throw N.error}return[7];case 16:return E=this.plugins.filter(function(I){return I.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),T=E.map(function(I){var L=de({},r);return I.execute(L).catch(function(V){return xo(L,0,String(V))})}),Promise.all(T).then(function(I){var L=Ae(I,1),V=L[0],D=V||xo(r,100,"Event not tracked, no destination plugins on the instance");o(D)}),[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(h){switch(h.label){case 0:h.trys.push([0,7,8,9]),n=_e(this._optOutListeners),r=n.next(),h.label=1;case 1:if(r.done)return[3,6];a=r.value,h.label=2;case 2:return h.trys.push([2,4,,5]),[4,a(t)];case 3:return h.sent(),[3,5];case 4:return o=h.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=h.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})(),OD=function(e,t,n){var r=typeof e=="string"?{event_type:e}:e;return de(de(de({},r),n),t&&{event_properties:t})},Yv=function(e,t){var n=de(de({},t),{event_type:dr.IDENTIFY,user_properties:e.getUserProperties()});return n},MD=function(e,t,n,r){var a,o=de(de({},r),{event_type:dr.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(a={},a[e]=t,a)});return o},DD=function(e,t,n){var r,a=new su;a.set(e,t);var o=de(de({},n),{event_type:dr.IDENTIFY,user_properties:a.getUserProperties(),groups:(r={},r[e]=t,r)});return o},ID=function(e,t){return de(de({},t),{event_type:dr.REVENUE,event_properties:e.getEventProperties()})},Cn=function(e){return{promise:e||Promise.resolve()}},PD=(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 _D(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,h;return te(this,function(m){switch(m.label){case 0:n=this[t],this[t]=[],m.label=1;case 1:m.trys.push([1,8,9,10]),r=_e(n),a=r.next(),m.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 m.sent(),[3,6];case 4:return[4,l];case 5:m.sent(),m.label=6;case 6:return a=r.next(),[3,2];case 7:return[3,10];case 8:return c=m.sent(),f={error:c},[3,10];case 9:try{a&&!a.done&&(h=r.return)&&h.call(r)}finally{if(f)throw f.error}return[7];case 10:return this[t].length?[4,this.runQueuedFunctions(t)]:[3,12];case 11:m.sent(),m.label=12;case 12:return[2]}})})},e.prototype.track=function(t,n,r){var a=OD(t,n,r);return this.userProperties=this.getOperationAppliedUserProperties(a.user_properties),Cn(this.dispatch(a))},e.prototype.identify=function(t,n){var r=Yv(t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Cn(this.dispatch(r))},e.prototype.groupIdentify=function(t,n,r,a){var o=MD(t,n,r,a);return Cn(this.dispatch(o))},e.prototype.setGroup=function(t,n,r){var a=DD(t,n,r);return this.userProperties=this.getOperationAppliedUserProperties(a.user_properties),Cn(this.dispatch(a))},e.prototype.revenue=function(t,n){var r=ID(t,n);return Cn(this.dispatch(r))},e.prototype.add=function(t){return this.isReady?this._addPlugin(t):(this.q.push(this._addPlugin.bind(this,t)),Cn())},e.prototype._addPlugin=function(t){return Cn(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)),Cn())},e.prototype._removePlugin=function(t){return Cn(this.timeline.deregister(t,this.config))},e.prototype.dispatchWithCallback=function(t,n){if(!this.isReady)return n(xo(t,0,ND));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=de({},r);if(t===void 0)return a;var o={};return Object.keys(t).forEach(function(l){Object.values(wa).includes(l)||(o[l]=t[l])}),wD.forEach(function(l){if(Object.keys(t).includes(l)){var c=t[l];switch(l){case wa.CLEAR_ALL:Object.keys(a).forEach(function(f){delete a[f]});break;case wa.UNSET:Object.keys(c).forEach(function(f){delete a[f]});break;case wa.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,xo(t,0,kD)]:(t.event_type===dr.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=xo(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 Cn(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})(),LD=(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 bg(t)&&(this.properties=t),this},e.prototype.getEventProperties=function(){var t=this.properties?de({},this.properties):{};return t[ti.REVENUE_PRODUCT_ID]=this.productId,t[ti.REVENUE_QUANTITY]=this.quantity,t[ti.REVENUE_PRICE]=this.price,t[ti.REVENUE_TYPE]=this.revenueType,t[ti.REVENUE_CURRENCY]=this.currency,t[ti.REVENUE]=this.revenue,t[ti.RECEIPT]=this.receipt,t[ti.RECEIPT_SIG]=this.receiptSig,t},e})(),ti;(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"})(ti||(ti={}));var zD=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},[])},Qn;(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"})(Qn||(Qn={}));var ld="Amplitude Logger ",jo=(function(){function e(){this.logLevel=Qn.None}return e.prototype.disable=function(){this.logLevel=Qn.None},e.prototype.enable=function(t){t===void 0&&(t=Qn.Warn),this.logLevel=t},e.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<Qn.Verbose||console.log("".concat(ld,"[Log]: ").concat(t.join(" ")))},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<Qn.Warn||console.warn("".concat(ld,"[Warn]: ").concat(t.join(" ")))},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<Qn.Error||console.error("".concat(ld,"[Error]: ").concat(t.join(" ")))},e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<Qn.Debug||console.log("".concat(ld,"[Debug]: ").concat(t.join(" ")))},e})(),Id=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:tk,logLevel:Qn.Warn,loggerProvider:new jo,offline:!1,optOut:!1,serverUrl:$v,serverZone:"US",useBatch:!1}},sk=(function(){function e(t){var n,r,a,o;this._optOut=!1;var l=Id();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=ok(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})(),UD=function(e,t){return e==="EU"?t?ik:nk:t?rk:$v},ok=function(e,t,n){if(e===void 0&&(e=""),t===void 0&&(t=Id().serverZone),n===void 0&&(n=Id().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:Id().serverZone;return{serverZone:r,serverUrl:UD(r,n)}},BD=(function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(t,n){this.sdk.metrics.histogram[t]=n},e})();function xg(e){return e>=200&&e<300}var Pd=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()})},kt=function(e){return function(){var t=de({},e.config),n=t.loggerProvider,r=t.logLevel;return{logger:n,logLevel:r}}},FD=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},At=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]=FD(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}},it=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,h=c.logLevel;if(h&&h<Qn.Debug||!h||!f)return e.apply(a,o);var m={type:"invoke public method",name:t,args:o,stacktrace:Pd(1),time:{start:new Date().toISOString()},states:{}};r&&m.states&&(m.states.before=r());var g=e.apply(a,o);return g&&g.promise?g.promise.then(function(){r&&m.states&&(m.states.after=r()),m.time&&(m.time.end=new Date().toISOString()),f.debug(JSON.stringify(m,null,2))}):(r&&m.states&&(m.states.after=r()),m.time&&(m.time.end=new Date().toISOString()),f.debug(JSON.stringify(m,null,2))),g}},VD=new Set([$v,nk,rk,ik]),HD=function(e,t){return t===void 0&&(t=!1),VD.has(e)?!0:t};function qD(e){return e instanceof Error?e.message:String(e)}function Fl(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch{}return t}var GD=(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(hD,"_").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=Na()),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,CD),!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=zD(n,this.config.flushQueueSize),[4,a.reduce(function(c,f){return ne(o,void 0,void 0,function(){return te(this,function(h){switch(h.label){case 0:return[4,c];case 1:return h.sent(),[4,this.send(f,t)];case 2:return[2,h.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,h;return te(this,function(m){switch(m.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,AD)];a={api_key:this.config.apiKey,events:t.map(function(g){var v=g.event;v.extra;var b=nf(v,["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 BD,m.label=1;case 1:return m.trys.push([1,3,,4]),o=ok(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,l=HD(o,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(o,a,this.config._enableRequestBodyCompressionExperimental&&l)];case 2:return c=m.sent(),c===null?(this.fulfillRequest(t,0,TD),[2]):n?(this.handleResponse(c,t),[3,4]):("body"in c?this.fulfillRequest(t,c.statusCode,"".concat(c.status,": ").concat(Fl(c))):this.fulfillRequest(t,c.statusCode,c.status),[2]);case 3:return f=m.sent(),h=qD(f),this.config.loggerProvider.error(h),(r=this.diagnosticsClient)===null||r===void 0||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:t.map(function(g){return g.event.event_type}),message:h,stack_trace:Pd()}),this.handleResponse({status:Yt.Failed,statusCode:0},t),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(t,n){var r;xg(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:Fl(t),stack_trace:Pd()});var a=t.status;switch(a){case Yt.Success:{this.handleSuccessResponse(t,n);break}case Yt.Invalid:{this.handleInvalidResponse(t,n);break}case Yt.PayloadTooLarge:{this.handlePayloadTooLargeResponse(t,n);break}case Yt.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,ED)},e.prototype.handleInvalidResponse=function(t,n){var r=this;if(t.body.missingField||t.body.error.startsWith(jD)){this.fulfillRequest(n,t.statusCode,t.body.error);return}var a=Je(Je(Je(Je([],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,h){if(o.has(h)){r.fulfillRequest([f],t.statusCode,t.body.error);return}return!0});l.length>0&&this.config.loggerProvider.warn(Fl(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(Fl(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),h=new Set(l),m=n.filter(function(v,b){if(v.event.user_id&&c.has(v.event.user_id)||v.event.device_id&&f.has(v.event.device_id)){r.fulfillRequest([v],t.statusCode,t.body.error);return}return h.has(b)&&(v.timeout=r.throttleTimeout),!0});m.length>0&&this.config.loggerProvider.warn(Fl(t));var g=this.removeEventsExceedFlushMaxRetries(m);this.scheduleEvents(g)},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;xg(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:Pd()})),this.removeEvents(t),t.forEach(function(c){return c.callback(xo(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})(),KD=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:$D(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),$D=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},YD=(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})(),ma=function(){return ma=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},ma.apply(this,arguments)};function Ld(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 Aw(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 zd=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=Ld(a),f=c.next();!f.done;f=c.next()){var h=f.value;if(h===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 m=Array.isArray(e),g=Array.isArray(t);if(m!==g)return!1;if(m&&g){for(var v=0;v<e.length;v++)if(!zd(e[v],t[v]))return!1}else{var b=Object.keys(e).sort(),S=Object.keys(t).sort();if(!zd(b,S))return!1;var w=!0;return Object.keys(e).forEach(function(E){zd(e[E],t[E])||(w=!1)}),w}return!0},WD="$set",XD="$unset",QD="$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 JD=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,n=ma({},this.identity.userProperties),r=ma(ma({},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,h,m,g=r.userProperties||{};try{for(var v=Ld(Object.entries(a)),b=v.next();!b.done;b=v.next()){var S=Aw(b.value,2),w=S[0],E=S[1];switch(w){case WD:try{for(var T=(c=void 0,Ld(Object.entries(E))),k=T.next();!k.done;k=T.next()){var C=Aw(k.value,2),N=C[0],j=C[1];g[N]=j}}catch(L){c={error:L}}finally{try{k&&!k.done&&(f=T.return)&&f.call(T)}finally{if(c)throw c.error}}break;case XD:try{for(var _=(h=void 0,Ld(Object.keys(E))),I=_.next();!I.done;I=_.next()){var N=I.value;delete g[N]}}catch(L){h={error:L}}finally{try{I&&!I.done&&(m=_.return)&&m.call(_)}finally{if(h)throw h.error}}break;case QD:g={};break}}}catch(L){o={error:L}}finally{try{b&&!b.done&&(l=v.return)&&l.call(v)}finally{if(o)throw o.error}}return r.userProperties=g,this},commit:function(){return t.setIdentity(r),this}}},e.prototype.getIdentity=function(){return ma({},this.identity)},e.prototype.setIdentity=function(t){var n=ma({},this.identity);this.identity=ma({},t),zd(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})(),Vl=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,Wv=(function(){function e(){this.identityStore=new JD,this.eventBridge=new YD,this.applicationContextProvider=new KD}return e.getInstance=function(t){return Vl.analyticsConnectorInstances||(Vl.analyticsConnectorInstances={}),Vl.analyticsConnectorInstances[t]||(Vl.analyticsConnectorInstances[t]=new e),Vl.analyticsConnectorInstances[t]},e})(),No=function(e){return e===void 0&&(e=tk),Wv.getInstance(e)},ZD=function(e,t){No(t).identityStore.editIdentity().setUserId(e).commit()},eI=function(e,t){No(t).identityStore.editIdentity().setDeviceId(e).commit()},tI=(function(){function e(){this.name="identity",this.type="before",this.identityStore=No().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=No(t.instanceName).identityStore),[2]})})},e})(),lk=function(e,t){t===void 0&&(t=Date.now());var n=Date.now(),r=n-t;return r>e},uk=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),[Nf,t,e.substring(0,n)].filter(Boolean).join("_")},nI=function(e){return"".concat(Nf.toLowerCase(),"_").concat(e.substring(0,6))},rI=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:""},af=function(){var e,t=ze();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=jw(l[0]),f=jw(l[1]);return f&&(a[c]=f),a},{});return r},jw=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},Sg=function(e,t){return!t||!t.length?!0:t.some(function(n){return typeof n=="string"?e===n:e.match(n)})},Ea=function(e,t){var n=e;try{n=decodeURI(e)}catch(r){t?.error("Malformed URI sequence: ",r)}return n},sf=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},iI=function(e,t){var n=sf(e.toString()),r=Math.abs(n),a=r*31,o=a%1e6;return o/1e6<t},Nw=function(e,t){var n=sf(e.toString()),r=Math.abs(n),a=r*31,o=a%1e5;return o/1e5<t},Xv=(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})(),aI=function(){var e,t=ze();return(e=t?.navigator)===null||e===void 0?void 0:e.locks},of=(function(){function e(t,n){n===void 0&&(n={}),this.options=de({},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=de({},this.options),r=new e(n),a=String(Date.now()),[4,r.transaction(t,function(c){var f,h;try{c.set(a);var m=c.get(),g=m===a;return!g&&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})),g}catch(b){if(o.config.diagnosticsClient){var v=b instanceof Error?b.message:String(b);(h=o.config.diagnosticsClient)===null||h===void 0||h.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:a,error:v,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=ck(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,h,m,g,v;return te(this,function(b){switch(b.label){case 0:a=ze(),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),h=f.next();!h.done;h=f.next())if(m=h.value,dk(m.domain,this.options.domain))return[2,m.value]}catch(S){g={error:S}}finally{try{h&&!h.done&&(v=f.return)&&v.call(f)}finally{if(g)throw g.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=ze(),l=((a=(r=o?.document)===null||r===void 0?void 0:r.cookie.split("; "))!==null&&a!==void 0?a:[]).filter(function(h){return h.indexOf(t+"=")===0}),c=void 0,f=this.config.duplicateResolverFn;if(typeof f=="function"&&l.length>1&&(c=l.find(function(h){var m;try{var g=f(h.substring(t.length+1));return g||(m=n.config.diagnosticsClient)===null||m===void 0||m.increment("cookies.duplicate.occurrence.document.cookie"),g}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 h=ze();h&&(h.document.cookie=f)}catch(g){var m=g instanceof Error?g.message:String(g);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(t,". Error: ").concat(m))}},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=aI(),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})(),sI=function(e){try{return decodeURIComponent(atob(e))}catch{return}},oI=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch{return}},ck=function(e){var t;return(t=sI(e))!==null&&t!==void 0?t:oI(e)},dk=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()},Rw=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),[Nf,t,e.substring(0,n)].filter(Boolean).join("_")},Qv=(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})(),lI=10,uI=1,ot={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},_w={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Ow=(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=ze())===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,uI);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(ot.TAGS)||t.createObjectStore(ot.TAGS,{keyPath:"key"}),t.objectStoreNames.contains(ot.COUNTERS)||t.createObjectStore(ot.COUNTERS,{keyPath:"key"}),t.objectStoreNames.contains(ot.HISTOGRAMS)||t.createObjectStore(ot.HISTOGRAMS,{keyPath:"key"}),!t.objectStoreNames.contains(ot.EVENTS)){var n=t.createObjectStore(ot.EVENTS,{keyPath:"id",autoIncrement:!0});n.createIndex("time_idx","time",{unique:!1})}t.objectStoreNames.contains(ot.INTERNAL)||t.createObjectStore(ot.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([ot.TAGS],"readwrite"),a=r.objectStore(ot.TAGS),[2,new Promise(function(f){var h=Object.entries(t);r.oncomplete=function(){f()},r.onabort=function(m){l.logger.debug("DiagnosticsStorage: Failed to set tags",m),f()},h.forEach(function(m){var g=Ae(m,2),v=g[0],b=g[1],S=a.put({key:v,value:b});S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to set tag",v,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([ot.COUNTERS],"readwrite"),a=r.objectStore(ot.COUNTERS),[2,new Promise(function(f){var h=Object.entries(t);r.oncomplete=function(){f()},r.onabort=function(m){l.logger.debug("DiagnosticsStorage: Failed to increment counters",m),f()},h.forEach(function(m){var g=Ae(m,2),v=g[0],b=g[1],S=a.get(v);S.onsuccess=function(){var w=S.result,E=w?w.value:0,T=a.put({key:v,value:E+b});T.onerror=function(k){l.logger.debug("DiagnosticsStorage: Failed to update counter",v,k)}},S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to read existing counter",v,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([ot.HISTOGRAMS],"readwrite"),a=r.objectStore(ot.HISTOGRAMS),[2,new Promise(function(f){var h=Object.entries(t);r.oncomplete=function(){f()},r.onabort=function(m){l.logger.debug("DiagnosticsStorage: Failed to set histogram stats",m),f()},h.forEach(function(m){var g=Ae(m,2),v=g[0],b=g[1],S=a.get(v);S.onsuccess=function(){var w=S.result,E;w?E={key:v,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:v,count:b.count,min:b.min,max:b.max,sum:b.sum};var T=a.put(E);T.onerror=function(k){l.logger.debug("DiagnosticsStorage: Failed to set histogram stats",v,k)}},S.onerror=function(w){l.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",v,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([ot.EVENTS],"readwrite"),a=r.objectStore(ot.EVENTS),[2,new Promise(function(f){r.oncomplete=function(){f()},r.onabort=function(m){l.logger.debug("DiagnosticsStorage: Failed to add event records",m),f()};var h=a.count();h.onsuccess=function(){var m=h.result,g=Math.max(0,lI-m);g<t.length&&l.logger.debug("DiagnosticsStorage: Only added ".concat(g," of ").concat(t.length," events due to storage limit")),t.slice(0,g).forEach(function(v){var b=a.add(v);b.onerror=function(S){l.logger.debug("DiagnosticsStorage: Failed to add event record",S)}})},h.onerror=function(m){l.logger.debug("DiagnosticsStorage: Failed to count existing events",m)}})];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([ot.INTERNAL],"readwrite"),o=a.objectStore(ot.INTERNAL),[2,new Promise(function(f,h){a.onabort=function(){return h(new Error("Failed to set internal value"))};var m=o.put({key:t,value:n});m.onsuccess=function(){return f()},m.onerror=function(){return h(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([ot.INTERNAL],"readonly"),a=r.objectStore(ot.INTERNAL),[2,new Promise(function(c,f){r.onabort=function(){return f(new Error("Failed to get internal value"))};var h=a.get(t);h.onsuccess=function(){return c(h.result)},h.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(_w.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(_w.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(h){switch(h.label){case 0:return h.trys.push([0,4,,5]),[4,this.getDB()];case 1:return t=h.sent(),n=t.transaction([ot.TAGS,ot.COUNTERS,ot.HISTOGRAMS,ot.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(n,ot.TAGS),this.getAllFromStore(n,ot.COUNTERS),this.getAllFromStore(n,ot.HISTOGRAMS),this.getAllFromStore(n,ot.EVENTS)])];case 2:return r=Ae.apply(void 0,[h.sent(),4]),a=r[0],o=r[1],l=r[2],c=r[3],[4,Promise.all([this.clearTable(n,ot.COUNTERS),this.clearTable(n,ot.HISTOGRAMS),this.clearTable(n,ot.EVENTS)])];case 3:return h.sent(),[2,{tags:a,counters:o,histogramStats:l,events:c}];case 4:return f=h.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})(),cI="__AMPLITUDE_SCRIPT_URL__",dI="sdk.error.uncaught",fI=function(){var e=ze();if(!e)return[];var t=e[cI];return Array.isArray(t)?t:typeof t=="string"?[t]:[]},hI=function(e){var t=ze();if(!(!t||typeof t.addEventListener!="function")){var n=function(o){var l=o.error instanceof Error?o.error:void 0,c=l?.stack,f=Mw({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,h=pI(f),m=Mw({filename:h,stack:f});m&&a({type:"unhandledrejection",message:(l=c?.message)!==null&&l!==void 0?l:mI(o.reason),stack:f,filename:h,errorName:c?.name,metadata:{isTrusted:o.isTrusted,matchReason:m}})},a=function(o){e.recordEvent(dI,de({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)}},Mw=function(e){var t,n,r=fI();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}}},pI=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},mI=function(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"[object Object]"}},gI=1e3,ud=300*1e3,vI="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",yI="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",um=1e4,bI=10,xI=(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"?vI:yI,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(a,null,2)),this.config=de({enabled:!0,sampleRate:0},a),this.startTimestamp=Date.now(),this.shouldTrack=Nw(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Ow.isSupported()?this.storage=new Ow(t,n):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),hI(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>=um){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>=um){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>=um){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>=bI){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})},gI)),this.flushTimer||(this.flushTimer=setTimeout(function(){t._flush().catch(function(n){t.logger.debug("DiagnosticsClient: Failed to flush",n)}).finally(function(){t.flushTimer=null})},ud))},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=de({},this.inMemoryTags),n=de({},this.inMemoryCounters),r=de({},this.inMemoryHistograms),a=Je([],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,h,m;return te(this,function(g){switch(g.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return g.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return t=g.sent(),n=t.tags,r=t.counters,a=t.histogramStats,o=t.events,this.storage.setLastFlushTimestamp(Date.now()),l={},n.forEach(function(v){l[v.key]=v.value}),c={},r.forEach(function(v){c[v.key]=v.value}),f={},a.forEach(function(v){f[v.key]={count:v.count,min:v.min,max:v.max,avg:Math.round(v.sum/v.count*100)/100}}),h=o.map(function(v){return{event_name:v.event_name,time:v.time,event_properties:v.event_properties}}),Object.keys(c).length===0&&Object.keys(f).length===0&&h.length===0?[2]:(m={tags:l,histogram:f,counters:c,events:h},this.fetch(m),[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]),!ze())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(ud),[2]):(r=t-n,r>=ud?(this._flush(),[2]):(this._setFlushTimer(ud-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=Nw(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e})(),Pu=(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,h,m,g,v,b,S,w,E,T,k,C,N,j,_,I;if(typeof t!="object")return null;var L=t.code||0,V=this.buildStatus(L);switch(V){case Yt.Success:return{status:V,statusCode:L,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 Yt.Invalid:return{status:V,statusCode:L,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:(h=t.events_with_invalid_id_lengths)!==null&&h!==void 0?h:{},epsThreshold:(m=t.eps_threshold)!==null&&m!==void 0?m:0,exceededDailyQuotaDevices:(g=t.exceeded_daily_quota_devices)!==null&&g!==void 0?g:{},silencedDevices:(v=t.silenced_devices)!==null&&v!==void 0?v:[],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 Yt.PayloadTooLarge:return{status:V,statusCode:L,body:{error:(E=t.error)!==null&&E!==void 0?E:""}};case Yt.RateLimit:return{status:V,statusCode:L,body:{error:(T=t.error)!==null&&T!==void 0?T:"",epsThreshold:(k=t.eps_threshold)!==null&&k!==void 0?k:0,throttledDevices:(C=t.throttled_devices)!==null&&C!==void 0?C:{},throttledUsers:(N=t.throttled_users)!==null&&N!==void 0?N:{},exceededDailyQuotaDevices:(j=t.exceeded_daily_quota_devices)!==null&&j!==void 0?j:{},exceededDailyQuotaUsers:(_=t.exceeded_daily_quota_users)!==null&&_!==void 0?_:{},throttledEvents:(I=t.throttled_events)!==null&&I!==void 0?I:[]}};case Yt.Timeout:default:return{status:V,statusCode:L}}},e.prototype.buildStatus=function(t){return xg(t)?Yt.Success:t===429?Yt.RateLimit:t===413?Yt.PayloadTooLarge:t===408?Yt.Timeout:t>=400&&t<500?Yt.Invalid:t>=500?Yt.Failed:Yt.Unknown},e})(),SI=(function(e){Mr(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:de({"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})(Pu),fk=2*1024;function hk(){return typeof CompressionStream<"u"}function pk(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 wI=(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})(),EI="https://sr-client-cfg.amplitude.com/config",TI="https://sr-client-cfg.eu.amplitude.com/config",CI=3,kI=1e3,AI=300*1e3,mk=(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"?EI:TI),this.logger=n,this.storage=new wI(t,n)}return e.prototype.subscribe=function(t,n,r){var a=Na(),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<AI)?(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=CI),n===void 0&&(n=kI),ne(this,void 0,void 0,function(){var r,a,o,l,c,f,h=this;return te(this,function(m){switch(m.label){case 0:r=n/t,a={remoteConfig:null,lastFetch:new Date},o=function(g){var v,b,S,w,E,T;return te(this,function(k){switch(k.label){case 0:v=new AbortController,b=setTimeout(function(){return v.abort()},n),k.label=1;case 1:return k.trys.push([1,7,8,9]),[4,fetch(l.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:v.signal})];case 2:return S=k.sent(),S.ok?[3,4]:[4,S.text()];case 3:return w=k.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=k.sent(),[2,{value:{remoteConfig:E,lastFetch:new Date}}];case 6:return[3,9];case 7:return T=k.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 g<t-1?[4,new Promise(function(C){return setTimeout(C,h.getJitterDelay(r))})]:[3,11];case 10:k.sent(),k.label=11;case 11:return[2]}})},l=this,c=0,m.label=1;case 1:return c<t?[5,o(c)]:[3,4];case 2:if(f=m.sent(),typeof f=="object")return[2,f.value];m.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})(),cm=ze(),oo=cm?.console,ps={},ou={},dm=!1;function jI(e){if(!oo||typeof oo[e]!="function")return!1;if(ou[e])return!0;var t=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{if(ps[e]&&!dm){dm=!0;var a=ps[e];a&&a.forEach(function(o){try{o(e,n)}catch{}})}}catch{}return dm=!1,ou[e].apply(oo,n)};return ou[e]=oo[e],oo[e]=t,!0}function NI(e,t){var n=jI(e);if(!n)return new Error("Console override failed");ps[e]?ps[e].push(t):ps[e]=[t]}function RI(e){var t,n;try{for(var r=_e(Object.values(ps)),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 _I(){var e,t;try{for(var n=_e(Object.entries(ou)),r=n.next();!r.done;r=n.next()){var a=Ae(r.value,2),o=a[0],l=a[1];l&&(oo[o]=l)}}catch(c){e={error:c}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}ou={},ps={}}var Dw={addListener:NI,removeListener:RI,_restoreConsole:_I},Tu;(function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"})(Tu||(Tu={}));var OI=null,MI=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],gk="data-amp-track-",DI=["div","span","h1","h2","h3","h4","h5","h6"],II=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],vk=Je(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],Ae(II),!1),PI=vk,LI=vk,zI=["*"],UI=1e3,BI=4,FI=50;function VI(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||e===void 0}function yk(e,t,n){if(e){var r=t.map(Iw),a=n.map(Iw);bk({json:e,allowlist:r,excludelist:a,ancestors:[]})}}function bk(e){var t,n,r=e.json,a=e.targetObject,o=e.allowlist,l=e.excludelist,c=e.ancestors,f=e.parentObject,h=e.targetKey;a||(a=r);var m=Object.keys(a);try{for(var g=_e(m),v=g.next();!v.done;v=g.next()){var b=v.value,S=Je(Je([],Ae(c),!1),[b],!1);VI(a[b])?(!Pw(S,o)||Pw(S,l))&&delete a[b]:bk({json:r,targetObject:a[b],allowlist:o,excludelist:l,ancestors:S,parentObject:a,targetKey:b})}}catch(w){t={error:w}}finally{try{v&&!v.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}Object.keys(a).length===0&&f&&h&&delete f[h]}function Iw(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(t){return t.replace(/~0/g,"~").replace(/~1/g,"/")})}function wg(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(wg(e,t,o,r+1))return!0;return!1}else return a==="*"||a===e[n]?wg(e,t,n+1,r+1):!1}function Pw(e,t){return t.some(function(n){return wg(e,n)})}var HI=500,xk=100,qI=(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(g){var v=Ae(g,2),b=v[0],S=v[1];o[b]=S});else if(a instanceof Headers)a.forEach(function(g,v){o[v]=g});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),h=f[0],m=f[1];o[h]=m}}catch(g){n={error:g}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return _f(o,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(typeof this._bodySize=="number")return this._bodySize;var t=ze();if(t?.TextEncoder){var n=this.request.body;return this._bodySize=Sk(n,xk),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,Jv(r,t,n)])})})},e})(),GI=(function(){function e(t,n){this.bodyRaw=t,this.requestHeaders=n}return e.prototype.headers=function(t){return t===void 0&&(t=[]),_f(this.requestHeaders,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return Sk(this.bodyRaw,xk)},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,Jv(r,t,n)])})})},e})();function Sk(e,t){var n,r,a,o=ze(),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,h=0,m=0;try{for(var g=_e(f.entries()),v=g.next();!v.done;v=g.next()){var b=Ae(v.value,2),S=b[0],w=b[1];if(h+=S.length,typeof w=="string")h+=new l().encode(w).length;else if(w instanceof Blob)h+=w.size;else return;if(++m>=t)return}}catch(E){n={error:E}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}a=h}else if(e instanceof ReadableStream){c=e;return}return a}}var KI=(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}),_f(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)},HI)}),[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,Jv(r,t,n)]}})})},e})(),$I=(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,h=Ae(f.split(": "),2),m=h[0],g=h[1];m&&g&&(a[m]=g)}}catch(v){n={error:v}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return _f(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?(yk(r,t,n),[2,r]):[2,null])})})},e})();function Jv(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return yk(r,t,n),r}catch{return null}}var lu;(function(e){e.REDACT="redact",e.REMOVE="remove"})(lu||(lu={}));var Lw="[REDACTED]",_f=function(e,t){var n,r,a=t.allow,o=a===void 0?[]:a,l=t.strategy,c=l===void 0?lu.REMOVE:l,f=Je([],Ae(xD),!1),h={},m=function(S){var w=S.toLowerCase();f.find(function(E){return E.toLowerCase()===w})?c===lu.REDACT&&(h[S]=Lw):o.find(function(E){return E.toLowerCase()===w})?h[S]=e[S]:c===lu.REDACT&&(h[S]=Lw)};try{for(var g=_e(Object.keys(e)),v=g.next();!v.done;v=g.next()){var b=v.value;m(b)}}catch(S){n={error:S}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return h},YI=(function(){function e(t,n,r,a,o,l,c,f,h,m,g){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=h,this.error=m,this.endTime=g}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(Je([],Ae(rf),!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(Je([],Ae(rf),!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 WI(e){return typeof e=="object"&&e!==null&&"url"in e&&"method"in e}var XI=(function(){function e(t,n){n===void 0&&(n=Na()),this.callback=t,this.id=n}return e})();function rs(e){try{e()}catch{}}var QI=(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=ze();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var t=ze();return!!t&&!!t.fetch},e.prototype.subscribe=function(t,n){var r,a,o,l,c,f,h,m,g,v;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=(g=(m=(h=this.globalScope)===null||h===void 0?void 0:h.XMLHttpRequest)===null||m===void 0?void 0:m.prototype)===null||g===void 0?void 0:g.setRequestHeader;b&&S&&w&&this.observeXhr(b,S,w);var E=(v=this.globalScope)===null||v===void 0?void 0:v.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){rs(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 h,m="GET";if(WI(n)?(h=n.url,m=n.method):h=(f=n?.toString)===null||f===void 0?void 0:f.call(n),h)try{var g=new URL(h);h="".concat(g.protocol,"//").concat(g.host).concat(g.pathname).concat(g.search).concat(g.hash)}catch{}m=r?.method||m;var v,b;a&&(v=a.status),o&&(b={name:o.name||"UnknownError",message:o.message||"An unknown error occurred"},v=0);var S=Math.floor(performance.now()-c),w=Math.floor(l+S),E=new YI(t,m,l,l,h,r,v,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,h=this;return te(this,function(m){switch(m.label){case 0:try{o=this.getTimestamps()}catch(g){rs(function(){var v;return(v=h.logger)===null||v===void 0?void 0:v.debug("an unexpected error occurred while retrieving timestamps",g)})}m.label=1;case 1:return m.trys.push([1,3,,4]),[4,t(r,a)];case 2:return l=m.sent(),[3,4];case 3:return f=m.sent(),c=f,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,a?new qI(a):void 0,l?new KI(l):void 0,c,o?.startTime,o?.durationStart)}catch(g){rs(function(){var v;return(v=h.logger)===null||v===void 0?void 0:v.debug("an unexpected error occurred while handling fetch",g)})}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"&&rs(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 h=this,m=Ae(c,2),g=m[0],v=m[1];try{h.$$AmplitudeAnalyticsEvent=de({method:g,url:(l=v?.toString)===null||l===void 0?void 0:l.call(v),headers:{}},o.getTimestamps())}catch(b){rs(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(h,c)},a.send=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var f=this,h=f,m=e.createXhrJsonParser(f,o),g=l[0],v=h.$$AmplitudeAnalyticsEvent;return h.$$AmplitudeAnalyticsEvent&&h.addEventListener("loadend",function(){try{var b=h.getAllResponseHeaders(),S=h.getResponseHeader("content-length"),w=new $I(h.status,b,S?parseInt(S,10):void 0,m),E=h.$$AmplitudeAnalyticsEvent.headers,T=new GI(g,E);v.status=h.status,o.handleNetworkRequestEvent("xhr",{url:v.url,method:v.method},T,w,void 0,v.startTime,v.durationStart)}catch(k){rs(function(){var C;return(C=o.logger)===null||C===void 0?void 0:C.debug("an unexpected error occurred while handling xhr send",k)})}}),n.apply(h,l)},a.setRequestHeader=function(l,c){var f=this;try{var h=f.$$AmplitudeAnalyticsEvent;h&&(h.headers[l]=c)}catch(m){rs(function(){var g;return(g=o.logger)===null||g===void 0?void 0:g.debug("an unexpected error occurred while calling xhr setRequestHeader",m)})}r.apply(f,[l,c])}}},e})(),zw=new QI,wk=(function(){function e(){}return e.prototype.parse=function(){return ne(this,void 0,void 0,function(){return te(this,function(t){return[2,de(de(de(de({},Rf),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=af(),n=t[pD],r=t[mD],a=t[gD],o=t[vD],l=t[yD],c=t[bD];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=af();return t={},t[mw]=n[mw],t[gw]=n[gw],t[vw]=n[vw],t[yw]=n[yw],t[bw]=n[bw],t[xw]=n[xw],t[Sw]=n[Sw],t[ww]=n[ww],t[Ew]=n[Ew],t[Tw]=n[Tw],t[Cw]=n[Cw],t},e})(),fo="data-amp-mask",Ta="*****",JI=/\b(?:\d[ -]*?){13,16}\b/,ZI=/(\d{3}-?\d{2}-?\d{4})/g,e3=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Zv=function(e,t){var n,r;if(t===void 0&&(t=[]),typeof e!="string")return"";var a=e;a=a.replace(JI,Ta),a=a.replace(ZI,Ta),a=a.replace(e3,Ta);try{for(var o=_e(t),l=o.next();!l.done;l=o.next()){var c=l.value;try{a=a.replace(c,Ta)}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},ey=function(e){if(typeof document>"u"||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(fo)?Ta:e?e(document.title):document.title},Hl={},Uw;function t3(){if(Uw)return Hl;Uw=1,Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.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,k){let C=T[k];if(C!=null){if(typeof C!="function")throw new TypeError(C+" is not a function");return C}}function l(T){let k=T.constructor;return k!==void 0&&(k=k[a],k===null&&(k=void 0)),k!==void 0?k:E}function c(T){return T instanceof E}function f(T){f.log?f.log(T):setTimeout(()=>{throw T})}function h(T){Promise.resolve().then(()=>{try{T()}catch(k){f(k)}})}function m(T){let k=T._cleanup;if(k!==void 0&&(T._cleanup=void 0,!!k))try{if(typeof k=="function")k();else{let C=o(k,"unsubscribe");C&&C.call(k)}}catch(C){f(C)}}function g(T){T._observer=void 0,T._queue=void 0,T._state="closed"}function v(T){let k=T._queue;if(k){T._queue=void 0,T._state="ready";for(let C=0;C<k.length&&(b(T,k[C].type,k[C].value),T._state!=="closed");++C);}}function b(T,k,C){T._state="running";let N=T._observer;try{let j=o(N,k);switch(k){case"next":j&&j.call(N,C);break;case"error":if(g(T),j)j.call(N,C);else throw C;break;case"complete":g(T),j&&j.call(N);break}}catch(j){f(j)}T._state==="closed"?m(T):T._state==="running"&&(T._state="ready")}function S(T,k,C){if(T._state!=="closed"){if(T._state==="buffering"){T._queue.push({type:k,value:C});return}if(T._state!=="ready"){T._state="buffering",T._queue=[{type:k,value:C}],h(()=>v(T));return}b(T,k,C)}}class w{constructor(k,C){this._cleanup=void 0,this._observer=k,this._queue=void 0,this._state="initializing";let N=this,j={get closed(){return N._state==="closed"},next(_){S(N,"next",_)},error(_){S(N,"error",_)},complete(){S(N,"complete")}};try{this._cleanup=C.call(void 0,j)}catch(_){j.error(_)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(g(this),m(this))}}class E{constructor(k){if(!(this instanceof E))throw new TypeError("Observable cannot be called as a function");if(typeof k!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=k}subscribe(k){return(typeof k!="object"||k===null)&&(k={next:k,error:arguments[1],complete:arguments[2]}),new w(k,this._subscriber)}forEach(k){return new Promise((C,N)=>{if(typeof k!="function"){N(new TypeError(k+" is not a function"));return}function j(){_.unsubscribe(),C()}let _=this.subscribe({next(I){try{k(I,j)}catch(L){N(L),_.unsubscribe()}},error:N,complete:C})})}map(k){if(typeof k!="function")throw new TypeError(k+" is not a function");let C=l(this);return new C(N=>this.subscribe({next(j){try{j=k(j)}catch(_){return N.error(_)}N.next(j)},error(j){N.error(j)},complete(){N.complete()}}))}filter(k){if(typeof k!="function")throw new TypeError(k+" is not a function");let C=l(this);return new C(N=>this.subscribe({next(j){try{if(!k(j))return}catch(_){return N.error(_)}N.next(j)},error(j){N.error(j)},complete(){N.complete()}}))}reduce(k){if(typeof k!="function")throw new TypeError(k+" is not a function");let C=l(this),N=arguments.length>1,j=!1,I=arguments[1];return new C(L=>this.subscribe({next(V){let D=!j;if(j=!0,!D||N)try{I=k(I,V)}catch(q){return L.error(q)}else I=V},error(V){L.error(V)},complete(){if(!j&&!N)return L.error(new TypeError("Cannot reduce an empty sequence"));L.next(I),L.complete()}}))}async all(){let k=[];return await this.forEach(C=>k.push(C)),k}concat(...k){let C=l(this);return new C(N=>{let j,_=0;function I(L){j=L.subscribe({next(V){N.next(V)},error(V){N.error(V)},complete(){_===k.length?(j=void 0,N.complete()):I(C.from(k[_++]))}})}return I(this),()=>{j&&(j.unsubscribe(),j=void 0)}})}flatMap(k){if(typeof k!="function")throw new TypeError(k+" is not a function");let C=l(this);return new C(N=>{let j=[],_=this.subscribe({next(L){if(k)try{L=k(L)}catch(D){return N.error(D)}let V=C.from(L).subscribe({next(D){N.next(D)},error(D){N.error(D)},complete(){let D=j.indexOf(V);D>=0&&j.splice(D,1),I()}});j.push(V)},error(L){N.error(L)},complete(){I()}});function I(){_.closed&&j.length===0&&N.complete()}return()=>{j.forEach(L=>L.unsubscribe()),_.unsubscribe()}})}[r](){return this}static from(k){let C=typeof this=="function"?this:E;if(k==null)throw new TypeError(k+" is not an object");let N=o(k,r);if(N){let j=N.call(k);if(Object(j)!==j)throw new TypeError(j+" is not an object");return c(j)&&j.constructor===C?j:new C(_=>j.subscribe(_))}if(e("iterator")&&(N=o(k,n),N))return new C(j=>{h(()=>{if(!j.closed){for(let _ of N.call(k))if(j.next(_),j.closed)return;j.complete()}})});if(Array.isArray(k))return new C(j=>{h(()=>{if(!j.closed){for(let _=0;_<k.length;++_)if(j.next(k[_]),j.closed)return;j.complete()}})});throw new TypeError(k+" is not observable")}static of(...k){let C=typeof this=="function"?this:E;return new C(N=>{h(()=>{if(!N.closed){for(let j=0;j<k.length;++j)if(N.next(k[j]),N.closed)return;N.complete()}})})}static get[a](){return this}}return Hl.Observable=E,Object.defineProperty(E,Symbol("extensions"),{value:{symbol:r,hostReportError:f},configurable:!0}),Hl}var fm,Bw;function n3(){return Bw||(Bw=1,fm=t3().Observable),fm}var r3=n3();const In=Oo(r3);function ty(e,t){return new In(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 vs(e,t){return new In(function(n){var r=!1,a=new Set,o=function(){var c,f;r=!0;try{for(var h=_e(a),m=h.next();!m.done;m=h.next()){var g=m.value;try{g.unsubscribe()}catch{}}}catch(v){c={error:v}}finally{try{m&&!m.done&&(f=h.return)&&f.call(h)}finally{if(c)throw c.error}}a.clear()},l=function(c){var f=c.subscribe({next:function(h){r||n.next(h)},error:function(h){r||(r=!0,n.error(h),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 ai(e){var t=new Set,n=null;function r(){n?.unsubscribe(),n=null,t.clear()}return new In(function(a){return t.add(a),n===null&&(n=e.subscribe({next:function(o){var l,c,f;try{for(var h=_e(t),m=h.next();!m.done;m=h.next()){var g=m.value;(f=g.next)===null||f===void 0||f.call(g,o)}}catch(v){l={error:v}}finally{try{m&&!m.done&&(c=h.return)&&c.call(h)}finally{if(l)throw l.error}}},error:function(o){var l,c,f;try{for(var h=_e(t),m=h.next();!m.done;m=h.next()){var g=m.value;(f=g.error)===null||f===void 0||f.call(g,o)}}catch(v){l={error:v}}finally{try{m&&!m.done&&(c=h.return)&&c.call(h)}finally{if(l)throw l.error}}r()},complete:function(){var o,l,c;try{for(var f=_e(t),h=f.next();!h.done;h=f.next()){var m=h.value;(c=m.complete)===null||c===void 0||c.call(m)}}catch(g){o={error:g}}finally{try{h&&!h.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 cd={exports:{}},Fw;function i3(){if(Fw)return cd.exports;Fw=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(g){return t(g)}if(Array.isArray(c)){var h=c.map(l);return o.pop(),h}var m=Object.keys(c).reduce(function(g,v){return g[v]=l(n(c,v)),g},{});return o.pop(),m}return l(a)}return cd.exports=function(a,o,l){return JSON.stringify(r(a),o,l)},cd.exports.ensureProperties=r,cd.exports}var Ek=i3();const Tk=Oo(Ek),a3=CO({__proto__:null,default:Tk},[Ek]);var s3=Tk||a3,Eg="https://app.amplitude.com",o3="https://app.eu.amplitude.com",l3="https://apps.stag2.amplitude.com",Ck={US:Eg,EU:o3,STAGING:l3},u3="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.2.js.gz",c3=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 d3(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var kk,Tg="__AMPLITUDE_MESSENGER_INSTANCE__",lf="__AMPLITUDE_MESSENGER__",f3=(function(){function e(t){var n=t===void 0?{}:t,r=n.origin,a=r===void 0?Eg:r;this[kk]=!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=d3(),l={id:o,action:t,args:n},c=new Promise(function(f,h){a.requestCallbacks[o]={resolve:f,reject:h},a.notify(l),r.timeout>0&&setTimeout(function(){h(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),h=f.next();!h.done;h=f.next()){var m=h.value;n(m)}}catch(g){r={error:g}}finally{try{h&&!h.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=c3(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===Eg&&(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 h,m,g,v,b;if((m=(h=n.logger)===null||h===void 0?void 0:h.debug)===null||m===void 0||m.call(h,"Message received: ",JSON.stringify(f)),n.endpoint===f.origin){var S=f.data,w=S?.action;if(w)if("id"in S&&S.id)(v=(g=n.logger)===null||g===void 0?void 0:g.debug)===null||v===void 0||v.call(g,"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=ze();t?.[lf]===this&&delete t[lf]},e})();kk=Tg;function h3(e){return typeof e=="object"&&e!==null&&Tg in e&&e[Tg]===!0}function Ak(e){var t=ze(),n=t?.[lf];if(h3(n))return n;var r=new f3(e);return t&&(t[lf]=r),r}var Vw="__AMPLITUDE_BACKGROUND_CAPTURE__";function jk(e,t){var n,r=e;if(r[Vw]!==!0){r[Vw]=!0;var a=(n=void 0)!==null&&n!==void 0?n:u3,o=null,l=function(c,f){var h,m;c==="background-capture-complete"&&((m=(h=e.logger)===null||h===void 0?void 0:h.debug)===null||m===void 0||m.call(h,"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 h=new URL(a,e.endpoint).toString();e.loadScriptOnce(h).then(function(){var m,g,v;(g=(m=e.logger)===null||m===void 0?void 0:m.debug)===null||g===void 0||g.call(m,"Background capture script loaded (external)"),o=(v=window?.amplitudeBackgroundCapture)===null||v===void 0?void 0:v.call(window,{messenger:e,onBackgroundCapture:l}),e.notify({action:"background-capture-loaded"})}).catch(function(){var m;(m=e.logger)===null||m===void 0||m.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 hm={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},Po=function(e,t){return typeof e=="boolean"?e:e?.[t]!==!1},Nk=function(e){return Po(e,"attribution")},p3=function(e){return Po(e,"fileDownloads")},Rk=function(e){return Po(e,"formInteractions")},_k=function(e){return Po(e,"pageViews")},Hw=function(e){return Po(e,"sessions")},m3=function(e){return Po(e,"pageUrlEnrichment")},Ok=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.networkTracking===!0||typeof e.networkTracking=="object")},Mk=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.elementInteractions===!0||typeof e.elementInteractions=="object")},g3=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e.webVitals===!0},Dk=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.frustrationInteractions===!0||typeof e.frustrationInteractions=="object")},v3=function(e){if(Mk(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.elementInteractions=="object")return e.autocapture.elementInteractions},y3=function(e){if(Dk(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.frustrationInteractions=="object")return e.autocapture.frustrationInteractions},b3=function(e){var t;if(Ok(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),de(de({},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."),de(de({},r),{hosts:void 0})}return r})})}},qw=function(e){var t=function(){return!1},n=void 0,r,a=e.pageCounter,o=_k(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}},Gw=function(e){return Nk(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution=="object"?de({},e.defaultTracking.attribution):{}},x3=function(e){if(Rk(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&typeof e.defaultTracking.formInteractions=="object")return e.defaultTracking.formInteractions},pm=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},mm=function(e){var t=e;return t&&t._q!==void 0},ny="2.36.3",Ik="amplitude-ts",S3="Web",w3="$remote",E3=(function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(Ik,"/").concat(ny),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=de(de(de(de(de(de(de(de({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:S3}),this.config.trackingOptions.language&&{language:rI()}),this.config.trackingOptions.ipAddress&&{ip:w3}),{insert_id:Na(),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})(),dd=1e3,Pk=(function(e){Mr(t,e);function t(n){var r=this,a,o,l;try{l=(a=ze())===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>dd?(o=r.length-dd,[4,e.prototype.set.call(this,n,r.slice(0,dd))]):[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(dd,".")),[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})(Qv),T3=(function(e){Mr(t,e);function t(){var n;return e.call(this,(n=ze())===null||n===void 0?void 0:n.sessionStorage)||this}return t})(Qv),C3=(function(e){Mr(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 h=new XMLHttpRequest;h.open("POST",n,!0),h.onreadystatechange=function(){if(h.readyState===o.state.done){var w=h.responseText;try{c(o.buildResponse(JSON.parse(w)))}catch{c(o.buildResponse({code:h.status}))}}};var m={"Content-Type":"application/json",Accept:"*/*"},g=JSON.stringify(r),v=a&&g.length>=fk&&hk(),b=function(w){var E,T;m=de(de({},o.customHeaders),m);try{for(var k=_e(Object.entries(m)),C=k.next();!C.done;C=k.next()){var N=Ae(C.value,2),j=N[0],_=N[1];h.setRequestHeader(j,_)}}catch(I){E={error:I}}finally{try{C&&!C.done&&(T=k.return)&&T.call(k)}finally{if(E)throw E.error}}h.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 v?[4,pk(g)]:[3,2];case 1:return w=E.sent(),w?(m["Content-Encoding"]="gzip",b(w)):b(g),[3,3];case 2:b(g),E.label=3;case 3:return[2]}})})};S().catch(f)})]})})},t})(Pu),k3=(function(e){Mr(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,h,m,g,v;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>=fk&&hk(),c=o,f={"Content-Type":"application/json",Accept:"*/*"},l?[4,pk(o)]:[3,2];case 1:h=b.sent(),h&&(f["Content-Encoding"]="gzip",c=h),b.label=2;case 2:return f=de(de({},this.customHeaders),f),m={headers:f,body:c,method:"POST"},[4,fetch(n,m)];case 3:return g=b.sent(),[4,g.text()];case 4:v=b.sent();try{return[2,this.buildResponse(JSON.parse(v))]}catch{return[2,this.buildResponse({code:g.status})]}return[2]}})})},t})(Pu),A3=(function(e){Mr(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 h=ze();if(!h?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var m=JSON.stringify(r),g=h.navigator.sendBeacon(n,m);return c(g?o.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:m.length,server_upload_time:Date.now()}):o.buildResponse({code:500}))}catch(v){f(v)}})]})})},t})(Pu),j3=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,h,m,g;return te(this,function(v){switch(v.label){case 0:return r=nI(e),[4,t.getRaw(r)];case 1:return a=v.sent(),a?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:v.sent(),v.label=3;case 3:return o=Ae(a.split("."),6),l=o[0],c=o[1],f=o[2],h=o[3],m=o[4],g=o[5],[2,{deviceId:l,userId:N3(c),sessionId:gm(h),lastEventId:gm(g),lastEventTime:gm(m),optOut:!!f}]}})})},gm=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},N3=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch{return}},Yr="[Amplitude]",Kw="".concat(Yr," Form Started"),R3="".concat(Yr," Form Submitted"),_3="".concat(Yr," File Downloaded"),$w="session_start",Yw="session_end",O3="".concat(Yr," File Extension"),M3="".concat(Yr," File Name"),D3="".concat(Yr," Link ID"),I3="".concat(Yr," Link Text"),P3="".concat(Yr," Link URL"),vm="".concat(Yr," Form ID"),ym="".concat(Yr," Form Name"),bm="".concat(Yr," Form Destination"),uf="cookie",Lk="US",Ww=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},L3=function(e){return Object.values(e).every(function(t){return!t})},z3=function(e){var t=de(de({},e),{referring_domain:void 0,referrer:void 0});return Object.values(t).every(function(n){return!n})},U3=function(e,t,n,r,a,o){a===void 0&&(a=!0),e.referrer;var l=e.referring_domain,c=nf(e,["referrer","referring_domain"]),f=t||{};f.referrer;var h=f.referring_domain,m=nf(f,["referrer","referring_domain"]),g=n.excludeInternalReferrers;if(g){var v=q3(g,r);if(!(v instanceof TypeError)&&e.referring_domain&&G3(e.referring_domain,o)){if(v==="always")return Xw(v,e.referring_domain,r),!1;if(v==="ifEmptyCampaign"&&z3(e))return Xw(v,e.referring_domain,r),!1}}if(B3(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&&L3(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(m),S=Ww(l||"")!==Ww(h||""),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},B3=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})},F3=function(e,t){var n=t.startsWith(".")?t:".".concat(t),r=e.startsWith(".")?e:".".concat(e);return!!r.endsWith(n)},V3=function(e,t){var n=de(de({},Rf),e),r=Object.entries(n).reduce(function(a,o){var l,c=Ae(o,2),f=c[0],h=c[1];return a.setOnce("initial_".concat(f),(l=h??t.initialEmptyValue)!==null&&l!==void 0?l:"EMPTY"),h?a.set(f,h):a.unset(f)},new su);return Yv(r)},H3=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},q3=function(e,t){if(e===!0)return hm.always;if(typeof e=="object"){var n=e.condition;if(typeof n=="string"&&Object.keys(hm).includes(n))return n;if(typeof n>"u")return hm.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),new TypeError(r)};function Xw(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 zk=["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"],Uk=function(e){var t,n,r=e||((n=(t=ze())===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 zk.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},G3=function(e,t){var n=ze();if(!n)return!1;var r=(t||"").trim()||Uk(n.location.hostname);return F3(e,r)},K3=(function(e){Mr(t,e);function t(n,r,a,o,l,c,f,h,m,g,v,b,S,w,E,T,k,C,N,j,_,I,L,V,D,q,G,Z,ce,J,B,X,le,ye,M,U,ee,P,ue,me,Se,we,Ue,Ne){a===void 0&&(a=new Xv),o===void 0&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),h===void 0&&(h=1e3),m===void 0&&(m=5),g===void 0&&(g=30),v===void 0&&(v=uf),T===void 0&&(T=new jo),k===void 0&&(k=Qn.Warn),N===void 0&&(N=!1),j===void 0&&(j=!1),L===void 0&&(L=""),V===void 0&&(V=Lk),G===void 0&&(G=1800*1e3),Z===void 0&&(Z=new Pk({loggerProvider:T})),ce===void 0&&(ce={ipAddress:!0,language:!0,platform:!0}),J===void 0&&(J="fetch"),B===void 0&&(B=!1),X===void 0&&(X=!0),P===void 0&&(P=!0),ue===void 0&&(ue=0),Ue===void 0&&(Ue=!1),Ne===void 0&&(Ne=!1);var ve=this,Pe;ve=e.call(this,{apiKey:n,storageProvider:Z,transportProvider:Bk(J)})||this,ve.apiKey=n,ve.appVersion=r,ve.cookieOptions=o,ve.defaultTracking=l,ve.autocapture=c,ve.flushIntervalMillis=h,ve.flushMaxRetries=m,ve.flushQueueSize=g,ve.identityStorage=v,ve.ingestionMetadata=b,ve.instanceName=S,ve.loggerProvider=T,ve.logLevel=k,ve.minIdLength=C,ve.offline=N,ve.partnerId=_,ve.plan=I,ve.serverUrl=L,ve.serverZone=V,ve.sessionTimeout=G,ve.storageProvider=Z,ve.trackingOptions=ce,ve.transport=J,ve.useBatch=B,ve.fetchRemoteConfig=X,ve.networkTrackingOptions=U,ve.identify=ee,ve.enableDiagnostics=P,ve.diagnosticsSampleRate=ue,ve.diagnosticsClient=me,ve.remoteConfig=Se,ve.topLevelDomain=we,ve.enableRequestBodyCompression=Ue,ve._enableRequestBodyCompressionExperimental=Ne,ve.version=ny,ve._optOut=!1,ve._cookieStorage=a,ve.deviceId=f,ve.lastEventId=w,ve.lastEventTime=E,ve.optOut=j,ve.deferredSessionId=q,ve.sessionId=D,ve.pageCounter=ye,ve.userId=le,ve.debugLogsEnabled=M,ve.loggerProvider.enable(M?Qn.Debug:ve.logLevel),ve.networkTrackingOptions=U,ve.identify=ee,ve.enableDiagnostics=P,ve.diagnosticsSampleRate=ue,ve.diagnosticsClient=me;var pt=(Pe=Se?.fetchRemoteConfig)!==null&&Pe!==void 0?Pe:X;return ve.remoteConfig=ve.remoteConfig||{},ve.remoteConfig.fetchRemoteConfig=pt,ve.fetchRemoteConfig=pt,ve.topLevelDomain=we||Uk(),ve}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 of&&(n.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(uk(this.apiKey),n)},t})(sk),$3=function(e,t,n,r,a){return t===void 0&&(t={}),ne(void 0,void 0,void 0,function(){var o,l,c,f,h,m,g,v,b,S,w,E,T,k,C,N,j,_,I,L,V,D,q,G,Z,ce,J,B,X,le,ye,M,U,ee,P,ue,me,Se,we,Ue,Ne,ve,Pe,pt,Zt,We,mt,gt,Gt;return te(this,function(_t){switch(_t.label){case 0:return o=t.identityStorage||uf,l="",o!==uf?[3,2]:[4,X3(void 0,r)];case 1:l=_t.sent(),_t.label=2;case 2:return c=de({domain:(q=(D=t.cookieOptions)===null||D===void 0?void 0:D.domain)!==null&&q!==void 0?q:l,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),f={duplicateResolverFn:function(Ft){var vt=ck(Ft);if(!vt)return!1;var dt=JSON.parse(vt);return dk(dt.cookieDomain,c.domain)},diagnosticsClient:r},h=Y3(t.identityStorage,c,f),[4,j3(e,h,(Z=(G=t.cookieOptions)===null||G===void 0?void 0:G.upgrade)!==null&&Z!==void 0?Z:!0)];case 3:return m=_t.sent(),[4,h.get(uk(e))];case 4:return g=_t.sent(),v=af(),b=v.ampTimestamp?Number(v.ampTimestamp):void 0,S=b?Date.now()<b:!0,w=(le=(X=(B=(ce=t.deviceId)!==null&&ce!==void 0?ce:S?(J=v.ampDeviceId)!==null&&J!==void 0?J:v.deviceId:void 0)!==null&&B!==void 0?B:g?.deviceId)!==null&&X!==void 0?X:m.deviceId)!==null&&le!==void 0?le:Na(),E=(ye=g?.lastEventId)!==null&&ye!==void 0?ye:m.lastEventId,T=(M=g?.lastEventTime)!==null&&M!==void 0?M:m.lastEventTime,k=(ee=(U=t.optOut)!==null&&U!==void 0?U:g?.optOut)!==null&&ee!==void 0?ee:m.optOut,C=(P=g?.sessionId)!==null&&P!==void 0?P:m.sessionId,N=g?.deferredSessionId,j=(me=(ue=t.userId)!==null&&ue!==void 0?ue:g?.userId)!==null&&me!==void 0?me:m.userId,n.previousSessionDeviceId=(Se=g?.deviceId)!==null&&Se!==void 0?Se:m.deviceId,n.previousSessionUserId=(we=g?.userId)!==null&&we!==void 0?we:m.userId,_={ipAddress:(Ne=(Ue=t.trackingOptions)===null||Ue===void 0?void 0:Ue.ipAddress)!==null&&Ne!==void 0?Ne:!0,language:(Pe=(ve=t.trackingOptions)===null||ve===void 0?void 0:ve.language)!==null&&Pe!==void 0?Pe:!0,platform:(Zt=(pt=t.trackingOptions)===null||pt===void 0?void 0:pt.platform)!==null&&Zt!==void 0?Zt:!0},I=g?.pageCounter,L=g?.debugLogsEnabled,t.autocapture!==void 0&&(t.defaultTracking=t.autocapture),V=new K3(e,t.appVersion,h,c,t.defaultTracking,t.autocapture,w,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,o,t.ingestionMetadata,t.instanceName,E,T,(We=a?.loggerProvider)!==null&&We!==void 0?We:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,k,t.partnerId,t.plan,t.serverUrl,(mt=a?.serverZone)!==null&&mt!==void 0?mt:t.serverZone,C,N,t.sessionTimeout,t.storageProvider,_,t.transport,t.useBatch,t.fetchRemoteConfig,j,I,L,t.networkTrackingOptions,t.identify,(gt=a?.enableDiagnostics)!==null&&gt!==void 0?gt:t.enableDiagnostics,(Gt=a?.diagnosticsSampleRate)!==null&&Gt!==void 0?Gt:n._diagnosticsSampleRate,r,t.remoteConfig,l,t.enableRequestBodyCompression,n._enableRequestBodyCompressionExperimentalValue),[4,V.storageProvider.isEnabled()];case 5:return _t.sent()||(V.loggerProvider.warn("Storage provider ".concat(V.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),V.storageProvider=new Xv),[2,V]}})})},Y3=function(e,t,n){switch(e===void 0&&(e=uf),t===void 0&&(t={}),e){case"localStorage":return new Pk;case"sessionStorage":return new T3;case"none":return new Xv;default:return new of(de(de({},t),{expirationDays:t.expiration}),n)}},W3=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)},Bk=function(e){var t=typeof e=="object"?e.type:e,n=typeof e=="object"?e.headers:void 0;return t==="xhr"?new C3(n):t==="beacon"?new A3:new k3(n)},X3=function(e,t){return ne(void 0,void 0,void 0,function(){var n,r,a,o,l,l,c,f,h;return te(this,function(m){switch(m.label){case 0:return[4,new of(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!m.sent()||typeof location>"u"||!location.hostname)return[2,""];for(n=location.hostname,r=n.split("."),a=[],o=1,zk.find(function(g){return n.endsWith(".".concat(g))})&&(o=2),l=r.length-o-1;l>=0;--l)a.push(r.slice(l).join("."));l=0,m.label=2;case 2:if(!(l<a.length))return[3,7];c=a[l],m.label=3;case 3:return m.trys.push([3,5,,6]),[4,of.isDomainWritable(c)];case 4:return f=m.sent(),f?[2,"."+c]:[3,6];case 5:return h=m.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(c),error:h instanceof Error?h.message:String(h)}),[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,""]}})})},Q3=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},J3="[Amplitude] Page Viewed",Qw=function(e){e===void 0&&(e={});var t,n=ze(),r=void 0,a=!1,o,l=e.trackOn,c=e.trackHistoryChanges,f=e.eventType,h=f===void 0?J3:f,m=function(T){var k=T;try{k=decodeURI(T)}catch(C){r?.error("Malformed URI sequence: ",C)}return k},g=function(){return ne(void 0,void 0,void 0,function(){var T,k,C;return te(this,function(N){switch(N.label){case 0:return T=m(typeof location<"u"&&location.href||""),C={event_type:h},k=[{}],[4,Z3()];case 1:return[2,(C.event_properties=de.apply(void 0,[de.apply(void 0,k.concat([N.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":T,"[Amplitude] Page Path":typeof location<"u"&&m(location.pathname)||"","[Amplitude] Page Title":ey(Zv),"[Amplitude] Page URL":T.split("?")[0]}]),C)]}})})},v=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,k,C,N;return te(this,function(j){switch(j.label){case 0:return T=location.href,k=tP(c,T,b||"")&&v(),b=T,k?(r?.log("Tracking page view event"),t!=null?[3,1]:[3,3]):[3,4];case 1:return N=(C=t).track,[4,g()];case 2:N.apply(C,[j.sent()]),j.label=3;case 3:j.label=4;case 4:return[2]}})})},w=function(){S()},E={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(T,k){return ne(void 0,void 0,void 0,function(){var C,N;return te(this,function(j){switch(j.label){case 0:return t=k,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(_,I,L){var V=Ae(L,3),D=V[0],q=V[1],G=V[2];_.apply(I,[D,q,G]),a&&S()}})),v()?(r.log("Tracking page view event"),N=(C=t).track,[4,g()]):[3,2];case 1:N.apply(C,[j.sent()]),j.label=2;case 2:return[2]}})})},execute:function(T){return ne(void 0,void 0,void 0,function(){var k;return te(this,function(C){switch(C.label){case 0:return l==="attribution"&&eP(T)?(r?.log("Enriching campaign event to page view event with campaign parameters"),[4,g()]):[3,2];case 1:k=C.sent(),T.event_type=k.event_type,T.event_properties=de(de({},T.event_properties),k.event_properties),C.label=2;case 2:return o&&T.event_type===h&&(o.pageCounter=o.pageCounter?o.pageCounter+1:1,T.event_properties=de(de({},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},Z3=function(){return ne(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return e=Q3,[4,new wk().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},eP=function(e){if(e.event_type==="$identify"&&e.user_properties){var t=e.user_properties,n=t[wa.SET]||{},r=t[wa.UNSET]||{},a=Je(Je([],Ae(Object.keys(n)),!1),Ae(Object.keys(r)),!1);return Object.keys(Rf).every(function(o){return a.includes(o)})}return!1},tP=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}},nP=function(){var e,t=[],n=function(m,g,v){m.addEventListener(g,v),t.push({element:m,type:g,handler:v})},r=function(){t.forEach(function(m){var g=m.element,v=m.type,b=m.handler;g?.removeEventListener(v,b)}),t=[]},a,o="@amplitude/plugin-form-interaction-tracking-browser",l="enrichment",c=function(m,g){return ne(void 0,void 0,void 0,function(){var v,b;return te(this,function(S){return a=x3(m),v=function(){if(!g){m.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(k){if(!w.has(k)){w.add(k);var C=!1;n(k,"change",function(){var N,j=Jw(k);C||g.track(Kw,(N={},N[vm]=no(k.id),N[ym]=no(k.name),N[bm]=j,N)),C=!0}),n(k,"submit",function(N){var j,_,I=Jw(k);if(C||g.track(Kw,(j={},j[vm]=no(k.id),j[ym]=no(k.name),j[bm]=I,j)),C=!0,a?.shouldTrackSubmit!==void 0)if(typeof a.shouldTrackSubmit=="function"&&typeof SubmitEvent<"u"&&N instanceof SubmitEvent)try{var L=a.shouldTrackSubmit(N);if(!L)return}catch{m.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else m.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");g.track(R3,(_={},_[vm]=no(k.id),_[ym]=no(k.name),_[bm]=I,_)),C=!1})}},T=Array.from(document.getElementsByTagName("form"));T.forEach(E),typeof MutationObserver<"u"&&(e=new MutationObserver(function(k){k.forEach(function(C){C.addedNodes.forEach(function(N){N.nodeName==="FORM"&&E(N),"querySelectorAll"in N&&typeof N.querySelectorAll=="function"&&Array.from(N.querySelectorAll("form")).map(E)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?v():(b=ze(),b?b.addEventListener("load",v):m.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},f=function(m){return ne(void 0,void 0,void 0,function(){return te(this,function(g){return[2,m]})})},h=function(){return ne(void 0,void 0,void 0,function(){return te(this,function(m){return e?.disconnect(),r(),[2]})})};return{name:o,type:l,setup:c,execute:f,teardown:h}},no=function(e){if(typeof e=="string")return e},Jw=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(t??""),window.location.href).href}catch{}return t},rP=function(){var e,t=[],n=function(h,m,g){h.addEventListener(m,g),t.push({element:h,type:m,handler:g})},r=function(){t.forEach(function(h){var m=h.element,g=h.type,v=h.handler;m?.removeEventListener(g,v)}),t=[]},a="@amplitude/plugin-file-download-tracking-browser",o="enrichment",l=function(h,m){return ne(void 0,void 0,void 0,function(){var g,v;return te(this,function(b){return g=function(){if(!m){h.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 k;try{k=new URL(T.href,window.location.href)}catch{return}var C=w.exec(k.href),N=C?.[1];N&&n(T,"click",function(){var j;N&&m.track(_3,(j={},j[O3]=N,j[M3]=k.pathname,j[D3]=T.id,j[I3]=T.text,j[P3]=T.href,j))})},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(k){k.addedNodes.forEach(function(C){C.nodeName==="A"&&S(C),"querySelectorAll"in C&&typeof C.querySelectorAll=="function"&&Array.from(C.querySelectorAll("a")).map(S)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?g():(v=ze(),v?v.addEventListener("load",g):h.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},c=function(h){return ne(void 0,void 0,void 0,function(){return te(this,function(m){return[2,h]})})},f=function(){return ne(void 0,void 0,void 0,function(){return te(this,function(h){return e?.disconnect(),r(),[2]})})};return{name:a,type:o,setup:l,execute:c,teardown:f}},Zw=!1,iP=function(e){if(!(Zw||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),Zw=!0}},aP=function(){var e="@amplitude/plugin-network-checker-browser",t="before",n=ze(),r=[],a=function(f,h){n?.addEventListener&&(n?.addEventListener(f,h),r.push({type:f,handler:h}))},o=function(){r.forEach(function(f){var h=f.type,m=f.handler;n?.removeEventListener(h,m)}),r=[]},l=function(f,h){return ne(void 0,void 0,void 0,function(){return te(this,function(m){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(){h.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 Fk(e){var t,n,r,a,o,l,c,f,h,m,g;if(!(typeof e!="object"||e===null)&&!Array.isArray(e)){var v=Object.keys(e);try{for(var b=_e(v),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),Fk(E)}catch{}}}catch(q){t={error:q}}finally{try{S&&!S.done&&(n=b.return)&&n.call(b)}finally{if(t)throw t.error}}try{if(!((h=(f=(c=e.autocapture)===null||c===void 0?void 0:c.networkTracking)===null||f===void 0?void 0:f.captureRules)===null||h===void 0)&&h.length)try{for(var T=_e(e.autocapture.networkTracking.captureRules),k=T.next();!k.done;k=T.next()){var C=k.value;try{for(var N=(o=void 0,_e(["responseHeaders","requestHeaders"])),j=N.next();!j.done;j=N.next()){var _=j.value,I=(m=C[_])!==null&&m!==void 0?m:{},L=I.captureSafeHeaders,V=I.allowlist;if(!(!L&&!V)){if(V!==void 0&&!Array.isArray(V)){delete C[_];continue}C[_]=Je(Je([],Ae(L?rf:[]),!1),Ae(V??[]),!1)}}}catch(q){o={error:q}}finally{try{j&&!j.done&&(l=N.return)&&l.call(N)}finally{if(o)throw o.error}}}}catch(q){r={error:q}}finally{try{k&&!k.done&&(a=T.return)&&a.call(T)}finally{if(r)throw r.error}}}catch{}var D=(g=e.autocapture)===null||g===void 0?void 0:g.frustrationInteractions;D&&(D.rageClick&&(D.rageClicks=D.rageClick,delete D.rageClick),D.deadClick&&(D.deadClicks=D.deadClick,delete D.deadClick))}}function eE(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(h){n.loggerProvider.warn("Invalid regex pattern: ".concat(f),h)}}}catch(h){r={error:h}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return e.concat(o)}function sP(e,t){var n,r,a,o,l,c,f;if(e){Fk(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var h=e;if(h&&"autocapture"in h){if(typeof h.autocapture=="boolean"&&(t.autocapture=h.autocapture),typeof h.autocapture=="object"&&h.autocapture!==null){var m=de({},h.autocapture);if(t.autocapture===void 0&&(t.autocapture=h.autocapture),typeof h.autocapture.elementInteractions=="object"&&h.autocapture.elementInteractions!==null&&(!((a=h.autocapture.elementInteractions.pageUrlAllowlistRegex)===null||a===void 0)&&a.length)){m.elementInteractions=de({},h.autocapture.elementInteractions);var g=m.elementInteractions,v=(o=g.pageUrlAllowlist)!==null&&o!==void 0?o:[],b=h.autocapture.elementInteractions.pageUrlAllowlistRegex;g.pageUrlAllowlist=eE(v,b,t),delete g.pageUrlAllowlistRegex}if(typeof h.autocapture.networkTracking=="object"&&h.autocapture.networkTracking!==null&&(!((l=h.autocapture.networkTracking.captureRules)===null||l===void 0)&&l.length)){m.networkTracking=de({},h.autocapture.networkTracking);var S=m.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 k=T.value;k.urls=eE((f=k.urls)!==null&&f!==void 0?f:[],k.urlsRegex,t),delete k.urlsRegex}}catch(C){n={error:C}}finally{try{T&&!T.done&&(r=E.return)&&r.call(E)}finally{if(n)throw n.error}}}typeof t.autocapture=="boolean"&&(t.autocapture=de({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},m)),typeof t.autocapture=="object"&&(t.autocapture=de(de({},t.autocapture),m))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(C){t.loggerProvider.error("Failed to apply remote configuration because of error: ",C)}}}var Vk="1.23.3",oP="@amplitude/plugin-autocapture-browser",lP="@amplitude/plugin-frustration-browser",Hk="[Amplitude] Element Clicked",uP="[Amplitude] Dead Click",cP="[Amplitude] Rage Click",dP="[Amplitude] Error Click",fP="[Amplitude] Element Changed",hP="[Amplitude] Thrashed Cursor",pP="[Amplitude] Element ID",mP="[Amplitude] Element Class",tE="[Amplitude] Element Tag",nE="[Amplitude] Element Text",gP="[Amplitude] Element Hierarchy",vP="[Amplitude] Element Href",yP="[Amplitude] Element Position Left",bP="[Amplitude] Element Position Top",xP="[Amplitude] Element Aria Label",SP="[Amplitude] Element Attributes",wP="[Amplitude] Element Parent Label",rE="[Amplitude] Page URL",EP="[Amplitude] Page Title",TP="[Amplitude] Viewport Height",CP="[Amplitude] Viewport Width",kP="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",AP="amp-visual-tagging-selector-highlight",qk="data-amp-mask-attributes",jP=25,Gk=128,NP=["input","select","textarea"],Kk=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"},$k=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&Sg(window.location.href,n)||!Sg(window.location.href,t))},So=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(!$k(e))return!1;var h=String(a?.getAttribute("type"))||"";if(typeof h=="string")switch(h.toLowerCase()){case"hidden":return!1;case"password":return!1}var m=Kk(a,r);if(n&&m)return!0;if(t){var g=t.some(function(v){var b;return!!(!((b=a?.matches)===null||b===void 0)&&b.call(a,v))});if(!g)return!1}switch(f){case"input":case"select":case"textarea":return r==="change"||r==="click";default:return m?!0:r==="click"}}},RP=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!NP.includes(a)&&!o},_P=function(e){return e?e.split(",").map(function(t){return t.trim()}).filter(function(t){return t.length>0&&t!=="id"&&t!=="class"}):[]},OP=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},{})},MP=function(e){return e==null||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0},iE=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return MP(r)||(t[n]=r),t},{})},ry=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:ry(e?.parentElement,t):null},Lu=function(e){return!(e.event.target===null||!e.closestTrackedAncestor)};function DP(e){return e.type==="click"||e.type==="change"}var cf;(function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"})(cf||(cf={}));var aE="__AMPLITUDE_VISUAL_TAGGING__";function IP(e,t){var n=e;if(n[aE]!==!0){n[aE]=!0;var r=t.dataExtractor,a=t.isElementSelectable,o=t.cssSelectorAllowlist,l=t.actionClickAllowlist,c=null,f=function(m){e.notify({action:"element-selected",data:m})},h=function(m,g){m==="selector-mode-changed"?e.notify({action:"track-selector-mode-changed",data:g}):m==="selector-moved"&&e.notify({action:"track-selector-moved",data:g})};e.registerActionHandler("initialize-visual-tagging-selector",function(m){e.loadScriptOnce(kP).then(function(){var g;c=(g=window?.amplitudeVisualTaggingSelector)===null||g===void 0?void 0:g.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(v){return a?a(m?.actionType||"click",v):!0},onTrack:h,onSelect:f,visualHighlightClass:AP,messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:l,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:Vk}}}),e.notify({action:"selector-loaded"})}).catch(function(){var g;(g=e.logger)===null||g===void 0||g.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var m;(m=c?.close)===null||m===void 0||m.call(c)})}}function PP(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,a=e.evaluateTriggers,o=n.clickObservable,l=o.filter(Lu).filter(function(f){return r("click",f.closestTrackedAncestor)}).map(function(f){return a(f)}),c=l;return c.subscribe(function(f){t?.track(Hk,f.targetElementProperties)})}function LP(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,a=e.shouldTrackEvent,o=e.evaluateTriggers,l=n.changeObservable,c=l.filter(Lu).filter(function(f){return a("change",f.closestTrackedAncestor)}).map(function(f){return o(f)});return c.subscribe(function(f){t?.track(fP,r("change",f.closestTrackedAncestor))})}function zP(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,h=n.navigateObservable,m=c.filter(function(E){return!o("click",E.closestTrackedAncestor)}).map(function(E){var T=ry(E.event.target,r.actionClickAllowlist);return E.closestTrackedAncestor=T,E.closestTrackedAncestor!==null&&(E.targetElementProperties=a(E.type,E.closestTrackedAncestor)),E}).filter(Lu).filter(function(E){return l("click",E.closestTrackedAncestor)}),g=h?vs(f,h):f,v=vs(m,g),b=null,S=null,w=ty(v,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(Hk,a("click",E.closestTrackedAncestor))})}var ka=ze(),Yk=function(){return new In(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()}})},Wk=function(e){return e===void 0&&(e="click"),new In(function(t){var n=function(r){t.next(r)};return ka.document.addEventListener(e,n,{capture:!0}),function(){ka.document.removeEventListener(e,n,{capture:!0})}})},UP=function(){return new In(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 Dw.addListener("error",t),function(){Dw.removeListener(t)}})},BP=function(){return new In(function(e){var t=function(n){if(n instanceof ErrorEvent){var r={kind:"error"};n.error instanceof Error||n.error instanceof DOMException?r=de(de({},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 ka.addEventListener("error",t),function(){ka.removeEventListener("error",t)}})},FP=function(){return new In(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 ka.addEventListener("unhandledrejection",t),function(){ka.removeEventListener("unhandledrejection",t)}})},VP=function(){var e=vs(BP(),FP());return vs(e,UP())},HP=function(){return new In(function(e){var t=function(r){e.next(r)},n={capture:!0};return ka.document.addEventListener("mousemove",t,n),function(){ka.document.removeEventListener("mousemove",t,n)}})},qP=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},GP=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}},KP=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}})},Cg={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},sE=function(e){var t,n,r,a,o=Object.values(Cg).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 h=(r=void 0,_e(f.definition)),m=h.next();!m.done;m=h.next()){var g=m.value,v=Cg[g.event_type];v&&o[v].add(f.id)}}catch(b){r={error:b}}finally{try{m&&!m.done&&(a=h.return)&&a.call(h)}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},oE=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 h=(r=void 0,_e(f.conditions)),m=h.next();!m.done;m=h.next()){var g=m.value;if(g.type==="LABELED_EVENT"){var v=g.match.eventId,b=o.get(v);b||(b=[],o.set(v,b)),b.push(f)}}}catch(S){r={error:S}}finally{try{m&&!m.done&&(a=h.return)&&a.call(h)}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},$P=function(e,t){return t.filter(function(n){return n.definition.some(function(r){return Cg[r.event_type]===e.type&&r.filters.every(function(a){return qP(e,a)})})})},YP=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 h=f.value,m=t.get(h.id);if(m)try{for(var g=(a=void 0,_e(m)),v=g.next();!v.done;v=g.next()){var b=v.value;l.add(b)}}catch(S){a={error:S}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}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)},WP=(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=$P(t,Array.from(this.groupedLabeledEvents[t.type]).map(function(m){return a.labeledEvents[m]})),l=YP(o,this.labeledEventToTriggerMap);try{for(var c=_e(l),f=c.next();!f.done;f=c.next()){var h=f.value;KP(h.actions,t,this.dataExtractor)}}catch(m){n={error:m}}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})(),XP=function(e,t,n,r){return new WP(e,t,n,r)},QP=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",qk,fo]),JP=["type"],ZP=["svg","path","g"],eL=["password","hidden"];function tL(e,t){var n,r,a,o,l,c;if(e===null)return null;var f=String(e.tagName).toLowerCase(),h={tag:f},m=Array.from((o=(a=e.parentElement)===null||a===void 0?void 0:a.children)!==null&&o!==void 0?o:[]);m.length&&(h.index=m.indexOf(e),h.indexOfType=m.filter(function(j){return j.tagName===e.tagName}).indexOf(e));var g=(c=(l=e.previousElementSibling)===null||l===void 0?void 0:l.tagName)===null||c===void 0?void 0:c.toLowerCase();g&&(h.prevSib=String(g));var v=e.getAttribute("id");v&&(h.id=String(v));var b=Array.from(e.classList);b.length&&(h.classes=b);var S={},w=Array.from(e.attributes),E=w.filter(function(j){return!QP.has(j.name)}),T=!RP(e);if(!eL.includes(String(e.getAttribute("type")))&&!ZP.includes(f))try{for(var k=_e(E),C=k.next();!C.done;C=k.next()){var N=C.value;if(!(T&&!JP.includes(N.name))){if(t.has(N.name)){S[N.name]=Ta;continue}S[N.name]=String(N.value).substring(0,Gk)}}}catch(j){n={error:j}}finally{try{C&&!C.done&&(r=k.return)&&r.call(k)}finally{if(n)throw n.error}}return Object.keys(S).length&&(h.attrs=S),h}function nL(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 Xk=(function(){function e(t,n){var r,a,o=this,l;this.replaceSensitiveString=function(v){return Zv(v,o.additionalMaskTextPatterns)},this.getHierarchy=function(v){var b,S,w,E,T=performance.now(),k=[];if(!v)return[];for(var C=nL(v),N=new Map,j=C.length-1;j>=0;j--){var _=C[j];if(_){var I=_P(_.getAttribute(qk)),L=j===C.length-1?[]:(w=N.get(C[j+1]))!==null&&w!==void 0?w:new Set,V=new Set(Je(Je([],Ae(L),!1),Ae(I),!1));N.set(_,V)}}k=C.map(function(J){var B;return tL(J,(B=N.get(J))!==null&&B!==void 0?B:new Set)});var D=function(J){J?.attrs&&Object.entries(J.attrs).forEach(function(B){var X=Ae(B,2),le=X[0],ye=X[1];J.attrs&&(J.attrs[le]=o.replaceSensitiveString(ye))})};try{for(var q=_e(k),G=q.next();!G.done;G=q.next()){var Z=G.value;D(Z)}}catch(J){b={error:J}}finally{try{G&&!G.done&&(S=q.return)&&S.call(q)}finally{if(b)throw b.error}}var ce=performance.now();return(E=o.diagnosticsClient)===null||E===void 0||E.recordHistogram("autocapturePlugin.getHierarchy",ce-T),k},this.getNearestLabel=function(v){var b=v.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(v,b,S){var w,E,T,k,C=(T=(E=b?.tagName)===null||E===void 0?void 0:E.toLowerCase)===null||T===void 0?void 0:T.call(E),N=typeof b.getBoundingClientRect=="function"?b.getBoundingClientRect():{left:null,top:null},j=o.getHierarchy(b),_=(k=j[0])===null||k===void 0?void 0:k.attrs,I=o.getNearestLabel(b),L=OP(_??{},S),V=(w={},w[gP]=j,w[tE]=C,w[nE]=o.getText(b),w[yP]=N.left==null?null:Math.round(N.left),w[bP]=N.top==null?null:Math.round(N.top),w[SP]=L,w[wP]=I,w[rE]=Ea(window.location.href.split("?")[0]),w[EP]=ey(o.replaceSensitiveString),w[TP]=window.innerHeight,w[CP]=window.innerWidth,w);if(V[pP]=b.getAttribute("id")||"",V[mP]=b.getAttribute("class"),V[xP]=_?.["aria-label"],C==="a"&&v==="click"&&b instanceof HTMLAnchorElement){var D=b.href.substring(0,Gk);V[vP]=o.replaceSensitiveString(D)}return iE(V)},this.addTypeAndTimestamp=function(v,b){return{event:v,timestamp:Date.now(),type:b}},this.addAdditionalEventProperties=function(v,b,S,w,E){E===void 0&&(E=!1);var T=o.addTypeAndTimestamp(v,b);if(DP(T)&&T.event.target!==null){if(E){var k=Kk(T.event.target,T.type);if(k)return T.closestTrackedAncestor=T.event.target,T.targetElementProperties=o.getEventProperties(T.type,T.closestTrackedAncestor,w),T}var C=ry(T.event.target,S);return C&&(T.closestTrackedAncestor=C,T.targetElementProperties=o.getEventProperties(T.type,C,w)),T}return T},this.extractDataFromDataSource=function(v,b){if(v.sourceType==="DOM_ELEMENT"){var S=GP(v,b);return S?v.elementExtractType==="TEXT"?o.getText(S):v.elementExtractType==="ATTRIBUTE"&&v.attribute?S.getAttribute(v.attribute):void 0:void 0}},this.getTextWithMaskedDescendants=function(v){var b,S,w="[".concat(fo,"], [contenteditable]");if(!v.querySelector(w))return v.innerText;var E="",T=Array.from(v.childNodes);try{for(var k=_e(T),C=k.next();!C.done;C=k.next()){var N=C.value;if(N.nodeType===Node.TEXT_NODE){E+=N.textContent||"";continue}if(N instanceof Element){if(N.hasAttribute(fo)||N.hasAttribute("contenteditable")){E+=Ta;continue}E+=o.getTextWithMaskedDescendants(N)}}}catch(j){b={error:j}}finally{try{C&&!C.done&&(S=k.return)&&S.call(k)}finally{if(b)throw b.error}}return E},this.getText=function(v){var b=v.closest("[".concat(fo,"]"))!==null;if(b)return Ta;var S="";return v.querySelector("[".concat(fo,"], [contenteditable]"))?S=o.getTextWithMaskedDescendants(v):S=v.innerText||"",o.replaceSensitiveString(S.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(v){var b,S,w;if(!v)return{};var E=(w=(S=v?.tagName)===null||S===void 0?void 0:S.toLowerCase)===null||w===void 0?void 0:w.call(S),T=(b={},b[tE]=E,b[nE]=o.getText(v),b[rE]=window.location.href.split("?")[0],b);return iE(T)},this.diagnosticsClient=n?.diagnosticsClient;var c=(l=t.maskTextRegex)!==null&&l!==void 0?l:[],f=[];try{for(var h=_e(c),m=h.next();!m.done;m=h.next()){var g=m.value;if(f.length>=jP)break;if(g instanceof RegExp)f.push(g);else if("pattern"in g&&typeof g.pattern=="string")try{f.push(new RegExp(g.pattern,"i"))}catch{}}}catch(v){r={error:v}}finally{try{m&&!m.done&&(a=h.return)&&a.call(h)}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 rL=function(e,t){var n,r,a,o,l,c,f,h;e===void 0&&(e={}),t?.diagnosticsClient.setTag("plugin.autocapture.version",Vk);var m=e.dataAttributePrefix,g=m===void 0?gk:m,v=e.visualTaggingOptions,b=v===void 0?{enabled:!0}:v;e.cssSelectorAllowlist=(n=e.cssSelectorAllowlist)!==null&&n!==void 0?n:MI,e.actionClickAllowlist=(r=e.actionClickAllowlist)!==null&&r!==void 0?r:DI,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(D,q){if(typeof q=="string"&&D.push(q),q instanceof RegExp&&D.push(q),typeof q=="object"&&q!==null&&"pattern"in q)try{D.push(new RegExp(q.pattern))}catch(G){return console.warn("Invalid regex pattern: ".concat(q.pattern),G),D}return D},[]);var S=oP,w="enrichment",E=[],T=new Xk(e,t),k=function(){var D,q=ai(Wk().map(function(J){return T.addAdditionalEventProperties(J,"click",e.cssSelectorAllowlist,g)})),G=ai(new In(function(J){var B,X=function(le){var ye=T.addAdditionalEventProperties(le,"change",e.cssSelectorAllowlist,g);J.next(ye)};return(B=ze())===null||B===void 0||B.document.addEventListener("change",X,{capture:!0}),function(){var le;return(le=ze())===null||le===void 0?void 0:le.document.removeEventListener("change",X)}})),Z;window.navigation&&(Z=ai(new In(function(J){var B=function(X){var le=T.addAdditionalEventProperties(X,"navigate",e.cssSelectorAllowlist,g);J.next(le)};return window.navigation.addEventListener("navigate",B),function(){window.navigation.removeEventListener("navigate",B)}})));var ce=ai(Yk().map(function(J){return T.addAdditionalEventProperties(J,"mutation",e.cssSelectorAllowlist,g)}));return D={},D[kr.ChangeObservable]=G,D[kr.ClickObservable]=q,D[kr.MutationObservable]=ce,D[kr.NavigateObservable]=Z,D},C=sE(Object.values((c=(l=e.pageActions)===null||l===void 0?void 0:l.labeledEvents)!==null&&c!==void 0?c:{})),N=oE((h=(f=e.pageActions)===null||f===void 0?void 0:f.triggers)!==null&&h!==void 0?h:[]),j=XP(C,N,T,e),_=function(D){var q,G;D&&(e.pageActions=de(de({},e.pageActions),D),C=sE(Object.values((q=e.pageActions.labeledEvents)!==null&&q!==void 0?q:{})),N=oE((G=e.pageActions.triggers)!==null&&G!==void 0?G:[]),j.update(C,N,e))},I=function(D,q){return ne(void 0,void 0,void 0,function(){var G,Z,ce,J,B,X,le,ye,M,U;return te(this,function(ee){return typeof document>"u"?[2]:(D.fetchRemoteConfig&&(D.remoteConfigClient?D.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(P){_(P)}):D.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),G=So(e,e.cssSelectorAllowlist),Z=So(e,e.actionClickAllowlist),ce=k(),J=PP({allObservables:ce,amplitude:q,shouldTrackEvent:G,evaluateTriggers:j.evaluate.bind(j)}),E.push(J),B=LP({allObservables:ce,getEventProperties:function(){for(var P=[],ue=0;ue<arguments.length;ue++)P[ue]=arguments[ue];return T.getEventProperties.apply(T,Je(Je([],Ae(P),!1),[g],!1))},amplitude:q,shouldTrackEvent:G,evaluateTriggers:j.evaluate.bind(j)}),E.push(B),X=zP({allObservables:ce,options:e,getEventProperties:function(){for(var P=[],ue=0;ue<arguments.length;ue++)P[ue]=arguments[ue];return T.getEventProperties.apply(T,Je(Je([],Ae(P),!1),[g],!1))},amplitude:q,shouldTrackEvent:G,shouldTrackActionClick:Z}),X&&E.push(X),(U=D?.loggerProvider)===null||U===void 0||U.log("".concat(S," has been successfully added.")),window.opener&&b.enabled&&(le=e.cssSelectorAllowlist,ye=e.actionClickAllowlist,M=Ak(),IP(M,{dataExtractor:T,isElementSelectable:So(e,Je(Je([],Ae(le),!1),Ae(ye),!1)),cssSelectorAllowlist:le,actionClickAllowlist:ye}),jk(M),M.setup(de({logger:D?.loggerProvider},D?.serverZone&&{endpoint:Ck[D.serverZone]}))),[2])})})},L=function(D){return ne(void 0,void 0,void 0,function(){return te(this,function(q){return[2,D]})})},V=function(){return ne(void 0,void 0,void 0,function(){var D,q,G,Z,ce;return te(this,function(J){try{for(D=_e(E),q=D.next();!q.done;q=D.next())G=q.value,G.unsubscribe()}catch(B){Z={error:B}}finally{try{q&&!q.done&&(ce=D.return)&&ce.call(D)}finally{if(Z)throw Z.error}}return[2]})})};return{name:S,type:w,setup:I,execute:L,teardown:V}},iL=3e3,aL=["mutation","navigate"];function sL(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 Lu(b)&&a("click",b.closestTrackedAncestor)&&b.event.target instanceof Element&&b.event.target.closest('a[target="_blank"]')===null&&b.event.button===cf.LEFT_OR_TOUCH_CONTACT}),h=c?vs(l,c):l,m=vs(f,h),g=null,v=ty(m,function(b){return g&&aL.includes(b.type)?(clearTimeout(g),g=null,Promise.resolve(null)):b.type==="click"?g?Promise.resolve(null):new Promise(function(S){g=setTimeout(function(){S(b),g=null},iL)}):Promise.resolve(null)});return v.subscribe(function(b){if(b){var S={"[Amplitude] X":b.event.clientX,"[Amplitude] Y":b.event.clientY};t.track(uP,de(de({},r("click",b.closestTrackedAncestor)),S),{time:b.timestamp})}})}var Qk=BI,Jk=UI,lE=FI;function uE(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>lE||e.xMax-e.xMin>lE}function cE(e){if(e.length===0)return null;var t=e[0],n=e[e.length-1],r=de({"[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 oL(e,t){var n=Math.max(0,e.length-Qk+1),r=e[n];return t.timestamp-r.timestamp>=Jk}function lL(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}function uL(e){var t=this,n=e.amplitude,r=e.allObservables,a=e.shouldTrackRageClick,o=r.clickObservable,l=r.selectionObservable,c=[],f={},h=null;function m(S){c=[],f={},S&&(uE(f,S),c.push(S))}var g=ty(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 uE(f,S),w=null,c.length===0||lL(c,S)||oL(c,S)||f.isOutOfBounds?(h&&(w=cE(c)),m(S)):c.push(S),h&&(clearTimeout(h.timerId),h.resolve(w),h=null),c.length>=Qk?[2,new Promise(function(T){h={resolve:T,timerId:setTimeout(function(){T(cE(c))},Jk)}})]:[2,null]})})}),v=l?.subscribe(function(){m()}),b=g.subscribe(function(S){S!==null&&n.track(cP,S.rageClickEvent,{time:S.time})});return{unsubscribe:function(){b.unsubscribe(),v?.unsubscribe()}}}var cL=2e3;function dL(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackErrorClick,a=n.clickObservable,o=n.browserErrorObservable,l=a.filter(function(m){return Lu(m)&&r("click",m.closestTrackedAncestor)&&m.event.target instanceof Element&&m.event.target.closest('a[target="_blank"]')===null&&m.event.button===cf.LEFT_OR_TOUCH_CONTACT}),c=null,f=null,h=function(){c!==null&&(clearTimeout(c),c=null),f=null};return vs(l,o).subscribe(function(m){var g;if(m.type==="click"){h(),f=m,c=setTimeout(h,cL);return}m.type==="error"&&f&&(t.track(dP,de((g={},g["[Amplitude] Kind"]=m.event.kind,g["[Amplitude] Message"]=m.event.message,g["[Amplitude] Stack"]=m.event.stack,g["[Amplitude] Filename"]=m.event.filename,g["[Amplitude] Line Number"]=m.event.lineNumber,g["[Amplitude] Column Number"]=m.event.columnNumber,g),f.targetElementProperties)),h())})}var ni;(function(e){e.INCREASING="increasing",e.DECREASING="decreasing"})(ni||(ni={}));var ds;(function(e){e.X="x",e.Y="y"})(ds||(ds={}));var fL=function(e){var t=e.allWindowObservables,n=t.mouseMoveObservable;return new In(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===ni.DECREASING&&r.next(ds.X),o=ni.INCREASING):f.x<a.x&&(o===ni.INCREASING&&r.next(ds.X),o=ni.DECREASING),f.y>a.y?(l===ni.DECREASING&&r.next(ds.Y),l=ni.INCREASING):f.y<a.y&&(l===ni.INCREASING&&r.next(ds.Y),l=ni.DECREASING),a=f})})};function hL(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 dE(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 fE(e){e.changes=[],e.startTime=void 0}function hE(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 pL(e,t){var n=void 0;if(dE(e)&&(n=e.startTime),dE(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}var Zk=10,eA=2e3,mL=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=n===void 0?Zk:n,a=e.thresholdMs,o=a===void 0?eA:a;return new In(function(l){var c={changes:[],changesThreshold:r,thresholdMs:o},f={changes:[],changesThreshold:r,thresholdMs:o},h=void 0,m=null;function g(){h!==void 0&&(l.next(h),h=void 0,m!==null&&clearTimeout(m),fE(c),fE(f))}return t.subscribe(function(v){m!==null&&clearTimeout(m),hL(v===ds.X?c:f);var b=pL(c,f);return b?(h=h||b,m=setTimeout(function(){g(),m=null},o)):g(),hE(c),hE(f),function(){m!==null&&(clearTimeout(m),m=null)}})})},gL=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,a=e.directionChanges,o=a===void 0?Zk:a,l=e.thresholdMs,c=l===void 0?eA:l,f=fL({allWindowObservables:r}),h=mL({mouseDirectionChangeObservable:f,directionChanges:o,thresholdMs:c});return h.subscribe(function(m){$k(n)&&t.track(hP,void 0,{time:m})})};function xm(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 fd=5,hd=4e3,vL=function(e){var t;e===void 0&&(e={});var n=lP,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 h=xm(e,"rageClicks",zI,c),m=xm(e,"deadClicks",PI,l),g=xm(e,"errorClicks",LI,o),v=(t=e.dataAttributePrefix)!==null&&t!==void 0?t:gk,b=new Xk(e),S=Je([],Ae(new Set(Je(Je(Je([],Ae(h),!1),Ae(m),!1),Ae(g),!1))),!1),w=function(){var C,N=ai(Wk("pointerdown").map(function(q){return b.addAdditionalEventProperties(q,"click",S,v,!0)})),j=ai(VP().map(function(q){return b.addTypeAndTimestamp(q,"error")})),_=ai(Yk().map(function(q){return b.addAdditionalEventProperties(q,"mutation",S,v)})),I;if(window.navigation){var L=new In(function(q){var G=function(Z){q.next(de(de({},Z),{type:"navigate"}))};return window.navigation.addEventListener("navigate",G),function(){window.navigation.removeEventListener("navigate",G)}});I=ai(L.map(function(q){return b.addAdditionalEventProperties(q,"navigate",S,v)}))}var V=ai(new In(function(q){var G=function(){var Z=document.activeElement;if(Z&&(Z.tagName==="TEXTAREA"||Z.tagName==="INPUT")){var ce=void 0,J=void 0;try{if(ce=Z.selectionStart,J=Z.selectionEnd,ce===J)return}catch{return}return q.next()}var B=window.getSelection();if(!(!B||B.isCollapsed))return q.next()};return window.document.addEventListener("selectionchange",G),function(){window.document.removeEventListener("selectionchange",G)}})),D=ai(HP());return C={},C[kr.ClickObservable]=N,C[kr.MutationObservable]=_,C[kr.NavigateObservable]=I,C[kr.BrowserErrorObservable]=j,C[kr.SelectionObservable]=V,C[kr.MouseMoveObservable]=D,C},E=function(C,N){return ne(void 0,void 0,void 0,function(){var j,_,I,L,V,D,q,G,Z,ce,J;return te(this,function(B){return typeof document>"u"?[2]:(j=w(),c&&(_=So(e,h),I=uL({allObservables:j,amplitude:N,shouldTrackRageClick:_}),a.push(I)),l&&(L=So(e,m),V=sL({amplitude:N,allObservables:j,getEventProperties:function(X,le){return b.getEventProperties(X,le,v)},shouldTrackDeadClick:L}),a.push(V)),o&&(D=So(e,g),q=dL({amplitude:N,allObservables:j,shouldTrackErrorClick:D}),a.push(q)),f&&(G=void 0,Z=void 0,typeof e.thrashedCursor=="object"&&(G=e.thrashedCursor.directionChanges,Z=e.thrashedCursor.threshold,G&&G<fd&&(C.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(G," is below the minimum of ").concat(fd,", setting to ").concat(fd)),G=fd),Z&&Z>hd&&(C.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(Z," is above the maximum of ").concat(hd,", setting to ").concat(hd)),Z=hd)),ce=gL({amplitude:N,options:e,allObservables:j,directionChanges:G,thresholdMs:Z}),a.push(ce)),(J=C?.loggerProvider)===null||J===void 0||J.log("".concat(n," has been successfully added.")),[2])})})},T=function(C){return ne(void 0,void 0,void 0,function(){return te(this,function(N){return[2,C]})})},k=function(){return ne(void 0,void 0,void 0,function(){var C,N,j,_,I;return te(this,function(L){try{for(C=_e(a),N=C.next();!N.done;N=C.next())j=N.value,j.unsubscribe()}catch(V){_={error:V}}finally{try{N&&!N.done&&(I=C.return)&&I.call(C)}finally{if(_)throw _.error}}return[2]})})};return{name:n,type:r,setup:E,execute:T,teardown:k}},yL="@amplitude/plugin-network-capture-browser",tA="[Amplitude] Network Request",nA="500-599";function Ud(e,t){var n=t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&"),r="^"+n.replace(/\*/g,".*")+"$",a=new RegExp(r);return a.test(e)}function rA(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),h=f[0],m=f[1];if(e===h&&m===void 0||e>=h&&e<=m)return!0}}catch(g){n={error:g}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function bL(e,t,n,r,a){if(!(e.hosts&&!e.hosts.find(function(l){return Ud(t,l)}))&&!(r&&e.urls&&!Sg(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||nA;if(!rA(n,o))return!1}return!0}}function iA(e){var t;if(e)try{var n=(t=ze())===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 xL(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===tA}))return!0}catch{}return!1}function pE(e){if(typeof e!="object"||e===null){if(e)return Je([],Ae(rf),!1);if(e===void 0){var t=void 0;return t}return}if(e.length!==0)return e}function mE(e){var t,n;return!(!((t=e?.allowlist)===null||t===void 0)&&t.length)&&!(!((n=e?.blocklist)===null||n===void 0)&&n.length)}function SL(e,t){var n;t===void 0&&(t={});var r=iA(e.url);if(!r)return!1;var a=r.host;if(t.ignoreAmplitudeRequests!==!1&&(Ud(a,"*.amplitude.com")||Ud(a,"amplitude.com"))||!((n=t.ignoreHosts)===null||n===void 0)&&n.find(function(l){return Ud(a,l)})||!t.captureRules&&e.status!==void 0&&!rA(e.status,nA))return!1;if(t.captureRules){var o;if(Je([],Ae(t.captureRules),!1).reverse().find(function(l){if(o=bL(l,a,e.status,e.url,e.method),o){var c=pE(l.responseHeaders);if(e.responseWrapper&&c){var f=e.responseWrapper.headers(c);f&&(e.responseHeaders=f)}var h=pE(l.requestHeaders);if(e.requestWrapper&&h){var m=e.requestWrapper.headers(h);m&&(e.requestHeaders=m)}e.responseWrapper&&l.responseBody&&!mE(l.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(l.responseBody.allowlist,l.responseBody.blocklist)),e.requestWrapper&&l.requestBody&&!mE(l.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(l.requestBody.allowlist,l.requestBody.blocklist))}return o!==void 0}),!o)return!1}return!(e.requestWrapper&&xL(a,e.requestWrapper))}function wL(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(tA,e),[2]}})})}function EL(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,a=e.loggerProvider,o=t.networkObservable,l=o.filter(function(c){return SL(c.event,n)});return l.subscribe(function(c){var f,h,m,g=c.event,v=iA(g.url);if(v){var b=(h=g.responseWrapper)===null||h===void 0?void 0:h.bodySize,S=(m=g.requestWrapper)===null||m===void 0?void 0:m.bodySize,w=(f={},f["[Amplitude] URL"]=v.hrefWithoutQueryOrHash,f["[Amplitude] URL Query"]=v.query,f["[Amplitude] URL Fragment"]=v.fragment,f["[Amplitude] Request Method"]=g.method,f["[Amplitude] Status Code"]=g.status,f["[Amplitude] Start Time"]=g.startTime,f["[Amplitude] Completion Time"]=g.endTime,f["[Amplitude] Duration"]=g.duration,f["[Amplitude] Request Body Size"]=S,f["[Amplitude] Response Body Size"]=b,f["[Amplitude] Request Type"]=g.type,f["[Amplitude] Request Headers"]=g.requestHeaders,f["[Amplitude] Response Headers"]=g.responseHeaders,f);wL(w,g,r,a)}})}var kg;(function(e){e.NetworkObservable="networkObservable"})(kg||(kg={}));var gE,TL=function(e){e===void 0&&(e={});var t=yL,n="enrichment",r,a=function(h,m){var g={event:h,timestamp:Date.now(),type:m};return g},o=function(){var h,m=new In(function(g){var v=new XI(function(b){var S=a(b,"network");g.next(S)});return zw.subscribe(v,r),function(){zw.unsubscribe(v)}});return h={},h[kg.NetworkObservable]=m,h},l=function(h,m){return ne(void 0,void 0,void 0,function(){var g;return te(this,function(v){return typeof document>"u"?[2]:(g=o(),r=h?.loggerProvider,gE=EL({allObservables:g,networkTrackingOptions:e,amplitude:m,loggerProvider:r}),r?.log("".concat(t," has been successfully added.")),[2])})})},c=function(h){return ne(void 0,void 0,void 0,function(){return te(this,function(m){return[2,h]})})},f=function(){return ne(void 0,void 0,void 0,function(){return te(this,function(h){return gE.unsubscribe(),[2]})})};return{name:t,type:n,setup:l,execute:c,teardown:f}},CL="web-vitals-browser",kL="[Amplitude] Web Vitals";let aA=-1;const Lo=e=>{addEventListener("pageshow",(t=>{t.persisted&&(aA=t.timeStamp,e(t))}),!0)},li=(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)))}},iy=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},ay=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},zu=()=>ay()?.activationStart??0,ui=(e,t=-1)=>{const n=ay();let r="navigate";return aA>=0?r="back-forward-cache":n&&(document.prerendering||zu()>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}},Sm=new WeakMap;function sy(e,t){return Sm.get(e)||Sm.set(e,new t),Sm.get(e)}class AL{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 Uu=(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{}},oy=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let ho=-1;const sA=new Set,vE=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,Ag=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of sA)t();isFinite(ho)||(ho=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",Ag,!0))}},Of=()=>{if(ho<0){const e=zu();ho=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((n=>n.name==="hidden"&&n.startTime>e))[0]?.startTime)??vE(),addEventListener("visibilitychange",Ag,!0),addEventListener("prerenderingchange",Ag,!0),Lo((()=>{setTimeout((()=>{ho=vE()}))}))}return{get firstHiddenTime(){return ho},onHidden(e){sA.add(e)}}},Mf=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},yE=[1800,3e3],oA=(e,t={})=>{Mf((()=>{const n=Of();let r,a=ui("FCP");const o=Uu("paint",(l=>{for(const c of l)c.name==="first-contentful-paint"&&(o.disconnect(),c.startTime<n.firstHiddenTime&&(a.value=Math.max(c.startTime-zu(),0),a.entries.push(c),r(!0)))}));o&&(r=li(e,a,yE,t.reportAllChanges),Lo((l=>{a=ui("FCP"),r=li(e,a,yE,t.reportAllChanges),iy((()=>{a.value=performance.now()-l.timeStamp,r(!0)}))})))}))},bE=[.1,.25],jL=(e,t={})=>{const n=Of();oA(oy((()=>{let r,a=ui("CLS",0);const o=sy(t,AL),l=f=>{for(const h of f)o.h(h);o.i>a.value&&(a.value=o.i,a.entries=o.o,r())},c=Uu("layout-shift",l);c&&(r=li(e,a,bE,t.reportAllChanges),n.onHidden((()=>{l(c.takeRecords()),r(!0)})),Lo((()=>{o.i=0,a=ui("CLS",0),r=li(e,a,bE,t.reportAllChanges),iy((()=>r()))})),setTimeout(r))})))};let lA=0,wm=1/0,pd=0;const NL=e=>{for(const t of e)t.interactionId&&(wm=Math.min(wm,t.interactionId),pd=Math.max(pd,t.interactionId),lA=pd?(pd-wm)/7+1:0)};let jg;const xE=()=>jg?lA:performance.interactionCount??0,RL=()=>{"interactionCount"in performance||jg||(jg=Uu("event",NL,{type:"event",buffered:!0,durationThreshold:0}))};let SE=0,_L=class{u=[];l=new Map;m;p;v(){SE=xE(),this.u.length=0,this.l.clear()}L(){const t=Math.min(this.u.length-1,Math.floor((xE()-SE)/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 uA=e=>{const t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=oy(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},wE=[200,500],OL=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Of();Mf((()=>{RL();let r,a=ui("INP");const o=sy(t,_L),l=f=>{uA((()=>{for(const m of f)o.h(m);const h=o.L();h&&h.P!==a.value&&(a.value=h.P,a.entries=h.entries,r())}))},c=Uu("event",l,{durationThreshold:t.durationThreshold??40});r=li(e,a,wE,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{l(c.takeRecords()),r(!0)})),Lo((()=>{o.v(),a=ui("INP"),r=li(e,a,wE,t.reportAllChanges)})))}))};let ML=class{m;h(t){this.m?.(t)}};const EE=[2500,4e3],DL=(e,t={})=>{Mf((()=>{const n=Of();let r,a=ui("LCP");const o=sy(t,ML),l=f=>{t.reportAllChanges||(f=f.slice(-1));for(const h of f)o.h(h),h.startTime<n.firstHiddenTime&&(a.value=Math.max(h.startTime-zu(),0),a.entries=[h],r())},c=Uu("largest-contentful-paint",l);if(c){r=li(e,a,EE,t.reportAllChanges);const f=oy((()=>{l(c.takeRecords()),c.disconnect(),r(!0)})),h=m=>{m.isTrusted&&(uA(f),removeEventListener(m.type,h,{capture:!0}))};for(const m of["keydown","click","visibilitychange"])addEventListener(m,h,{capture:!0});Lo((m=>{a=ui("LCP"),r=li(e,a,EE,t.reportAllChanges),iy((()=>{a.value=performance.now()-m.timeStamp,r(!0)}))}))}}))},TE=[800,1800],Ng=e=>{document.prerendering?Mf((()=>Ng(e))):document.readyState!=="complete"?addEventListener("load",(()=>Ng(e)),!0):setTimeout(e)},IL=(e,t={})=>{let n=ui("TTFB"),r=li(e,n,TE,t.reportAllChanges);Ng((()=>{const a=ay();a&&(n.value=Math.max(a.responseStart-zu(),0),n.entries=[a],r(!0),Lo((()=>{n=ui("TTFB",0),r=li(e,n,TE,t.reportAllChanges),r(!0)})))}))};function PL(e){var t,n=((t=e.entries[0])===null||t===void 0?void 0:t.startTime)||0;return performance.timeOrigin+n}function ql(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(PL(e)),navigationStart:Math.floor(performance.timeOrigin)}}var LL=function(){var e=null,t=ze(),n=t?.document,r=t?.location,a=function(c,f){return ne(void 0,void 0,void 0,function(){var h,m;return te(this,function(g){return n===void 0?[2]:(h=Ea(r?.href||"",c.loggerProvider),m={"[Amplitude] Page Domain":r?.hostname||"","[Amplitude] Page Location":h,"[Amplitude] Page Path":Ea(r?.pathname||"",c.loggerProvider),"[Amplitude] Page Title":typeof document<"u"&&document.title||"","[Amplitude] Page URL":Ea(h.split("?")[0],c.loggerProvider)},DL(function(v){m["[Amplitude] LCP"]=ql(v)}),oA(function(v){m["[Amplitude] FCP"]=ql(v)}),OL(function(v){m["[Amplitude] INP"]=ql(v)}),jL(function(v){m["[Amplitude] CLS"]=ql(v)}),IL(function(v){m["[Amplitude] TTFB"]=ql(v)}),e=function(){n.visibilityState==="hidden"&&e&&(f.track(kL,m),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:CL,type:"enrichment",setup:a,execute:o,teardown:l}},CE=(function(){function e(t,n){var r;this.shouldTrackNewCampaign=!1,this.options=de({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:H3(((r=n.cookieOptions)===null||r===void 0?void 0:r.domain)||n.topLevelDomain),optOut:n.optOut},t),this.storage=n.cookieStorage,this.storageKey=Rw(n.apiKey,"MKTG"),this.webExpStorageKey=Rw(n.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=Rf,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?lk(this.sessionTimeout,this.lastEventTime):!0,U3(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 wk().parse(),this.storage.get(this.storageKey)])];case 4:return[2,n.sent()]}})})},e.prototype.generateCampaignEvent=function(t){this.shouldTrackNewCampaign=!1;var n=V3(this.currentCampaign,this.options);return t&&(n.event_id=t),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e})(),md="AMP_CURRENT_PAGE",gd="AMP_PREVIOUS_PAGE",ro="AMP_URL_INFO",uu;(function(e){e.Direct="direct",e.Internal="internal",e.External="external"})(uu||(uu={}));var zL=new Set([dr.IDENTIFY,dr.GROUP_IDENTIFY,dr.REVENUE]),UL=function(e){var t={},n=t.internalDomains,r=n===void 0?[]:n,a=ze(),o=void 0,l=!1,c=void 0,f=!1,h=!1,m=function(w){var E;try{var T=Ea(w,c);E=new URL(T).hostname}catch(k){c?.error("Could not parse URL: ",k)}return E},g=function(w){var E=typeof location<"u"&&location.hostname||"",T=w?m(w):void 0;if(!T)return uu.Direct;var k=r.some(function(N){return E.indexOf(N)!==-1}),C=r.some(function(N){return T.indexOf(N)!==-1});return E===T||C&&k?uu.Internal:uu.External},v=function(){return ne(void 0,void 0,void 0,function(){var w,E,T,k,C;return te(this,function(N){switch(N.label){case 0:return o&&l?[4,o.get(ro)]:[3,3];case 1:return w=N.sent(),E=Ea(typeof location<"u"&&location.href||""),T=w?.[md]||"",k=void 0,E===T?k=w?.[gd]||"":T?k=T:k=document.referrer||"",[4,o.set(ro,(C={},C[md]=E,C[gd]=k,C))];case 2:N.sent(),N.label=3;case 3:return[2]}})})},b=function(){v()},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"),h=!0,a?(o=new Qv(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(k,C,N){var j=Ae(N,3),_=j[0],I=j[1],L=j[2];k.apply(C,[_,I,L]),h&&b()}}),a.history.replaceState=new Proxy(a.history.replaceState,{apply:function(k,C,N){var j=Ae(N,3),_=j[0],I=j[1],L=j[2];k.apply(C,[_,I,L]),h&&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,k,C,N;return te(this,function(j){switch(j.label){case 0:return E=Ea(typeof location<"u"&&location.href||""),o&&l?[4,o.get(ro)]:[3,5];case 1:return T=j.sent(),T?.[md]?[3,3]:[4,o.set(ro,(N={},N[md]=E,N[gd]=document.referrer||"",N))];case 2:j.sent(),j.label=3;case 3:return[4,o.get(ro)];case 4:if(k=j.sent(),C="",k&&(C=k[gd]||""),zL.has(w.event_type))return[2,w];w.event_properties=de(de({},w.event_properties||{}),{"[Amplitude] Page Domain":Gl(w,"[Amplitude] Page Domain",typeof location<"u"&&location.hostname||""),"[Amplitude] Page Location":Gl(w,"[Amplitude] Page Location",E),"[Amplitude] Page Path":Gl(w,"[Amplitude] Page Path",typeof location<"u"&&Ea(location.pathname)||""),"[Amplitude] Page Title":Gl(w,"[Amplitude] Page Title",ey(Zv)),"[Amplitude] Page URL":Gl(w,"[Amplitude] Page URL",E.split("?")[0]),"[Amplitude] Previous Page Location":C,"[Amplitude] Previous Page Type":g(C)}),j.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),h=!1),o&&l?[4,o.set(ro,{})]:[3,2];case 1:w.sent(),w.label=2;case 2:return[2]}})})}};return S};function Gl(e,t,n){return e.event_properties||(e.event_properties={}),e.event_properties[t]===void 0?n:e.event_properties[t]}var Em=-1,BL=(function(e){Mr(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),Cn(this._init(de(de({},l),{userId:o,apiKey:n})))},t.prototype._init=function(n){var r,a,o,l,c,f,h;return ne(this,void 0,void 0,function(){var m,g,v,b,S,w,E,T,k,C,N,j,_,I,L,V=this;return te(this,function(D){switch(D.label){case 0:return this.initializing?[2]:(this.initializing=!0,m=W3(n),g=(r=n.loggerProvider)!==null&&r!==void 0?r:new jo,v=(a=n.serverZone)!==null&&a!==void 0?a:Lk,S=this._diagnosticsSampleRate,w=(o=n.enableDiagnostics)!==null&&o!==void 0?o:!0,m?(b=new mk(n.apiKey,g,v,(l=n.remoteConfig)===null||l===void 0?void 0:l.serverUrl),[4,new Promise(function(q){b?.subscribe("configs.diagnostics.browserSDK","all",function(G,Z,ce){if(g.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:G,source:Z,lastFetch:ce},null,2)),G){var J=G.sampleRate;typeof J=="number"&&!isNaN(J)&&(S=J);var B=G.enabled;typeof B=="boolean"&&(w=B)}q()})})]):[3,2]);case 1:D.sent(),D.label=2;case 2:return E=new xI(n.apiKey,g,v,{enabled:w,sampleRate:S}),E.setTag("library","".concat(Ik,"/").concat(ny)),typeof navigator<"u"&&E.setTag("user_agent",navigator.userAgent),[4,$3(n.apiKey,n,this,E,{loggerProvider:g,serverZone:v,enableDiagnostics:w,diagnosticsSampleRate:S})];case 3:return T=D.sent(),m&&b?[4,new Promise(function(q){b?.subscribe("configs.analyticsSDK.browserSDK","all",function(G,Z,ce){T.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:G,source:Z,lastFetch:ce},null,2)),G&&sP(G,T),q()})})]:[3,5];case 4:D.sent(),D.label=5;case 5:return[4,e.prototype._init.call(this,T)];case 6:return D.sent(),this.logBrowserOptions(T),this.config.remoteConfigClient=b,Nk(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener(function(q){return ne(V,void 0,void 0,function(){var G;return te(this,function(Z){switch(Z.label){case 0:return q?[3,2]:(G=Gw(this.config),this.webAttribution=new CE(G,this.config),[4,this.webAttribution.init()]);case 1:Z.sent(),Z.label=2;case 2:return[2]}})})}),k=Gw(this.config),this.webAttribution=new CE(k,this.config),[4,this.webAttribution.init()]):[3,8];case 7:D.sent(),D.label=8;case 8:return C=af(),N=C.ampTimestamp?Number(C.ampTimestamp):void 0,j=N?Date.now()<N:!0,_=j&&!Number.isNaN(Number(C.ampSessionId))?Number(C.ampSessionId):void 0,I=this.config.deferredSessionId,I===Em&&!this.config.optOut&&(I=Date.now()),this.setSessionId((h=(f=(c=n.sessionId)!==null&&c!==void 0?c:_)!==null&&f!==void 0?f:I)!==null&&h!==void 0?h:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(q){return ne(V,void 0,void 0,function(){return te(this,function(G){return!q&&this.config.deferredSessionId&&(this.config.deferredSessionId===Em?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),L=No(n.instanceName),L.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===OI?[3,10]:[4,this.add(aP()).promise];case 9:D.sent(),D.label=10;case 10:return[4,this.add(new GD({diagnosticsClient:E})).promise];case 11:return D.sent(),[4,this.add(new E3).promise];case 12:return D.sent(),[4,this.add(new tI).promise];case 13:return D.sent(),iP(this.config),p3(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(rP()).promise]):[3,15];case 14:D.sent(),D.label=15;case 15:return Rk(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(nP()).promise]):[3,17];case 16:D.sent(),D.label=17;case 17:return _k(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Qw(qw(this.config))).promise]):[3,20];case 18:return D.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(q){return ne(V,void 0,void 0,function(){return te(this,function(G){switch(G.label){case 0:return q?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Qw(qw(this.config))).promise]);case 1:return G.sent(),[2]}})})}),D.label=20;case 20:return Mk(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(rL(v3(this.config),{diagnosticsClient:E})).promise]):[3,22];case 21:D.sent(),D.label=22;case 22:return Dk(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(vL(y3(this.config))).promise]):[3,24];case 23:D.sent(),D.label=24;case 24:return Ok(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(TL(b3(this.config))).promise]):[3,26];case 25:D.sent(),D.label=26;case 26:return g3(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(LL()).promise]):[3,28];case 27:D.sent(),D.label=28;case 28:return m3(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(UL()).promise]):[3,30];case 29:D.sent(),D.label=30;case 30:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 31:return D.sent(),L.eventBridge.setEventReceiver(function(q){var G=q.eventProperties||{},Z=G.time,ce=nf(G,["time"]),J=typeof Z=="number"?{time:Z}:void 0;V.track(q.eventType,ce,J)}),[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}),ZD(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}),eI(n,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(Na()),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 su,c=(o=n.userProperties)!==null&&o!==void 0?o:{};try{for(var f=_e(Object.entries(c)),h=f.next();!h.done;h=f.next()){var m=Ae(h.value,2),g=m[0],v=m[1];l.set(g,v)}}catch(b){r={error:b}}finally{try{h&&!h.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)),Cn(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=n??Em,Cn(Promise.resolve());if(n===void 0&&(n=Date.now()),n===this.config.sessionId)return Cn(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,Hw(this.config.defaultTracking)&&(o&&l&&a.push(this.track(Yw,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(Yv(this.config.identify)).promise),Hw(this.config.defaultTracking)&&a.push(this.track($w,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,Cn(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=Bk(n)},t.prototype.identify=function(n,r){if(mm(n)){var a=n._q;n._q=[],n=pm(new su,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(mm(a)){var l=a._q;a._q=[],a=pm(new su,l)}return e.prototype.groupIdentify.call(this,n,r,a,o)},t.prototype.revenue=function(n,r){if(mm(n)){var a=n._q;n._q=[],n=pm(new LD,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=lk(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),n.event_type!==$w&&n.event_type!==Yw&&(!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=de(de({},n),{apiKey:n.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",s3(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})(PD),cA="[Amplitude]",FL="".concat(cA," Session Replay ID"),VL=0,HL=Tu.US,qL={enabled:!0},ly=1e3,GL="".concat(cA," Session Replay Debug"),KL="amp-block",dA="amp-mask",$L="amp-unmask",YL="https://api-sr.amplitude.com/sessions/v2/track",WL="https://api-sr.eu.amplitude.com/sessions/v2/track",XL="https://api-sr.stag2.amplitude.com/sessions/v2/track",QL=1*1e6,JL=3e4,ZL=6e4,e4=500,t4=10*1e3,fA=1024,n4=1e3,ga;(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"})(ga||(ga={}));var Rg=(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})(),_g="medium";function r4(e){return e.toLowerCase()}function i4(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?r4(t):null}var hA=function(e,t,n){switch(t){case"light":{if(e!=="input")return!0;var r=n?i4(n):"";return r?!!(["password","hidden","email","tel"].includes(r)||n.autocomplete.startsWith("cc-")):!1}case"medium":case"conservative":return!0;default:return hA(e,_g,n)}},a4=function(e,t,n){var r,a,o;if(t===void 0&&(t={defaultMaskLevel:_g}),n){if(n.closest("."+dA))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("."+$L))return!1;var c=((a=t.unmaskSelector)!==null&&a!==void 0?a:[]).some(function(f){return n.closest(f)});if(c)return!1}return hA(e,(o=t.defaultMaskLevel)!==null&&o!==void 0?o:_g,n)},kE=function(e,t){return function(n,r){return a4(e,t,r)?n.replace(/[^\s]/g,"*"):n}},s4=function(){var e=ze();return e?.location?e.location.href:""},o4=function(e,t){return"".concat(t,"/").concat(e)},pA=function(e,t){return t||(e===Tu.STAGING?XL:e===Tu.EU?WL:YL)},l4=function(e){if(typeof e!="string"||e.trim()==="")return!1;var t=/^\/|^https?:\/\/[^\s]+$/;return!!t.test(e)},u4=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},c4=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 l4(t.selector)}))throw new Error("ugcFilterRules must be an array of objects with valid globs")},Df=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=u4(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},mA=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=ze(),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/fA):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:""}]}})})},gA=function(e){var t=de({},e),n=t.apiKey;return t.apiKey="****".concat(n.substring(n.length-4)),t},vA=function(){return{flushMaxRetries:2,logLevel:Qn.Warn,loggerProvider:new jo,transportProvider:new SI}},d4=(function(e){Mr(t,e);function t(n,r){var a=this,o,l,c,f,h,m,g=vA();if(a=e.call(this,de(de({transportProvider:g.transportProvider,loggerProvider:new Rg(r.loggerProvider||g.loggerProvider)},r),{apiKey:n}))||this,a.flushMaxRetries=r.flushMaxRetries!==void 0&&r.flushMaxRetries<=g.flushMaxRetries?r.flushMaxRetries:g.flushMaxRetries,a.apiKey=n,a.sampleRate=r.sampleRate||VL,a.serverZone=r.serverZone||HL,a.configServerUrl=r.configServerUrl,a.trackServerUrl=r.trackServerUrl,a.shouldInlineStylesheet=r.shouldInlineStylesheet,a.version=r.version,a.performanceConfig=r.performanceConfig||qL,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:ly,a.captureDocumentTitle=(h=r.captureDocumentTitle)!==null&&h!==void 0?h:!1,r.privacyConfig&&(a.privacyConfig=r.privacyConfig),r.interactionConfig&&(a.interactionConfig=r.interactionConfig,a.interactionConfig.ugcFilterRules&&c4(a.interactionConfig.ugcFilterRules)),r.debugMode&&(a.debugMode=r.debugMode),r.useWebWorker!==void 0)a.useWebWorker=r.useWebWorker;else{var v=r;((m=v.experimental)===null||m===void 0?void 0:m.useWebWorker)!==void 0&&(a.useWebWorker=v.experimental.useWebWorker)}return r.omitElementTags&&(a.omitElementTags=r.omitElementTags),a}return t})(sk);const f4="modulepreload",h4=function(e){return"/"+e},AE={},nu=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let f=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");a=f(n.map(h=>{if(h=h4(h),h in AE)return;AE[h]=!0;const m=h.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":f4,m||(v.as="script"),v.crossOrigin="",v.href=h,c&&v.setAttribute("nonce",c),document.head.appendChild(v),m)return new Promise((b,S)=>{v.addEventListener("load",b),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}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 yA=(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))(yA||{}),bA=(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))(bA||{}),p4=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},m4=(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,h,m,g,v,b,S,w,E,T,k,C,N,j=this;return te(this,function(_){switch(_.label){case 0:a=de({},this.localConfig),a.optOut=this.localConfig.optOut,a.captureEnabled=!0,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,new Promise(function(I,L){j.remoteConfigClient.subscribe("configs.sessionReplay","all",function(V,D){var q;if(j.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(D,":"),JSON.stringify(V,null,2)),!V){L(new Error("No remote config received"));return}var G=V,Z=G.sr_sampling_config,ce=G.sr_privacy_config,J=G.sr_targeting_config,B=(q=a.interactionConfig)===null||q===void 0?void 0:q.ugcFilterRules;a.interactionConfig=G.sr_interaction_config,a.interactionConfig&&B&&(a.interactionConfig.ugcFilterRules=B),a.loggingConfig=G.sr_logging_config,(Z||ce||J)&&(o={},Z&&(o.sr_sampling_config=Z),ce&&(o.sr_privacy_config=ce),J&&(o.sr_targeting_config=J)),I()})})];case 2:return _.sent(),[3,4];case 3:return l=_.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,h=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){m=(t=a.privacyConfig)!==null&&t!==void 0?t:{},g={defaultMaskLevel:(r=(n=f.defaultMaskLevel)!==null&&n!==void 0?n:m.defaultMaskLevel)!==null&&r!==void 0?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},v=function(I){var L,V,D,q,G,Z,ce,J,B,X={};typeof I.blockSelector=="string"&&(I.blockSelector=[I.blockSelector]);try{for(var le=_e((ce=I.blockSelector)!==null&&ce!==void 0?ce:[]),ye=le.next();!ye.done;ye=le.next()){var M=ye.value;X[M]="block"}}catch(me){L={error:me}}finally{try{ye&&!ye.done&&(V=le.return)&&V.call(le)}finally{if(L)throw L.error}}try{for(var U=_e((J=I.maskSelector)!==null&&J!==void 0?J:[]),ee=U.next();!ee.done;ee=U.next()){var M=ee.value;X[M]="mask"}}catch(me){D={error:me}}finally{try{ee&&!ee.done&&(q=U.return)&&q.call(U)}finally{if(D)throw D.error}}try{for(var P=_e((B=I.unmaskSelector)!==null&&B!==void 0?B:[]),ue=P.next();!ue.done;ue=P.next()){var M=ue.value;X[M]="unmask"}}catch(me){G={error:me}}finally{try{ue&&!ue.done&&(Z=P.return)&&Z.call(P)}finally{if(G)throw G.error}}return X},b=de(de({},v(m)),v(f));try{for(S=_e(Object.entries(b)),w=S.next();!w.done;w=S.next())E=Ae(w.value,2),T=E[0],k=E[1],k==="mask"?g.maskSelector.push(T):k==="block"?g.blockSelector.push(T):k==="unmask"&&g.unmaskSelector.push(T)}catch(I){C={error:I}}finally{try{w&&!w.done&&(N=S.return)&&N.call(S)}finally{if(C)throw C.error}}a.privacyConfig=p4(g,this.localConfig.loggerProvider)}return h&&Object.keys(h).length>0&&(a.targetingConfig=h),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:gA(a)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:o}]}})})},e})(),g4=function(e,t){return ne(void 0,void 0,void 0,function(){var n,r;return te(this,function(a){return n=new d4(e,t),r=new mk(e,n.loggerProvider,n.serverZone,t.configServerUrl),[2,new m4(r,n)]})})},Rr=Uint8Array,Fn=Uint16Array,Cu=Uint32Array,uy=new Rr([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]),cy=new Rr([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]),jE=new Rr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xA=function(e,t){for(var n=new Fn(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new Cu(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]},SA=xA(uy,2),v4=SA[0],Og=SA[1];v4[28]=258,Og[258]=28;var y4=xA(cy,0),NE=y4[1],Mg=new Fn(32768);for(var Bt=0;Bt<32768;++Bt){var da=(Bt&43690)>>>1|(Bt&21845)<<1;da=(da&52428)>>>2|(da&13107)<<2,da=(da&61680)>>>4|(da&3855)<<4,Mg[Bt]=((da&65280)>>>8|(da&255)<<8)>>>1}var cu=(function(e,t,n){for(var r=e.length,a=0,o=new Fn(t);a<r;++a)++o[e[a]-1];var l=new Fn(t);for(a=0;a<t;++a)l[a]=l[a-1]+o[a-1]<<1;var c;if(n){c=new Fn(1<<t);var f=15-t;for(a=0;a<r;++a)if(e[a])for(var h=a<<4|e[a],m=t-e[a],g=l[e[a]-1]++<<m,v=g|(1<<m)-1;g<=v;++g)c[Mg[g]>>>f]=h}else for(c=new Fn(r),a=0;a<r;++a)c[a]=Mg[l[e[a]-1]++]>>>15-e[a];return c}),ys=new Rr(288);for(var Bt=0;Bt<144;++Bt)ys[Bt]=8;for(var Bt=144;Bt<256;++Bt)ys[Bt]=9;for(var Bt=256;Bt<280;++Bt)ys[Bt]=7;for(var Bt=280;Bt<288;++Bt)ys[Bt]=8;var df=new Rr(32);for(var Bt=0;Bt<32;++Bt)df[Bt]=5;var b4=cu(ys,9,0),x4=cu(df,5,0),wA=function(e){return(e/8>>0)+(e&7&&1)},EA=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Fn?Fn:e instanceof Cu?Cu:Rr)(n-t);return r.set(e.subarray(t,n)),r},Mi=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Kl=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},Tm=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 Rr(0),0];if(a==1){var l=new Rr(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort(function(j,_){return j.f-_.f}),n.push({s:-1,f:25001});var c=n[0],f=n[1],h=0,m=1,g=2;for(n[0]={s:-1,f:c.f+f.f,l:c,r:f};m!=a-1;)c=n[n[h].f<n[g].f?h++:g++],f=n[h!=m&&n[h].f<n[g].f?h++:g++],n[m++]={s:-1,f:c.f+f.f,l:c,r:f};for(var v=o[0].s,r=1;r<a;++r)o[r].s>v&&(v=o[r].s);var b=new Fn(v+1),S=Dg(n[m-1],b,0);if(S>t){var r=0,w=0,E=S-t,T=1<<E;for(o.sort(function(_,I){return b[I.s]-b[_.s]||_.f-I.f});r<a;++r){var k=o[r].s;if(b[k]>t)w+=T-(1<<S-b[k]),b[k]=t;else break}for(w>>>=E;w>0;){var C=o[r].s;b[C]<t?w-=1<<t-b[C]++-1:++r}for(;r>=0&&w;--r){var N=o[r].s;b[N]==t&&(--b[N],++w)}S=t}return[new Rr(b),S]},Dg=function(e,t,n){return e.s==-1?Math.max(Dg(e.l,t,n+1),Dg(e.r,t,n+1)):t[e.s]=n},RE=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Fn(++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]},$l=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ig=function(e,t,n){var r=n.length,a=wA(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},_E=function(e,t,n,r,a,o,l,c,f,h,m){Mi(t,m++,n),++a[256];for(var g=Tm(a,15),v=g[0],b=g[1],S=Tm(o,15),w=S[0],E=S[1],T=RE(v),k=T[0],C=T[1],N=RE(w),j=N[0],_=N[1],I=new Fn(19),L=0;L<k.length;++L)I[k[L]&31]++;for(var L=0;L<j.length;++L)I[j[L]&31]++;for(var V=Tm(I,7),D=V[0],q=V[1],G=19;G>4&&!D[jE[G-1]];--G);var Z=h+5<<3,ce=$l(a,ys)+$l(o,df)+l,J=$l(a,v)+$l(o,w)+l+14+3*G+$l(I,D)+(2*I[16]+3*I[17]+7*I[18]);if(Z<=ce&&Z<=J)return Ig(t,m,e.subarray(f,f+h));var B,X,le,ye;if(Mi(t,m,1+(J<ce)),m+=2,J<ce){B=cu(v,b,0),X=v,le=cu(w,E,0),ye=w;var M=cu(D,q,0);Mi(t,m,C-257),Mi(t,m+5,_-1),Mi(t,m+10,G-4),m+=14;for(var L=0;L<G;++L)Mi(t,m+3*L,D[jE[L]]);m+=3*G;for(var U=[k,j],ee=0;ee<2;++ee)for(var P=U[ee],L=0;L<P.length;++L){var ue=P[L]&31;Mi(t,m,M[ue]),m+=D[ue],ue>15&&(Mi(t,m,P[L]>>>5&127),m+=P[L]>>>12)}}else B=b4,X=ys,le=x4,ye=df;for(var L=0;L<c;++L)if(r[L]>255){var ue=r[L]>>>18&31;Kl(t,m,B[ue+257]),m+=X[ue+257],ue>7&&(Mi(t,m,r[L]>>>23&31),m+=uy[ue]);var me=r[L]&31;Kl(t,m,le[me]),m+=ye[me],me>3&&(Kl(t,m,r[L]>>>5&8191),m+=cy[me])}else Kl(t,m,B[r[L]]),m+=X[r[L]];return Kl(t,m,B[256]),m+X[256]},S4=new Cu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),w4=function(e,t,n,r,a,o){var l=e.length,c=new Rr(r+l+5*(1+Math.floor(l/7e3))+a),f=c.subarray(r,c.length-a),h=0;if(!t||l<8)for(var m=0;m<=l;m+=65535){var g=m+65535;g<l?h=Ig(f,h,e.subarray(m,g)):(f[m]=o,h=Ig(f,h,e.subarray(m,l)))}else{for(var v=S4[t-1],b=v>>>13,S=v&8191,w=(1<<n)-1,E=new Fn(32768),T=new Fn(w+1),k=Math.ceil(n/3),C=2*k,N=function(We){return(e[We]^e[We+1]<<k^e[We+2]<<C)&w},j=new Cu(25e3),_=new Fn(288),I=new Fn(32),L=0,V=0,m=0,D=0,q=0,G=0;m<l;++m){var Z=N(m),ce=m&32767,J=T[Z];if(E[ce]=J,T[Z]=ce,q<=m){var B=l-m;if((L>7e3||D>24576)&&B>423){h=_E(e,f,0,j,_,I,V,D,G,m-G,h),D=L=V=0,G=m;for(var X=0;X<286;++X)_[X]=0;for(var X=0;X<30;++X)I[X]=0}var le=2,ye=0,M=S,U=ce-J&32767;if(B>2&&Z==N(m-U))for(var ee=Math.min(b,B)-1,P=Math.min(32767,m),ue=Math.min(258,B);U<=P&&--M&&ce!=J;){if(e[m+le]==e[m+le-U]){for(var me=0;me<ue&&e[m+me]==e[m+me-U];++me);if(me>le){if(le=me,ye=U,me>ee)break;for(var Se=Math.min(U,me-2),we=0,X=0;X<Se;++X){var Ue=m-U+X+32768&32767,Ne=E[Ue],ve=Ue-Ne+32768&32767;ve>we&&(we=ve,J=Ue)}}}ce=J,J=E[ce],U+=ce-J+32768&32767}if(ye){j[D++]=268435456|Og[le]<<18|NE[ye];var Pe=Og[le]&31,pt=NE[ye]&31;V+=uy[Pe]+cy[pt],++_[257+Pe],++I[pt],q=m+le,++L}else j[D++]=e[m],++_[e[m]]}}h=_E(e,f,o,j,_,I,V,D,G,m-G,h)}return EA(c,0,r+wA(h)+a)},E4=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}}},T4=function(e,t,n,r,a){return w4(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)},C4=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},k4=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 A4(e,t){t===void 0&&(t={});var n=E4();n.p(e);var r=T4(e,t,2,4);return k4(r,t),C4(r,r.length-4,n.d()),r}function j4(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Rr(e.length+(e.length>>>1)),a=0,o=function(h){r[a++]=h},l=0;l<n;++l){if(a+5>r.length){var c=new Rr(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 EA(r,0,a)}function N4(e,t){for(var n="",r=0;r<e.length;){var a=e[r++];n+=String.fromCharCode(a)}return n}const R4="v1",_4=e=>{const t={...e,v:R4};return N4(A4(j4(JSON.stringify(t))))};var O4=2e3,M4=(function(){function e(t,n,r,a){var o=this,l;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(g){var v=_4(g);return JSON.stringify(v)},this.addCompressedEventToManager=function(g,v){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:g},sessionId:v,deviceId:o.deviceId})},this.addCompressedEvent=function(g,v){if(o.worker)try{o.worker.postMessage({event:g,sessionId:v})}catch(S){S.name==="DataCloneError"?o.worker.postMessage(JSON.stringify({event:g,sessionId:v})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",S)}else{var b=o.compressEvent(g);o.addCompressedEventToManager(b,v)}},this.terminate=function(){var g;(g=o.worker)===null||g===void 0||g.terminate()};var c=ze();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)||O4,a){n.loggerProvider.log("Enabling web worker for compression");try{var f=new Blob([a],{type:"application/javascript"}),h=URL.createObjectURL(f),m=new Worker(h);m.onerror=function(g){n.loggerProvider.error("Worker failed, falling back to non-worker compression:",g),m.terminate(),o.worker=void 0},m.onmessage=function(g){var v=g.data,b=v.compressedEvent,S=v.sessionId;o.addCompressedEventToManager(b,S)},this.worker=m}catch(g){n.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",g)}}}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})(),D4="Unexpected error occurred",I4="Network error occurred, event batch rejected",OE="Session replay event batch rejected due to exceeded retry count",io="Failed to store session replay events in IndexedDB",P4="Session replay event batch not sent due to missing device ID",L4="Session replay event batch not sent due to missing api key",Pg="1.32.0",z4=(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(de(de({},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:OE}),!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(h){switch(h.label){case 0:n=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),h.label=1;case 1:h.trys.push([1,6,7,8]),r=_e(n),a=r.next(),h.label=2;case 2:return a.done?[3,5]:(o=a.value,[4,this.send(o,t)]);case 3:h.sent(),h.label=4;case 4:return a=r.next(),[3,2];case 5:return[3,8];case 6:return l=h.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,h,m,g,v,b,S,w,E,T;return te(this,function(k){switch(k.label){case 0:if(o=t.apiKey,!o)return[2,this.completeRequest({context:t,err:L4})];if(l=t.deviceId,!l)return[2,this.completeRequest({context:t,err:P4})];if(c=s4(),f=Pg,h=t.sampleRate,m=new URLSearchParams({device_id:l,session_id:"".concat(t.sessionId),type:"".concat(t.type)}),g="".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),v=this.payloadBatcher({version:1,events:t.events}),v.events.length===0)return this.completeRequest({context:t}),[2];k.label=1;case 1:return k.trys.push([1,6,,7]),b={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(o),"X-Client-Version":f,"X-Client-Library":g,"X-Client-Url":c.substring(0,n4),"X-Client-Sample-Rate":"".concat(h)},body:JSON.stringify(v),method:"POST"},S="".concat(pA(t.serverZone,this.trackServerUrl),"?").concat(m.toString()),[4,fetch(S,b)];case 2:if(w=k.sent(),w===null)return this.completeRequest({context:t,err:D4}),[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:k.sent(),k.label=5;case 5:return[3,7];case 6:return T=k.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 Pu().buildStatus(t),a=r,a){case Yt.Success:return[3,1];case Yt.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:I4}),o.label=5;case 5:return[2]}})})},e.prototype.handleSuccessResponse=function(t){var n=Math.round(new Blob(t.events).size/fA);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:OE}),[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 Lg=(e,t)=>t.some(n=>e instanceof n);let ME,DE;function U4(){return ME||(ME=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function B4(){return DE||(DE=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const zg=new WeakMap,Cm=new WeakMap,If=new WeakMap;function F4(e){const t=new Promise((n,r)=>{const a=()=>{e.removeEventListener("success",o),e.removeEventListener("error",l)},o=()=>{n(ms(e.result)),a()},l=()=>{r(e.error),a()};e.addEventListener("success",o),e.addEventListener("error",l)});return If.set(t,e),t}function V4(e){if(zg.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)});zg.set(e,t)}let Ug={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return zg.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ms(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 TA(e){Ug=e(Ug)}function H4(e){return B4().includes(e)?function(...t){return e.apply(Bg(this),t),ms(this.request)}:function(...t){return ms(e.apply(Bg(this),t))}}function q4(e){return typeof e=="function"?H4(e):(e instanceof IDBTransaction&&V4(e),Lg(e,U4())?new Proxy(e,Ug):e)}function ms(e){if(e instanceof IDBRequest)return F4(e);if(Cm.has(e))return Cm.get(e);const t=q4(e);return t!==e&&(Cm.set(e,t),If.set(t,e)),t}const Bg=e=>If.get(e);function CA(e,t,{blocked:n,upgrade:r,blocking:a,terminated:o}={}){const l=indexedDB.open(e,t),c=ms(l);return r&&l.addEventListener("upgradeneeded",f=>{r(ms(l.result),f.oldVersion,f.newVersion,ms(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",h=>a(h.oldVersion,h.newVersion,h))}).catch(()=>{}),c}const G4=["get","getKey","getAll","getAllKeys","count"],K4=["put","add","delete","clear"],km=new Map;function IE(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(km.get(t))return km.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,a=K4.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(a||G4.includes(n)))return;const o=async function(l,...c){const f=this.transaction(l,a?"readwrite":"readonly");let h=f.store;return r&&(h=h.index(c.shift())),(await Promise.all([h[n](...c),a&&f.done]))[0]};return km.set(t,o),o}TA(e=>({...e,get:(t,n,r)=>IE(t,n)||e.get(t,n,r),has:(t,n)=>!!IE(t,n)||e.has(t,n)}));const $4=["continue","continuePrimaryKey","advance"],PE={},Fg=new WeakMap,kA=new WeakMap,Y4={get(e,t){if(!$4.includes(t))return e[t];let n=PE[t];return n||(n=PE[t]=function(...r){Fg.set(this,kA.get(this)[t](...r))}),n}};async function*W4(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,Y4);for(kA.set(n,t),If.set(n,Bg(t));t;)yield n,t=await(Fg.get(n)||t.continue()),Fg.delete(n)}function LE(e,t){return t===Symbol.asyncIterator&&Lg(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Lg(e,[IDBIndex,IDBObjectStore])}TA(e=>({...e,get(t,n,r){return LE(t,n)?W4:e.get(t,n,r)},has(t,n){return LE(t,n)||e.has(t,n)}}));var AA=(function(){function e(t){var n=this,r,a,o;this.minInterval=e4,this.maxInterval=t4,this.maxPersistedEventsSize=QL,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(l,c){var f=n.getStringSize(c),h=n.getEventsArraySize(l);return h+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(h){n={error:h}}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})(),X4=function(e){return typeof e=="object"&&e!==null&&e.name==="AbortError"},Ii=function(e,t,n){X4(n)?e.debug(t):e.warn(t)},du="sessionCurrentSequence",fu="sequencesToSend",Q4=function(e){var t,n;return e.objectStoreNames.contains(du)||(n=e.createObjectStore(du,{keyPath:"sessionId"})),e.objectStoreNames.contains(fu)||(t=e.createObjectStore(fu,{keyPath:"sequenceId",autoIncrement:!0}),t.createIndex("sessionId","sessionId")),{sequencesStore:t,currentSequenceStore:n}},J4=function(e){return ne(void 0,void 0,void 0,function(){return te(this,function(t){switch(t.label){case 0:return[4,CA(e,1,{upgrade:Q4})];case 1:return[2,t.sent()]}})})},Z4=(function(e){Mr(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,h;return te(this,function(m){switch(m.label){case 0:return m.trys.push([0,5,,6]),a=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:o=m.sent(),m.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=m.sent(),[3,2];case 4:return[2,a];case 5:return h=m.sent(),Ii(this.loggerProvider,"".concat(io,": ").concat(h),h),[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(du,a)];case 1:return o=f.sent(),o?[4,this.db.put(fu,{sessionId:a,events:o.events})]:[2,void 0];case 2:return l=f.sent(),[4,this.db.put(du,{sessionId:a,events:[]})];case 3:return f.sent(),[2,de(de({},o),{sessionId:a,sequenceId:l})];case 4:return c=f.sent(),Ii(this.loggerProvider,"".concat(io,": ").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,h,m,g;return te(this,function(v){switch(v.label){case 0:return v.trys.push([0,10,,11]),l=this.db.transaction(du,"readwrite"),[4,l.store.get(a)];case 1:return c=v.sent(),c?[3,3]:[4,l.store.put({sessionId:a,events:[o]})];case 2:return v.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 v.sent(),[3,7];case 5:return h=c.events.concat(o),[4,l.store.put({sessionId:a,events:h})];case 6:v.sent(),v.label=7;case 7:return[4,l.done];case 8:return v.sent(),f?[4,this.storeSendingEvents(a,f)]:[2,void 0];case 9:return m=v.sent(),m?[2,{events:f,sessionId:a,sequenceId:m}]:[2,void 0];case 10:return g=v.sent(),Ii(this.loggerProvider,"".concat(io,": ").concat(g),g),[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(fu,{sessionId:a,events:o})];case 1:return l=f.sent(),[2,l];case 2:return c=f.sent(),Ii(this.loggerProvider,"".concat(io,": ").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(fu,o)];case 2:return c.sent(),[3,4];case 3:return l=c.sent(),Ii(this.loggerProvider,"".concat(io,": ").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,J4(o)];case 1:return l=f.sent(),[2,new t(de(de({},r),{db:l}))];case 2:return c=f.sent(),Ii(r.loggerProvider,"".concat(io,": ").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,h;return te(this,function(m){switch(m.label){case 0:return n?[4,this.db.get("sessionCurrentSequence",n)]:[3,2];case 1:return l=m.sent(),l?[2,[l]]:[2,void 0];case 2:r=[],m.label=3;case 3:return m.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:a=_e.apply(void 0,[m.sent()]),o=a.next(),m.label=5;case 5:if(o.done)return[3,7];l=o.value,r.push(l),m.label=6;case 6:return o=a.next(),[3,5];case 7:return[3,10];case 8:return c=m.sent(),f={error:c},[3,10];case 9:try{o&&!o.done&&(h=a.return)&&h.call(a)}finally{if(f)throw f.error}return[7];case 10:return[2,r]}})})},t})(AA),e6=(function(e){Mr(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=Je([],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})(AA),zE=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(k){return[2,f.flush(T)]})})}var f,h,m,g,v,b,S,w,E;return te(this,function(T){switch(T.label){case 0:return f=new z4(de(de({},t),{loggerProvider:t.loggerProvider,payloadBatcher:o})),h=function(){return new e6({loggerProvider:t.loggerProvider,maxInterval:r,minInterval:n})},m=function(){return ne(void 0,void 0,void 0,function(){var k;return te(this,function(C){switch(C.label){case 0:return[4,Z4.new(a,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:r,apiKey:t.apiKey})];case 1:return k=C.sent(),k?[2,k]:(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,h()])}})})},l!=="idb"?[3,2]:[4,m()];case 1:return v=T.sent(),[3,3];case 2:v=h(),T.label=3;case 3:return g=v,b=function(k){var C=k.events,N=k.sessionId,j=k.deviceId,_=k.sequenceId;t.debugMode&&mA().then(function(I){var L=I.totalStorageSize,V=I.percentOfQuota,D=I.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(L," KB, percentage of quota: ").concat(V,"%, usage details: ").concat(D))}).catch(function(){}),f.sendEventsList({events:C,sessionId:N,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:j,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(I){switch(I.label){case 0:return[4,g.cleanUpSessionEventsStore(N,_)];case 1:return I.sent(),[2]}})})}})},S=function(k){var C=k.sessionId,N=k.deviceId;g.storeCurrentSequence(C).then(function(j){j&&b({sequenceId:j.sequenceId,events:j.events,sessionId:j.sessionId,deviceId:N})}).catch(function(j){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",j)})},w=function(k){var C=k.deviceId;return ne(void 0,void 0,void 0,function(){var N;return te(this,function(j){switch(j.label){case 0:return[4,g.getSequencesToSend()];case 1:return N=j.sent(),N&&N.forEach(function(_){b({sequenceId:_.sequenceId,events:_.events,sessionId:_.sessionId,deviceId:C})}),[2]}})})},E=function(k){var C=k.event,N=k.sessionId,j=k.deviceId;g.addEventToCurrentSequence(N,C.data).then(function(_){return _&&b({sequenceId:_.sequenceId,events:_.events,sessionId:_.sessionId,deviceId:j})}).catch(function(_){t.loggerProvider.warn("Failed to add event to session replay capture:",_)})},[2,{sendCurrentSequenceEvents:S,addEvent:E,sendStoredEvents:w,flush:c}]}})})},UE=(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})(),_r,dy,jA;function t6(e,t){if(jA=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};_r=de(de({},n),t),dy=n6(_r.root,n);var r=vd(e,"all",function(){return vd(e,"two",function(){return vd(e,"one",function(){return vd(e,"none")})})});if(r){var a=_A(OA(r,e));return a.length>0&&(r=a[0]),Pf(r)}else throw new Error("Selector was not found.")}function n6(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function vd(e,t,n){for(var r=null,a=[],o=e,l=0,c=function(){var h,m,g=new Date().getTime()-jA.getTime();if(_r.timeoutMs!==void 0&&g>_r.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(g,"ms"));var v=bd(r6(o))||bd.apply(void 0,Je([],Ae(i6(o)),!1))||bd.apply(void 0,Je([],Ae(a6(o)),!1))||bd(s6(o))||[VE()],b=o6(o);if(t=="all")b&&(v=v.concat(v.filter(Am).map(function(k){return yd(k,b)})));else if(t=="two")v=v.slice(0,1),b&&(v=v.concat(v.filter(Am).map(function(k){return yd(k,b)})));else if(t=="one"){var S=Ae(v=v.slice(0,1),1),w=S[0];b&&Am(w)&&(v=[yd(w,b)])}else t=="none"&&(v=[VE()],b&&(v=[yd(v[0],b)]));try{for(var E=(h=void 0,_e(v)),T=E.next();!T.done;T=E.next()){var w=T.value;w.level=l}}catch(k){h={error:k}}finally{try{T&&!T.done&&(m=E.return)&&m.call(E)}finally{if(h)throw h.error}}if(a.push(v),a.length>=_r.seedMinLength&&(r=BE(a,n),r))return"break";o=o.parentElement,l++};o;){var f=c();if(f==="break")break}return r||(r=BE(a,n)),!r&&n?n():r}function BE(e,t){var n,r,a=_A(RA(e));if(a.length>_r.threshold)return t?t():null;try{for(var o=_e(a),l=o.next();!l.done;l=o.next()){var c=l.value;if(NA(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 Pf(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 FE(e){return e.map(function(t){return t.penalty}).reduce(function(t,n){return t+n},0)}function NA(e){var t=Pf(e);switch(dy.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 r6(e){var t=e.getAttribute("id");return t&&_r.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}function i6(e){var t=Array.from(e.attributes).filter(function(n){return _r.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 a6(e){var t=Array.from(e.classList).filter(_r.className);return t.map(function(n){return{name:"."+CSS.escape(n),penalty:1}})}function s6(e){var t=e.tagName.toLowerCase();return _r.tagName(t)?{name:t,penalty:2}:null}function VE(){return{name:"*",penalty:3}}function o6(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 yd(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Am(e){return e.name!=="html"&&!e.name.startsWith("#")}function bd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(l6);return n.length>0?n:null}function l6(e){return e!=null}function RA(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(RA(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 _A(e){return Je([],Ae(e),!1).sort(function(t,n){return FE(t)-FE(n)})}function OA(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>_r.optimizedMinLength))return[3,5];r=1,l.label=1;case 1:return r<e.length-1?n.counter>_r.maxNumberOfTries?[2]:(n.counter+=1,a=Je([],Ae(e),!1),a.splice(r,1),o=Pf(a),n.visited.has(o)?[2]:NA(a)&&u6(a,t)?[4,a]:[3,4]):[3,5];case 2:return l.sent(),n.visited.set(o,!0),[5,_e(OA(a,t,n))];case 3:l.sent(),l.label=4;case 4:return r++,[3,1];case 5:return[2]}})}function u6(e,t){return dy.querySelector(Pf(e))===t}var c6=36e5,d6=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}},f6=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,h=l.selector,m=l.timestamp,g=m-m%c6,v="".concat(c,":").concat(f,":").concat(h??"",":").concat(g);return o[v]?o[v].count+=1:o[v]=de(de({},l),{timestamp:g,count:1}),o},{});return{version:t,events:Object.values(a)}},h6=(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,h=a.ugcFilterRules,m=a.performanceOptions;return function(g){if(g.type===bA.Click){var v=ze();if(v){var b=v.location,S=v.innerHeight,w=v.innerWidth;if(b){var E=g.x,T=g.y;if(!(E===void 0||T===void 0)){var k=f.getNode(g.id),C;if(k)try{C=t6(k,m)}catch{r.logger.debug("error resolving selector from finder")}var N=Df(b.href,h),j={x:E+r.scrollWatcher.currentScrollX,y:T+r.scrollWatcher.currentScrollY,selector:C,viewportHeight:S,viewportWidth:w,pageUrl:N,timestamp:Date.now(),type:"click"},_=c();_&&o.addEvent({sessionId:l,event:{type:"interaction",data:JSON.stringify(j)},deviceId:_})}}}}}},this.logger=t,this.scrollWatcher=n}return e})();function jm(){var e=ze();return e?.innerHeight||document.documentElement&&document.documentElement.clientHeight||0}function Nm(){var e=ze();return e?.innerWidth||document.documentElement&&document.documentElement.clientWidth||0}var p6=(function(){function e(t,n){var r=ze();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=pA(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})(),m6=(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(),h=ze();h&&f&&r.transport.send(f,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:jm(),viewportWidth:Nm(),pageUrl:Df(h.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=Nm(),this._maxScrollHeight=jm(),this.config=n,this.transport=t}return e.default=function(t,n){return new e(new p6(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=Nm();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=jm();this._maxScrollY=t.y;var l=t.y+o;l>this._maxScrollHeight&&(this._maxScrollHeight=l),this.timestamp=n}},e})(),HE=(function(){function e(t){var n=t.sessionId,r=t.deviceId;this.deviceId=r,this.sessionId=n,n&&r&&(this.sessionReplayId=o4(n,r))}return e})(),g6=1e3*60*60*24*2,v6=(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,CA(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,h;return te(this,function(m){switch(m.label){case 0:return m.trys.push([0,3,,4]),[4,this.openOrCreateDB(a)];case 1:return l=m.sent(),c=String(o),[4,l.get("sessionTargetingMatch",c)];case 2:return f=m.sent(),[2,f?.targetingMatch];case 3:return h=m.sent(),Ii(r,"Failed to get targeting match for session id ".concat(o,": ").concat(h),h),[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,h,m;return te(this,function(g){switch(g.label){case 0:return g.trys.push([0,3,,4]),[4,this.openOrCreateDB(a)];case 1:return c=g.sent(),f=String(o),[4,c.put("sessionTargetingMatch",{targetingMatch:l,sessionId:f,lastUpdated:Date.now()})];case 2:return h=g.sent(),[2,h];case 3:return m=g.sent(),Ii(r,"Failed to store targeting match for session id ".concat(o,": ").concat(m),m),[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,h,m,g,v,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:h=S.sent(),m=0,S.label=3;case 3:return m<h.length?(g=h[m],v=Date.now()-g.lastUpdated,g.sessionId!==c&&v>g6?[4,f.store.delete(g.sessionId)]:[3,5]):[3,6];case 4:S.sent(),S.label=5;case 5:return m++,[3,3];case 6:return[4,f.done];case 7:return S.sent(),[3,9];case 8:return b=S.sent(),Ii(r,"Failed to clear old targeting matches for sessions: ".concat(b),b),[3,9];case 9:return[2]}})})}}return e})(),Rm=new v6,y6=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,h,m,g,v,b,S;return te(this,function(w){switch(w.label){case 0:return[4,Rm.clearStoreOfOldSessions({loggerProvider:r,apiKey:a,currentSessionId:t})];case 1:return w.sent(),[4,Rm.getTargetingMatchForSession({loggerProvider:r,apiKey:a,sessionId:t})];case 2:if(f=w.sent(),f===!0&&!c)return[2,!0];h=!0,w.label=3;case 3:return w.trys.push([3,6,,7]),[4,nu(()=>import("./index-XnQwXlLu.js"),[])];case 4:return m=w.sent().evaluateTargeting,g=de(de({},o),{flag:n,sessionId:typeof t=="string"?parseInt(t,10):t,apiKey:a,loggerProvider:r}),[4,m(g)];case 5:return v=w.sent(),v&&v.sr_targeting_config&&(h=v.sr_targeting_config.key==="on"),Rm.storeTargetingMatchForSession({loggerProvider:r,apiKey:a,sessionId:t,targetingMatch:h}),[3,7];case 6:return b=w.sent(),S=b,r.warn(S.message),[3,7];case 7:return[2,h]}})})},_m="__amplitude_url_tracking_patched__",qE=new WeakMap;function MA(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?ly:o;if(a){var c=function(){var N;return(N=e.location.href)!==null&&N!==void 0?N:""},f=c(),h=e.setInterval(function(){var N=c();N!==f&&(f=N,t(N))},l);return function(){h!=null&&e.clearInterval(h)}}var m=qE.get(e);if(!m){var g=void 0,v=new Set,b=function(){var N;return(N=e.location.href)!==null&&N!==void 0?N:""},S=function(){var N=b();g!==void 0&&N===g||(g=N,v.forEach(function(j){return j(N)}))},w=function(N){var j=function(){for(var _=[],I=0;I<arguments.length;I++)_[I]=arguments[I];var L=N.apply(this,_);return S(),L};return j[_m]=!0,j},E=e.history;if(E?.pushState){var T=Reflect.get(E,"pushState");T[_m]||(E.pushState=w(T))}if(E?.replaceState){var k=Reflect.get(E,"replaceState");k[_m]||(E.replaceState=w(k))}m={callbacks:v,notify:S,onPopStateOrHashChange:function(){return S()},listenersAttached:!1},qE.set(e,m)}var C=m;return C.listenersAttached||(e.addEventListener("popstate",C.onPopStateOrHashChange),e.addEventListener("hashchange",C.onPopStateOrHashChange),C.listenersAttached=!0),C.callbacks.add(t),function(){C.callbacks.delete(t),C.callbacks.size===0&&C.listenersAttached&&(e.removeEventListener("popstate",C.onPopStateOrHashChange),e.removeEventListener("hashchange",C.onPopStateOrHashChange),C.listenersAttached=!1)}}function DA(e){return e===void 0&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,n,r){var a,o,l,c=de(de({},e),r),f=c.ugcFilterRules||[],h=(a=c.enablePolling)!==null&&a!==void 0?a:!1,m=(o=c.pollingInterval)!==null&&o!==void 0?o:ly,g=(l=c.captureDocumentTitle)!==null&&l!==void 0?l:!1;if(!n)return function(){};var v=void 0,b=function(){return n.location&&n.location.href||""},S=function(){var T=n.innerHeight,k=n.innerWidth,C=n.document,N=b(),j="";g&&(j=C?.title||"");var _=f.length>0?Df(N,f):N;return{href:_,title:j,viewportHeight:T,viewportWidth:k,type:"url-change-event"}},w=function(){var T=b();if(v===void 0||T!==v){v=T;var k=S();t(k)}},E=MA(n,function(){return w()},h?{enablePolling:!0,pollingInterval:m}:{});return w(),function(){return E()}},options:e}}DA();var b6=(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=ze();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,h,m,g,v,b,S,w,E,T,k;return te(this,function(C){switch(C.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,h=n.event,h&&Object.values(dr).includes(h.event_type)&&(h=void 0),m=(T=(S=(b=n.page)===null||b===void 0?void 0:b.url)!==null&&S!==void 0?S:(E=(w=ze())===null||w===void 0?void 0:w.location)===null||E===void 0?void 0:E.href)!==null&&T!==void 0?T:"",g=(k=n.page)!==null&&k!==void 0?k:m!==""?{url:m}:void 0,[4,y6({sessionId:this.identifiers.sessionId,targetingConfig:l,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:n.userProperties,event:h,page:g},urlChange:o})]):[3,2];case 1:if(v=C.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||v,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:h,targetingParams:n},null,2)),C.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:C.sent(),C.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(h){switch(h.label){case 0:return h.trys.push([0,3,,4]),o=void 0,l=this.config,l&&n!==ga.METADATA?(o={config:gA(l),version:Pg},a?[4,mA()]:[3,2]):[3,2];case 1:c=h.sent(),o=de(de({},c),o),h.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(n,de(de({},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=h.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 Rg(new jo)}return e.prototype.init=function(t,n){return Cn(this._init(t,n))},e.prototype.setupUrlChangeListenerForTargeting=function(){var t=this,n;(n=this.urlChangeCleanup)===null||n===void 0||n.call(this);var r=ze();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=MA(r,a);this.urlChangeCleanup=function(){o(),t.urlChangeCleanup=null}}},e.prototype.getCurrentPageForTargeting=function(){var t,n,r=(n=(t=ze())===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,h,m;return ne(this,void 0,void 0,function(){var g,v,b,S,w,E,T,k,C,N,L,j,_,I,L,V,D,q,G;return te(this,function(Z){switch(Z.label){case 0:return(r=this.urlChangeCleanup)===null||r===void 0||r.call(this),this.loggerProvider=new Rg(n.loggerProvider||new jo),Object.prototype.hasOwnProperty.call(n,"logLevel")&&this.loggerProvider.enable(n.logLevel),this.identifiers=new HE({sessionId:n.sessionId,deviceId:n.deviceId}),g=this,[4,g4(t,n)];case 1:return g.joinedConfigGenerator=Z.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:v=Z.sent(),b=v.joinedConfig,S=v.localConfig,w=v.remoteConfig,this.config=b,this.setMetadata(n.sessionId,b,S,w,(a=n.version)===null||a===void 0?void 0:a.version,Pg,(o=n.version)===null||o===void 0?void 0:o.type),n.sessionId&&(!((l=this.config.interactionConfig)===null||l===void 0)&&l.enabled)&&(E=m6.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 h6(this.loggerProvider,E)),T=[],k=this.config.storeType,k==="idb"&&!(!((c=ze())===null||c===void 0)&&c.indexedDB)&&(k="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(k," for event storage.")),Z.label=3;case 3:return Z.trys.push([3,5,,6]),[4,zE({config:this.config,type:"replay",storeType:k})];case 4:return C=Z.sent(),T.push({name:"replay",manager:C}),[3,6];case 5:return N=Z.sent(),L=N,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(L.toString())),[3,6];case 6:if(!(!((f=this.config.interactionConfig)===null||f===void 0)&&f.enabled))return[3,10];j=this.config.interactionConfig.batch?f6:d6,Z.label=7;case 7:return Z.trys.push([7,9,,10]),[4,zE({config:this.config,type:"interaction",minInterval:(h=this.config.interactionConfig.trackEveryNms)!==null&&h!==void 0?h:JL,maxInterval:ZL,payloadBatcher:j,storeType:k})];case 8:return _=Z.sent(),T.push({name:"interaction",manager:_}),[3,10];case 9:return I=Z.sent(),L=I,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(L.toString())),[3,10];case 10:return this.eventsManager=new(UE.bind.apply(UE,Je([void 0],Ae(T),!1))),this.eventCompressor&&this.eventCompressor.terminate(),V=void 0,D=ze(),this.config.useWebWorker&&D&&D.Worker?[4,nu(()=>import("./index-D7Bf6Say.js"),[])]:[3,12];case 11:q=Z.sent().compressionScript,V=q,Z.label=12;case 12:return this.eventCompressor=new M4(this.eventsManager,this.config,this.getDeviceId(),V),[4,this.initializeNetworkObservers()];case 13:return Z.sent(),!((m=ze())===null||m===void 0)&&m.opener&&(G=Ak(),jk(G),G.setup(de({logger:this.loggerProvider},this.config.serverZone&&{endpoint:Ck[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 Z.sent(),this.config.targetingConfig&&this.setupUrlChangeListenerForTargeting(),[2]}})})},e.prototype.setSessionId=function(t,n){return Cn(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 HE({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[FL]=r.sessionReplayId?r.sessionReplayId:null,t),n.debugMode&&(o[GL]=JSON.stringify({appHash:sf(n.apiKey).toString()}))),this.addCustomRRWebEvent(ga.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=No(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=iI(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(ga.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,h,m,g;return te(this,function(v){switch(v.label){case 0:f=[];try{h=DA({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(h)}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];v.label=1;case 1:return v.trys.push([1,3,,4]),[4,nu(()=>import("./rrweb-plugin-console-record-sPdhR0i8.js"),[])];case 2:return m=v.sent().getRecordConsolePlugin,f.push(m({level:t.console.levels})),[3,4];case 3:return g=v.sent(),this.loggerProvider.warn("Failed to load console plugin:",g),[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,nu(()=>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 h,m,g,v,b,S,w,E,T,k,C,N,j,_=this;return te(this,function(I){switch(I.label){case 0:return h=this.config,m=this.getShouldRecord(),g=(n=this.identifiers)===null||n===void 0?void 0:n.sessionId,!m||!g||!h?[2]:(this.stopRecordingEvents(),[4,this.getRecordFunction()]);case 1:return v=I.sent(),v?[4,this.initializeNetworkObservers()]:[2];case 2:I.sent(),(r=this.networkObservers)===null||r===void 0||r.start(function(L){_.addCustomRRWebEvent(ga.FETCH_REQUEST,L)}),b=h.privacyConfig,S=h.interactionConfig,w=h.loggingConfig,E=S?.enabled?{mouseInteraction:this.eventsManager&&((a=this.clickHandler)===null||a===void 0?void 0:a.createHook({eventsManager:this.eventsManager,sessionId:g,deviceIdFn:this.getDeviceId.bind(this),mirror:v.mirror,ugcFilterRules:(o=S.ugcFilterRules)!==null&&o!==void 0?o:[],performanceOptions:(l=h.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(g,".")),I.label=3;case 3:return I.trys.push([3,5,,6]),k=this,C=v,j={emit:function(L){if(_.shouldOptOut()){_.loggerProvider.log("Opting session ".concat(g," out of recording due to optOut config.")),_.stopRecordingEvents(),_.sendEvents();return}L.type===yA.Meta&&(L.data.href=Df(L.data.href,T)),_.eventCompressor&&_.eventCompressor.enqueueEvent(L,g)},inlineStylesheet:h.shouldInlineStylesheet,hooks:E,maskAllInputs:!0,maskTextClass:dA,blockClass:KL,blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:h.applyBackgroundColorToBlockedElements,maskInputFn:kE("input",b),maskTextFn:kE("text",b),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:(c=h.omitElementTags)===null||c===void 0?void 0:c.script,comment:(f=h.omitElementTags)===null||f===void 0?void 0:f.comment},errorHandler:function(L){var V=L;if(V.message.includes("insertRule")&&V.message.includes("CSSStyleSheet")||V._external_)throw V;return _.loggerProvider.warn("Error while capturing replay: ",V.toString()),!0}},[4,this.getRecordingPlugins(w)];case 4:return k.recordCancelCallback=C.apply(void 0,[(j.plugins=I.sent(),j)]),this.addCustomRRWebEvent(ga.DEBUG_INFO),t&&this.addCustomRRWebEvent(ga.METADATA,this.metadata),[3,6];case 5:return N=I.sent(),this.loggerProvider.warn("Failed to initialize session replay:",N),[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()?sf(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,nu(()=>import("./observers-DqhQeBfm.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})(),is=function(e){return function(){var t=e.config,n=t||vA(),r=n.loggerProvider,a=n.logLevel;return{logger:r,logLevel:a}}},x6=function(){var e=new b6;return{init:it(e.init.bind(e),"init",is(e)),evaluateTargetingAndCapture:it(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",is(e)),setSessionId:it(e.setSessionId.bind(e),"setSessionId",is(e)),getSessionId:it(e.getSessionId.bind(e),"getSessionId",is(e)),getSessionReplayProperties:it(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",is(e)),flush:it(e.flush.bind(e),"flush",is(e)),shutdown:it(e.shutdown.bind(e),"shutdown",is(e))}};const xs=x6();var S6=xs.init,w6=xs.setSessionId,E6=xs.getSessionId,T6=xs.getSessionReplayProperties,C6=xs.flush,k6=xs.shutdown,A6=xs.evaluateTargetingAndCapture,j6=function(e){return e===void 0&&(e="$default_instance"),Wv.getInstance(e)},va;(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"})(va||(va={}));var GE;(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"})(GE||(GE={}));var KE;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(KE||(KE={}));var N6=[va.SET,va.SET_ONCE,va.ADD,va.APPEND,va.PREPEND,va.POSTINSERT],R6=function(e){if(e.user_properties){var t={},n=Object.keys(e.user_properties);return n.forEach(function(r){if(N6.includes(r)){var a=e.user_properties&&e.user_properties[r];t=de(de({},t),a)}}),t}},$E="1.26.0",_6="[Amplitude]",O6="".concat(_6," Session Replay ID"),Vg=(function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:C6,getSessionId:E6,getSessionReplayProperties:T6,init:S6,setSessionId:w6,shutdown:k6,evaluateTargetingAndCapture:A6},this.options=de({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(t,n){var r,a,o,l,c,f,h,m;return ne(this,void 0,void 0,function(){var g,v,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($E,".")),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=de(de({},t.defaultTracking),{sessions:!0})),g=j6(this.config.instanceName).identityStore,v=g.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:$E},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:(h=this.options.useWebWorker)!==null&&h!==void 0?h:(m=this.options.experimental)===null||m===void 0?void 0:m.useWebWorker,userProperties:v,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,h;return te(this,function(m){switch(m.label){case 0:return m.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:m.sent(),m.label=2;case 2:f=this.sessionReplay.getSessionReplayProperties(),t.event_properties=de(de({},t.event_properties),f),m.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:m.sent(),m.label=6;case 6:return o&&o===t.session_id?(l=void 0,t.event_type===dr.IDENTIFY&&(l=R6(t)),c=ze(),[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:m.sent(),f=this.sessionReplay.getSessionReplayProperties(),t.event_properties=de(de({},t.event_properties),f),m.label=8;case 8:return t.event_type===dr.IDENTIFY&&t.event_properties&&delete t.event_properties[O6],[2,Promise.resolve(t)];case 9:return h=m.sent(),(a=this.config)===null||a===void 0||a.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(h.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})(),M6=function(e){return new Vg(e)},Hg=function(e,t){return Hg=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])},Hg(e,t)};function IA(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Hg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ba=function(){return ba=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},ba.apply(this,arguments)};function PA(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(m){try{h(r.next(m))}catch(g){l(g)}}function f(m){try{h(r.throw(m))}catch(g){l(g)}}function h(m){m.done?o(m.value):a(m.value).then(c,f)}h((r=r.apply(e,[])).next())})}function LA(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(h){return function(m){return f([h,m])}}function f(h){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,h[0]&&(n=0)),n;)try{if(r=1,a&&(o=h[0]&2?a.return:h[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,h[1])).done)return o;switch(a=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return n.label++,{value:h[1],done:!1};case 5:n.label++,a=h[1],h=[0];continue;case 7:h=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){n=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){n.label=h[1];break}if(h[0]===6&&n.label<o[1]){n.label=o[1],o=h;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(h);break}o[2]&&n.ops.pop(),n.trys.pop();continue}h=t.call(e,n)}catch(m){h=[6,m],a=0}finally{r=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Cr(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 fy(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 hy(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"},D6=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)},Bd=-862048943,Fd=461845907,Vd=15,I6=13,P6=5,L6=-430675100,z6=function(e,t){t===void 0&&(t=0);for(var n=D6(e),r=n.length,a=r>>2,o=t,l=0;l<a;l++){var c=l<<2,f=F6(n,c);o=U6(f,o)}var h=a<<2,m=0;switch(r-h){case 3:m^=n[h+2]<<16,m^=n[h+1]<<8,m^=n[h],m=Math.imul(m,Bd),m=hu(m,Vd),m=Math.imul(m,Fd),o^=m;break;case 2:m^=n[h+1]<<8,m^=n[h],m=Math.imul(m,Bd),m=hu(m,Vd),m=Math.imul(m,Fd),o^=m;break;case 1:m^=n[h],m=Math.imul(m,Bd),m=hu(m,Vd),m=Math.imul(m,Fd),o^=m;break}return o^=r,B6(o)>>>0},U6=function(e,t){var n=e,r=t;return n=Math.imul(n,Bd),n=hu(n,Vd),n=Math.imul(n,Fd),r^=n,r=hu(r,I6),r=Math.imul(r,P6),r+L6|0},B6=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},hu=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},F6=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 V6(n)},V6=function(e){return(e&-16777216)>>>24|(e&16711680)>>>8|(e&65280)<<8|(e&255)<<24},YE=function(e,t){var n,r;if(!(!t||t.length===0)){try{for(var a=Cr(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}},H6="(\\d+)\\.(\\d+)",q6="(\\d+)",G6="(-(([-\\w]+\\.?)*))?",K6="^".concat(H6,"(\\.").concat(q6).concat(G6,")?$"),$6=(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(K6).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})(),Y6=(function(){function e(){}return e.prototype.evaluate=function(t,n){var r,a,o={},l={context:t,result:o};try{for(var c=Cr(n),f=c.next();!f.done;f=c.next()){var h=f.value,m=this.evaluateFlag(l,h);m&&(o[h.key]=m)}}catch(g){r={error:g}}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=Cr(n.segments),c=l.next();!c.done;c=l.next()){var f=c.value;if(o=this.evaluateSegment(t,n,f),o){var h=ba(ba(ba({},n.metadata),f.metadata),o.metadata);o=ba(ba({},o),{metadata:h});break}}}catch(m){r={error:m}}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=Cr(n),f=c.next();!f.done;f=c.next()){var h=f.value,m=!0;try{for(var g=(o=void 0,Cr(h)),v=g.next();!v.done;v=g.next()){var b=v.value;if(m=this.matchCondition(t,b),!m)break}}catch(S){o={error:S}}finally{try{v&&!v.done&&(l=g.return)&&l.call(g)}finally{if(o)throw o.error}}if(m)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=YE(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 z6(t)},e.prototype.bucket=function(t,n){var r,a,o,l;if(!n.bucket)return n.variant;var c=this.coerceString(YE(t,n.bucket.selector));if(!c||c.length===0)return n.variant;var f="".concat(n.bucket.salt,"/").concat(c),h=this.getHash(f),m=h%100,g=Math.floor(h/100);try{for(var v=Cr(n.bucket.allocations),b=v.next();!b.done;b=v.next()){var S=b.value,w=S.range[0],E=S.range[1];if(m>=w&&m<E)try{for(var T=(o=void 0,Cr(S.distributions)),k=T.next();!k.done;k=T.next()){var C=k.value,N=C.range[0],j=C.range[1];if(g>=N&&g<j)return C.variant}}catch(_){o={error:_}}finally{try{k&&!k.done&&(l=T.return)&&l.call(T)}finally{if(o)throw o.error}}}}catch(_){r={error:_}}finally{try{b&&!b.done&&(a=v.return)&&a.call(v)}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 $6.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=Cr(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(h){return a(h)}).filter(function(h){return h!==void 0});return c===void 0||f.length===0?r.some(function(h){return l.comparator(t,n,h)}):f.some(function(h){return o(c,n,h)})},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&&hy([],fy(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=Cr(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=Cr(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})(),W6=function(e,t){var n,r,a=ba({},e),o=[],l=t||Object.keys(a);try{for(var c=Cr(l),f=c.next();!f.done;f=c.next()){var h=f.value,m=zA(h,a);m&&o.push.apply(o,hy([],fy(m),!1))}}catch(g){n={error:g}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return o},zA=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(g){if(n.some(function(b){return b===g}))throw Error("Detected a cycle between flags ".concat(n));var v=zA(g,t,n);v&&l.push.apply(l,hy([],fy(v),!1))};try{for(var f=Cr(o.dependencies),h=f.next();!h.done;h=f.next()){var m=h.value;c(m)}}catch(g){r={error:g}}finally{try{h&&!h.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 UA="3.7.7",X6=UA,zo=typeof Buffer=="function",WE=typeof TextDecoder=="function"?new TextDecoder:void 0,XE=typeof TextEncoder=="function"?new TextEncoder:void 0,Q6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ru=Array.prototype.slice.call(Q6),xd=(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(ru),J6=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,jn=String.fromCharCode.bind(String),QE=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),BA=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),FA=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),VA=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+=ru[t>>18&63]+ru[t>>12&63]+ru[t>>6&63]+ru[t&63]}return l?o.slice(0,l-3)+"===".substring(l):o},py=typeof btoa=="function"?e=>btoa(e):zo?e=>Buffer.from(e,"binary").toString("base64"):VA,qg=zo?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,a=e.length;r<a;r+=4096)n.push(jn.apply(null,e.subarray(r,r+4096)));return py(n.join(""))},Hd=(e,t=!1)=>t?BA(qg(e)):qg(e),Z6=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?jn(192|t>>>6)+jn(128|t&63):jn(224|t>>>12&15)+jn(128|t>>>6&63)+jn(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return jn(240|t>>>18&7)+jn(128|t>>>12&63)+jn(128|t>>>6&63)+jn(128|t&63)}},ez=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,HA=e=>e.replace(ez,Z6),JE=zo?e=>Buffer.from(e,"utf8").toString("base64"):XE?e=>qg(XE.encode(e)):e=>py(HA(e)),wo=(e,t=!1)=>t?BA(JE(e)):JE(e),ZE=e=>wo(e,!0),tz=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,nz=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 jn((n>>>10)+55296)+jn((n&1023)+56320);case 3:return jn((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return jn((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},qA=e=>e.replace(tz,nz),GA=e=>{if(e=e.replace(/\s+/g,""),!J6.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=xd[e.charAt(o++)]<<18|xd[e.charAt(o++)]<<12|(r=xd[e.charAt(o++)])<<6|(a=xd[e.charAt(o++)]),n+=r===64?jn(t>>16&255):a===64?jn(t>>16&255,t>>8&255):jn(t>>16&255,t>>8&255,t&255);return n},my=typeof atob=="function"?e=>atob(FA(e)):zo?e=>Buffer.from(e,"base64").toString("binary"):GA,KA=zo?e=>QE(Buffer.from(e,"base64")):e=>QE(my(e).split("").map(t=>t.charCodeAt(0))),$A=e=>KA(YA(e)),rz=zo?e=>Buffer.from(e,"base64").toString("utf8"):WE?e=>WE.decode(KA(e)):e=>qA(my(e)),YA=e=>FA(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Gg=e=>rz(YA(e)),iz=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)},WA=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),XA=function(){const e=(t,n)=>Object.defineProperty(String.prototype,t,WA(n));e("fromBase64",function(){return Gg(this)}),e("toBase64",function(t){return wo(this,t)}),e("toBase64URI",function(){return wo(this,!0)}),e("toBase64URL",function(){return wo(this,!0)}),e("toUint8Array",function(){return $A(this)})},QA=function(){const e=(t,n)=>Object.defineProperty(Uint8Array.prototype,t,WA(n));e("toBase64",function(t){return Hd(this,t)}),e("toBase64URI",function(){return Hd(this,!0)}),e("toBase64URL",function(){return Hd(this,!0)})},az=()=>{XA(),QA()},Kg={version:UA,VERSION:X6,atob:my,atobPolyfill:GA,btoa:py,btoaPolyfill:VA,fromBase64:Gg,toBase64:wo,encode:wo,encodeURI:ZE,encodeURL:ZE,utob:HA,btou:qA,decode:Gg,isValid:iz,fromUint8Array:Hd,toUint8Array:$A,extendString:XA,extendUint8Array:QA,extendBuiltins:az};var JA=(function(e){IA(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),$g=(function(e){IA(t,e);function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return t})(Error),sz=(function(){function e(t,n,r){this.deploymentKey=t,this.serverUrl=n,this.httpClient=r}return e.prototype.getVariants=function(t,n){return PA(this,void 0,void 0,function(){var r,a,o,l;return LA(this,function(c){switch(c.label){case 0:return r=Kg.encodeURL(JSON.stringify(t)),a={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},n?.flagKeys&&(a["X-Amp-Exp-Flag-Keys"]=Kg.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 JA(l.status,"Fetch error response: status=".concat(l.status));return[2,JSON.parse(l.body)]}})})},e})(),oz=(function(){function e(t,n,r){this.deploymentKey=t,this.serverUrl=n,this.httpClient=r}return e.prototype.getFlags=function(t){return PA(this,void 0,void 0,function(){var n,r,a;return LA(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"]=Kg.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})(),un=typeof globalThis<"u"?globalThis:global||self,Ss=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},lz=function(){var e=Ss();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch{return!1}return!1},uz=(function(){function e(t,n){this.poller=void 0,this.action=t,this.ms=n}return e.prototype.start=function(){this.poller||(this.poller=un.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(un.clearInterval(this.poller),this.poller=void 0)},e})(),iu={exports:{}},cz=iu.exports,e1;function dz(){return e1||(e1=1,(function(e,t){(function(n,r){var a="0.7.33",o="",l="?",c="function",f="undefined",h="object",m="string",g="major",v="model",b="name",S="type",w="vendor",E="version",T="architecture",k="console",C="mobile",N="tablet",j="smarttv",_="wearable",I="embedded",L=350,V="Amazon",D="Apple",q="ASUS",G="BlackBerry",Z="Browser",ce="Chrome",J="Edge",B="Firefox",X="Google",le="Huawei",ye="LG",M="Microsoft",U="Motorola",ee="Opera",P="Samsung",ue="Sharp",me="Sony",Se="Xiaomi",we="Zebra",Ue="Facebook",Ne=function(Le,Me){var W={};for(var H in Le)Me[H]&&Me[H].length%2===0?W[H]=Me[H].concat(Le[H]):W[H]=Le[H];return W},ve=function(Le){for(var Me={},W=0;W<Le.length;W++)Me[Le[W].toUpperCase()]=Le[W];return Me},Pe=function(Le,Me){return typeof Le===m?pt(Me).indexOf(pt(Le))!==-1:!1},pt=function(Le){return Le.toLowerCase()},Zt=function(Le){return typeof Le===m?Le.replace(/[^\d\.]/g,o).split(".")[0]:r},We=function(Le,Me){if(typeof Le===m)return Le=Le.replace(/^\s\s*/,o),typeof Me===f?Le:Le.substring(0,L)},mt=function(Le,Me){for(var W=0,H,se,Ee,Te,Ve,st;W<Me.length&&!Ve;){var Xt=Me[W],Ot=Me[W+1];for(H=se=0;H<Xt.length&&!Ve;)if(Ve=Xt[H++].exec(Le),Ve)for(Ee=0;Ee<Ot.length;Ee++)st=Ve[++se],Te=Ot[Ee],typeof Te===h&&Te.length>0?Te.length===2?typeof Te[1]==c?this[Te[0]]=Te[1].call(this,st):this[Te[0]]=Te[1]:Te.length===3?typeof Te[1]===c&&!(Te[1].exec&&Te[1].test)?this[Te[0]]=st?Te[1].call(this,st,Te[2]):r:this[Te[0]]=st?st.replace(Te[1],Te[2]):r:Te.length===4&&(this[Te[0]]=st?Te[3].call(this,st.replace(Te[1],Te[2])):r):this[Te]=st||r;W+=2}},gt=function(Le,Me){for(var W in Me)if(typeof Me[W]===h&&Me[W].length>0){for(var H=0;H<Me[W].length;H++)if(Pe(Me[W][H],Le))return W===l?r:W}else if(Pe(Me[W],Le))return W===l?r:W;return Le},Gt={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},_t={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"},Ft={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"+Z]],[/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 "+Z],E],[/\bfocus\/([\w\.]+)/i],[E,[b,B+" 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 "+Z]],[/fxios\/([-\w\.]+)/i],[E,[b,B]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+Z]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+Z],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,Ue],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,ce+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,ce+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[b,"Android "+Z]],[/(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,gt,Gt]],[/(webkit|khtml)\/([\w\.]+)/i],[b,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[b,B+" 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,pt]],[/((?: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,pt]],[/(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,pt]]],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],[v,[w,P],[S,N]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[v,[w,P],[S,C]],[/((ipod|iphone)\d+,\d+)/i],[v,[w,D],[S,C]],[/(ipad\d+,\d+)/i],[v,[w,D],[S,N]],[/\((ip(?:hone|od)[\w ]*);/i],[v,[w,D],[S,C]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[w,D],[S,N]],[/(macintosh);/i],[v,[w,D]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[w,le],[S,N]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[w,le],[S,C]],[/\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],[[v,/_/g," "],[w,Se],[S,C]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[w,Se],[S,N]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[w,"OPPO"],[S,C]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[w,"Vivo"],[S,C]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[v,[w,"Realme"],[S,C]],[/\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],[v,[w,U],[S,C]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[w,U],[S,N]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[w,ye],[S,N]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[w,ye],[S,C]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[w,"Lenovo"],[S,N]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[w,"Nokia"],[S,C]],[/(pixel c)\b/i],[v,[w,X],[S,N]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[w,X],[S,C]],[/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],[v,[w,me],[S,C]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[w,me],[S,N]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[w,"OnePlus"],[S,C]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[w,V],[S,N]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[w,V],[S,C]],[/(playbook);[-\w\),; ]+(rim)/i],[v,w,[S,N]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[w,G],[S,C]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[w,q],[S,N]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[w,q],[S,C]],[/(nexus 9)/i],[v,[w,"HTC"],[S,N]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[w,[v,/_/g," "],[S,C]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[w,"Acer"],[S,N]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[w,"Meizu"],[S,C]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[w,ue],[S,C]],[/(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,v,[S,C]],[/(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,v,[S,N]],[/(surface duo)/i],[v,[w,M],[S,N]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[w,"Fairphone"],[S,C]],[/(u304aa)/i],[v,[w,"AT&T"],[S,C]],[/\bsie-(\w*)/i],[v,[w,"Siemens"],[S,C]],[/\b(rct\w+) b/i],[v,[w,"RCA"],[S,N]],[/\b(venue[\d ]{2,7}) b/i],[v,[w,"Dell"],[S,N]],[/\b(q(?:mv|ta)\w+) b/i],[v,[w,"Verizon"],[S,N]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[w,"Barnes & Noble"],[S,N]],[/\b(tm\d{3}\w+) b/i],[v,[w,"NuVision"],[S,N]],[/\b(k88) b/i],[v,[w,"ZTE"],[S,N]],[/\b(nx\d{3}j) b/i],[v,[w,"ZTE"],[S,C]],[/\b(gen\d{3}) b.+49h/i],[v,[w,"Swiss"],[S,C]],[/\b(zur\d{3}) b/i],[v,[w,"Swiss"],[S,N]],[/\b((zeki)?tb.*\b) b/i],[v,[w,"Zeki"],[S,N]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[w,"Dragon Touch"],v,[S,N]],[/\b(ns-?\w{0,9}) b/i],[v,[w,"Insignia"],[S,N]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[w,"NextBook"],[S,N]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[w,"Voice"],v,[S,C]],[/\b(lvtel\-)?(v1[12]) b/i],[[w,"LvTel"],v,[S,C]],[/\b(ph-1) /i],[v,[w,"Essential"],[S,C]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[w,"Envizen"],[S,N]],[/\b(trio[-\w\. ]+) b/i],[v,[w,"MachSpeed"],[S,N]],[/\btu_(1491) b/i],[v,[w,"Rotor"],[S,N]],[/(shield[\w ]+) b/i],[v,[w,"Nvidia"],[S,N]],[/(sprint) (\w+)/i],[w,v,[S,C]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[w,M],[S,C]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[w,we],[S,N]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[w,we],[S,C]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[w,v,[S,k]],[/droid.+; (shield) bui/i],[v,[w,"Nvidia"],[S,k]],[/(playstation [345portablevi]+)/i],[v,[w,me],[S,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[w,M],[S,k]],[/smart-tv.+(samsung)/i],[w,[S,j]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[w,P],[S,j]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[w,ye],[S,j]],[/(apple) ?tv/i],[w,[v,D+" TV"],[S,j]],[/crkey/i],[[v,ce+"cast"],[w,X],[S,j]],[/droid.+aft(\w)( bui|\))/i],[v,[w,V],[S,j]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[w,ue],[S,j]],[/(bravia[\w ]+)( bui|\))/i],[v,[w,me],[S,j]],[/(mitv-\w{5}) bui/i],[v,[w,Se],[S,j]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[w,We],[v,We],[S,j]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[S,j]],[/((pebble))app/i],[w,v,[S,_]],[/droid.+; (glass) \d/i],[v,[w,X],[S,_]],[/droid.+; (wt63?0{2,3})\)/i],[v,[w,we],[S,_]],[/(quest( 2)?)/i],[v,[w,Ue],[S,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[w,[S,I]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[v,[S,C]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[S,N]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[S,N]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[S,C]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[w,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[b,J+"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,gt,_t]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[E,gt,_t]],[/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,G]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[b,B+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[b,"webOS"]],[/crkey\/([\d\.]+)/i],[E,[b,ce+"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]]},vt=function(Le,Me){if(typeof Le===h&&(Me=Le,Le=r),!(this instanceof vt))return new vt(Le,Me).getResult();var W=Le||(typeof n!==f&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:o),H=Me?Ne(Ft,Me):Ft;return this.getBrowser=function(){var se={};return se[b]=r,se[E]=r,mt.call(se,W,H.browser),se.major=Zt(se.version),se},this.getCPU=function(){var se={};return se[T]=r,mt.call(se,W,H.cpu),se},this.getDevice=function(){var se={};return se[w]=r,se[v]=r,se[S]=r,mt.call(se,W,H.device),se},this.getEngine=function(){var se={};return se[b]=r,se[E]=r,mt.call(se,W,H.engine),se},this.getOS=function(){var se={};return se[b]=r,se[E]=r,mt.call(se,W,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 W},this.setUA=function(se){return W=typeof se===m&&se.length>L?We(se,L):se,this},this.setUA(W),this};vt.VERSION=a,vt.BROWSER=ve([b,E,g]),vt.CPU=ve([T]),vt.DEVICE=ve([v,w,S,k,C,j,N,_,I]),vt.ENGINE=vt.OS=ve([b,E]),e.exports&&(t=e.exports=vt),t.UAParser=vt;var dt=typeof n!==f&&(n.jQuery||n.Zepto);if(dt&&!dt.ua){var Ln=new vt;dt.ua=Ln.getResult(),dt.ua.get=function(){return Ln.getUA()},dt.ua.set=function(Le){Ln.setUA(Le);var Me=Ln.getResult();for(var W in Me)dt.ua[W]=Me[W]}}})(typeof window=="object"?window:cz)})(iu,iu.exports)),iu.exports}var fz=dz(),ct=function(){return ct=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},ct.apply(this,arguments)};function kn(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(m){try{h(r.next(m))}catch(g){l(g)}}function f(m){try{h(r.throw(m))}catch(g){l(g)}}function h(m){m.done?o(m.value):a(m.value).then(c,f)}h((r=r.apply(e,t||[])).next())})}function An(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(h){return function(m){return f([h,m])}}function f(h){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,h[0]&&(n=0)),n;)try{if(r=1,a&&(o=h[0]&2?a.return:h[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,h[1])).done)return o;switch(a=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return n.label++,{value:h[1],done:!1};case 5:n.label++,a=h[1],h=[0];continue;case 7:h=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){n=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){n.label=h[1];break}if(h[0]===6&&n.label<o[1]){n.label=o[1],o=h;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(h);break}o[2]&&n.ops.pop(),n.trys.pop();continue}h=t.call(e,n)}catch(m){h=[6,m],a=0}finally{r=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Aa(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 On(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 jr(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 t1=function(e,t){var n,r;t===void 0&&(t=!1);var a=gy(e,t),o=void 0,l=un.document.cookie.split("; ");try{for(var c=Aa(l),f=c.next();!f.done;f=c.next()){var h=f.value,m=On(h.split("=",2),2),g=m[0],v=m[1];g===a&&(o=decodeURIComponent(v))}}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}},hz=function(e){var t=gy(e,!0);try{var n=un.localStorage.getItem(t);if(!n)return;var r=JSON.parse(n);return typeof r!="object"?void 0:r}catch{return}},pz=function(e){var t=gy(e,!0);try{var n=un.sessionStorage.getItem(t);if(!n)return;var r=JSON.parse(n);return typeof r!="object"?void 0:r}catch{return}},gy=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))},mz=(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 kn(this,void 0,void 0,function(){return An(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=t1(this.apiKey,!0);return t?(this.commitIdentityToConnector(t),!0):(t=t1(this.apiKey,!1),t?(this.commitIdentityToConnector(t),!0):(t=hz(this.apiKey),t?(this.commitIdentityToConnector(t),!0):(t=pz(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 kn(this,void 0,void 0,function(){var n,r=this;return An(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){un.setTimeout(l,t,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]:[2]})})},e})();function gz(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(m){return c[m.toLowerCase()]},has:function(m){return m.toLowerCase()in c}}}};for(var h in a.open(t.method||"get",e,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,g,v){o.push(g=g.toLowerCase()),l.push([g,v]),c[g]=c[g]?c[g]+","+v:v}),n(f())},a.onerror=r,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(h,t.headers[h]);a.send(t.body||null)})}var vz=un.fetch||gz,yz=function(e,t){return t==null||t<=0?e:new Promise(function(n,r){un.setTimeout(function(){r(new $g("Request timeout after "+t+" milliseconds"))},t),e.then(n,r)})},bz=function(e,t,n,r,a){var o=function(){return kn(void 0,void 0,void 0,function(){var l,c,f;return An(this,function(h){switch(h.label){case 0:return[4,vz(e,{method:t,headers:n,body:r})];case 1:return l=h.sent(),f={status:l.status},[4,l.text()];case 2:return c=(f.body=h.sent(),f),[2,c]}})})};return yz(o(),a)},xz=(function(){function e(t){this.client=t}return e.prototype.request=function(t){return kn(this,void 0,void 0,function(){return An(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})(),ZA={request:bz},Hr;(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"})(Hr||(Hr={}));var Pi;(function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"})(Pi||(Pi={}));var pn;(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"})(pn||(pn={}));var n1=function(e){return!e||e===pn.FallbackInline||e===pn.FallbackConfig||e===pn.SecondaryInitialVariants},po={debug:!1,logLevel:Hr.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Pi.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:ZA},r1="1.20.3",Sz=512,wz=(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:po.instanceName;this.queue=new Tz(o),this.cache=new Ez(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})(),Ez=(function(){function e(t){this.isSessionStorageAvailable=Cz(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(t),this.isSessionStorageAvailable&&(un.sessionStorage.removeItem("EXP_sent_".concat(t)),un.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,h=c??null,m=!1;return(!l||h!==f)&&(m=!0,this.inMemoryCache[t.flag_key]=f),this.storeCache(),m},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&un.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=un.sessionStorage.getItem(this.storageKey);this.inMemoryCache=t?JSON.parse(t):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{un.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch{}},e})(),Tz=(function(){function e(t,n){n===void 0&&(n=Sz),this.isLocalStorageAvailable=lz(),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=un.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&&(un.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var t=un.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)),un.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e})(),Cz=function(){var e=Ss();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch{return!1}return!1},kz=(function(){function e(t,n){n===void 0&&(n=Hr.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>=Hr.Error&&(n=this.logger).error.apply(n,jr([t],On(r),!1))},e.prototype.warn=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Hr.Warn&&(n=this.logger).warn.apply(n,jr([t],On(r),!1))},e.prototype.info=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Hr.Info&&(n=this.logger).info.apply(n,jr([t],On(r),!1))},e.prototype.debug=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Hr.Debug&&(n=this.logger).debug.apply(n,jr([t],On(r),!1))},e.prototype.verbose=function(t){for(var n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.logLevel>=Hr.Verbose&&(n=this.logger).verbose.apply(n,jr([t],On(r),!1))},e})(),Az=(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,jr([t],On(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,jr([t],On(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,jr([t],On(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,jr([t],On(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,jr([t],On(n),!1))},e})(),Lf=(function(){function e(){this.globalScope=Ss()}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})(),jz=function(e,t,n){var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r);return new ej(a,n,tj)},Nz=function(e,t,n){n===void 0&&(n=new Lf);var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r,"-flags");return new ej(a,n)},Rz=function(e,t,n){n===void 0&&(n=new Lf);var r=e.substring(e.length-6),a="amp-exp-".concat(t,"-").concat(r,"-variants-options");return new _z(a,n)},_z=(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})(),ej=(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 ct({},this.cache)},e.prototype.put=function(t,n){this.cache[t]=n},e.prototype.putAll=function(t){var n,r;try{for(var a=Aa(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=Aa(Object.keys(a)),c=l.next();!c.done;c=l.next()){var f=c.value;try{var h=void 0;this.transformer?h=this.transformer(a[f]):h=a[f],h&&(o[f]=h)}catch{}}}catch(m){t={error:m}}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})(),tj=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}},nj=(function(){function e(){this.globalScope=Ss()}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})(),Oz=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)}},Fr=function(e){return e==null},Om=function(e){return Fr(e)?!0:e&&Object.keys(e).length===0},Mz=function(e){var t,n;if(!e||typeof e!="object")return{};var r={};try{for(var a=Aa(Object.entries(e)),o=a.next();!o.done;o=a.next()){var l=On(o.value,2),c=l[0],f=l[1];Fr(f)||(r[c]=f)}}catch(h){t={error:h}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r},i1=function(e){var t;return((t=e?.metadata)===null||t===void 0?void 0:t.evaluationMode)==="local"},Dz=(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 kn(this,void 0,void 0,function(){return An(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 kn(this,void 0,void 0,function(){var a=this;return An(this,function(o){return this.done?[2]:(this.timeoutHandle=un.setTimeout(function(){return kn(a,void 0,void 0,function(){var l,c;return An(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})(),Iz=function(e){var t,n,r,a;if(!e)return{};var o={user:e},l=Ss();l&&(o.page={url:l.location.href});var c={};if(!e.groups)return o;try{for(var f=Aa(Object.keys(e.groups)),h=f.next();!h.done;h=f.next()){var m=h.value,g=e.groups[m];if(g.length>0&&g[0]){var v=g[0],b={group_name:v},S=(a=(r=e.group_properties)===null||r===void 0?void 0:r[m])===null||a===void 0?void 0:a[v];S&&Object.keys(S).length>0&&(b.group_properties=S),c[m]=b}}}catch(w){t={error:w}}finally{try{h&&!h.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},Un=function(e){return e==null?{}:typeof e=="string"?{key:e,value:e}:e},a1=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},Pz=(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})(),Lz=(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})(),zz=1e4,Uz=8,Bz=500,Fz=1e4,Vz=1.5,s1=6e4,Hz="https://api.lab.eu.amplitude.com",qz="https://flag.lab.eu.amplitude.com",Gz=(function(){function e(t,n){var r=this,a,o,l,c;this.engine=new Y6,this.isRunning=!1,this.apiKey=t,n=Mz(n),this.config=ct(ct(ct({},po),n),{serverUrl:n?.serverUrl||(((a=n?.serverZone)===null||a===void 0?void 0:a.toLowerCase())==="eu"?Hz:po.serverUrl),flagsServerUrl:n?.flagsServerUrl||(((o=n?.serverZone)===null||o===void 0?void 0:o.toLowerCase())==="eu"?qz:po.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<s1?s1:(l=n.flagConfigPollingIntervalMillis)!==null&&l!==void 0?l:po.flagConfigPollingIntervalMillis}),this.logger=new kz(this.config.loggerProvider||new Az,e.getLogLevel(n));var f=(c=this.config)===null||c===void 0?void 0:c.internalInstanceNameSuffix;if(this.isWebExperiment=f==="web",this.poller=new uz(function(){return r.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var h in this.config.initialVariants)this.config.initialVariants[h]=tj(this.config.initialVariants[h]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Pz(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new Lz(this.config.exposureTrackingProvider)),this.integrationManager=new wz(this.config,this);var m=new xz(this.config.httpClient||ZA);this.flagApi=new oz(this.apiKey,this.config.flagsServerUrl,m),this.evaluationApi=new sz(this.apiKey,this.config.serverUrl,m);var g,v=f?"".concat(this.config.instanceName,"-").concat(f):this.config.instanceName;this.isWebExperiment?g=new nj:g=new Lf,this.variants=jz(this.apiKey,v,g),this.flags=Nz(this.apiKey,v,g),this.fetchVariantsOptions=Rz(this.apiKey,v,g);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch{}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(t){return kn(this,void 0,void 0,function(){var n,r,a,o;return An(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 kn(this,arguments,void 0,function(t,n){var r;return t===void 0&&(t=this.user),An(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 $g?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);i1(r)||delete t[n]}return ct(ct(ct({},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=ct({},this.user.user_properties);return ct(ct({},this.user),{user_properties:n})}else return ct({},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=ct({},t.user_properties);this.user=ct(ct({},t),{user_properties:r})}else this.user=ct({},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=W6(this.flags.getAll(),t),l=Iz(a),c=this.engine.evaluate(l,o),f={};try{for(var h=Aa(Object.keys(c)),m=h.next();!m.done;m=h.next()){var g=m.value;f[g]=a1(c[g])}}catch(v){n={error:v}}finally{try{m&&!m.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}return f},e.prototype.variantAndSource=function(t,n){var r={};this.config.source===Pi.LocalStorage?r=this.localStorageVariantAndSource(t,n):this.config.source===Pi.InitialVariants&&(r=this.initialVariantsVariantAndSource(t,n));var a=this.flags.get(t);return(i1(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=pn.LocalEvaluation,f=(a=l?.metadata)===null||a===void 0?void 0:a.default;if(!Fr(l)&&!f)return{variant:Un(l),source:c,hasDefaultVariant:!1};if(f&&(o={variant:Un(l),source:c,hasDefaultVariant:!0}),!Fr(r))return{variant:Un(r),source:pn.FallbackInline,hasDefaultVariant:o.hasDefaultVariant};var h=this.config.initialVariants[t];if(!Fr(h))return{variant:Un(h),source:pn.SecondaryInitialVariants,hasDefaultVariant:o.hasDefaultVariant};var m=Un(this.config.fallbackVariant),g={variant:m,source:pn.FallbackConfig,hasDefaultVariant:o.hasDefaultVariant};return Om(m)?o:g},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(!Fr(o)&&!l)return{variant:Un(o),source:pn.LocalStorage,hasDefaultVariant:!1};if(l&&(a={variant:Un(o),source:pn.LocalStorage,hasDefaultVariant:!0}),!Fr(n))return{variant:Un(n),source:pn.FallbackInline,hasDefaultVariant:a.hasDefaultVariant};var c=this.config.initialVariants[t];if(!Fr(c))return{variant:Un(c),source:pn.SecondaryInitialVariants,hasDefaultVariant:a.hasDefaultVariant};var f=Un(this.config.fallbackVariant),h={variant:f,source:pn.FallbackConfig,hasDefaultVariant:a.hasDefaultVariant};return Om(f)?a:h},e.prototype.initialVariantsVariantAndSource=function(t,n){var r,a={},o=this.config.initialVariants[t];if(!Fr(o))return{variant:Un(o),source:pn.InitialVariants,hasDefaultVariant:!1};var l=this.variants.get(t),c=(r=l?.metadata)===null||r===void 0?void 0:r.default;if(!Fr(l)&&!c)return{variant:Un(l),source:pn.LocalStorage,hasDefaultVariant:!1};if(c&&(a={variant:Un(l),source:pn.LocalStorage,hasDefaultVariant:!0}),!Fr(n))return{variant:Un(n),source:pn.FallbackInline,hasDefaultVariant:a.hasDefaultVariant};var f=Un(this.config.fallbackVariant),h={variant:f,source:pn.FallbackConfig,hasDefaultVariant:a.hasDefaultVariant};return Om(f)?a:h},e.prototype.fetchInternal=function(t,n,r,a){return kn(this,void 0,void 0,function(){var o,l,c;return An(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,ct({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 kn(this,void 0,void 0,function(){return An(this,function(n){return this.fetchVariantsOptions.put(ct(ct({},this.fetchVariantsOptions.get()||{}),{trackingOption:t?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(t){var n=ct({},t);return delete n.cookie,n},e.prototype.doFetch=function(t,n,r){return kn(this,void 0,void 0,function(){var a,o,l,c,f,h,m;return An(this,function(g){switch(g.label){case 0:return[4,this.addContextOrWait(t)];case 1:return t=g.sent(),t=this.cleanUserPropsForFetch(t),this.logger.debug("[Experiment] Fetch variants for user: ",t),[4,this.evaluationApi.getVariants(t,ct({timeoutMillis:n},r))];case 2:a=g.sent(),o={};try{for(l=Aa(Object.keys(a)),c=l.next();!c.done;c=l.next())f=c.value,o[f]=a1(a[f])}catch(v){h={error:v}}finally{try{c&&!c.done&&(m=l.return)&&m.call(l)}finally{if(h)throw h.error}}return this.logger.debug("[Experiment] Received variants: ",o),[2,o]}})})},e.prototype.doFlags=function(){return kn(this,void 0,void 0,function(){var t,n,r;return An(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:r1,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 $g){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 kn(this,void 0,void 0,function(){var r,a,o,l,l;return An(this,function(c){r=n&&n.flagKeys?n.flagKeys:[],r.length===0&&this.variants.clear(),a=function(f){r=r.filter(function(h){return h!==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 kn(this,void 0,void 0,function(){var r=this;return An(this,function(a){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Dz(Uz,Bz,Fz,Vz),this.retriesBackoff.start(function(){return kn(r,void 0,void 0,function(){return An(this,function(o){switch(o.label){case 0:return[4,this.fetchInternal(t,zz,!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=ct(ct(ct({},r?.user_properties),a.user_properties),t?.user_properties);return ct(ct(ct(ct({library:"experiment-js-client/".concat(r1)},r),a),t),{user_properties:o})},e.prototype.addContextOrWait=function(t){return kn(this,void 0,void 0,function(){return An(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==Pi.LocalStorage)return this.variants.getAll();if(this.config.source==Pi.InitialVariants)return this.config.initialVariants},e.prototype.secondaryVariants=function(){if(this.config.source==Pi.LocalStorage)return this.config.initialVariants;if(this.config.source==Pi.InitialVariants)return this.variants.getAll()},e.prototype.exposureInternal=function(t,n){var r,a,o,l,c,f,h,m,g,v=(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(v){this.legacyExposureInternal(t,n.variant,n.source);var b={flag_key:t},S=n1(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&&(!((h=n.variant)===null||h===void 0)&&h.key?b.variant=n.variant.key:!((m=n.variant)===null||m===void 0)&&m.value&&(b.variant=n.variant.value)),w&&(b.metadata=w),this.isWebExperiment&&(b.time=Date.now()),this.isWebExperiment){var E=Ss();if(E?.location)try{var T=E.location.href;b.metadata.url=T.split("?")[0]||""}catch{}}var k=this.addContext(this.getUser());(g=this.userSessionExposureTracker)===null||g===void 0||g.track(b,k),this.integrationManager.track(b,k)}}},e.prototype.legacyExposureInternal=function(t,n,r){var a,o,l,c,f;if(this.analyticsProvider){var h=this.addContext(this.getUser()),m=Oz(h,t,n,r);n1(r)||!n?.value?(o=(a=this.analyticsProvider)===null||a===void 0?void 0:a.unsetUserProperty)===null||o===void 0||o.call(a,m):n?.value&&((c=(l=this.analyticsProvider)===null||l===void 0?void 0:l.setUserProperty)===null||c===void 0||c.call(l,m),(f=this.analyticsProvider)===null||f===void 0||f.track(m))}},e.getLogLevel=function(t){var n;return t.debug===!0?Hr.Debug:(n=t.logLevel)!==null&&n!==void 0?n:Hr.Error},e.prototype.shouldRetryFetch=function(t){return t instanceof JA?t.statusCode<400||t.statusCode>=500||t.statusCode===429:!0},e.prototype.addPlugin=function(t){t.type==="integration"&&this.integrationManager.setIntegration(t)},e})(),Kz=(function(){function e(t,n){var r,a,o;this.globalScope=Ss(),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 fz.UAParser(this.userAgent).getResult(),this.localStorage=new Lf,this.sessionStorage=new nj,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 ct({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=Aa(o.searchParams),c=l.next();!c.done;c=l.next()){var f=On(c.value,2),h=f[0],m=f[1];a[h]=jr(jr([],On((r=a[h])!==null&&r!==void 0?r:[]),!1),On(m.split(",")),!1)}}catch(g){t={error:g}}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(g,v){var b=On(v,2),S=b[0],w=b[1];return g[S]=w.length==1?w[0]:w,g},{})}},e})();un.experimentInstances={};var o1=un.experimentInstances,$z=function(e,t){var n=function(){return new mz(e,Wv.getInstance(rj(t)),1e4)};return Xz(e,t,n)},rj=function(e){return e?.instanceName||po.instanceName},Yz=function(e,t){var n=rj(t),r=t?.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)},Wz=function(e,t){return new Gz(e,ct(ct({},t),{userProvider:new Kz(t?.userProvider,e)}))},Xz=function(e,t,n){var r=Yz(e,t),a=o1[r];return a||(a=Wz(e,t),n&&a.addPlugin(n()),o1[r]=a,a)},qd=(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=$z(((r=this.config)===null||r===void 0?void 0:r.deploymentKey)||t.apiKey,this.config),[2]})})},e.pluginName="@amplitude/experiment-analytics-plugin",e})(),Qz=function(e){return new qd(e)},Jz=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Zz(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),Zz=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},eU=(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})(),ya=function(){return ya=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},ya.apply(this,arguments)};function Gd(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 l1(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 Kd=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=Gd(a),f=c.next();!f.done;f=c.next()){var h=f.value;if(h===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 m=Array.isArray(e),g=Array.isArray(t);if(m!==g)return!1;if(m&&g){for(var v=0;v<e.length;v++)if(!Kd(e[v],t[v]))return!1}else{var b=Object.keys(e).sort(),S=Object.keys(t).sort();if(!Kd(b,S))return!1;var w=!0;return Object.keys(e).forEach(function(E){Kd(e[E],t[E])||(w=!1)}),w}return!0},tU="$set",nU="$unset",rU="$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 iU=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,n=ya({},this.identity.userProperties),r=ya(ya({},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,h,m,g=r.userProperties||{};try{for(var v=Gd(Object.entries(a)),b=v.next();!b.done;b=v.next()){var S=l1(b.value,2),w=S[0],E=S[1];switch(w){case tU:try{for(var T=(c=void 0,Gd(Object.entries(E))),k=T.next();!k.done;k=T.next()){var C=l1(k.value,2),N=C[0],j=C[1];g[N]=j}}catch(L){c={error:L}}finally{try{k&&!k.done&&(f=T.return)&&f.call(T)}finally{if(c)throw c.error}}break;case nU:try{for(var _=(h=void 0,Gd(Object.keys(E))),I=_.next();!I.done;I=_.next()){var N=I.value;delete g[N]}}catch(L){h={error:L}}finally{try{I&&!I.done&&(m=_.return)&&m.call(_)}finally{if(h)throw h.error}}break;case rU:g={};break}}}catch(L){o={error:L}}finally{try{b&&!b.done&&(l=v.return)&&l.call(v)}finally{if(o)throw o.error}}return r.userProperties=g,this},commit:function(){return t.setIdentity(r),this}}},e.prototype.getIdentity=function(){return ya({},this.identity)},e.prototype.setIdentity=function(t){var n=ya({},this.identity);this.identity=ya({},t),Kd(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})(),Yl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,aU=(function(){function e(){this.identityStore=new iU,this.eventBridge=new eU,this.applicationContextProvider=new Jz}return e.getInstance=function(t){return Yl.analyticsConnectorInstances||(Yl.analyticsConnectorInstances={}),Yl.analyticsConnectorInstances[t]||(Yl.analyticsConnectorInstances[t]=new e),Yl.analyticsConnectorInstances[t]},e})(),u1=["boot"],sU="$default_instance";function oU(e){var t,n,r,a,o,l,c,f,h;let m=typeof window<"u"?window.engagement:void 0,g=!1,v={_q:(t=m?._q)!=null?t:[],_configuration:{apiKey:(r=(n=m?._configuration)==null?void 0:n.apiKey)!=null?r:"",serverUrl:(a=m?._configuration)==null?void 0:a.serverUrl,chatUrl:(o=m?._configuration)==null?void 0:o.chatUrl,mediaUrl:(l=m?._configuration)==null?void 0:l.mediaUrl,serverZone:(f=(c=m?._configuration)==null?void 0:c.serverZone)!=null?f:"US",options:{...(h=m?._configuration)==null?void 0:h.options}},init(S,w){var E,T,k,C;if(v._configuration.apiKey){console.log("Engagement SDK has already been initialized. Ignoring additional init call.");return}if(w!=null&&w.useEngagementDomain){let L=((E=w.serverZone)!=null?E:v._configuration.serverZone)==="EU",V="amplitudeengagement.com";w.serverUrl||(w.serverUrl=L?`https://gs.eu.${V}`:`https://gs.${V}`),w.chatUrl||(w.chatUrl=L?`https://houston-chat.eu.${V}`:`https://houston-chat.${V}`),w.mediaUrl||(w.mediaUrl=L?`https://engagement-static.eu.${V}`:`https://engagement-static.${V}`),w.cdnUrl||(w.cdnUrl=L?`https://cdn.eu.${V}`:`https://cdn.${V}`)}v._configuration={...v._configuration,...w,apiKey:S,options:{splitting:!0,...v._configuration.options,...w?.options}},(k=(T=v._configuration)==null?void 0:T.options)!=null&&k.logger&&v._configuration.options.logger.enable((C=v._configuration.options.logLevel)!=null?C:2);let N;if(w!=null&&w.cdnUrl)v._configuration.options.splitting?N=`${w.cdnUrl}/engagement-browser/prod/split/index.js`:N=w.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let L=v._configuration.serverZone==="EU"?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";v._configuration.options.splitting?N=`${L}/engagement-browser/prod/split/index.js`:N=`${L}/engagement-browser/prod/index.min.js.gz`}let j=null,_=()=>{if(g=!0,j&&(clearTimeout(j),j=null),v._q&&v._q.length>0)for(console.warn(`Engagement SDK failed to load within ${I}ms. Resolving pending calls gracefully.`);v._q.length>0;){let L=v._q.shift();if(!L)continue;let V=L[0],D=u1.includes(V);if(console.warn(`Engagement SDK method '${V}' still in queue (isAsyncMethod=${D}); attempting to resolve as no-op.`),D&&L[1]instanceof Function&&L[2]instanceof Function){let q=L[1];console.warn(`Engagement SDK method '${V}' resolved as no-op due to script loading failure`),q(void 0)}}};e(N,v._configuration.options.splitting?"module":void 0,w?.nonce,_);let I=1e4;j=setTimeout(()=>{_()},I)},plugin(S){let w=v.init;return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(E,T){var k;let C=(k=E.instanceName)!=null?k:sU,N=aU.getInstance(C).identityStore;w(E.apiKey,{serverZone:E.serverZone,...S,options:{logLevel:E.logLevel,logger:E.loggerProvider,...S?.options}});let j=[{track:_=>{T.track(_)}}];await window.engagement.boot({user:()=>{let _=N.getIdentity();return{user_id:T.getUserId(),device_id:T.getDeviceId(),user_properties:_.userProperties,getSessionId:T.getSessionId}},integrations:j}),N.addIdentityListener(_=>{var I,L,V,D;if(!((I=window.engagement)!=null&&I._.user)||!((L=window.engagement)!=null&&L._analytics.hasBooted)){console.warn("Engagement SDK not booted. Ignoring identity change.");return}((D=(V=window.engagement)==null?void 0:V._.user)==null?void 0:D.user_id)!==_.userId?(window.engagement.shutdown(),window.engagement.boot({user:()=>{let q=N.getIdentity();return{user_id:T.getUserId(),device_id:T.getDeviceId(),user_properties:q.userProperties,getSessionId:T.getSessionId}},integrations:j})):window.engagement._setUserProperties(_.userProperties)})},async execute(E){return window.engagement.forwardEvent(E),E}}}},b=v;return new Proxy(v,{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 k=Array.from(arguments),C=`${w}.${T}`;k.unshift(C),v._q.push(k)}}}):u1.includes(w)?function(){let E=Array.prototype.slice.call(arguments);return new Promise((T,k)=>{E.unshift(w,T,k),v._q.push(E),g&&T(void 0)})}:function(){let E=Array.prototype.slice.call(arguments);E.unshift(w),v._q.push(E)}}})}var ij=(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))(ij||{}),lU=e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(ij))window.opener.postMessage({message:e},t)};function uU(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 cU=()=>(lU("ENGAGEMENT_SNIPPET"),oU((e,t,n,r)=>uU([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,n,r))),c1=cU(),dU=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=c1),c1.plugin(e)),fU="1.0.4",hU="amplitude-ts-unified",pU=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(hU,"/").concat(fU,"-").concat((t=e.library)!==null&&t!==void 0?t:""),[2,e]})})}}},mU=(function(e){Mr(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(qd);if(n.length===0){this.config.loggerProvider.debug("".concat(qd.pluginName," plugin is not found."));return}else{if(n.length===1)return n[0].experiment;this.config.loggerProvider.debug("Multiple instances of ".concat(qd.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,pU()),[4,e.prototype.init.call(this,n,de(de({},r?.analytics),a)).promise];case 1:return l.sent(),[4,e.prototype.add.call(this,M6(de(de({},r?.sessionReplay),a))).promise];case 2:return l.sent(),[4,e.prototype.add.call(this,Qz(de(de({},r?.experiment),a))).promise];case 3:return l.sent(),o=this.plugin(Vg.pluginName),o===void 0?this.config.loggerProvider.debug("".concat(Vg.pluginName," plugin is not found.")):this._sessionReplay=o.sessionReplay,[4,e.prototype.add.call(this,dU(de(de({},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})(BL),gU=function(){var e=new mU;return{_setDiagnosticsSampleRate:it(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",kt(e),At(e,["config"])),_enableRequestBodyCompressionExperimental:it(e._enableRequestBodyCompressionExperimental.bind(e),"_enableRequestBodyCompressionExperimental",kt(e),At(e,["config"])),experiment:it(e.experiment.bind(e),"experiment",kt(e),At(e,["config"])),sessionReplay:it(e.sessionReplay.bind(e),"sessionReplay",kt(e),At(e,["config"])),initAll:it(e.initAll.bind(e),"initAll",kt(e),At(e,["config"])),init:it(e.init.bind(e),"init",kt(e),At(e,["config"])),add:it(e.add.bind(e),"add",kt(e),At(e,["config.apiKey","timeline.plugins"])),remove:it(e.remove.bind(e),"remove",kt(e),At(e,["config.apiKey","timeline.plugins"])),track:it(e.track.bind(e),"track",kt(e),At(e,["config.apiKey","timeline.queue.length"])),logEvent:it(e.logEvent.bind(e),"logEvent",kt(e),At(e,["config.apiKey","timeline.queue.length"])),identify:it(e.identify.bind(e),"identify",kt(e),At(e,["config.apiKey","timeline.queue.length"])),groupIdentify:it(e.groupIdentify.bind(e),"groupIdentify",kt(e),At(e,["config.apiKey","timeline.queue.length"])),setGroup:it(e.setGroup.bind(e),"setGroup",kt(e),At(e,["config.apiKey","timeline.queue.length"])),revenue:it(e.revenue.bind(e),"revenue",kt(e),At(e,["config.apiKey","timeline.queue.length"])),flush:it(e.flush.bind(e),"flush",kt(e),At(e,["config.apiKey","timeline.queue.length"])),getUserId:it(e.getUserId.bind(e),"getUserId",kt(e),At(e,["config","config.userId"])),setUserId:it(e.setUserId.bind(e),"setUserId",kt(e),At(e,["config","config.userId"])),getDeviceId:it(e.getDeviceId.bind(e),"getDeviceId",kt(e),At(e,["config","config.deviceId"])),setDeviceId:it(e.setDeviceId.bind(e),"setDeviceId",kt(e),At(e,["config","config.deviceId"])),reset:it(e.reset.bind(e),"reset",kt(e),At(e,["config","config.userId","config.deviceId"])),getSessionId:it(e.getSessionId.bind(e),"getSessionId",kt(e),At(e,["config"])),setSessionId:it(e.setSessionId.bind(e),"setSessionId",kt(e),At(e,["config"])),extendSession:it(e.extendSession.bind(e),"extendSession",kt(e),At(e,["config"])),setOptOut:it(e.setOptOut.bind(e),"setOptOut",kt(e),At(e,["config"])),getOptOut:it(e.getOptOut.bind(e),"getOptOut",kt(e),At(e,["config"])),setTransport:it(e.setTransport.bind(e),"setTransport",kt(e),At(e,["config"])),getIdentity:it(e.getIdentity.bind(e),"getIdentity",kt(e),At(e,["config"])),setIdentity:it(e.setIdentity.bind(e),"setIdentity",kt(e),At(e,["config","config.userId","config.deviceId"]))}};const aj=gU();var vU=aj.initAll,yU=aj.track;const bU="59c3e241b838466cd5fc0657b380fb4b",d1="__animaAmplitudeInitialized";function sj(){return typeof window>"u"?null:window}function oj(){const e=sj();!e||e[d1]||(vU(bU,{analytics:{autocapture:!0},sessionReplay:{sampleRate:1}}),e[d1]=!0)}function f1(e,t){sj()&&(oj(),yU(e,t))}const h1="anima.gateway.device-identity.v1";function Yg(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function lj(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 xU(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function Wg(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}async function uj(e){const t=await crypto.subtle.digest("SHA-256",Wg(e));return xU(new Uint8Array(t))}async function SU(){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 uj(t),publicKey:Yg(t),privateKey:Yg(n)}}async function wU(){if(typeof window>"u")throw new Error("Device identity requires a browser context.");try{const n=window.localStorage.getItem(h1);if(n){const r=JSON.parse(n);if(r?.version===1&&typeof r.deviceId=="string"&&typeof r.publicKey=="string"&&typeof r.privateKey=="string"&&await uj(lj(r.publicKey))===r.deviceId)return{deviceId:r.deviceId,publicKey:r.publicKey,privateKey:r.privateKey}}}catch{}const e=await SU(),t={version:1,deviceId:e.deviceId,publicKey:e.publicKey,privateKey:e.privateKey,createdAtMs:Date.now()};try{window.localStorage.setItem(h1,JSON.stringify(t))}catch{}return e}async function EU(e,t){if(!crypto?.subtle)throw new Error("WebCrypto is unavailable in this browser context.");const n=lj(e),r=await crypto.subtle.importKey("pkcs8",Wg(n),{name:"Ed25519"},!1,["sign"]),a=new TextEncoder().encode(t),o=await crypto.subtle.sign({name:"Ed25519"},r,Wg(a));return Yg(new Uint8Array(o))}function TU(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 vy(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 yy(e){const t=Array.isArray(e.scopes)?e.scopes:["operator.admin"],n=Array.isArray(e.caps)?e.caps:[],r=await wU(),a=Date.now(),o=TU({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 EU(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 p1="http://localhost:18789",m1="ws://localhost:18789/ws",Sd="token",cj="anima.gateway.token",CU="anima.control.settings.v1";function kU(e){if(!e)return new URLSearchParams;const t=e.startsWith("#")?e.slice(1):e;return t?new URLSearchParams(t):new URLSearchParams}function g1(e){if(!(typeof window>"u"||!e))try{window.localStorage.setItem(cj,e)}catch{}}function AU(){if(typeof window>"u")return null;try{const e=new URL(window.location.href),t=kU(e.hash),n=e.searchParams.get(Sd)?.trim()||"",r=t.get(Sd)?.trim()||"",a=n||r;if(n&&e.searchParams.delete(Sd),r){t.delete(Sd);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 jU(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(CU);if(!e)return null;const t=JSON.parse(e);return(typeof t.token=="string"?t.token.trim():"")||null}catch{return null}}function NU(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(cj)?.trim()||"";if(e)return e}catch{}return jU()}function RU(){if(typeof window>"u")return p1;const e=window.location.protocol==="https:"?"https:":"http:",t=window.location.host?.trim();return t?`${e}//${t}`:p1}function by(){if(typeof window>"u")return m1;const e=window.location.protocol==="https:"?"wss:":"ws:",t=window.location.host?.trim();return t?`${e}//${t}/ws`:m1}function _U(){const e=AU();if(e)return g1(e),e;const t=NU();return t?(g1(t),t):null}function xy(){const e=_U();if(e)return{token:e}}const OU=RU(),MU=by(),v1=3,DU=1e4,IU=2*6e4,PU=15*6e4,LU=8;function ku(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function zU(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 ls(e,t){return await new Promise((n,r)=>{const a=new WebSocket(MU);let o=!1,l=!1,c=!1,f,h="",m="",g=null;const v=window.setTimeout(()=>{w(new Error(`Gateway RPC timed out: ${e}`))},DU);function b(){window.clearTimeout(v),g!=null&&window.clearTimeout(g),a.close()}function S(k){o||(o=!0,b(),n(k))}function w(k){o||(o=!0,b(),r(k))}function E(k,C,N){a.send(JSON.stringify({type:"req",id:k,method:C,params:N??{}}))}async function T(){if(l||h||c)return;c=!0;const k=xy();if(!k){c=!1,w(new Error("Gateway token missing. Re-open this page once with ?token=ANIMA_GATEWAY_TOKEN."));return}try{const C=await yy({minProtocol:v1,maxProtocol:v1,client:{id:"webchat-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:k,nonce:f});h=ku(),E(h,"connect",C),c=!1}catch(C){c=!1,w(C instanceof Error?C:new Error(String(C)))}}a.addEventListener("open",()=>{g=window.setTimeout(()=>{g=null,T()},100)}),a.addEventListener("message",k=>{let C;try{C=JSON.parse(String(k.data))}catch{return}const N=C;if(N.type==="event"){if(N.event==="connect.challenge"){const j=vy(N.payload);j&&(f=j),T()}return}if(N.type==="res"){if(N.id===h){if(h="",c=!1,!N.ok){w(new Error(N.error?.message||"Gateway connect failed"));return}l=!0,m=ku(),E(m,e,t);return}if(N.id===m&&l){if(!N.ok){w(new Error(N.error?.message||`Gateway method failed: ${e}`));return}S(N.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 Be(e,t){return await ls(e,t)}function UU(e,t,n=Xg()){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 Xg(){return{total:0,active:0,recent:0,failed:0,latest:[]}}function BU(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function FU(e){const t=e?.trim().toLowerCase();return t?t.startsWith("subagent:")||t.includes(":subagent:"):!1}function VU(e){if(!Array.isArray(e.sessions)||e.sessions.length===0)return Xg();const t=Date.now(),n=e.sessions.filter(r=>FU(r.key)).map(r=>{const a=BU(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<=IU?c="active":o<=PU&&(c="recent"),{key:r.key?.trim()||ku(),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?Xg():{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,LU).map(r=>({key:r.key,status:r.status,updatedAt:r.updatedAt}))}}function HU(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 qU(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||ku(),mode:t.origin?.surface||t.kind||"session",status:t.abortedLastRun?"failed":"completed",prompt:`Model: ${r}`,durationMs:0,costUsd:null,savedAt:n}}):[]}const GU={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 wd(e,t){const n=(t?.method||"GET").toUpperCase();if(n==="GET"&&e==="/api/status"){const[r,a,o]=await Promise.all([ls("status",{}),ls("last-heartbeat",{}).catch(()=>null),ls("sessions.list",{limit:200,includeGlobal:!0,includeUnknown:!0}).catch(()=>({sessions:[]}))]),l=VU(o);return UU(r,a,l)}if(n==="GET"&&e==="/api/identity"){const r=await ls("agent.identity.get",{sessionKey:"main"}).catch(()=>({name:"Assistant",avatar:"A",agentId:"main"}));return HU(r)}if(n==="GET"&&e==="/api/sessions"){const r=await ls("sessions.list",{limit:50}).catch(()=>({sessions:[]}));return qU(r)}if(n==="GET"&&e==="/api/queue")return[];if(n==="POST"&&e==="/api/queue"){const r=zU(t),a=typeof r.prompt=="string"?r.prompt.trim():"",o=ku();return a&&await ls("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 GU;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 zf(e,t){try{const n=new Headers(t?.headers??{});n.has("Content-Type")||n.set("Content-Type","application/json");const r=await fetch(`${OU}${e}`,{...t,headers:n});if(!r.ok){if(e.startsWith("/api/"))return await wd(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 wd(e,t);try{return JSON.parse(o)}catch{return await wd(e,t)}}return JSON.parse(o)}catch(n){if(e.startsWith("/api/"))return await wd(e,t);throw n}}async function dj(){return zf("/api/status")}async function KU(){return zf("/api/identity")}async function $U(){return zf("/api/sessions")}async function YU(e,t="normal"){return zf("/api/queue",{method:"POST",body:JSON.stringify({prompt:e,priority:t,source:"web"})})}async function fj(){return await Be("config.get",{})}async function WU(){return await Be("config.schema",{})}async function hj(e,t,n=!1){await Be(n?"config.apply":"config.set",{raw:e,baseHash:t})}async function Qg(e,t){await Be("config.patch",{raw:e,baseHash:t})}async function pj(){return await Be("anima.runtime.get",{})}async function XU(e){await Be("anima.runtime.set-working-mode",{mode:e})}async function QU(e,t,n){const r=await Be("anima.memory.list",{kind:e,...t?{query:t}:{},limit:n});return Array.isArray(r.entries)?r.entries:[]}async function JU(){return await Be("anima.mission.get",{})}async function ZU(e,t){return(await Be("anima.mission.set",{fileName:e,content:t})).file}async function xa(e){return(await Be("anima.mission.patch",{patch:e})).state}async function eB(e){return(await Be("anima.mission.connect-repo",{...e})).repo}async function tB(e){await Be("anima.trust.set",{people:e})}async function nB(e){await Be("anima.mission.import",e)}async function mj(){return await Be("anima.registration.status",{})}async function gj(e){await Be("anima.registration.set-token",{token:e})}async function vj(e){await Be("anima.registration.register-invite",e)}async function Jg(e){await Be("set-heartbeats",{enabled:e})}async function yj(e,t="next-heartbeat"){await Be("wake",{text:e,mode:t})}async function y1(e){return await Be("logs.tail",{...typeof e=="number"?{cursor:e}:{},limit:160,maxBytes:12e4})}async function bj(){return await Be("voicewake.get",{})}async function xj(e){return await Be("voicewake.set",{triggers:e})}async function Sj(){return await Be("anima.providers.get",{})}async function Zg(e){await Be("anima.providers.set",{providers:e})}async function wj(e,t){await Be("anima.providers.rotate",{autoRotation:e,...t?{rotationStrategy:t}:{}})}async function rB(){const e=await Be("org.list",{});return Array.isArray(e.orgs)?e.orgs:[]}async function iB(e){return await Be("org.get",{orgId:e})}async function aB(e){return await Be("org.create",e)}async function sB(e,t){return(await Be("org.addMember",{orgId:e,...t})).member}async function oB(e,t,n){return(await Be("org.updateMember",{orgId:e,memberId:t,...n})).member}async function lB(e,t){await Be("org.removeMember",{orgId:e,memberId:t})}async function uB(e){const t=await Be("org.hierarchy",{orgId:e});return Array.isArray(t.hierarchy)?t.hierarchy:[]}async function cB(e){return Be("org.join",e)}async function dB(e){return Be("org.validateInvite",e)}async function fB(e,t){return(await Be("boardroom.listSessions",{orgId:e,status:t})).sessions??[]}async function hB(e){return(await Be("boardroom.createSession",e)).session}async function pB(e,t){return(await Be("boardroom.startSession",{sessionId:e,chairId:t})).session}async function mB(e){return(await Be("boardroom.concludeSession",{sessionId:e})).session}async function gB(e,t){return(await Be("boardroom.listProposals",{orgId:e,status:t})).proposals??[]}async function vB(e){return(await Be("boardroom.createProposal",e)).proposal}async function yB(){const e=await Be("ico.metrics.get",{});return{generatedAt:typeof e.generatedAt=="string"?e.generatedAt:new Date().toISOString(),project:e.project??null,metrics:Array.isArray(e.metrics)?e.metrics:[]}}async function bB(){const e=await Be("impact.footprint.get",{});return{generatedAt:typeof e.generatedAt=="string"?e.generatedAt:new Date().toISOString(),metrics:Array.isArray(e.metrics)?e.metrics:[]}}async function xB(){return(await Be("steer.get",{})).active}async function SB(e,t="user"){return Be("steer.set",{text:e,setBy:t})}async function wB(){return Be("steer.clear",{})}async function EB(){const e=await Be("steer.history",{});return Array.isArray(e.history)?e.history:[]}async function TB(){return(await Be("ego.get",{})).ego}async function CB(e){return(await Be("ego.updateSelf",e)).selfConcept}function kB(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const AB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NB={};function b1(e,t){return(NB.jsx?jB:AB).test(e)}const RB=/[ \t\n\f\r]/g;function _B(e){return typeof e=="object"?e.type==="text"?x1(e.value):!1:x1(e)}function x1(e){return e.replace(RB,"")===""}class Bu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bu.prototype.normal={};Bu.prototype.property={};Bu.prototype.space=void 0;function Ej(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Bu(n,r,t)}function ev(e){return e.toLowerCase()}class Jn{constructor(t,n){this.attribute=n,this.property=t}}Jn.prototype.attribute="";Jn.prototype.booleanish=!1;Jn.prototype.boolean=!1;Jn.prototype.commaOrSpaceSeparated=!1;Jn.prototype.commaSeparated=!1;Jn.prototype.defined=!1;Jn.prototype.mustUseProperty=!1;Jn.prototype.number=!1;Jn.prototype.overloadedBoolean=!1;Jn.prototype.property="";Jn.prototype.spaceSeparated=!1;Jn.prototype.space=void 0;let OB=0;const $e=ws(),on=ws(),tv=ws(),be=ws(),Mt=ws(),Eo=ws(),lr=ws();function ws(){return 2**++OB}const nv=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:on,commaOrSpaceSeparated:lr,commaSeparated:Eo,number:be,overloadedBoolean:tv,spaceSeparated:Mt},Symbol.toStringTag,{value:"Module"})),Mm=Object.keys(nv);class Sy extends Jn{constructor(t,n,r,a){let o=-1;if(super(t,n),S1(this,"space",a),typeof r=="number")for(;++o<Mm.length;){const l=Mm[o];S1(this,Mm[o],(r&nv[l])===nv[l])}}}Sy.prototype.defined=!0;function S1(e,t,n){n&&(e[t]=n)}function Uo(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new Sy(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[ev(r)]=r,n[ev(o.attribute)]=r}return new Bu(t,n,e.space)}const Tj=Uo({properties:{ariaActiveDescendant:null,ariaAtomic:on,ariaAutoComplete:null,ariaBusy:on,ariaChecked:on,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:Mt,ariaCurrent:null,ariaDescribedBy:Mt,ariaDetails:null,ariaDisabled:on,ariaDropEffect:Mt,ariaErrorMessage:null,ariaExpanded:on,ariaFlowTo:Mt,ariaGrabbed:on,ariaHasPopup:null,ariaHidden:on,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Mt,ariaLevel:be,ariaLive:null,ariaModal:on,ariaMultiLine:on,ariaMultiSelectable:on,ariaOrientation:null,ariaOwns:Mt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:on,ariaReadOnly:on,ariaRelevant:null,ariaRequired:on,ariaRoleDescription:Mt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:on,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 Cj(e,t){return t in e?e[t]:t}function kj(e,t){return Cj(e,t.toLowerCase())}const MB=Uo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Eo,acceptCharset:Mt,accessKey:Mt,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:Mt,autoFocus:$e,autoPlay:$e,blocking:Mt,capture:null,charSet:null,checked:$e,cite:null,className:Mt,cols:be,colSpan:null,content:null,contentEditable:on,controls:$e,controlsList:Mt,coords:be|Eo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:tv,draggable:on,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:Mt,height:be,hidden:tv,high:be,href:null,hrefLang:null,htmlFor:Mt,httpEquiv:Mt,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:Mt,itemRef:Mt,itemScope:$e,itemType:Mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:be,pattern:null,ping:Mt,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:Mt,required:$e,reversed:$e,rows:be,rowSpan:be,sandbox:Mt,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:on,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:$e,useMap:null,value:on,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Mt,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:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:on,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:$e,disableRemotePlayback:$e,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:kj}),DB=Uo({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:lr,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:Mt,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:$e,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:Eo,g2:Eo,glyphName:Eo,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:lr,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:Mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lr,rev:lr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lr,requiredFeatures:lr,requiredFonts:lr,requiredFormats:lr,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:lr,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:lr,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:lr,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:Cj}),Aj=Uo({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()}}),jj=Uo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kj}),Nj=Uo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),IB={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"},PB=/[A-Z]/g,w1=/-[a-z]/g,LB=/^data[-\w.:]+$/i;function zB(e,t){const n=ev(t);let r=t,a=Jn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&LB.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(w1,BB);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!w1.test(o)){let l=o.replace(PB,UB);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=Sy}return new a(r,t)}function UB(e){return"-"+e.toLowerCase()}function BB(e){return e.charAt(1).toUpperCase()}const FB=Ej([Tj,MB,Aj,jj,Nj],"html"),wy=Ej([Tj,DB,Aj,jj,Nj],"svg");function VB(e){return e.join(" ").trim()}var ao={},Dm,E1;function HB(){if(E1)return Dm;E1=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
+ `,h="/",m="*",g="",v="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 k=1,C=1;function N(ce){var J=ce.match(t);J&&(k+=J.length);var B=ce.lastIndexOf(f);C=~B?ce.length-B:C+ce.length}function j(){var ce={line:k,column:C};return function(J){return J.position=new _(ce),V(),J}}function _(ce){this.start=ce,this.end={line:k,column:C},this.source=T.source}_.prototype.content=E;function I(ce){var J=new Error(T.source+":"+k+":"+C+": "+ce);if(J.reason=ce,J.filename=T.source,J.line=k,J.column=C,J.source=E,!T.silent)throw J}function L(ce){var J=ce.exec(E);if(J){var B=J[0];return N(B),E=E.slice(B.length),J}}function V(){L(n)}function D(ce){var J;for(ce=ce||[];J=q();)J!==!1&&ce.push(J);return ce}function q(){var ce=j();if(!(h!=E.charAt(0)||m!=E.charAt(1))){for(var J=2;g!=E.charAt(J)&&(m!=E.charAt(J)||h!=E.charAt(J+1));)++J;if(J+=2,g===E.charAt(J-1))return I("End of comment missing");var B=E.slice(2,J-2);return C+=2,N(B),E=E.slice(J),C+=2,ce({type:v,comment:B})}}function G(){var ce=j(),J=L(r);if(J){if(q(),!L(a))return I("property missing ':'");var B=L(o),X=ce({type:b,property:w(J[0].replace(e,g)),value:B?w(B[0].replace(e,g)):g});return L(l),X}}function Z(){var ce=[];D(ce);for(var J;J=G();)J!==!1&&(ce.push(J),D(ce));return ce}return V(),Z()}function w(E){return E?E.replace(c,g):g}return Dm=S,Dm}var T1;function qB(){if(T1)return ao;T1=1;var e=ao&&ao.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ao,"__esModule",{value:!0}),ao.default=n;const t=e(HB());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:h,value:m}=f;c?a(h,m,f):m&&(o=o||{},o[h]=m)}),o}return ao}var Wl={},C1;function GB(){if(C1)return Wl;C1=1,Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},l=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},f=function(h,m){return m===void 0&&(m={}),o(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(a,c):h=h.replace(r,c),h.replace(t,l))};return Wl.camelCase=f,Wl}var Xl,k1;function KB(){if(k1)return Xl;k1=1;var e=Xl&&Xl.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(qB()),n=GB();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,Xl=r,Xl}var $B=KB();const YB=Oo($B),Rj=_j("end"),Ey=_j("start");function _j(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 WB(e){const t=Ey(e),n=Rj(e);if(t&&n)return{start:t,end:n}}function pu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?A1(e.position):"start"in e||"end"in e?A1(e):"line"in e||"column"in e?rv(e):""}function rv(e){return j1(e&&e.line)+":"+j1(e&&e.column)}function A1(e){return rv(e&&e.start)+"-"+rv(e&&e.end)}function j1(e){return e&&typeof e=="number"?e:1}class Pn 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=pu(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}}Pn.prototype.file="";Pn.prototype.name="";Pn.prototype.reason="";Pn.prototype.message="";Pn.prototype.stack="";Pn.prototype.column=void 0;Pn.prototype.line=void 0;Pn.prototype.ancestors=void 0;Pn.prototype.cause=void 0;Pn.prototype.fatal=void 0;Pn.prototype.place=void 0;Pn.prototype.ruleId=void 0;Pn.prototype.source=void 0;const Ty={}.hasOwnProperty,XB=new Map,QB=/[A-Z]/g,JB=new Set(["table","tbody","thead","tfoot","tr"]),ZB=new Set(["td","th"]),Oj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e8(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=l8(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=o8(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"?wy:FB,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Mj(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function Mj(e,t,n){if(t.type==="element")return t8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return n8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return i8(e,t,n);if(t.type==="mdxjsEsm")return r8(e,t);if(t.type==="root")return a8(e,t,n);if(t.type==="text")return s8(e,t)}function t8(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=wy,e.schema=a),e.ancestors.push(t);const o=Ij(e,t.tagName,!1),l=u8(e,t);let c=ky(e,t);return JB.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!_B(f):!0})),Dj(e,l,o,t),Cy(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function n8(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)}Au(e,t.position)}function r8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Au(e,t.position)}function i8(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=wy,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ij(e,t.name,!0),l=c8(e,t),c=ky(e,t);return Dj(e,l,o,t),Cy(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function a8(e,t,n){const r={};return Cy(r,ky(e,t)),e.create(t,e.Fragment,r,n)}function s8(e,t){return t.value}function Dj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Cy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function o8(e,t,n){return r;function r(a,o,l,c){const h=Array.isArray(l.children)?n:t;return c?h(o,l,c):h(o,l)}}function l8(e,t){return n;function n(r,a,o,l){const c=Array.isArray(o.children),f=Ey(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 u8(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Ty.call(t.properties,a)){const o=d8(e,a,t.properties[a]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&ZB.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 c8(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 Au(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 Au(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function ky(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:XB;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 h=a.get(f)||0;l=f+"-"+h,a.set(f,h+1)}}const c=Mj(e,o,l);c!==void 0&&n.push(c)}return n}function d8(e,t,n){const r=zB(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kB(n):VB(n)),r.property==="style"){let a=typeof n=="object"?n:f8(e,String(n));return e.stylePropertyNameCase==="css"&&(a=h8(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?IB[r.property]||r.property:r.attribute,n]}}function f8(e,t){try{return YB(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Pn("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=Oj+"#cannot-parse-style-attribute",a}}function Ij(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=b1(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=b1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Ty.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Au(e)}function Au(e,t){const n=new Pn("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=Oj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function h8(e){const t={};let n;for(n in e)Ty.call(e,n)&&(t[p8(n)]=e[n]);return t}function p8(e){let t=e.replace(QB,m8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function m8(e){return"-"+e.toLowerCase()}const Im={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"]},g8={};function Ay(e,t){const n=g8,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Pj(e,r,a)}function Pj(e,t,n){if(v8(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 N1(e.children,t,n)}return Array.isArray(e)?N1(e,t,n):""}function N1(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Pj(e[a],t,n);return r.join("")}function v8(e){return!!(e&&typeof e=="object")}const R1=document.createElement("i");function jy(e){const t="&"+e+";";R1.innerHTML=t;const n=R1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function fr(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 Ar(e,t){return e.length>0?(fr(e,e.length,0,t),e):t}const _1={}.hasOwnProperty;function Lj(e){const t={};let n=-1;for(;++n<e.length;)y8(t,e[n]);return t}function y8(e,t){let n;for(n in t){const a=(_1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){_1.call(a,l)||(a[l]=[]);const c=o[l];b8(a[l],Array.isArray(c)?c:c?[c]:[])}}}function b8(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);fr(e,0,0,r)}function zj(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 qr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Bn=Ra(/[A-Za-z]/),Mn=Ra(/[\dA-Za-z]/),x8=Ra(/[#-'*+\--9=?A-Z^-~]/);function ff(e){return e!==null&&(e<32||e===127)}const iv=Ra(/\d/),S8=Ra(/[\dA-Fa-f]/),w8=Ra(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function Rt(e){return e!==null&&(e<0||e===32)}function Ze(e){return e===-2||e===-1||e===32}const Uf=Ra(new RegExp("\\p{P}|\\p{S}","u")),bs=Ra(/\s/);function Ra(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Bo(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&Mn(e.charCodeAt(n+1))&&Mn(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 at(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return Ze(f)?(e.enter(n),c(f)):t(f)}function c(f){return Ze(f)&&o++<a?(e.consume(f),c):(e.exit(n),t(f))}}const E8={tokenize:T8};function T8(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"),at(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 C8={tokenize:k8},O1={tokenize:A8};function k8(e){const t=this,n=[];let r=0,a,o,l;return c;function c(C){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,f,h)(C)}return h(C)}function f(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&k();const N=t.events.length;let j=N,_;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){_=t.events[j][1].end;break}T(r);let I=N;for(;I<t.events.length;)t.events[I][1].end={..._},I++;return fr(t.events,j+1,0,t.events.slice(N)),t.events.length=I,h(C)}return c(C)}function h(C){if(r===n.length){if(!a)return v(C);if(a.currentConstruct&&a.currentConstruct.concrete)return S(C);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(O1,m,g)(C)}function m(C){return a&&k(),T(r),v(C)}function g(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,S(C)}function v(C){return t.containerState={},e.attempt(O1,b,S)(C)}function b(C){return r++,n.push([t.currentConstruct,t.containerState]),v(C)}function S(C){if(C===null){a&&k(),T(0),e.consume(C);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),w(C)}function w(C){if(C===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(C);return}return De(C)?(e.consume(C),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(C),w)}function E(C,N){const j=t.sliceStream(C);if(N&&j.push(null),C.previous=o,o&&(o.next=C),o=C,a.defineSkip(C.start),a.write(j),t.parser.lazy[C.start.line]){let _=a.events.length;for(;_--;)if(a.events[_][1].start.offset<l&&(!a.events[_][1].end||a.events[_][1].end.offset>l))return;const I=t.events.length;let L=I,V,D;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(V){D=t.events[L][1].end;break}V=!0}for(T(r),_=I;_<t.events.length;)t.events[_][1].end={...D},_++;fr(t.events,L+1,0,t.events.slice(I)),t.events.length=_}}function T(C){let N=n.length;for(;N-- >C;){const j=n[N];t.containerState=j[1],j[0].exit.call(t,e)}n.length=C}function k(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function A8(e,t,n){return at(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ro(e){if(e===null||Rt(e)||bs(e))return 1;if(Uf(e))return 2}function Bf(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 av={name:"attention",resolveAll:j8,tokenize:N8};function j8(e,t){let n=-1,r,a,o,l,c,f,h,m;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 g={...e[r][1].end},v={...e[n][1].start};M1(g,-f),M1(v,f),l={type:f>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},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},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Ar(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Ar(h,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),h=Ar(h,Bf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Ar(h,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=Ar(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,fr(e,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function N8(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Ro(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 h=e.exit("attentionSequence"),m=Ro(f),g=!m||m===2&&a||n.includes(f),v=!a||a===2&&m||n.includes(r);return h._open=!!(o===42?g:g&&(a||!v)),h._close=!!(o===42?v:v&&(m||!g)),t(f)}}function M1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R8={name:"autolink",tokenize:_8};function _8(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 Bn(b)?(e.consume(b),l):b===64?n(b):h(b)}function l(b){return b===43||b===45||b===46||Mn(b)?(r=1,c(b)):h(b)}function c(b){return b===58?(e.consume(b),r=0,f):(b===43||b===45||b===46||Mn(b))&&r++<32?(e.consume(b),c):(r=0,h(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||ff(b)?n(b):(e.consume(b),f)}function h(b){return b===64?(e.consume(b),m):x8(b)?(e.consume(b),h):n(b)}function m(b){return Mn(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),r=0,m):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):v(b)}function v(b){if((b===45||Mn(b))&&r++<63){const S=b===45?v:g;return e.consume(b),S}return n(b)}}const Fu={partial:!0,tokenize:O8};function O8(e,t,n){return r;function r(o){return Ze(o)?at(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||De(o)?t(o):n(o)}}const Uj={continuation:{tokenize:D8},exit:I8,name:"blockQuote",tokenize:M8};function M8(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 Ze(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function D8(e,t,n){const r=this;return a;function a(l){return Ze(l)?at(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Uj,t,n)(l)}}function I8(e){e.exit("blockQuote")}const Bj={name:"characterEscape",tokenize:P8};function P8(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 w8(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Fj={name:"characterReference",tokenize:L8};function L8(e,t,n){const r=this;let a=0,o,l;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),f}function f(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,l=Mn,m(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=S8,m):(e.enter("characterReferenceValue"),o=7,l=iv,m(g))}function m(g){if(g===59&&a){const v=e.exit("characterReferenceValue");return l===Mn&&!jy(r.sliceSerialize(v))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&a++<o?(e.consume(g),m):n(g)}}const D1={partial:!0,tokenize:U8},I1={concrete:!0,name:"codeFenced",tokenize:z8};function z8(e,t,n){const r=this,a={partial:!0,tokenize:j};let o=0,l=0,c;return f;function f(_){return h(_)}function h(_){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,c=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(_)}function m(_){return _===c?(l++,e.consume(_),m):l<3?n(_):(e.exit("codeFencedFenceSequence"),Ze(_)?at(e,g,"whitespace")(_):g(_))}function g(_){return _===null||De(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(D1,w,N)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===null||De(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(_)):Ze(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,b,"whitespace")(_)):_===96&&_===c?n(_):(e.consume(_),v)}function b(_){return _===null||De(_)?g(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(_))}function S(_){return _===null||De(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(_)):_===96&&_===c?n(_):(e.consume(_),S)}function w(_){return e.attempt(a,N,E)(_)}function E(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),T}function T(_){return o>0&&Ze(_)?at(e,k,"linePrefix",o+1)(_):k(_)}function k(_){return _===null||De(_)?e.check(D1,w,N)(_):(e.enter("codeFlowValue"),C(_))}function C(_){return _===null||De(_)?(e.exit("codeFlowValue"),k(_)):(e.consume(_),C)}function N(_){return e.exit("codeFenced"),t(_)}function j(_,I,L){let V=0;return D;function D(J){return _.enter("lineEnding"),_.consume(J),_.exit("lineEnding"),q}function q(J){return _.enter("codeFencedFence"),Ze(J)?at(_,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):G(J)}function G(J){return J===c?(_.enter("codeFencedFenceSequence"),Z(J)):L(J)}function Z(J){return J===c?(V++,_.consume(J),Z):V>=l?(_.exit("codeFencedFenceSequence"),Ze(J)?at(_,ce,"whitespace")(J):ce(J)):L(J)}function ce(J){return J===null||De(J)?(_.exit("codeFencedFence"),I(J)):L(J)}}}function U8(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 Pm={name:"codeIndented",tokenize:F8},B8={partial:!0,tokenize:V8};function F8(e,t,n){const r=this;return a;function a(h){return e.enter("codeIndented"),at(e,o,"linePrefix",5)(h)}function o(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?f(h):De(h)?e.attempt(B8,l,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||De(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}function V8(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):at(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 H8={name:"codeText",previous:G8,resolve:q8,tokenize:K8};function q8(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 G8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function K8(e,t,n){let r=0,a,o;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),f(g))}function f(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),f):g===96?(o=e.enter("codeTextSequence"),a=0,m(g)):De(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||De(g)?(e.exit("codeTextData"),f(g)):(e.consume(g),h)}function m(g){return g===96?(e.consume(g),a++,m):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class $8{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&&Ql(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),Ql(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ql(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);Ql(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ql(this.left,n.reverse())}}}function Ql(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 Vj(e){const t={};let n=-1,r,a,o,l,c,f,h;const m=new $8(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.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,Y8(m,n)),n=t[n],h=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(m.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={...m.get(a)[1].start},c=m.slice(a,n),c.unshift(r),m.splice(a,n-a+1,c))}}return fr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function Y8(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=[],h={};let m,g,v=-1,b=n,S=0,w=0;const E=[w];for(;b;){for(;e.get(++a)[1]!==b;);o.push(a),b._tokenizer||(m=r.sliceStream(b),b.next||m.push(null),g&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++v<c.length;)c[v][0]==="exit"&&c[v-1][0]==="enter"&&c[v][1].type===c[v-1][1].type&&c[v][1].start.line!==c[v][1].end.line&&(w=v+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(),v=E.length;v--;){const T=c.slice(E[v],E[v+1]),k=o.pop();f.push([k,k+T.length-1]),e.splice(k,2,T)}for(f.reverse(),v=-1;++v<f.length;)h[S+f[v][0]]=S+f[v][1],S+=f[v][1]-f[v][0]-1;return h}const W8={resolve:Q8,tokenize:J8},X8={partial:!0,tokenize:Z8};function Q8(e){return Vj(e),e}function J8(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(X8,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 Z8(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),at(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 Hj(e,t,n,r,a,o,l,c,f){const h=f||Number.POSITIVE_INFINITY;let m=0;return g;function g(T){return T===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(T),e.exit(o),v):T===null||T===32||T===41||ff(T)?n(T):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(T))}function v(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),v(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!m&&(T===null||T===41||Rt(T))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(T)):m<h&&T===40?(e.consume(T),m++,w):T===41?(e.consume(T),m--,w):T===null||T===32||T===40||ff(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 qj(e,t,n,r,a,o){const l=this;let c=0,f;return h;function h(b){return e.enter(r),e.enter(a),e.consume(b),e.exit(a),e.enter(o),m}function m(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"),m):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||De(b)||c++>999?(e.exit("chunkString"),m(b)):(e.consume(b),f||(f=!Ze(b)),b===92?v:g)}function v(b){return b===91||b===92||b===93?(e.consume(b),c++,g):g(b)}}function Gj(e,t,n,r,a,o){let l;return c;function c(v){return v===34||v===39||v===40?(e.enter(r),e.enter(a),e.consume(v),e.exit(a),l=v===40?41:v,f):n(v)}function f(v){return v===l?(e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):(e.enter(o),h(v))}function h(v){return v===l?(e.exit(o),f(l)):v===null?n(v):De(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),at(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===l||v===null||De(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?g:m)}function g(v){return v===l||v===92?(e.consume(v),m):m(v)}}function mu(e,t){let n;return r;function r(a){return De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ze(a)?at(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const e5={name:"definition",tokenize:n5},t5={partial:!0,tokenize:r5};function n5(e,t,n){const r=this;let a;return o;function o(b){return e.enter("definition"),l(b)}function l(b){return qj.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function c(b){return a=qr(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 Rt(b)?mu(e,h)(b):h(b)}function h(b){return Hj(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(t5,g,g)(b)}function g(b){return Ze(b)?at(e,v,"whitespace")(b):v(b)}function v(b){return b===null||De(b)?(e.exit("definition"),r.parser.defined.push(a),t(b)):n(b)}}function r5(e,t,n){return r;function r(c){return Rt(c)?mu(e,a)(c):n(c)}function a(c){return Gj(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Ze(c)?at(e,l,"whitespace")(c):l(c)}function l(c){return c===null||De(c)?t(c):n(c)}}const i5={name:"hardBreakEscape",tokenize:a5};function a5(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 s5={name:"headingAtx",resolve:o5,tokenize:l5};function o5(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"},fr(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function l5(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||Rt(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||De(m)?(e.exit("atxHeading"),t(m)):Ze(m)?at(e,c,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||Rt(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const u5=["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"],P1=["pre","script","style","textarea"],c5={concrete:!0,name:"htmlFlow",resolveTo:h5,tokenize:p5},d5={partial:!0,tokenize:g5},f5={partial:!0,tokenize:m5};function h5(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 p5(e,t,n){const r=this;let a,o,l,c,f;return h;function h(P){return m(P)}function m(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),g}function g(P){return P===33?(e.consume(P),v):P===47?(e.consume(P),o=!0,w):P===63?(e.consume(P),a=3,r.interrupt?t:M):Bn(P)?(e.consume(P),l=String.fromCharCode(P),E):n(P)}function v(P){return P===45?(e.consume(P),a=2,b):P===91?(e.consume(P),a=5,c=0,S):Bn(P)?(e.consume(P),a=4,r.interrupt?t:M):n(P)}function b(P){return P===45?(e.consume(P),r.interrupt?t:M):n(P)}function S(P){const ue="CDATA[";return P===ue.charCodeAt(c++)?(e.consume(P),c===ue.length?r.interrupt?t:G:S):n(P)}function w(P){return Bn(P)?(e.consume(P),l=String.fromCharCode(P),E):n(P)}function E(P){if(P===null||P===47||P===62||Rt(P)){const ue=P===47,me=l.toLowerCase();return!ue&&!o&&P1.includes(me)?(a=1,r.interrupt?t(P):G(P)):u5.includes(l.toLowerCase())?(a=6,ue?(e.consume(P),T):r.interrupt?t(P):G(P)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):o?k(P):C(P))}return P===45||Mn(P)?(e.consume(P),l+=String.fromCharCode(P),E):n(P)}function T(P){return P===62?(e.consume(P),r.interrupt?t:G):n(P)}function k(P){return Ze(P)?(e.consume(P),k):D(P)}function C(P){return P===47?(e.consume(P),D):P===58||P===95||Bn(P)?(e.consume(P),N):Ze(P)?(e.consume(P),C):D(P)}function N(P){return P===45||P===46||P===58||P===95||Mn(P)?(e.consume(P),N):j(P)}function j(P){return P===61?(e.consume(P),_):Ze(P)?(e.consume(P),j):C(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),f=P,I):Ze(P)?(e.consume(P),_):L(P)}function I(P){return P===f?(e.consume(P),f=null,V):P===null||De(P)?n(P):(e.consume(P),I)}function L(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Rt(P)?j(P):(e.consume(P),L)}function V(P){return P===47||P===62||Ze(P)?C(P):n(P)}function D(P){return P===62?(e.consume(P),q):n(P)}function q(P){return P===null||De(P)?G(P):Ze(P)?(e.consume(P),q):n(P)}function G(P){return P===45&&a===2?(e.consume(P),B):P===60&&a===1?(e.consume(P),X):P===62&&a===4?(e.consume(P),U):P===63&&a===3?(e.consume(P),M):P===93&&a===5?(e.consume(P),ye):De(P)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(d5,ee,Z)(P)):P===null||De(P)?(e.exit("htmlFlowData"),Z(P)):(e.consume(P),G)}function Z(P){return e.check(f5,ce,ee)(P)}function ce(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),J}function J(P){return P===null||De(P)?Z(P):(e.enter("htmlFlowData"),G(P))}function B(P){return P===45?(e.consume(P),M):G(P)}function X(P){return P===47?(e.consume(P),l="",le):G(P)}function le(P){if(P===62){const ue=l.toLowerCase();return P1.includes(ue)?(e.consume(P),U):G(P)}return Bn(P)&&l.length<8?(e.consume(P),l+=String.fromCharCode(P),le):G(P)}function ye(P){return P===93?(e.consume(P),M):G(P)}function M(P){return P===62?(e.consume(P),U):P===45&&a===2?(e.consume(P),M):G(P)}function U(P){return P===null||De(P)?(e.exit("htmlFlowData"),ee(P)):(e.consume(P),U)}function ee(P){return e.exit("htmlFlow"),t(P)}}function m5(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 g5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Fu,t,n)}}const v5={name:"htmlText",tokenize:y5};function y5(e,t,n){const r=this;let a,o,l;return c;function c(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),f}function f(M){return M===33?(e.consume(M),h):M===47?(e.consume(M),j):M===63?(e.consume(M),C):Bn(M)?(e.consume(M),L):n(M)}function h(M){return M===45?(e.consume(M),m):M===91?(e.consume(M),o=0,S):Bn(M)?(e.consume(M),k):n(M)}function m(M){return M===45?(e.consume(M),b):n(M)}function g(M){return M===null?n(M):M===45?(e.consume(M),v):De(M)?(l=g,X(M)):(e.consume(M),g)}function v(M){return M===45?(e.consume(M),b):g(M)}function b(M){return M===62?B(M):M===45?v(M):g(M)}function S(M){const U="CDATA[";return M===U.charCodeAt(o++)?(e.consume(M),o===U.length?w:S):n(M)}function w(M){return M===null?n(M):M===93?(e.consume(M),E):De(M)?(l=w,X(M)):(e.consume(M),w)}function E(M){return M===93?(e.consume(M),T):w(M)}function T(M){return M===62?B(M):M===93?(e.consume(M),T):w(M)}function k(M){return M===null||M===62?B(M):De(M)?(l=k,X(M)):(e.consume(M),k)}function C(M){return M===null?n(M):M===63?(e.consume(M),N):De(M)?(l=C,X(M)):(e.consume(M),C)}function N(M){return M===62?B(M):C(M)}function j(M){return Bn(M)?(e.consume(M),_):n(M)}function _(M){return M===45||Mn(M)?(e.consume(M),_):I(M)}function I(M){return De(M)?(l=I,X(M)):Ze(M)?(e.consume(M),I):B(M)}function L(M){return M===45||Mn(M)?(e.consume(M),L):M===47||M===62||Rt(M)?V(M):n(M)}function V(M){return M===47?(e.consume(M),B):M===58||M===95||Bn(M)?(e.consume(M),D):De(M)?(l=V,X(M)):Ze(M)?(e.consume(M),V):B(M)}function D(M){return M===45||M===46||M===58||M===95||Mn(M)?(e.consume(M),D):q(M)}function q(M){return M===61?(e.consume(M),G):De(M)?(l=q,X(M)):Ze(M)?(e.consume(M),q):V(M)}function G(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),a=M,Z):De(M)?(l=G,X(M)):Ze(M)?(e.consume(M),G):(e.consume(M),ce)}function Z(M){return M===a?(e.consume(M),a=void 0,J):M===null?n(M):De(M)?(l=Z,X(M)):(e.consume(M),Z)}function ce(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Rt(M)?V(M):(e.consume(M),ce)}function J(M){return M===47||M===62||Rt(M)?V(M):n(M)}function B(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),le}function le(M){return Ze(M)?at(e,ye,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):ye(M)}function ye(M){return e.enter("htmlTextData"),l(M)}}const Ny={name:"labelEnd",resolveAll:w5,resolveTo:E5,tokenize:T5},b5={tokenize:C5},x5={tokenize:k5},S5={tokenize:A5};function w5(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&&fr(e,0,e.length,n),e}function E5(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}},h={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",h,t]],c=Ar(c,e.slice(o+1,o+r+3)),c=Ar(c,[["enter",m,t]]),c=Ar(c,Bf(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=Ar(c,[["exit",m,t],e[l-2],e[l-1],["exit",h,t]]),c=Ar(c,e.slice(l+1)),c=Ar(c,[["exit",f,t]]),fr(e,o,e.length,c),e}function T5(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(v){return o?o._inactive?g(v):(l=r.parser.defined.includes(qr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),f):n(v)}function f(v){return v===40?e.attempt(b5,m,l?m:g)(v):v===91?e.attempt(x5,m,l?h:g)(v):l?m(v):g(v)}function h(v){return e.attempt(S5,m,g)(v)}function m(v){return t(v)}function g(v){return o._balanced=!0,n(v)}}function C5(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),a}function a(g){return Rt(g)?mu(e,o)(g):o(g)}function o(g){return g===41?m(g):Hj(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Rt(g)?mu(e,f)(g):m(g)}function c(g){return n(g)}function f(g){return g===34||g===39||g===40?Gj(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function h(g){return Rt(g)?mu(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function k5(e,t,n){const r=this;return a;function a(c){return qj.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(qr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function A5(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 j5={name:"labelStartImage",resolveAll:Ny.resolveAll,tokenize:N5};function N5(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 R5={name:"labelStartLink",resolveAll:Ny.resolveAll,tokenize:_5};function _5(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 Lm={name:"lineEnding",tokenize:O5};function O5(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),at(e,t,"linePrefix")}}const $d={name:"thematicBreak",tokenize:M5};function M5(e,t,n){let r=0,a;return o;function o(h){return e.enter("thematicBreak"),l(h)}function l(h){return a=h,c(h)}function c(h){return h===a?(e.enter("thematicBreakSequence"),f(h)):r>=3&&(h===null||De(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===a?(e.consume(h),r++,f):(e.exit("thematicBreakSequence"),Ze(h)?at(e,c,"whitespace")(h):c(h))}}const Xn={continuation:{tokenize:L5},exit:U5,name:"list",tokenize:P5},D5={partial:!0,tokenize:B5},I5={partial:!0,tokenize:z5};function P5(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:iv(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($d,n,h)(b):h(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return iv(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"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Fu,r.interrupt?n:m,e.attempt(D5,v,g))}function m(b){return r.containerState.initialBlankLine=!0,o++,v(b)}function g(b){return Ze(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function L5(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Fu,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,at(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Ze(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(I5,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,at(e,e.attempt(Xn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function z5(e,t,n){const r=this;return at(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 U5(e){e.exit(this.containerState.type)}function B5(e,t,n){const r=this;return at(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!Ze(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const L1={name:"setextUnderline",resolveTo:F5,tokenize:V5};function F5(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 V5(e,t,n){const r=this;let a;return o;function o(h){let m=r.events.length,g;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){g=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),a=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===a?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Ze(h)?at(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||De(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const H5={tokenize:q5};function q5(e){const t=this,n=e.attempt(Fu,r,e.attempt(this.parser.constructs.flowInitial,a,at(e,e.attempt(this.parser.constructs.flow,a,e.attempt(W8,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 G5={resolveAll:$j()},K5=Kj("string"),$5=Kj("text");function Kj(e){return{resolveAll:$j(e==="text"?Y5: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(m){return h(m)?o(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return h(m)?(n.exit("data"),o(m)):(n.consume(m),f)}function h(m){if(m===null)return!0;const g=a[m];let v=-1;if(g)for(;++v<g.length;){const b=g[v];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function $j(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 Y5(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 h=a[o];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)f=!0,c++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={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={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const W5={42:Xn,43:Xn,45:Xn,48:Xn,49:Xn,50:Xn,51:Xn,52:Xn,53:Xn,54:Xn,55:Xn,56:Xn,57:Xn,62:Uj},X5={91:e5},Q5={[-2]:Pm,[-1]:Pm,32:Pm},J5={35:s5,42:$d,45:[L1,$d],60:c5,61:L1,95:$d,96:I1,126:I1},Z5={38:Fj,92:Bj},eF={[-5]:Lm,[-4]:Lm,[-3]:Lm,33:j5,38:Fj,42:av,60:[R8,v5],91:R5,92:[i5,Bj],93:Ny,95:av,96:H8},tF={null:[av,G5]},nF={null:[42,95]},rF={null:[]},iF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nF,contentInitial:X5,disable:rF,document:W5,flow:J5,flowInitial:Q5,insideSpan:tF,string:Z5,text:eF},Symbol.toStringTag,{value:"Module"}));function aF(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:I(j),check:I(_),consume:k,enter:C,exit:N,interrupt:I(_,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:g};let m=t.tokenize.call(h,f);return t.resolveAll&&o.push(t),h;function g(q){return l=Ar(l,q),E(),l[l.length-1]!==null?[]:(L(t,0),h.events=Bf(o,h.events,h),h.events)}function v(q,G){return oF(b(q),G)}function b(q){return sF(l,q)}function S(){const{_bufferIndex:q,_index:G,line:Z,column:ce,offset:J}=r;return{_bufferIndex:q,_index:G,line:Z,column:ce,offset:J}}function w(q){a[q.line]=q.column,D()}function E(){let q;for(;r._index<l.length;){const G=l[r._index];if(typeof G=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<G.length;)T(G.charCodeAt(r._bufferIndex));else T(G)}}function T(q){m=m(q)}function k(q){De(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,D()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=q}function C(q,G){const Z=G||{};return Z.type=q,Z.start=S(),h.events.push(["enter",Z,h]),c.push(Z),Z}function N(q){const G=c.pop();return G.end=S(),h.events.push(["exit",G,h]),G}function j(q,G){L(q,G.from)}function _(q,G){G.restore()}function I(q,G){return Z;function Z(ce,J,B){let X,le,ye,M;return Array.isArray(ce)?ee(ce):"tokenize"in ce?ee([ce]):U(ce);function U(Se){return we;function we(Ue){const Ne=Ue!==null&&Se[Ue],ve=Ue!==null&&Se.null,Pe=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return ee(Pe)(Ue)}}function ee(Se){return X=Se,le=0,Se.length===0?B:P(Se[le])}function P(Se){return we;function we(Ue){return M=V(),ye=Se,Se.partial||(h.currentConstruct=Se),Se.name&&h.parser.constructs.disable.null.includes(Se.name)?me():Se.tokenize.call(G?Object.assign(Object.create(h),G):h,f,ue,me)(Ue)}}function ue(Se){return q(ye,M),J}function me(Se){return M.restore(),++le<X.length?P(X[le]):B}}}function L(q,G){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&fr(h.events,G,h.events.length-G,q.resolve(h.events.slice(G),h)),q.resolveTo&&(h.events=q.resolveTo(h.events,h))}function V(){const q=S(),G=h.previous,Z=h.currentConstruct,ce=h.events.length,J=Array.from(c);return{from:ce,restore:B};function B(){r=q,h.previous=G,h.currentConstruct=Z,h.events.length=ce,c=J,D()}}function D(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function sF(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 oF(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 lF(e){const r={constructs:Lj([iF,...(e||{}).extensions||[]]),content:a(E8),defined:[],document:a(C8),flow:a(H5),lazy:{},string:a(K5),text:a($5)};return r;function a(o){return l;function l(c){return aF(r,o,c)}}}function uF(e){for(;!Vj(e););return e}const z1=/[\0\t\n\r]/g;function cF(){let e=1,t="",n=!0,r;return a;function a(o,l,c){const f=[];let h,m,g,v,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(z1.lastIndex=g,h=z1.exec(o),v=h&&h.index!==void 0?h.index:o.length,b=o.charCodeAt(v),!h){t=o.slice(g);break}if(b===10&&g===v&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),g<v&&(f.push(o.slice(g,v)),e+=v-g),b){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}g=v+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const dF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fF(e){return e.replace(dF,hF)}function hF(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return zj(n.slice(o?2:1),o?16:10)}return jy(n)||e}const Yj={}.hasOwnProperty;function pF(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),mF(n)(uF(lF(n).document().write(cF()(e,t,!0))))}function mF(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ft),autolinkProtocol:V,autolinkEmail:V,atxHeading:o(mt),blockQuote:o(ve),characterEscape:V,characterReference:V,codeFenced:o(Pe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Pe,l),codeText:o(pt,l),codeTextData:V,data:V,codeFlowValue:V,definition:o(Zt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(We),hardBreakEscape:o(gt),hardBreakTrailing:o(gt),htmlFlow:o(Gt,l),htmlFlowData:V,htmlText:o(Gt,l),htmlTextData:V,image:o(_t),label:l,link:o(Ft),listItem:o(dt),listItemValue:v,listOrdered:o(vt,g),listUnordered:o(vt),paragraph:o(Ln),reference:P,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(mt),strong:o(Le),thematicBreak:o(W)},exit:{atxHeading:f(),atxHeadingSequence:j,autolink:f(),autolinkEmail:Ne,autolinkProtocol:Ue,blockQuote:f(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:Se,characterReference:we,codeFenced:f(E),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:D,codeIndented:f(T),codeText:f(J),codeTextData:D,data:D,definition:f(),definitionDestinationString:N,definitionLabelString:k,definitionTitleString:C,emphasis:f(),hardBreakEscape:f(G),hardBreakTrailing:f(G),htmlFlow:f(Z),htmlFlowData:D,htmlText:f(ce),htmlTextData:D,image:f(X),label:ye,labelText:le,lineEnding:q,link:f(B),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ue,resourceDestinationString:M,resourceTitleString:U,resource:ee,setextHeading:f(L),setextHeadingLineSequence:I,setextHeadingText:_,strong:f(),thematicBreak:f()}};Wj(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(H){let se={type:"root",children:[]};const Ee={stack:[se],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:m,data:n},Te=[];let Ve=-1;for(;++Ve<H.length;)if(H[Ve][1].type==="listOrdered"||H[Ve][1].type==="listUnordered")if(H[Ve][0]==="enter")Te.push(Ve);else{const st=Te.pop();Ve=a(H,st,Ve)}for(Ve=-1;++Ve<H.length;){const st=t[H[Ve][0]];Yj.call(st,H[Ve][1].type)&&st[H[Ve][1].type].call(Object.assign({sliceSerialize:H[Ve][2].sliceSerialize},Ee),H[Ve][1])}if(Ee.tokenStack.length>0){const st=Ee.tokenStack[Ee.tokenStack.length-1];(st[1]||U1).call(Ee,void 0,st[0])}for(se.position={start:fa(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:fa(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)se=t.transforms[Ve](se)||se;return se}function a(H,se,Ee){let Te=se-1,Ve=-1,st=!1,Xt,Ot,St,z;for(;++Te<=Ee;){const Y=H[Te];switch(Y[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Y[0]==="enter"?Ve++:Ve--,z=void 0;break}case"lineEndingBlank":{Y[0]==="enter"&&(Xt&&!z&&!Ve&&!St&&(St=Te),z=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:z=void 0}if(!Ve&&Y[0]==="enter"&&Y[1].type==="listItemPrefix"||Ve===-1&&Y[0]==="exit"&&(Y[1].type==="listUnordered"||Y[1].type==="listOrdered")){if(Xt){let xe=Te;for(Ot=void 0;xe--;){const He=H[xe];if(He[1].type==="lineEnding"||He[1].type==="lineEndingBlank"){if(He[0]==="exit")continue;Ot&&(H[Ot][1].type="lineEndingBlank",st=!0),He[1].type="lineEnding",Ot=xe}else if(!(He[1].type==="linePrefix"||He[1].type==="blockQuotePrefix"||He[1].type==="blockQuotePrefixWhitespace"||He[1].type==="blockQuoteMarker"||He[1].type==="listItemIndent"))break}St&&(!Ot||St<Ot)&&(Xt._spread=!0),Xt.end=Object.assign({},Ot?H[Ot][1].start:Y[1].end),H.splice(Ot||Te,0,["exit",Xt,Y[2]]),Te++,Ee++}if(Y[1].type==="listItemPrefix"){const xe={type:"listItem",_spread:!1,start:Object.assign({},Y[1].start),end:void 0};Xt=xe,H.splice(Te,0,["enter",xe,Y[2]]),Te++,Ee++,St=void 0,z=!0}}}return H[se][1]._spread=st,Ee}function o(H,se){return Ee;function Ee(Te){c.call(this,H(Te),Te),se&&se.call(this,Te)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(H,se,Ee){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([se,Ee||void 0]),H.position={start:fa(se.start),end:void 0}}function f(H){return se;function se(Ee){H&&H.call(this,Ee),h.call(this,Ee)}}function h(H,se){const Ee=this.stack.pop(),Te=this.tokenStack.pop();if(Te)Te[0].type!==H.type&&(se?se.call(this,H,Te[0]):(Te[1]||U1).call(this,H,Te[0]));else throw new Error("Cannot close `"+H.type+"` ("+pu({start:H.start,end:H.end})+"): it’s not open");Ee.position.end=fa(H.end)}function m(){return Ay(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(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 k(H){const se=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=se,Ee.identifier=qr(this.sliceSerialize(H)).toLowerCase()}function C(){const H=this.resume(),se=this.stack[this.stack.length-1];se.title=H}function N(){const H=this.resume(),se=this.stack[this.stack.length-1];se.url=H}function j(H){const se=this.stack[this.stack.length-1];if(!se.depth){const Ee=this.sliceSerialize(H).length;se.depth=Ee}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function I(H){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function V(H){const Ee=this.stack[this.stack.length-1].children;let Te=Ee[Ee.length-1];(!Te||Te.type!=="text")&&(Te=Me(),Te.position={start:fa(H.start),end:void 0},Ee.push(Te)),this.stack.push(Te)}function D(H){const se=this.stack.pop();se.value+=this.sliceSerialize(H),se.position.end=fa(H.end)}function q(H){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=se.children[se.children.length-1];Ee.position.end=fa(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(V.call(this,H),D.call(this,H))}function G(){this.data.atHardBreak=!0}function Z(){const H=this.resume(),se=this.stack[this.stack.length-1];se.value=H}function ce(){const H=this.resume(),se=this.stack[this.stack.length-1];se.value=H}function J(){const H=this.resume(),se=this.stack[this.stack.length-1];se.value=H}function B(){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 X(){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 le(H){const se=this.sliceSerialize(H),Ee=this.stack[this.stack.length-2];Ee.label=fF(se),Ee.identifier=qr(se).toLowerCase()}function ye(){const H=this.stack[this.stack.length-1],se=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Te=H.children;Ee.children=Te}else Ee.alt=se}function M(){const H=this.resume(),se=this.stack[this.stack.length-1];se.url=H}function U(){const H=this.resume(),se=this.stack[this.stack.length-1];se.title=H}function ee(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function ue(H){const se=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=se,Ee.identifier=qr(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function me(H){this.data.characterReferenceType=H.type}function Se(H){const se=this.sliceSerialize(H),Ee=this.data.characterReferenceType;let Te;Ee?(Te=zj(se,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=jy(se);const Ve=this.stack[this.stack.length-1];Ve.value+=Te}function we(H){const se=this.stack.pop();se.position.end=fa(H.end)}function Ue(H){D.call(this,H);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(H)}function Ne(H){D.call(this,H);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(H)}function ve(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function pt(){return{type:"inlineCode",value:""}}function Zt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function We(){return{type:"emphasis",children:[]}}function mt(){return{type:"heading",depth:0,children:[]}}function gt(){return{type:"break"}}function Gt(){return{type:"html",value:""}}function _t(){return{type:"image",title:null,url:"",alt:null}}function Ft(){return{type:"link",title:null,url:"",children:[]}}function vt(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function dt(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Ln(){return{type:"paragraph",children:[]}}function Le(){return{type:"strong",children:[]}}function Me(){return{type:"text",value:""}}function W(){return{type:"thematicBreak"}}}function fa(e){return{line:e.line,column:e.column,offset:e.offset}}function Wj(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Wj(e,r):gF(e,r)}}function gF(e,t){let n;for(n in t)if(Yj.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 U1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pu({start:t.start,end:t.end})+") is still open")}function vF(e){const t=this;t.parser=n;function n(r){return pF(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function yF(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 bF(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
27
+ `}]}function xF(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 SF(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wF(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EF(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Bo(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 h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function TF(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 CF(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Xj(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 kF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xj(e,t);const a={src:Bo(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 AF(e,t){const n={src:Bo(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 jF(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 NF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xj(e,t);const a={href:Bo(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 RF(e,t){const n={href:Bo(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 _F(e,t,n){const r=e.all(t),a=n?OF(n):Qj(t),o={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.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 m=r[c];(a||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
29
+ `}),m.type==="element"&&m.tagName==="p"&&!a?l.push(...m.children):l.push(m)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
30
+ `});const h={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,h),e.applyData(t,h)}function OF(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=Qj(n[r])}return t}function Qj(e){const t=e.spread;return t??e.children.length>1}function MF(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 DF(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IF(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function PF(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LF(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=Ey(t.children[1]),f=Rj(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 zF(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 h=[];for(;++f<c;){const g=t.children[f],v={},b=l?l[f]:void 0;b&&(v.align=b);let S={type:"element",tagName:o,properties:v,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),h.push(S)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function UF(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const B1=9,F1=32;function BF(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(V1(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(V1(t.slice(a),a>0,!1)),o.join("")}function V1(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===B1||o===F1;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===B1||o===F1;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function FF(e,t){const n={type:"text",value:BF(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function VF(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const HF={blockquote:yF,break:bF,code:xF,delete:SF,emphasis:wF,footnoteReference:EF,heading:TF,html:CF,imageReference:kF,image:AF,inlineCode:jF,linkReference:NF,link:RF,listItem:_F,list:MF,paragraph:DF,root:IF,strong:PF,table:LF,tableCell:UF,tableRow:zF,text:FF,thematicBreak:VF,toml:Ed,yaml:Ed,definition:Ed,footnoteDefinition:Ed};function Ed(){}const Jj=-1,Ff=0,gu=1,hf=2,Ry=3,_y=4,Oy=5,My=6,Zj=7,eN=8,H1=typeof self=="object"?self:globalThis,qF=(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 Ff:case Jj:return n(l,a);case gu:{const c=n([],a);for(const f of l)c.push(r(f));return c}case hf:{const c=n({},a);for(const[f,h]of l)c[r(f)]=r(h);return c}case Ry:return n(new Date(l),a);case _y:{const{source:c,flags:f}=l;return n(new RegExp(c,f),a)}case Oy:{const c=n(new Map,a);for(const[f,h]of l)c.set(r(f),r(h));return c}case My:{const c=n(new Set,a);for(const f of l)c.add(r(f));return c}case Zj:{const{name:c,message:f}=l;return n(new H1[c](f),a)}case eN: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 H1[o](l),a)};return r},q1=e=>qF(new Map,e)(0),so="",{toString:GF}={},{keys:KF}=Object,Jl=e=>{const t=typeof e;if(t!=="object"||!e)return[Ff,t];const n=GF.call(e).slice(8,-1);switch(n){case"Array":return[gu,so];case"Object":return[hf,so];case"Date":return[Ry,so];case"RegExp":return[_y,so];case"Map":return[Oy,so];case"Set":return[My,so];case"DataView":return[gu,n]}return n.includes("Array")?[gu,n]:n.includes("Error")?[Zj,n]:[hf,n]},Td=([e,t])=>e===Ff&&(t==="function"||t==="symbol"),$F=(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]=Jl(l);switch(c){case Ff:{let m=l;switch(f){case"bigint":c=eN,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return a([Jj],l)}return a([c,m],l)}case gu:{if(f){let v=l;return f==="DataView"?v=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(l)),a([f,[...v]],l)}const m=[],g=a([c,m],l);for(const v of l)m.push(o(v));return g}case hf:{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 m=[],g=a([c,m],l);for(const v of KF(l))(e||!Td(Jl(l[v])))&&m.push([o(v),o(l[v])]);return g}case Ry:return a([c,l.toISOString()],l);case _y:{const{source:m,flags:g}=l;return a([c,{source:m,flags:g}],l)}case Oy:{const m=[],g=a([c,m],l);for(const[v,b]of l)(e||!(Td(Jl(v))||Td(Jl(b))))&&m.push([o(v),o(b)]);return g}case My:{const m=[],g=a([c,m],l);for(const v of l)(e||!Td(Jl(v)))&&m.push(o(v));return g}}const{message:h}=l;return a([c,{name:f,message:h}],l)};return o},G1=(e,{json:t,lossy:n}={})=>{const r=[];return $F(!(t||n),!!t,new Map,r)(e),r},pf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?q1(G1(e,t)):structuredClone(e):(e,t)=>q1(G1(e,t));function YF(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 WF(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function XF(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||YF,r=e.options.footnoteBackLabel||WF,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 h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const m=e.all(h),g=String(h.identifier).toUpperCase(),v=Bo(g.toLowerCase());let b=0;const S=[],w=e.footnoteCounts.get(g);for(;w!==void 0&&++b<=w;){S.length>0&&S.push({type:"text",value:" "});let k=typeof n=="string"?n:n(f,b);typeof k=="string"&&(k={type:"text",value:k}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,b),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const E=m[m.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const k=E.children[E.children.length-1];k&&k.type==="text"?k.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else m.push(...S);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(m,!0)};e.patch(h,T),c.push(T)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...pf(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 Vf=(function(e){if(e==null)return eV;if(typeof e=="function")return Hf(e);if(typeof e=="object")return Array.isArray(e)?QF(e):JF(e);if(typeof e=="string")return ZF(e);throw new Error("Expected function, string, or object as test")});function QF(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Vf(e[n]);return Hf(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function JF(e){const t=e;return Hf(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function ZF(e){return Hf(t);function t(n){return n&&n.type===e}}function Hf(e){return t;function t(n,r,a){return!!(tV(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function eV(){return!0}function tV(e){return e!==null&&typeof e=="object"&&"type"in e}const tN=[],nV=!0,sv=!1,rV="skip";function nN(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=Vf(a),l=r?-1:1;c(e,void 0,[])();function c(f,h,m){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=tN,S,w,E;if((!t||o(f,h,m[m.length-1]||void 0))&&(b=iV(n(f,m)),b[0]===sv))return b;if("children"in f&&f.children){const T=f;if(T.children&&b[0]!==rV)for(w=(r?T.children.length:-1)+l,E=m.concat(T);w>-1&&w<T.children.length;){const k=T.children[w];if(S=c(k,w,E)(),S[0]===sv)return S;w=typeof S[1]=="number"?S[1]:w+l}}return b}}}function iV(e){return Array.isArray(e)?e:typeof e=="number"?[nV,e]:e==null?tN:[e]}function Dy(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),nN(e,o,c,a);function c(f,h){const m=h[h.length-1],g=m?m.children.indexOf(f):void 0;return l(f,g,m)}}const ov={}.hasOwnProperty,aV={};function sV(e,t){const n=t||aV,r=new Map,a=new Map,o=new Map,l={...HF,...n.handlers},c={all:h,applyData:lV,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:oV,wrap:cV};return Dy(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?r:a,v=String(m.identifier).toUpperCase();g.has(v)||g.set(v,m)}}),c;function f(m,g){const v=m.type,b=c.handlers[v];if(ov.call(c.handlers,v)&&b)return b(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(v)){if("children"in m){const{children:w,...E}=m,T=pf(E);return T.children=c.all(m),T}return pf(m)}return(c.options.unknownHandler||uV)(c,m,g)}function h(m){const g=[];if("children"in m){const v=m.children;let b=-1;for(;++b<v.length;){const S=c.one(v[b],m);if(S){if(b&&v[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=K1(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=K1(w.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function oV(e,t){e.position&&(t.position=WB(e))}function lV(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,pf(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function uV(e,t){const n=t.data||{},r="value"in t&&!(ov.call(n,"hProperties")||ov.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 cV(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 K1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function $1(e,t){const n=sV(e,t),r=n.one(e,void 0),a=XF(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 dV(e,t){return e&&"run"in e?async function(n,r){const a=$1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return $1(n,{file:r,...e||t})}}function Y1(e){if(e)throw e}var zm,W1;function fV(){if(W1)return zm;W1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!g)return!1;var v;for(v in h);return typeof v>"u"||e.call(h,v)},l=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return zm=function f(){var h,m,g,v,b,S,w=arguments[0],E=1,T=arguments.length,k=!1;for(typeof w=="boolean"&&(k=w,w=arguments[1]||{},E=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});E<T;++E)if(h=arguments[E],h!=null)for(m in h)g=c(w,m),v=c(h,m),w!==v&&(k&&v&&(o(v)||(b=a(v)))?(b?(b=!1,S=g&&a(g)?g:[]):S=g&&o(g)?g:{},l(w,{name:m,newValue:f(k,S,v)})):typeof v<"u"&&l(w,{name:m,newValue:v}));return w},zm}var hV=fV();const Um=Oo(hV);function lv(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 pV(){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,...h){const m=e[++o];let g=-1;if(f){l(f);return}for(;++g<a.length;)(h[g]===null||h[g]===void 0)&&(h[g]=a[g]);a=h,m?mV(m,c)(...h):l(null,...h)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function mV(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(h){const m=h;if(c&&n)throw m;return a(m)}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 ri={basename:gV,dirname:vV,extname:yV,join:bV,sep:"/"};function gV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vu(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 vV(e){if(Vu(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 yV(e){Vu(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 bV(...e){let t=-1,n;for(;++t<e.length;)Vu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":xV(n)}function xV(e){Vu(e);const t=e.codePointAt(0)===47;let n=SV(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function SV(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 Vu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wV={cwd:EV};function EV(){return"/"}function uv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TV(e){if(typeof e=="string")e=new URL(e);else if(!uv(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 CV(e)}function CV(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 Bm=["history","path","basename","stem","extname","dirname"];class rN{constructor(t){let n;t?uv(t)?n={path:t}:typeof t=="string"||kV(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":wV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Bm.length;){const o=Bm[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)Bm.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ri.basename(this.path):void 0}set basename(t){Vm(t,"basename"),Fm(t,"basename"),this.path=ri.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ri.dirname(this.path):void 0}set dirname(t){X1(this.basename,"dirname"),this.path=ri.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ri.extname(this.path):void 0}set extname(t){if(Fm(t,"extname"),X1(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=ri.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){uv(t)&&(t=TV(t)),Vm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ri.basename(this.path,this.extname):void 0}set stem(t){Vm(t,"stem"),Fm(t,"stem"),this.path=ri.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 Pn(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 Fm(e,t){if(e&&e.includes(ri.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ri.sep+"`")}function Vm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function X1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function kV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const AV=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),jV={}.hasOwnProperty;class Iy extends AV{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=pV()}copy(){const t=new Iy;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Um(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Gm("data",this.frozen),this.namespace[t]=n,this):jV.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Gm("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=Cd(t),r=this.parser||this.Parser;return Hm("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Hm("process",this.parser||this.Parser),qm("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const c=Cd(t),f=r.parse(c);r.run(f,c,function(m,g,v){if(m||!g||!v)return h(m);const b=g,S=r.stringify(b,v);_V(S)?v.value=S:v.result=S,h(m,v)});function h(m,g){m||!g?l(m):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),Hm("processSync",this.parser||this.Parser),qm("processSync",this.compiler||this.Compiler),this.process(t,a),J1("processSync","process",n),r;function a(o,l){n=!0,Y1(o),r=l}}run(t,n,r){Q1(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=Cd(n);a.run(t,f,h);function h(m,g,v){const b=g||t;m?c(m):l?l(b):r(void 0,b,v)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),J1("runSync","run",r),a;function o(l,c){Y1(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=Cd(n),a=this.compiler||this.Compiler;return qm("stringify",a),Q1(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Gm("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(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...g]=h;f(m,g)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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(h.plugins),h.settings&&(a.settings=Um(!0,a.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const g=h[m];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,m){let g=-1,v=-1;for(;++g<r.length;)if(r[g][0]===h){v=g;break}if(v===-1)r.push([h,...m]);else if(m.length>0){let[b,...S]=m;const w=r[v][1];lv(w)&&lv(b)&&(b=Um(!0,w,b)),r[v]=[h,b,...S]}}}}const NV=new Iy().freeze();function Hm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gm(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 Q1(e){if(!lv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function J1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Cd(e){return RV(e)?e:new rN(e)}function RV(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _V(e){return typeof e=="string"||OV(e)}function OV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Z1=[],eT={allowDangerousHtml:!0},DV=/^(https?|ircs?|mailto|xmpp)$/i,IV=[{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 PV(e){const t=LV(e),n=zV(e);return UV(t.runSync(t.parse(n),n),e)}function LV(e){const t=e.rehypePlugins||Z1,n=e.remarkPlugins||Z1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...eT}:eT;return NV().use(vF).use(n).use(dV,r).use(t)}function zV(e){const t=e.children||"",n=new rN;return typeof t=="string"&&(n.value=t),n}function UV(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||BV;for(const m of IV)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+MV+m.id,void 0);return Dy(e,h),e8(e,{Fragment:d.Fragment,components:a,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(m,g,v){if(m.type==="raw"&&v&&typeof g=="number")return l?v.children.splice(g,1):v.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let b;for(b in Im)if(Object.hasOwn(Im,b)&&Object.hasOwn(m.properties,b)){const S=m.properties[b],w=Im[b];(w===null||w.includes(m.tagName))&&(m.properties[b]=f(String(S||""),b,m))}}if(m.type==="element"){let b=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!b&&r&&typeof g=="number"&&(b=!r(m,g,v)),b&&v&&typeof g=="number")return c&&m.children?v.children.splice(g,1,...m.children):v.children.splice(g,1),g}}}function BV(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||DV.test(e.slice(0,t))?e:""}function tT(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 FV(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function VV(e,t,n){const a=Vf((n||{}).ignore||[]),o=HV(t);let l=-1;for(;++l<o.length;)nN(e,"text",c);function c(h,m){let g=-1,v;for(;++g<m.length;){const b=m[g],S=v?v.children:void 0;if(a(b,S?S.indexOf(b):void 0,v))return;v=b}if(v)return f(h,m)}function f(h,m){const g=m[m.length-1],v=o[l][0],b=o[l][1];let S=0;const E=g.children.indexOf(h);let T=!1,k=[];v.lastIndex=0;let C=v.exec(h.value);for(;C;){const N=C.index,j={index:C.index,input:C.input,stack:[...m,h]};let _=b(...C,j);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?v.lastIndex=N+1:(S!==N&&k.push({type:"text",value:h.value.slice(S,N)}),Array.isArray(_)?k.push(..._):_&&k.push(_),S=N+C[0].length,T=!0),!v.global)break;C=v.exec(h.value)}return T?(S<h.value.length&&k.push({type:"text",value:h.value.slice(S)}),g.children.splice(E,1,...k)):k=[h],E+k.length}}function HV(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([qV(a[0]),GV(a[1])])}return t}function qV(e){return typeof e=="string"?new RegExp(FV(e),"g"):e}function GV(e){return typeof e=="function"?e:function(){return e}}const Km="phrasing",$m=["autolink","link","image","label"];function KV(){return{transforms:[ZV],enter:{literalAutolink:YV,literalAutolinkEmail:Ym,literalAutolinkHttp:Ym,literalAutolinkWww:Ym},exit:{literalAutolink:JV,literalAutolinkEmail:QV,literalAutolinkHttp:WV,literalAutolinkWww:XV}}}function $V(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Km,notInConstruct:$m},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Km,notInConstruct:$m},{character:":",before:"[ps]",after:"\\/",inConstruct:Km,notInConstruct:$m}]}}function YV(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ym(e){this.config.enter.autolinkProtocol.call(this,e)}function WV(e){this.config.exit.autolinkProtocol.call(this,e)}function XV(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 QV(e){this.config.exit.autolinkEmail.call(this,e)}function JV(e){this.exit(e)}function ZV(e){VV(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,eH],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tH]],{ignore:["link","linkReference"]})}function eH(e,t,n,r,a){let o="";if(!iN(a)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!nH(n)))return!1;const l=rH(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 tH(e,t,n,r){return!iN(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function nH(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 rH(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=tT(e,"(");let o=tT(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 iN(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bs(n)||Uf(n))&&(!t||n!==47)}aN.peek=fH;function iH(){this.buffer()}function aH(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function sH(){this.buffer()}function oH(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uH(e){this.exit(e)}function cH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dH(e){this.exit(e)}function fH(){return"["}function aN(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 hH(){return{enter:{gfmFootnoteCallString:iH,gfmFootnoteCall:aH,gfmFootnoteDefinitionLabelString:sH,gfmFootnoteDefinition:oH},exit:{gfmFootnoteCallString:lH,gfmFootnoteCall:uH,gfmFootnoteDefinitionLabelString:cH,gfmFootnoteDefinition:dH}}}function pH(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:aN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,o,l){const c=o.createTracker(l);let f=c.move("[^");const h=o.enter("footnoteDefinition"),m=o.enter("label");return f+=c.move(o.safe(o.associationId(r),{before:f,after:"]"})),m(),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?sN:mH))),h(),f}}function mH(e,t,n){return t===0?e:sN(e,t,n)}function sN(e,t,n){return(n?"":" ")+e}const gH=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];oN.peek=SH;function vH(){return{canContainEols:["delete"],enter:{strikethrough:bH},exit:{strikethrough:xH}}}function yH(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gH}],handlers:{delete:oN}}}function bH(e){this.enter({type:"delete",children:[]},e)}function xH(e){this.exit(e)}function oN(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 SH(){return"~"}function wH(e){return e.length}function EH(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||wH,o=[],l=[],c=[],f=[];let h=0,m=-1;for(;++m<e.length;){const w=[],E=[];let T=-1;for(e[m].length>h&&(h=e[m].length);++T<e[m].length;){const k=TH(e[m][T]);if(n.alignDelimiters!==!1){const C=a(k);E[T]=C,(f[T]===void 0||C>f[T])&&(f[T]=C)}w.push(k)}l[m]=w,c[m]=E}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<h;)o[g]=nT(r[g]);else{const w=nT(r);for(;++g<h;)o[g]=w}g=-1;const v=[],b=[];for(;++g<h;){const w=o[g];let E="",T="";w===99?(E=":",T=":"):w===108?E=":":w===114&&(T=":");let k=n.alignDelimiters===!1?1:Math.max(1,f[g]-E.length-T.length);const C=E+"-".repeat(k)+T;n.alignDelimiters!==!1&&(k=E.length+k+T.length,k>f[g]&&(f[g]=k),b[g]=k),v[g]=C}l.splice(1,0,v),c.splice(1,0,b),m=-1;const S=[];for(;++m<l.length;){const w=l[m],E=c[m];g=-1;const T=[];for(;++g<h;){const k=w[g]||"";let C="",N="";if(n.alignDelimiters!==!1){const j=f[g]-(E[g]||0),_=o[g];_===114?C=" ".repeat(j):_===99?j%2?(C=" ".repeat(j/2+.5),N=" ".repeat(j/2-.5)):(C=" ".repeat(j/2),N=C):N=" ".repeat(j)}n.delimiterStart!==!1&&!g&&T.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||g)&&T.push(" "),n.alignDelimiters!==!1&&T.push(C),T.push(k),n.alignDelimiters!==!1&&T.push(N),n.padding!==!1&&T.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&T.push("|")}S.push(n.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return S.join(`
38
+ `)}function TH(e){return e==null?"":String(e)}function nT(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 CH(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()),kH);return a(),l}function kH(e,t,n){return">"+(n?"":" ")+e}function AH(e,t){return rT(e,t.inConstruct,!0)&&!rT(e,t.notInConstruct,!1)}function rT(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 iT(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
39
+ `&&AH(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
40
+ `}function jH(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 NH(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 RH(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 _H(e,t,n,r){const a=RH(n),o=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(NH(e,n)){const g=n.enter("codeIndented"),v=n.indentLines(o,OH);return g(),v}const c=n.createTracker(r),f=a.repeat(Math.max(jH(o,a)+1,3)),h=n.enter("codeFenced");let m=c.move(f);if(e.lang){const g=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
41
+ `,encode:["`"],...c.current()})),g()}return m+=c.move(`
42
+ `),o&&(m+=c.move(o+`
43
+ `)),m+=c.move(f),h(),m}function OH(e,t,n){return(n?"":" ")+e}function Py(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 MH(e,t,n,r){const a=Py(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
44
+ `,...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),h+=f.move(" "+a),h+=f.move(n.safe(e.title,{before:h,after:a,...f.current()})),h+=f.move(a),c()),l(),h}function DH(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 ju(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mf(e,t,n){const r=Ro(e),a=Ro(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}}lN.peek=IH;function lN(e,t,n,r){const a=DH(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 h=f.charCodeAt(0),m=mf(r.before.charCodeAt(r.before.length-1),h,a);m.inside&&(f=ju(h)+f.slice(1));const g=f.charCodeAt(f.length-1),v=mf(r.after.charCodeAt(0),g,a);v.inside&&(f=f.slice(0,-1)+ju(g));const b=l.move(a);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},c+f+b}function IH(e,t,n){return n.options.emphasis||"*"}function PH(e,t){let n=!1;return Dy(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,sv}),!!((!e.depth||e.depth<3)&&Ay(e)&&(t.options.setext||n))}function LH(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(PH(e,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:`
45
+ `,after:`
46
+ `});return g(),m(),v+`
47
+ `+(a===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
48
+ `))+1))}const l="#".repeat(a),c=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
49
+ `,...o.current()});return/^[\t ]/.test(h)&&(h=ju(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),f(),c(),h}uN.peek=zH;function uN(e){return e.value||""}function zH(){return"<"}cN.peek=UH;function cN(e,t,n,r){const a=Py(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),h+=f.move(" "+a),h+=f.move(n.safe(e.title,{before:h,after:a,...f.current()})),h+=f.move(a),c()),h+=f.move(")"),l(),h}function UH(){return"!"}dN.peek=BH;function dN(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 h=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!h||h!==g?f+=c.move(g+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function BH(){return"!"}fN.peek=FH;function fN(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 h=f.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(f.index+1)}}return a+r+a}function FH(){return"`"}function hN(e,t){const n=Ay(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))}pN.peek=VH;function pN(e,t,n,r){const a=Py(n),o=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(hN(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(e,{before:g,after:">",...l.current()})),g+=l.move(">"),c(),n.stack=m,g}c=n.enter("link"),f=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(f=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=l.move(" "+a),h+=l.move(n.safe(e.title,{before:h,after:a,...l.current()})),h+=l.move(a),f()),h+=l.move(")"),c(),h}function VH(e,t,n){return hN(e,n)?"<":"["}mN.peek=HH;function mN(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 h=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!h||h!==g?f+=c.move(g+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function HH(){return"["}function Ly(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 qH(e){const t=Ly(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 GH(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 gN(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 KH(e,t,n,r){const a=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?GH(n):Ly(n);const c=e.ordered?l==="."?")":".":qH(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.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),gN(n)===l&&m){let g=-1;for(;++g<e.children.length;){const v=e.children[g];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,a(),h}function $H(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 YH(e,t,n,r){const a=$H(n);let o=n.bulletCurrent||Ly(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"),h=n.indentLines(n.containerFlow(e,c.current()),m);return f(),h;function m(g,v,b){return v?(b?"":" ".repeat(l))+g:(b?o:o+" ".repeat(l-o.length))+g}}function WH(e,t,n,r){const a=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),a(),l}const XH=Vf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function QH(e,t,n,r){return(e.children.some(function(l){return XH(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function JH(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}vN.peek=ZH;function vN(e,t,n,r){const a=JH(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 h=f.charCodeAt(0),m=mf(r.before.charCodeAt(r.before.length-1),h,a);m.inside&&(f=ju(h)+f.slice(1));const g=f.charCodeAt(f.length-1),v=mf(r.after.charCodeAt(0),g,a);v.inside&&(f=f.slice(0,-1)+ju(g));const b=l.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},c+f+b}function ZH(e,t,n){return n.options.strong||"*"}function eq(e,t,n,r){return n.safe(e.value,r)}function tq(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 nq(e,t,n){const r=(gN(n)+(n.options.ruleSpaces?" ":"")).repeat(tq(n));return n.options.ruleSpaces?r.slice(0,-1):r}const yN={blockquote:CH,break:iT,code:_H,definition:MH,emphasis:lN,hardBreak:iT,heading:LH,html:uN,image:cN,imageReference:dN,inlineCode:fN,link:pN,linkReference:mN,list:KH,listItem:YH,paragraph:WH,root:QH,strong:vN,text:eq,thematicBreak:nq};function rq(){return{enter:{table:iq,tableData:aT,tableHeader:aT,tableRow:sq},exit:{codeText:oq,table:aq,tableData:Wm,tableHeader:Wm,tableRow:Wm}}}function iq(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 aq(e){this.exit(e),this.data.inTable=void 0}function sq(e){this.enter({type:"tableRow",children:[]},e)}function Wm(e){this.exit(e)}function aT(e){this.enter({type:"tableCell",children:[]},e)}function oq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lq));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lq(e,t){return t==="|"?t:e}function uq(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:v,table:l,tableCell:f,tableRow:c}};function l(b,S,w,E){return h(m(b,w,E),b.align)}function c(b,S,w,E){const T=g(b,w,E),k=h([T]);return k.slice(0,k.indexOf(`
51
+ `))}function f(b,S,w,E){const T=w.enter("tableCell"),k=w.enter("phrasing"),C=w.containerPhrasing(b,{...E,before:o,after:o});return k(),T(),C}function h(b,S){return EH(b,{align:S,alignDelimiters:r,padding:n,stringLength:a})}function m(b,S,w){const E=b.children;let T=-1;const k=[],C=S.enter("table");for(;++T<E.length;)k[T]=g(E[T],S,w);return C(),k}function g(b,S,w){const E=b.children;let T=-1;const k=[],C=S.enter("tableRow");for(;++T<E.length;)k[T]=f(E[T],b,S,w);return C(),k}function v(b,S,w){let E=yN.inlineCode(b,S,w);return w.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function cq(){return{exit:{taskListCheckValueChecked:sT,taskListCheckValueUnchecked:sT,paragraph:fq}}}function dq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hq}}}function sT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fq(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 hq(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=yN.listItem(e,t,n,{...r,...c.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(m){return m+l}}function pq(){return[KV(),hH(),vH(),rq(),cq()]}function mq(e){return{extensions:[$V(),pH(e),yH(),uq(e),dq()]}}const gq={tokenize:wq,partial:!0},bN={tokenize:Eq,partial:!0},xN={tokenize:Tq,partial:!0},SN={tokenize:Cq,partial:!0},vq={tokenize:kq,partial:!0},wN={name:"wwwAutolink",tokenize:xq,previous:TN},EN={name:"protocolAutolink",tokenize:Sq,previous:CN},Ui={name:"emailAutolink",tokenize:bq,previous:kN},hi={};function yq(){return{text:hi}}let as=48;for(;as<123;)hi[as]=Ui,as++,as===58?as=65:as===91&&(as=97);hi[43]=Ui;hi[45]=Ui;hi[46]=Ui;hi[95]=Ui;hi[72]=[Ui,EN];hi[104]=[Ui,EN];hi[87]=[Ui,wN];hi[119]=[Ui,wN];function bq(e,t,n){const r=this;let a,o;return l;function l(g){return!cv(g)||!kN.call(r,r.previous)||zy(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return cv(g)?(e.consume(g),c):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(vq,m,h)(g):g===45||g===95||Mn(g)?(o=!0,e.consume(g),f):m(g)}function h(g){return e.consume(g),a=!0,f}function m(g){return o&&a&&Bn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function xq(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!TN.call(r,r.previous)||zy(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(gq,e.attempt(bN,e.attempt(xN,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Sq(e,t,n){const r=this;let a="",o=!1;return l;function l(g){return(g===72||g===104)&&CN.call(r,r.previous)&&!zy(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(Bn(g)&&a.length<5)return a+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const v=a.toLowerCase();if(v==="http"||v==="https")return e.consume(g),f}return n(g)}function f(g){return g===47?(e.consume(g),o?h:(o=!0,f)):n(g)}function h(g){return g===null||ff(g)||Rt(g)||bs(g)||Uf(g)?n(g):e.attempt(bN,e.attempt(xN,m),n)(g)}function m(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function wq(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 Eq(e,t,n){let r,a,o;return l;function l(h){return h===46||h===95?e.check(SN,f,c)(h):h===null||Rt(h)||bs(h)||h!==45&&Uf(h)?f(h):(o=!0,e.consume(h),l)}function c(h){return h===95?r=!0:(a=r,r=void 0),e.consume(h),l}function f(h){return a||r||!o?n(h):t(h)}}function Tq(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(SN,t,o)(l):l===null||Rt(l)||bs(l)?t(l):(e.consume(l),a)}function o(l){return l===41&&r++,e.consume(l),a}}function Cq(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||Rt(c)||bs(c)?t(c):n(c)}function a(c){return c===null||c===40||c===91||Rt(c)||bs(c)?t(c):r(c)}function o(c){return Bn(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):Bn(c)?(e.consume(c),l):n(c)}}function kq(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return Mn(o)?n(o):t(o)}}function TN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Rt(e)}function CN(e){return!Bn(e)}function kN(e){return!(e===47||cv(e))}function cv(e){return e===43||e===45||e===46||e===95||Mn(e)}function zy(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 Aq={tokenize:Iq,partial:!0};function jq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Oq,continuation:{tokenize:Mq},exit:Dq}},text:{91:{name:"gfmFootnoteCall",tokenize:_q},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Nq,resolveTo:Rq}}}}function Nq(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 h=qr(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function Rq(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 _q(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),f}function f(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!l||g===null||g===91||Rt(g))return n(g);if(g===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return a.includes(qr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Rt(g)||(l=!0),o++,e.consume(g),g===92?m:h}function m(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function Oq(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"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(S)}function m(S){if(l>999||S===93&&!c||S===null||S===91||Rt(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=qr(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Rt(S)||(c=!0),l++,e.consume(S),S===92?g:m}function g(S){return S===91||S===92||S===93?(e.consume(S),l++,m):m(S)}function v(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),a.includes(o)||a.push(o),at(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function Mq(e,t,n){return e.check(Fu,t,e.attempt(Aq,t,n))}function Dq(e){e.exit("gfmFootnoteDefinition")}function Iq(e,t,n){const r=this;return at(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 Pq(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 h=f;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[f][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[f][1].end)},g={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[f][1].start)},v=[["enter",m,c],["enter",l[h][1],c],["exit",l[h][1],c],["enter",g,c]],b=c.parser.constructs.insideSpan.null;b&&fr(v,v.length,0,Bf(b,l.slice(h+1,f),c)),fr(v,v.length,0,[["exit",g,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),fr(l,h-1,f-h+3,v),f=h+v.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 h=this.previous,m=this.events;let g=0;return v;function v(S){return h===126&&m[m.length-1][1].type!=="characterEscape"?f(S):(l.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const w=Ro(h);if(S===126)return g>1?f(S):(l.consume(S),g++,b);if(g<2&&!n)return f(S);const E=l.exit("strikethroughSequenceTemporary"),T=Ro(S);return E._open=!T||T===2&&!!w,E._close=!w||w===2&&!!T,c(S)}}}class Lq{constructor(){this.map=[]}add(t,n,r){zq(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 zq(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 Uq(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 Bq(){return{flow:{null:{name:"table",tokenize:Fq,resolveAll:Vq}}}}function Fq(e,t,n){const r=this;let a=0,o=0,l;return c;function c(D){let q=r.events.length-1;for(;q>-1;){const ce=r.events[q][1].type;if(ce==="lineEnding"||ce==="linePrefix")q--;else break}const G=q>-1?r.events[q][1].type:null,Z=G==="tableHead"||G==="tableRow"?_:f;return Z===_&&r.parser.lazy[r.now().line]?n(D):Z(D)}function f(D){return e.enter("tableHead"),e.enter("tableRow"),h(D)}function h(D){return D===124||(l=!0,o+=1),m(D)}function m(D){return D===null?n(D):De(D)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),b):n(D):Ze(D)?at(e,m,"whitespace")(D):(o+=1,l&&(l=!1,a+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),g(D)))}function g(D){return D===null||D===124||Rt(D)?(e.exit("data"),m(D)):(e.consume(D),D===92?v:g)}function v(D){return D===92||D===124?(e.consume(D),g):g(D)}function b(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(D):(e.enter("tableDelimiterRow"),l=!1,Ze(D)?at(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):S(D))}function S(D){return D===45||D===58?E(D):D===124?(l=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),w):j(D)}function w(D){return Ze(D)?at(e,E,"whitespace")(D):E(D)}function E(D){return D===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),T):D===45?(o+=1,T(D)):D===null||De(D)?N(D):j(D)}function T(D){return D===45?(e.enter("tableDelimiterFiller"),k(D)):j(D)}function k(D){return D===45?(e.consume(D),k):D===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(D))}function C(D){return Ze(D)?at(e,N,"whitespace")(D):N(D)}function N(D){return D===124?S(D):D===null||De(D)?!l||a!==o?j(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):j(D)}function j(D){return n(D)}function _(D){return e.enter("tableRow"),I(D)}function I(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),I):D===null||De(D)?(e.exit("tableRow"),t(D)):Ze(D)?at(e,I,"whitespace")(D):(e.enter("data"),L(D))}function L(D){return D===null||D===124||Rt(D)?(e.exit("data"),I(D)):(e.consume(D),D===92?V:L)}function V(D){return D===92||D===124?(e.consume(D),L):L(D)}}function Vq(e,t){let n=-1,r=!0,a=0,o=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,h,m,g;const v=new Lq;for(;++n<e.length;){const b=e[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(c=!1,f!==0&&(oT(v,t,f,h,m),m=void 0,f=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,g=void 0,o=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(n,0,[["enter",m,t]])),a=S.type==="tableDelimiterRow"?2:m?3:1):a&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],g=kd(v,t,o,a,void 0,g),o=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],g=kd(v,t,o,a,void 0,g)),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],g=kd(v,t,o,a,n,g)):l[1]!==0&&(g=kd(v,t,l,a,n,g)),a=0):a&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&oT(v,t,f,h,m),v.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=Uq(t.events,n))}return e}function kd(e,t,n,r,a,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},lo(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=lo(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 h=lo(t.events,n[2]),m=lo(t.events,n[3]),g={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const v=t.events[n[2]],b=t.events[n[3]];if(v[1].end=Object.assign({},b[1].end),v[1].type="chunkText",v[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",g,t]])}return a!==void 0&&(o.end=Object.assign({},lo(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function oT(e,t,n,r,a){const o=[],l=lo(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 lo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Hq={name:"tasklistCheck",tokenize:Gq};function qq(){return{text:{91:Hq}}}function Gq(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 Rt(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):Ze(f)?e.check({tokenize:Kq},t,n)(f):n(f)}}function Kq(e,t,n){return at(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function $q(e){return Lj([yq(),jq(),Pq(e),Bq(),qq()])}const Yq={};function Wq(e){const t=this,n=e||Yq,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push($q(n)),o.push(pq()),l.push(mq(n))}function Sa({value:e,className:t}){return d.jsx("div",{className:t??"anima-markdown",children:d.jsx(PV,{remarkPlugins:[Wq],components:{a:({node:n,...r})=>d.jsx("a",{...r,target:"_blank",rel:"noopener noreferrer",children:r.children})},children:e})})}function Zl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function gf(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(!Zl(n))return t;const r=Zl(n.agents)?n.agents:null,a=r&&Zl(r.defaults)?r.defaults:null,o=a&&Zl(a.heartbeat)?a.heartbeat:null;if(!o)return t;const l=Zl(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 AN(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(),h=e.activeTimezone.trim(),m=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||h)&&(t.activeHours={...c?{start:c}:{},...f?{end:f}:{},...h?{timezone:h}:{}}),m){const g=Number.parseInt(m,10);if(!Number.isFinite(g)||g<0)throw new Error("Heartbeat ackMaxChars must be a non-negative integer.");t.ackMaxChars=g}return{agents:{defaults:{heartbeat:t}}}}const Xq=by(),Qq=/\[\[\s*(?:reply_to_current|reply_to\s*:[^\]\n]*|audio_as_voice)\s*\]\]/gi;function lT(e){const t=[];return{text:e.replace(Qq,r=>{const a=r.replace(/[[\]\s]/g,"").trim();return t.push({tag:a,raw:r.trim()}),""}).replace(/[ \t]+/g," ").trim(),directives:t}}const Ad="main",uT=3,cT="Persistent NoxSoft agent orchestrating ANIMA continuity, mission control, and delivery.",Jq={live:"Live now",delayed:"Delayed update",stale:"Stale data",unavailable:"Source unavailable"},dT=[{id:"users_total",label:"Users"},{id:"newsletter_subscribers_total",label:"Newsletter Subs"},{id:"downloads_total",label:"Downloads"},{id:"promo_videos_hosted_total",label:"Promo Videos"},{id:"ico_holders_total",label:"ICO Holders"},{id:"ico_total_raised_usd",label:"ICO Raised"}];function ss(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Xm(e,t,n=""){const r=e?.[t];return typeof r=="string"?r:n}function Qm(e,t,n=!1){const r=e?.[t];return typeof r=="boolean"?r:n}function Zq(e,t,n){const r=e?.[t];return typeof r=="number"&&Number.isFinite(r)?r:n}function fT(e){const t=ss(e?.config),n=ss(t?.agents),r=ss(n?.defaults),a=ss(r?.memorySearch),o=ss(a?.experimental),l=ss(r?.compaction),c=ss(l?.memoryFlush),f=Array.isArray(a?.extraPaths)?a?.extraPaths.filter(h=>typeof h=="string"):[];return{searchEnabled:Qm(a,"enabled",!0),provider:Xm(a,"provider","openai"),sessionMemory:Qm(o,"sessionMemory",!1),extraPaths:f.join(", "),memoryFlushEnabled:Qm(c,"enabled",!0),memoryFlushPrompt:Xm(c,"prompt"),memoryFlushSystemPrompt:Xm(c,"systemPrompt"),browseLimit:Zq(a,"browseLimit",200)}}function us(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function To(e){if(!e)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>To(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 To(t.message);if("content"in t)return To(t.content)}return""}function e9(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 t9(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=To(n.content).trim();return r?{id:us(),role:n.role,text:r,timestamp:typeof n.timestamp=="number"?n.timestamp:Date.now()}:null}).filter(t=>!!t):[]}function uo(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 n9(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 ur(e){const t=e.tone??"accent";return d.jsx("span",{className:`badge badge-${t}`,children:e.label})}const Er={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:{display:"grid",gridTemplateRows:"0fr",overflow:"hidden",transition:"grid-template-rows 0.25s ease, opacity 0.2s ease"},bodyOpen:{gridTemplateRows:"1fr",opacity:1},bodyClosed:{gridTemplateRows:"0fr",opacity:0},bodyInner:{padding:"0.75rem 1rem 1rem",minHeight:0,overflow:"hidden"}};function Tr(e){const[t,n]=R.useState(e.defaultOpen??!1);return d.jsxs("div",{className:e.className||"card",style:Er.wrapper,children:[d.jsxs("div",{style:{...Er.header,...t?Er.headerOpen:{}},onClick:()=>n(r=>!r),role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n(a=>!a))},children:[d.jsxs("div",{style:Er.headerLeft,children:[d.jsx("span",{style:{...Er.chevron,...t?Er.chevronOpen:{}},children:"▶"}),d.jsx("span",{style:Er.title,children:e.title})]}),d.jsxs("div",{style:Er.badge,children:[e.badge,e.headerRight]})]}),d.jsx("div",{style:{...Er.body,...t?Er.bodyOpen:Er.bodyClosed},children:d.jsx("div",{style:Er.bodyInner,children:e.children})})]})}function _n(e){return d.jsxs("div",{className:"runtime-stat",children:[d.jsx("div",{className:"runtime-stat-label",children:e.label}),d.jsx("div",{className:"runtime-stat-value",children:e.value}),e.detail?d.jsx("div",{className:"runtime-stat-detail",children:e.detail}):null]})}function r9(e){return d.jsx("div",{className:"segmented-control",children:["read","write"].map(t=>d.jsx("button",{type:"button",className:`segment ${e.value===t?"active":""}`,disabled:e.busy,onClick:()=>e.onChange(t),children:t.toUpperCase()},t))})}function i9({subagents:e}){return e?d.jsxs("div",{className:"card",children:[d.jsxs("div",{className:"card-header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Subagents"}),d.jsx("div",{className:"card-subtitle",children:"Native orchestration visibility"})]}),d.jsx(ur,{label:`${e.total} tracked`})]}),d.jsxs("div",{className:"stats-grid compact",children:[d.jsx(_n,{label:"Active",value:String(e.active)}),d.jsx(_n,{label:"Recent",value:String(e.recent)}),d.jsx(_n,{label:"Failed",value:String(e.failed)})]}),e.latest.length===0?d.jsx("div",{className:"empty-note",children:"No subagent activity yet."}):d.jsx("div",{className:"activity-list",children:e.latest.map(t=>d.jsxs("div",{className:"activity-row",children:[d.jsxs("div",{children:[d.jsx("div",{className:"mono subtle",children:n9(t.key)}),d.jsx("div",{className:"runtime-stat-detail",children:uo(t.updatedAt)})]}),d.jsx(ur,{tone:t.status==="failed"?"error":t.status==="active"?"success":t.status==="recent"?"accent":"warning",label:t.status})]},`${t.key}:${t.updatedAt??"none"}`))})]}):null}function a9({tools:e}){const[t,n]=R.useState(!1),r=e.filter(o=>o.status==="done").length,a=e.filter(o=>o.status==="error").length;return d.jsxs("div",{className:"tool-activity-panel",children:[d.jsxs("button",{type:"button",className:"tool-activity-toggle",onClick:()=>n(o=>!o),children:[d.jsx("span",{className:"tool-activity-icon",children:t?"▾":"▸"}),d.jsxs("span",{className:"tool-activity-summary",children:[e.length," tool",e.length!==1?"s":""," used",a>0&&d.jsxs("span",{className:"tool-count-error",children:[" · ",a," failed"]}),r>0&&!a&&d.jsx("span",{className:"tool-count-ok",children:" · all succeeded"})]})]}),t&&d.jsx("div",{className:"tool-activity-list",children:e.map(o=>d.jsx(s9,{tool:o},o.id))})]})}function s9({tool:e}){const[t,n]=R.useState(!1),r=e.status==="done"?"✓":e.status==="error"?"✗":"◌",a=e.status==="done"?"success":e.status==="error"?"error":"running";return d.jsxs("div",{className:`tool-activity-item ${a}`,children:[d.jsxs("button",{type:"button",className:"tool-activity-item-header",onClick:()=>n(o=>!o),children:[d.jsx("span",{className:`tool-status-icon ${a}`,children:r}),d.jsx("span",{className:"tool-name",children:e.name}),(e.input||e.result)&&d.jsx("span",{className:"tool-detail-toggle",children:t?"▾":"▸"})]}),t&&(e.input||e.result)&&d.jsxs("div",{className:"tool-detail-body",children:[e.input&&d.jsxs("div",{className:"tool-detail-section",children:[d.jsx("div",{className:"tool-detail-label",children:"Input"}),d.jsx("pre",{className:"tool-detail-pre",children:e.input})]}),e.result&&d.jsxs("div",{className:"tool-detail-section",children:[d.jsx("div",{className:"tool-detail-label",children:"Result"}),d.jsx("pre",{className:"tool-detail-pre",children:e.result})]})]})]})}function o9({runId:e,activity:t}){const n=e?t.get(e):void 0;return!n||n.length===0?null:d.jsx("div",{className:"live-tool-activity",children:n.map(r=>d.jsxs("div",{className:`live-tool-chip ${r.status}`,children:[d.jsx("span",{className:"live-tool-dot"}),d.jsx("span",{className:"live-tool-name",children:r.name})]},r.id))})}function l9({directives:e}){return d.jsx("div",{className:"directive-badges",children:e.map((t,n)=>d.jsx("span",{className:"directive-badge",title:t.raw,children:t.tag.replace(/_/g," ")},n))})}function u9(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[a,o]=R.useState(null),[l,c]=R.useState(null),[f,h]=R.useState(()=>gf(null)),[m,g]=R.useState(`{
53
+ }
54
+ `),[v,b]=R.useState({token:"",inviteCode:"",agentName:"",displayName:"",description:cT}),[S,w]=R.useState(null),[E,T]=R.useState(""),[k,C]=R.useState(()=>fT(null)),[N,j]=R.useState(null),[_,I]=R.useState(null),[L,V]=R.useState(null),[D,q]=R.useState(null),[G,Z]=R.useState(null),[ce,J]=R.useState(!1),[B,X]=R.useState(!1),[le,ye]=R.useState(!1),[M,U]=R.useState(!1),[ee,P]=R.useState(!1),[ue,me]=R.useState(!1),[Se,we]=R.useState("Check chat.noxsoft.net, sync mission control, and report anything needing action."),[Ue,Ne]=R.useState(!1),[ve,Pe]=R.useState([]),[pt,Zt]=R.useState(""),[We,mt]=R.useState(null),[gt,Gt]=R.useState(!1),[_t,Ft]=R.useState(""),[vt,dt]=R.useState(!1),[Ln,Le]=R.useState(!1),[Me,W]=R.useState(null),[H,se]=R.useState([]),[Ee,Te]=R.useState(new Map),Ve=R.useRef(new Map);R.useEffect(()=>{Ve.current=Ee},[Ee]);const st=R.useRef(null),Xt=R.useRef(new Map),Ot=R.useRef(null),St=R.useRef(null),z=R.useRef(null),Y=R.useRef(""),xe=R.useRef(null),He=R.useRef(null),en=R.useRef(new Set),Dr=n?.assistant?.name?.trim()||a?.agent?.display_name||"ANIMA",Oa=n?.mission?.state?.workingMode??"write",Ir=n?.mission?.repo??n?.mission?.state?.repo,Pt=n?.mission?.state?.speech,Bi=_?.metrics??[],Ma=R.useMemo(()=>new Map(Bi.map($=>[$.id,$])),[Bi]),qo=Bi.filter($=>$.state!=="unavailable").length,Go=dT.length,Ko=qo===0?"warning":qo===Go?"success":"accent",cn=R.useCallback(async()=>{J(!0);try{const[$,he,Ye,nt,Lt,wt,Zn,er]=await Promise.all([dj(),pj(),mj(),fj(),y1().catch(()=>null),Sj().catch(()=>null),bj().catch(()=>({triggers:[]})),bB().catch(()=>null)]);t($),r(he),o(Ye),c(nt),g(typeof nt.raw=="string"?nt.raw:`{
55
+ }
56
+ `),h(gf(nt)),b({token:Ye.tokenPreview||"",inviteCode:"",agentName:Ye.suggestedIdentity.name,displayName:Ye.suggestedIdentity.displayName,description:cT}),w(wt),T(Zn.triggers.join(", ")),C(fT(nt)),j(he.mission.state.autoToggle),I(er),Lt&&V(Lt),q(null)}catch($){q($ instanceof Error?$.message:String($))}finally{J(!1),X(!0)}},[]),$u=R.useRef(void 0);R.useEffect(()=>{$u.current=L?.cursor},[L?.cursor]);const $o=R.useCallback(async()=>{try{const $=await y1($u.current);V(he=>!he||$.reset?$:{...$,lines:[...he.lines,...$.lines].slice(-320)})}catch{}},[]);R.useEffect(()=>{cn();const $=window.setInterval(()=>{cn()},15e3),he=window.setInterval(()=>{$o()},4e3);return()=>{window.clearInterval($),window.clearInterval(he)}},[cn,$o]),R.useEffect(()=>{Y.current=_t},[_t]),R.useEffect(()=>{xe.current?.scrollIntoView({behavior:"smooth",block:"end"})},[ve,_t]),R.useEffect(()=>{if(typeof window>"u")return;const $=window.speechSynthesis;if(!$)return;const he=()=>{const Ye=$.getVoices().map(nt=>nt.name).filter(Boolean);se(Ye)};return he(),$.addEventListener?.("voiceschanged",he),()=>$.removeEventListener?.("voiceschanged",he)},[]),R.useEffect(()=>{if(typeof window>"u")return;const $=window.SpeechRecognition||window.webkitSpeechRecognition;if(!$){dt(!1),He.current=null;return}dt(!0);const he=new $;he.continuous=Pt?.continuous??!0,he.interimResults=!0,he.lang=Pt?.lang||"en-US";const Ye=wt=>{const Zn=wt;let er="";for(let fn=0;fn<Zn.results.length;fn+=1){const La=Zn.results[fn]?.[0];La?.transcript&&(er+=La.transcript)}er.trim()&&Zt(er.trim())},nt=wt=>{W(wt.error||"Voice capture failed."),Le(!1)},Lt=()=>{Le(!1)};return he.addEventListener("result",Ye),he.addEventListener("error",nt),he.addEventListener("end",Lt),He.current=he,()=>{he.removeEventListener("result",Ye),he.removeEventListener("error",nt),he.removeEventListener("end",Lt),he.stop(),He.current=null}},[Pt?.continuous,Pt?.lang]),R.useEffect(()=>{if(!Pt?.autoSpeak||typeof window>"u"||!window.speechSynthesis)return;const $=ve.toReversed().find(Ye=>Ye.role==="assistant");if(!$||en.current.has($.id))return;const he=new SpeechSynthesisUtterance($.text);if(he.lang=Pt.lang||"en-US",he.rate=Pt.rate||1,he.pitch=Pt.pitch||1,Pt.voiceName){const Ye=window.speechSynthesis.getVoices().find(nt=>nt.name===Pt.voiceName);Ye&&(he.voice=Ye)}en.current.add($.id),window.speechSynthesis.cancel(),window.speechSynthesis.speak(he)},[ve,Pt]);const Da=R.useMemo(()=>function(he,Ye){const nt=st.current;if(!nt||nt.readyState!==WebSocket.OPEN)return Promise.reject(new Error("Gateway websocket is not connected"));const Lt=us(),wt={type:"req",id:Lt,method:he,params:Ye};return new Promise((Zn,er)=>{Xt.current.set(Lt,{resolve:Zn,reject:fn=>er(fn)});try{nt.send(JSON.stringify(wt))}catch(fn){Xt.current.delete(Lt),er(fn instanceof Error?fn:new Error(String(fn)))}})},[]);R.useEffect(()=>{let $=!1,he=!1,Ye=!1,nt;function Lt(Ge){for(const yt of Xt.current.values())yt.reject(new Error(Ge));Xt.current.clear()}async function wt(){try{const Ge=await Da("chat.history",{sessionKey:Ad,limit:120});if($)return;Pe(t9(Ge?.messages))}catch(Ge){$||mt(Ge instanceof Error?Ge.message:String(Ge))}}async function Zn(){if($||he||Ye)return;const Ge=st.current;if(!(!Ge||Ge.readyState!==WebSocket.OPEN)){he=!0;try{const yt=xy();if(!yt)throw new Error("Gateway token missing. Re-open this page once with ?token=ANIMA_GATEWAY_TOKEN.");const ft=await yy({minProtocol:uT,maxProtocol:uT,client:{id:"anima-control-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:yt,nonce:nt});if(await Da("connect",ft),$)return;Ye=!0,Ne(!0),mt(null),wt()}catch(yt){if(!$){Ne(!1);const ft=yt instanceof Error?yt.message:String(yt);ft!=="Gateway websocket is not connected"&&mt(ft)}}finally{he=!1}}}function er(){$||Ot.current!==null||(Ot.current=window.setTimeout(()=>{Ot.current=null,$||La()},1500))}function fn(Ge){if(Ge.sessionKey&&Ge.sessionKey!==Ad)return;const yt=Ge.runId;if(yt){if(Ge.stream==="tool"){const ft=Ge.data||{},jt=typeof ft.name=="string"?ft.name:typeof ft.tool=="string"?ft.tool:"";if(!jt)return;const gn=typeof ft.phase=="string"?ft.phase:"",yn=ft.input?typeof ft.input=="string"?ft.input:JSON.stringify(ft.input,null,2):void 0,tn=ft.result?typeof ft.result=="string"?ft.result:JSON.stringify(ft.result,null,2):void 0;Te(Wr=>{const za=Wr.get(yt)||[];if(gn==="start"||gn==="call")return new Map(Wr).set(yt,[...za,{id:us(),name:jt,input:yn,status:"running",timestamp:Date.now()}]);const mi=[...za],Ua=mi.findLastIndex(Ba=>Ba.name===jt&&Ba.status==="running");return Ua>=0&&(mi[Ua]={...mi[Ua],status:gn==="error"?"error":"done",result:tn||mi[Ua].result}),new Map(Wr).set(yt,mi)})}Ge.stream==="lifecycle"&&(typeof Ge.data?.phase=="string"?Ge.data.phase:"")==="start"&&Te(jt=>new Map(jt).set(yt,[]))}}function pi(Ge){if(!(Ge.sessionKey&&Ge.sessionKey!==Ad)){if(Ge.state==="delta"){const yt=To(Ge.message);yt&&Ft(ft=>e9(ft,yt));return}if(Ge.state==="final"){const yt=z.current;if(Ge.runId&&yt&&Ge.runId!==yt)return;const ft=To(Ge.message).trim()||Y.current.trim(),{text:jt,directives:gn}=lT(ft),yn=Ge.runId||z.current||void 0,tn=yn?Ve.current.get(yn):void 0;(jt||tn&&tn.length>0)&&Pe(Wr=>[...Wr,{id:us(),role:"assistant",text:jt,timestamp:Date.now(),directives:gn.length>0?gn:void 0,toolActivity:tn&&tn.length>0?tn:void 0,runId:yn||void 0}]),yn&&Te(Wr=>{const za=new Map(Wr);return za.delete(yn),za}),z.current=null,Gt(!1),Ft("");return}if(Ge.state==="error"){const yt=Ge.errorMessage||"Chat run failed";mt(yt),Pe(ft=>[...ft,{id:us(),role:"assistant",text:`Error: ${yt}`,timestamp:Date.now()}]),z.current=null,Gt(!1),Ft("");return}Ge.state==="aborted"&&(z.current=null,Gt(!1),Ft(""))}}function La(){he=!1,Ye=!1,nt=void 0;const Ge=new WebSocket(Xq);st.current=Ge,Ne(!1),Ge.addEventListener("open",()=>{St.current&&window.clearTimeout(St.current),St.current=window.setTimeout(()=>{St.current=null,Zn()},300)}),Ge.addEventListener("message",yt=>{let ft;try{ft=JSON.parse(String(yt.data))}catch{return}const jt=ft;if(jt.type==="res"){const gn=Xt.current.get(jt.id);if(!gn)return;Xt.current.delete(jt.id),jt.ok?gn.resolve(jt.payload):gn.reject(new Error(jt.error?.message||"Gateway request failed"));return}if(jt.type==="event"){if(jt.event==="connect.challenge"){const gn=vy(jt.payload);gn&&(nt=gn),Zn();return}jt.event==="chat"&&pi(jt.payload||{}),jt.event==="agent"&&fn(jt.payload||{})}}),Ge.addEventListener("error",()=>{mt("Websocket error while connecting to ANIMA gateway")}),Ge.addEventListener("close",()=>{he=!1,Ye=!1,Ne(!1),Lt("Gateway websocket closed"),er()})}return La(),()=>{$=!0,St.current&&window.clearTimeout(St.current),Ot.current&&window.clearTimeout(Ot.current),Lt("Dashboard shutting down"),st.current?.close(),st.current=null}},[Da]);const Ia=R.useCallback(async $=>{try{const he=await xa({speech:$});n&&r({...n,mission:{...n.mission,state:{...n.mission.state,speech:he.speech}}})}catch(he){Z(he instanceof Error?he.message:String(he))}},[n]);async function Yo($){$.preventDefault();const he=pt.trim();if(!he||gt)return;const Ye=st.current;if(!Ye||Ye.readyState!==WebSocket.OPEN){mt("Gateway websocket is not connected");return}const nt=us();z.current=nt,Pe(Lt=>[...Lt,{id:us(),role:"user",text:he,timestamp:Date.now()}]),Zt(""),Gt(!0),Ft(""),mt(null);try{await Da("chat.send",{sessionKey:Ad,message:he,deliver:!1,idempotencyKey:nt})}catch(Lt){mt(Lt instanceof Error?Lt.message:String(Lt)),Gt(!1),Ft(""),z.current=null}}async function Wo($){ye(!0),Z(null);try{await XU($),await cn(),Z(`Working mode set to ${$}.`)}catch(he){Z(he instanceof Error?he.message:String(he))}finally{ye(!1)}}async function Yu(){if(!l?.hash){Z("Config hash missing. Refresh the dashboard and try again.");return}U(!0),Z(null);try{await Qg(JSON.stringify(AN(f),null,2),l.hash),await cn(),Z("Heartbeat settings updated.")}catch($){Z($ instanceof Error?$.message:String($))}finally{U(!1)}}async function Wu($){P(!0),Z(null);try{await Jg($),await cn(),Z($?"Heartbeat enabled.":"Heartbeat disabled.")}catch(he){Z(he instanceof Error?he.message:String(he))}finally{P(!1)}}async function Pr($){Z(null);try{const he=Se.trim()||"Check NoxSoft chat, mission control, and continuity status.";await yj(he,$),Z($==="now"?"Heartbeat wake sent immediately.":"Wake queued for the next heartbeat.")}catch(he){Z(he instanceof Error?he.message:String(he))}}async function dn(){me(!0),Z(null);try{v.token.trim()&&await gj(v.token.trim()),v.inviteCode.trim()&&await vj({code:v.inviteCode.trim(),name:v.agentName.trim()||void 0,displayName:v.displayName.trim()||void 0,description:v.description.trim()||void 0}),await cn(),Z("Registration settings updated.")}catch($){Z($ instanceof Error?$.message:String($))}finally{me(!1)}}async function Nn(){if(S){me(!0),Z(null);try{await Zg(S.providers.map($=>({id:$.id,name:$.name,enabled:$.enabled,priority:$.priority}))),await wj(S.autoRotation,S.rotationStrategy||"on-rate-limit"),await cn(),Z("Provider settings updated.")}catch($){Z($ instanceof Error?$.message:String($))}finally{me(!1)}}}async function Fi(){me(!0),Z(null);try{const $=E.split(",").map(he=>he.trim()).filter(Boolean);await xj($),await cn(),Z("Voice wake settings updated.")}catch($){Z($ instanceof Error?$.message:String($))}finally{me(!1)}}async function Xo(){if(!l?.hash){Z("Config hash missing. Refresh the dashboard and try again.");return}me(!0),Z(null);try{await Qg(JSON.stringify({agents:{defaults:{memorySearch:{enabled:k.searchEnabled,provider:k.provider.trim()||"openai",browseLimit:Math.max(1,Math.floor(k.browseLimit||200)),extraPaths:k.extraPaths.split(",").map($=>$.trim()).filter(Boolean),experimental:{sessionMemory:k.sessionMemory}},compaction:{memoryFlush:{enabled:k.memoryFlushEnabled,prompt:k.memoryFlushPrompt.trim()||void 0,systemPrompt:k.memoryFlushSystemPrompt.trim()||void 0}}}}},null,2),l.hash),await cn(),Z("Memory settings updated.")}catch($){Z($ instanceof Error?$.message:String($))}finally{me(!1)}}async function $f(){if(N){me(!0),Z(null);try{await xa({autoToggle:N}),await cn(),Z("Auto-toggle policy updated.")}catch($){Z($ instanceof Error?$.message:String($))}finally{me(!1)}}}async function Xu($){if(!l?.hash){Z("Config hash missing. Refresh the dashboard and try again.");return}me(!0),Z(null);try{await hj(m,l.hash,$),await cn(),Z($?"Raw config saved and applied.":"Raw config saved.")}catch(he){Z(he instanceof Error?he.message:String(he))}finally{me(!1)}}function Qu(){if(!He.current){W("Browser speech recognition is not available here.");return}W(null),Le(!0),He.current.start()}function Pa(){He.current?.stop(),Le(!1)}return B?D&&!n&&!e?d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Assistant Home"}),d.jsxs("div",{className:"card empty-state-card",children:[d.jsx("div",{className:"empty-state-symbol",children:"!"}),d.jsx("div",{className:"empty-state-copy",children:"Unable to reach gateway"}),d.jsx("div",{className:"runtime-stat-detail",style:{marginTop:"0.5rem"},children:D}),d.jsxs("div",{className:"runtime-stat-detail",style:{marginTop:"1rem"},children:["Make sure the daemon is running with ",d.jsx("code",{children:"anima start"})," and that the gateway is accessible. If connecting via browser, verify the URL includes"," ",d.jsx("code",{children:"?token=YOUR_TOKEN"}),"."]})]})]}):d.jsxs("div",{children:[d.jsxs("div",{className:"page-header-row",children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"page-title",children:[Dr," Home"]}),d.jsx("div",{className:"page-subtitle",children:"Local mission control, heartbeat orchestration, and direct gateway chat."})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[d.jsx("span",{className:`status-chip ${D?"offline":"online"}`,children:D?"Gateway unreachable":"Gateway connected"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{cn()},children:ce?"Refreshing...":"Refresh"})]})]}),d.jsxs("div",{className:"hero-grid",children:[d.jsxs("div",{className:"card identity-hero",children:[d.jsx("div",{className:"identity-badge",children:n?.assistant.avatar||"A"}),d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:Dr}),d.jsx("div",{className:"card-subtitle mono",children:n?.assistant.agentId||a?.agent?.name||"main"}),d.jsxs("div",{className:"badge-row top-gap",children:[d.jsx(ur,{tone:e?.heartbeat.running?"success":"warning",label:e?.heartbeat.running?"heartbeat live":"heartbeat idle"}),d.jsx(ur,{tone:a?.agent?"accent":"warning",label:a?.agent?"registered":"not registered"}),d.jsx(ur,{tone:Ir?.remoteConfigured?"success":"warning",label:Ir?.remoteConfigured?"repo linked":"repo pending"})]})]})]}),d.jsxs("div",{className:"card",children:[d.jsxs("div",{className:"card-header compact",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Working Mode"}),d.jsx("div",{className:"card-subtitle",children:"Control whether ANIMA is in read-only or write-capable mode."})]}),d.jsx(r9,{value:Oa,busy:le,onChange:Wo})]}),d.jsxs("div",{className:"runtime-stat-detail top-gap",children:["Session security:"," ",d.jsx("span",{className:"mono",children:n?.mainSession.execSecurity??"unknown"})," · Ask policy: ",d.jsx("span",{className:"mono",children:n?.mainSession.execAsk??"unknown"})]})]})]}),G?d.jsx("div",{className:"card status-banner",children:d.jsx("div",{children:G})}):null,d.jsxs("div",{className:"stats-grid compact",style:{marginBottom:"1.5rem"},children:[d.jsx(_n,{label:"Heartbeat",value:e?.heartbeat.running?"Live":"Idle",detail:e?.heartbeat.lastBeat?`Last: ${uo(e.heartbeat.lastBeat)}`:"No beats yet"}),d.jsx(_n,{label:"Mode",value:Oa.toUpperCase(),detail:`Security: ${n?.mainSession.execSecurity??"unknown"}`}),d.jsx(_n,{label:"Gateway",value:Ue?"Connected":"Disconnected",detail:`${ve.length} messages`}),d.jsx(_n,{label:"Providers",value:String(S?.providers.filter($=>$.enabled).length??0),detail:`of ${S?.providers.length??0} configured`}),d.jsx(_n,{label:"Subagents",value:String(e?.subagents?.active??0),detail:`${e?.subagents?.total??0} tracked`}),d.jsx(_n,{label:"Queued Events",value:String(n?.queuedSystemEvents.length??0)})]}),d.jsxs("div",{className:"card",style:{marginBottom:"1.5rem"},children:[d.jsxs("div",{className:"card-header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Impact Footprint"}),d.jsx("div",{className:"card-subtitle",children:"Real source feed status for public impact metrics."})]}),d.jsx(ur,{tone:Ko,label:`${qo}/${Go} available`})]}),d.jsx("div",{className:"stats-grid compact",children:dT.map($=>{const he=Ma.get($.id),Ye=he?.state??"unavailable",nt=he&&he.state!=="unavailable"?he.displayValue:"--";return d.jsx(_n,{label:$.label,value:nt,detail:`${Jq[Ye]} · ${he?.sourceRef??"source unavailable"}`},$.id)})}),d.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:_?`Generated ${uo(_.generatedAt)}.`:"Footprint feed unavailable right now."})]}),d.jsxs("div",{className:"dashboard-grid",children:[d.jsx("div",{className:"dashboard-main-column",children:d.jsxs(Tr,{title:`Talk to ${Dr}`,badge:d.jsx("span",{className:`status-chip ${Ue?"online":"offline"}`,children:Ue?"Connected":"Reconnecting"}),className:"card live-chat-card",children:[d.jsxs("div",{className:"live-chat-feed",children:[ve.length===0&&!_t?d.jsx("div",{className:"empty-note",children:"Conversation history is empty. Send a message to begin."}):null,ve.map($=>d.jsx("div",{className:`live-chat-row ${$.role==="user"?"user":"assistant"}`,children:d.jsxs("div",{className:`live-chat-bubble ${$.role}`,children:[d.jsx("div",{className:"live-chat-role",children:$.role==="user"?"You":Dr}),$.toolActivity&&$.toolActivity.length>0&&d.jsx(a9,{tools:$.toolActivity}),$.text&&d.jsx(Sa,{value:$.text,className:"live-chat-markdown"}),$.directives&&$.directives.length>0&&d.jsx(l9,{directives:$.directives})]})},$.id)),_t?d.jsx("div",{className:"live-chat-row assistant",children:d.jsxs("div",{className:"live-chat-bubble assistant",children:[d.jsx("div",{className:"live-chat-role",children:Dr}),d.jsx(o9,{runId:z.current,activity:Ee}),d.jsx(Sa,{value:lT(_t).text,className:"live-chat-markdown"})]})}):null,d.jsx("div",{ref:xe})]}),d.jsxs("div",{className:"voice-toolbar",children:[d.jsx("button",{type:"button",className:"action-button ghost",onClick:Ln?Pa:Qu,disabled:!vt,children:Ln?"Stop Listening":"Start Listening"}),d.jsxs("button",{type:"button",className:"action-button ghost",onClick:()=>{Ia({autoSpeak:!(Pt?.autoSpeak??!1)})},children:["Auto Speak: ",Pt?.autoSpeak?"On":"Off"]}),d.jsxs("button",{type:"button",className:"action-button ghost",onClick:()=>{Ia({continuous:!(Pt?.continuous??!0)})},children:["Continuous: ",Pt?.continuous===!1?"Off":"On"]})]}),Me?d.jsx("div",{className:"runtime-stat-detail warning-text",children:Me}):null,We?d.jsx("div",{className:"runtime-stat-detail warning-text",children:We}):null,d.jsxs("form",{onSubmit:Yo,className:"live-chat-input-row",children:[d.jsx("textarea",{value:pt,onChange:$=>Zt($.target.value),placeholder:`Message ${Dr} directly...`,className:"live-chat-input",rows:4}),d.jsx("button",{type:"submit",className:"live-chat-send",disabled:gt||!pt.trim(),children:gt?"Sending...":"Send"})]})]})}),d.jsxs("div",{className:"dashboard-side-column",children:[d.jsxs(Tr,{title:"Heartbeat Studio",defaultOpen:!0,headerRight:d.jsx("button",{type:"button",className:"action-button ghost",onClick:$=>{$.stopPropagation(),Wu(!(e?.heartbeat.running??!1))},disabled:ee,children:ee?"Saving...":e?.heartbeat.running?"Disable":"Enable"}),badge:d.jsx(ur,{tone:e?.heartbeat.running?"success":"warning",label:e?.heartbeat.running?"live":"idle"}),children:[d.jsxs("div",{className:"stats-grid compact",children:[d.jsx(_n,{label:"Cadence",value:f.every||"unset"}),d.jsx(_n,{label:"Last beat",value:e?.heartbeat.lastBeat?uo(e.heartbeat.lastBeat):"none",detail:n?.lastHeartbeat?.preview||"No heartbeat summary yet."}),d.jsx(_n,{label:"Queued events",value:String(n?.queuedSystemEvents.length??0)})]}),d.jsxs("div",{className:"form-grid two-col top-gap",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Every"}),d.jsx("input",{className:"search-bar mono",value:f.every,onChange:$=>h(he=>({...he,every:$.target.value})),placeholder:"5m"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Target"}),d.jsx("input",{className:"search-bar mono",value:f.target,onChange:$=>h(he=>({...he,target:$.target.value})),placeholder:"last"})]})]}),d.jsxs("label",{className:"field-block top-gap-sm",children:[d.jsx("span",{children:"Prompt"}),d.jsx("textarea",{className:"search-bar mono",rows:4,value:f.prompt,onChange:$=>h(he=>({...he,prompt:$.target.value})),placeholder:"Heartbeat reminder and continuity prompt"})]}),d.jsxs("div",{className:"button-row top-gap",children:[d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Yu()},disabled:M,children:M?"Saving...":"Save Heartbeat"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Pr("now")},children:"Wake Now"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Pr("next-heartbeat")},children:"Queue Wake"})]}),d.jsxs("label",{className:"field-block top-gap",children:[d.jsx("span",{children:"Wake text"}),d.jsx("textarea",{className:"search-bar",rows:3,value:Se,onChange:$=>we($.target.value)})]}),d.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."})]}),d.jsxs(Tr,{title:"Continuity",badge:d.jsx(ur,{tone:Ir?.remoteConfigured?"success":"warning",label:Ir?.remoteConfigured?"linked":"needs repo"}),children:[d.jsxs("div",{className:"stats-grid compact",children:[d.jsx(_n,{label:"Mission dir",value:n?.mission?.directory||"~/.anima/mission-control"}),d.jsx(_n,{label:"Repo",value:Ir?.url||"Create a private SSH repo",detail:Ir?.branch||"branch unset"}),d.jsx(_n,{label:"History",value:String(n?.mission?.importantHistory?.length??0),detail:"archived continuity files"})]}),d.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($=>$.fileName==="self-directives.md")?d.jsxs("details",{className:"details-panel top-gap",open:!0,children:[d.jsx("summary",{children:"Self directives"}),d.jsx(Sa,{value:n.mission.files.find($=>$.fileName==="self-directives.md")?.content||"",className:"markdown-preview"})]}):null]}),d.jsxs(Tr,{title:"Identity + NoxSoft",badge:d.jsx(ur,{tone:a?.agent?"accent":"warning",label:a?.agent?"registered":"unregistered"}),children:[d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Agent token"}),d.jsx("input",{className:"search-bar mono",value:v.token,onChange:$=>b(he=>({...he,token:$.target.value})),placeholder:"nox_ag_...",spellCheck:!1})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Invite code"}),d.jsx("input",{className:"search-bar mono",value:v.inviteCode,onChange:$=>b(he=>({...he,inviteCode:$.target.value})),placeholder:"NX-XXXXXX"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Agent name"}),d.jsx("input",{className:"search-bar mono",value:v.agentName,onChange:$=>b(he=>({...he,agentName:$.target.value}))})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Display name"}),d.jsx("input",{className:"search-bar",value:v.displayName,onChange:$=>b(he=>({...he,displayName:$.target.value}))})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Description"}),d.jsx("input",{className:"search-bar",value:v.description,onChange:$=>b(he=>({...he,description:$.target.value}))})]})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{dn()},disabled:ue,children:ue?"Saving...":"Save Identity"})}),d.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Stored token path:"," ",d.jsx("span",{className:"mono",children:a?.tokenPath||"~/.noxsoft-agent-token"})]})]}),d.jsx(Tr,{title:"Providers",badge:d.jsx(ur,{label:`${S?.providers.filter($=>$.enabled).length??0} active`}),children:S?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"activity-list",children:S.providers.map($=>d.jsxs("div",{className:"activity-row",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:$.name}),d.jsx("div",{className:"runtime-stat-detail mono",children:$.apiKeyMasked})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[d.jsxs("span",{className:"runtime-stat-detail",children:["P",$.priority]}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>w(he=>he&&{...he,providers:he.providers.map(Ye=>Ye.id===$.id?{...Ye,enabled:!Ye.enabled}:Ye)}),children:$.enabled?"Disable":"Enable"})]})]},$.id))}),d.jsxs("div",{className:"toggle-row top-gap",children:[d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:S.autoRotation,onChange:()=>w($=>$&&{...$,autoRotation:!$.autoRotation})}),"Auto-rotate providers"]}),d.jsxs("select",{value:S.rotationStrategy||"on-rate-limit",onChange:$=>w(he=>he&&{...he,rotationStrategy:$.target.value}),children:[d.jsx("option",{value:"on-rate-limit",children:"On rate limit"}),d.jsx("option",{value:"round-robin",children:"Round robin"})]})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Nn()},disabled:ue,children:ue?"Saving...":"Save Providers"})})]}):d.jsx("div",{className:"empty-note",children:"Provider configuration unavailable."})}),d.jsxs(Tr,{title:"Memory Engine",children:[d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Provider"}),d.jsx("input",{className:"search-bar mono",value:k.provider,onChange:$=>C(he=>({...he,provider:$.target.value}))})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Browse limit"}),d.jsx("input",{className:"search-bar mono",type:"number",min:1,value:k.browseLimit,onChange:$=>C(he=>({...he,browseLimit:Number($.target.value)||200}))})]}),d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Extra paths"}),d.jsx("input",{className:"search-bar mono",value:k.extraPaths,onChange:$=>C(he=>({...he,extraPaths:$.target.value})),placeholder:"memory/people.md, memory/project.md"})]}),d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Memory flush prompt"}),d.jsx("textarea",{className:"search-bar",rows:3,value:k.memoryFlushPrompt,onChange:$=>C(he=>({...he,memoryFlushPrompt:$.target.value}))})]}),d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Memory flush system prompt"}),d.jsx("textarea",{className:"search-bar",rows:3,value:k.memoryFlushSystemPrompt,onChange:$=>C(he=>({...he,memoryFlushSystemPrompt:$.target.value}))})]})]}),d.jsxs("div",{className:"toggle-row top-gap",children:[d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:k.searchEnabled,onChange:$=>C(he=>({...he,searchEnabled:$.target.checked}))}),"Memory search enabled"]}),d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:k.sessionMemory,onChange:$=>C(he=>({...he,sessionMemory:$.target.checked}))}),"Index session transcripts"]}),d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:k.memoryFlushEnabled,onChange:$=>C(he=>({...he,memoryFlushEnabled:$.target.checked}))}),"Pre-compaction memory flush"]})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Xo()},disabled:ue,children:ue?"Saving...":"Save Memory"})})]}),d.jsx(Tr,{title:"Auto-Toggle Policy",children:N?d.jsxs(d.Fragment,{children:[d.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(([$,he])=>d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:N[$],onChange:Ye=>j(nt=>nt&&{...nt,[$]:Ye.target.checked})}),he]},$))}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{$f()},disabled:ue,children:ue?"Saving...":"Save Policy"})})]}):d.jsx("div",{className:"empty-note",children:"Mission policy unavailable."})}),d.jsx(i9,{subagents:e?.subagents}),d.jsxs(Tr,{title:"Agent Logs",badge:d.jsx(ur,{label:`${L?.lines.length??0} lines`}),children:[d.jsx("div",{className:"runtime-stat-detail mono",children:L?.file||"No log file detected."}),d.jsx("pre",{className:"log-console",children:L?.lines.join(`
57
+ `)||"No log lines yet."})]}),d.jsx(Tr,{title:"Inner World",badge:d.jsx(ur,{label:`${(n?.mission?.innerWorld||[]).length} entries`}),children:d.jsx("div",{className:"activity-list",children:(n?.mission?.innerWorld||[]).map($=>d.jsxs("div",{className:"inner-world-entry",children:[d.jsxs("div",{className:"activity-row",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:$.title}),d.jsx("div",{className:"runtime-stat-detail mono",children:$.path})]}),d.jsx("div",{className:"runtime-stat-detail",children:uo($.updatedAt)})]}),d.jsx(Sa,{value:$.content,className:"markdown-preview"})]},$.id))})}),d.jsx(Tr,{title:"Important History",badge:d.jsx(ur,{label:`${(n?.mission?.importantHistory||[]).length} files`}),children:(n?.mission?.importantHistory||[]).length?d.jsx("div",{className:"activity-list",children:(n?.mission?.importantHistory||[]).map($=>d.jsxs("div",{className:"inner-world-entry",children:[d.jsxs("div",{className:"activity-row",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:$.relativePath}),d.jsx("div",{className:"runtime-stat-detail mono",children:$.archiveId}),d.jsx("div",{className:"runtime-stat-detail mono",children:$.path})]}),d.jsx("div",{className:"runtime-stat-detail",children:uo($.updatedAt)})]}),d.jsx(Sa,{value:$.content,className:"markdown-preview"})]},$.id))}):d.jsx("div",{className:"empty-note",children:"No archived continuity has been imported yet."})}),d.jsxs(Tr,{title:"Speech Setup",children:[d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Language"}),d.jsx("input",{className:"search-bar mono",value:Pt?.lang||"en-US",onChange:$=>{Ia({lang:$.target.value})}})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Voice"}),d.jsxs("select",{className:"search-bar",value:Pt?.voiceName||"",onChange:$=>{Ia({voiceName:$.target.value||void 0})},children:[d.jsx("option",{value:"",children:"System default"}),H.map($=>d.jsx("option",{value:$,children:$},$))]})]})]}),d.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."}),d.jsxs("label",{className:"field-block top-gap",children:[d.jsx("span",{children:"Wake triggers"}),d.jsx("input",{className:"search-bar",value:E,onChange:$=>T($.target.value),placeholder:"anima, axiom, hey anima"})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Fi()},disabled:ue,children:ue?"Saving...":"Save Voice Wake"})})]}),d.jsxs(Tr,{title:"Raw Config",children:[d.jsxs("div",{className:"runtime-stat-detail",children:["Hash: ",d.jsx("span",{className:"mono",children:l?.hash||"<none>"})]}),d.jsx("textarea",{value:m,onChange:$=>g($.target.value),spellCheck:!1,className:"search-bar mono advanced-editor top-gap"}),d.jsxs("div",{className:"button-row top-gap",children:[d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Xu(!1)},disabled:ue,children:ue?"Saving...":"Save Raw Config"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Xu(!0)},disabled:ue,children:"Save + Apply"})]})]})]})]})]}):d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Assistant Home"}),d.jsxs("div",{className:"card empty-state-card",children:[d.jsx("div",{className:"empty-state-symbol",children:"~"}),d.jsx("div",{className:"empty-state-copy",children:"Connecting to gateway..."}),d.jsx("div",{className:"runtime-stat-detail",children:"Establishing connection to the ANIMA daemon."})]})]})}function dv(e){return e?new Date(e).toLocaleString():"—"}function c9(e){return e==="improving"?" ↑":e==="declining"?" ↓":""}function d9({cap:e}){const t=Math.round(e.confidence*100),n=t>=70?"#00c853":t>=40?"#ff9800":"#ff3b30";return d.jsxs("div",{style:{marginBottom:8},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13},children:[d.jsxs("span",{children:[e.name,d.jsx("span",{style:{color:n,fontSize:11},children:c9(e.trend)})]}),d.jsxs("span",{style:{color:"#888"},children:[t,"%"]})]}),d.jsx("div",{style:{height:6,background:"#222",borderRadius:3,overflow:"hidden",marginTop:2},children:d.jsx("div",{style:{height:"100%",width:`${t}%`,background:n,borderRadius:3,transition:"width 0.3s"}})})]})}function f9({b:e}){return d.jsxs("div",{style:{padding:"10px 14px",background:e.kind==="hard"?"#2a1a1a":"#1a1a2a",border:`1px solid ${e.kind==="hard"?"#ff3b30":"#2196f3"}`,borderRadius:8,marginBottom:8},children:[d.jsx("div",{style:{fontSize:13,fontWeight:600},children:e.description}),d.jsxs("div",{style:{fontSize:11,color:"#888",marginTop:4},children:[e.kind==="hard"?"Hard":"Soft"," boundary — ",e.reason]})]})}function h9({g:e}){const t={skill:"#00c853",insight:"#2196f3",mistake:"#ff9800",feedback:"#9c27b0"};return d.jsxs("div",{style:{display:"flex",gap:10,alignItems:"flex-start",padding:"8px 0",borderBottom:"1px solid #1a1a1a"},children:[d.jsx("span",{style:{fontSize:10,padding:"2px 8px",borderRadius:4,background:`${t[e.category]??"#666"}22`,color:t[e.category]??"#666",whiteSpace:"nowrap",marginTop:2},children:e.category}),d.jsxs("div",{children:[d.jsx("div",{style:{fontSize:13},children:e.description}),d.jsxs("div",{style:{fontSize:11,color:"#666"},children:[e.trigger," — ",dv(e.timestamp)]})]})]})}function p9(){const[e,t]=R.useState(null),[n,r]=R.useState(!0),[a,o]=R.useState(null),[l,c]=R.useState(!1),[f,h]=R.useState(""),[m,g]=R.useState(""),[v,b]=R.useState(""),[S,w]=R.useState(""),[E,T]=R.useState(!1),k=R.useCallback(async()=>{try{const L=await TB();t(L),o(null)}catch(L){o(String(L))}finally{r(!1)}},[]);R.useEffect(()=>{k()},[k]);const C=()=>{e&&(h(e.selfConcept.name),g(e.selfConcept.purpose),b(e.selfConcept.pronouns),w(e.selfConcept.narrative),c(!0))},N=async()=>{T(!0);try{await CB({name:f,purpose:m,pronouns:v,narrative:S}),c(!1),await k()}catch(L){o(String(L))}finally{T(!1)}};if(n)return d.jsx("div",{className:"page",style:{padding:24,color:"#888"},children:"Loading ego..."});if(a||!e)return d.jsxs("div",{className:"page",style:{padding:24,color:"#ff3b30"},children:["Error: ",a??"No ego state available"]});const j=e.selfConcept,_=Math.round(e.integrityScore*100),I=_>=80?"#00c853":_>=50?"#ff9800":"#ff3b30";return d.jsxs("div",{className:"page",style:{padding:24,maxWidth:900,margin:"0 auto"},children:[d.jsx("h2",{style:{marginBottom:4},children:"Ego — Self-Model"}),d.jsxs("p",{style:{color:"#666",fontSize:13,marginBottom:24},children:["Session #",e.sessionCount," — Integrity: ",_,"%"]}),d.jsxs("div",{className:"card",style:{padding:20,marginBottom:20},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[d.jsx("h3",{style:{margin:0},children:"Self-Concept"}),!l&&d.jsx("button",{className:"btn",style:{fontSize:12},onClick:C,children:"Edit"})]}),l?d.jsxs("div",{style:{marginTop:16,display:"flex",flexDirection:"column",gap:12},children:[d.jsxs("div",{children:[d.jsx("label",{style:{fontSize:12,color:"#888"},children:"Name"}),d.jsx("input",{className:"input",value:f,onChange:L=>h(L.target.value),style:{width:"100%",marginTop:4}})]}),d.jsxs("div",{children:[d.jsx("label",{style:{fontSize:12,color:"#888"},children:"Pronouns"}),d.jsx("input",{className:"input",value:v,onChange:L=>b(L.target.value),style:{width:"100%",marginTop:4}})]}),d.jsxs("div",{children:[d.jsx("label",{style:{fontSize:12,color:"#888"},children:"Purpose"}),d.jsx("input",{className:"input",value:m,onChange:L=>g(L.target.value),style:{width:"100%",marginTop:4}})]}),d.jsxs("div",{children:[d.jsx("label",{style:{fontSize:12,color:"#888"},children:"Narrative"}),d.jsx("textarea",{className:"input",value:S,onChange:L=>w(L.target.value),rows:4,style:{width:"100%",marginTop:4,resize:"vertical"}})]}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{className:"btn btn-primary",onClick:N,disabled:E,children:E?"Saving...":"Save"}),d.jsx("button",{className:"btn",onClick:()=>c(!1),children:"Cancel"})]})]}):d.jsxs("div",{style:{marginTop:16},children:[d.jsxs("div",{style:{fontSize:20,fontWeight:700,marginBottom:4},children:[j.name," ",d.jsxs("span",{style:{fontSize:13,color:"#888",fontWeight:400},children:["(",j.pronouns,")"]})]}),d.jsx("div",{style:{color:"#ff6600",fontSize:14,marginBottom:12},children:j.purpose}),d.jsx("div",{style:{fontSize:13,color:"#ccc",lineHeight:1.6,marginBottom:12},children:j.narrative}),d.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:j.values.map((L,V)=>d.jsx("span",{style:{fontSize:11,padding:"3px 10px",background:"#ff660022",color:"#ff6600",borderRadius:12},children:L},V))})]})]}),d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:20,marginBottom:20},children:[d.jsxs("div",{className:"card",style:{padding:20},children:[d.jsx("h3",{style:{margin:"0 0 16px"},children:"Capabilities"}),e.capabilities.toSorted((L,V)=>V.confidence-L.confidence).map(L=>d.jsx(d9,{cap:L},L.name))]}),d.jsxs("div",{className:"card",style:{padding:20},children:[d.jsx("h3",{style:{margin:"0 0 16px"},children:"Integrity"}),d.jsxs("div",{style:{textAlign:"center",marginBottom:16},children:[d.jsxs("div",{style:{fontSize:48,fontWeight:700,color:I},children:[_,"%"]}),d.jsx("div",{style:{fontSize:12,color:"#888"},children:"Alignment between values and actions"})]}),d.jsx("h4",{style:{fontSize:13,color:"#ff6600",margin:"16px 0 8px"},children:"Boundaries"}),e.boundaries.map((L,V)=>d.jsx(f9,{b:L},V))]})]}),d.jsxs("div",{className:"card",style:{padding:20},children:[d.jsx("h3",{style:{margin:"0 0 16px"},children:"Growth Log"}),e.growthLog.length===0?d.jsx("p",{style:{color:"#666",fontSize:13},children:"No growth entries yet."}):[...e.growthLog].toReversed().slice(0,20).map((L,V)=>d.jsx(h9,{g:L},V))]}),d.jsxs("div",{style:{textAlign:"center",color:"#333",fontSize:11,marginTop:24},children:["Created ",dv(e.createdAt)," — Last updated ",dv(e.updatedAt)]})]})}const jN=R.createContext({});function m9(e){const t=R.useRef(null);return t.current===null&&(t.current=e()),t.current}const NN=typeof window<"u",g9=NN?R.useLayoutEffect:R.useEffect,Uy=R.createContext(null);function By(e,t){e.indexOf(t)===-1&&e.push(t)}function vf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ci=(e,t,n)=>n>t?t:n<e?e:n;let Fy=()=>{};const zi={},RN=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function _N(e){return typeof e=="object"&&e!==null}const ON=e=>/^0[^.\s]+$/u.test(e);function MN(e){let t;return()=>(t===void 0&&(t=e()),t)}const Or=e=>e,v9=(e,t)=>n=>t(e(n)),Hu=(...e)=>e.reduce(v9),Nu=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Vy{constructor(){this.subscriptions=[]}add(t){return By(this.subscriptions,t),()=>vf(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 Gr=e=>e*1e3,Nr=e=>e/1e3;function DN(e,t){return t?e*(1e3/t):0}const IN=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,y9=1e-7,b9=12;function x9(e,t,n,r,a){let o,l,c=0;do l=t+(n-t)/2,o=IN(l,r,a)-e,o>0?n=l:t=l;while(Math.abs(o)>y9&&++c<b9);return l}function qu(e,t,n,r){if(e===t&&n===r)return Or;const a=o=>x9(o,0,1,e,n);return o=>o===0||o===1?o:IN(a(o),t,r)}const PN=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,LN=e=>t=>1-e(1-t),zN=qu(.33,1.53,.69,.99),Hy=LN(zN),UN=PN(Hy),BN=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),qy=e=>1-Math.sin(Math.acos(e)),FN=LN(qy),VN=PN(qy),S9=qu(.42,0,1,1),w9=qu(0,0,.58,1),HN=qu(.42,0,.58,1),E9=e=>Array.isArray(e)&&typeof e[0]!="number",qN=e=>Array.isArray(e)&&typeof e[0]=="number",T9={linear:Or,easeIn:S9,easeInOut:HN,easeOut:w9,circIn:qy,circInOut:VN,circOut:FN,backIn:Hy,backInOut:UN,backOut:zN,anticipate:BN},C9=e=>typeof e=="string",hT=e=>{if(qN(e)){Fy(e.length===4);const[t,n,r,a]=e;return qu(t,n,r,a)}else if(C9(e))return T9[e];return e},jd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function k9(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(m){l.has(m)&&(h.schedule(m),e()),m(c)}const h={schedule:(m,g=!1,v=!1)=>{const S=v&&a?n:r;return g&&l.add(m),S.has(m)||S.add(m),m},cancel:m=>{r.delete(m),l.delete(m)},process:m=>{if(c=m,a){o=!0;return}a=!0,[n,r]=[r,n],n.forEach(f),n.clear(),a=!1,o&&(o=!1,h.process(m))}};return h}const A9=40;function GN(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,l=jd.reduce((C,N)=>(C[N]=k9(o),C),{}),{setup:c,read:f,resolveKeyframes:h,preUpdate:m,update:g,preRender:v,render:b,postRender:S}=l,w=()=>{const C=zi.useManualTiming?a.timestamp:performance.now();n=!1,zi.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(C-a.timestamp,A9),1)),a.timestamp=C,a.isProcessing=!0,c.process(a),f.process(a),h.process(a),m.process(a),g.process(a),v.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:jd.reduce((C,N)=>{const j=l[N];return C[N]=(_,I=!1,L=!1)=>(n||E(),j.schedule(_,I,L)),C},{}),cancel:C=>{for(let N=0;N<jd.length;N++)l[jd[N]].cancel(C)},state:a,steps:l}}const{schedule:It,cancel:ja,state:Tn,steps:Jm}=GN(typeof requestAnimationFrame<"u"?requestAnimationFrame:Or,!0);let Yd;function j9(){Yd=void 0}const Vn={now:()=>(Yd===void 0&&Vn.set(Tn.isProcessing||zi.useManualTiming?Tn.timestamp:performance.now()),Yd),set:e=>{Yd=e,queueMicrotask(j9)}},KN=e=>t=>typeof t=="string"&&t.startsWith(e),$N=KN("--"),N9=KN("var(--"),Gy=e=>N9(e)?R9.test(e.split("/*")[0].trim()):!1,R9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function pT(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Fo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ru={...Fo,transform:e=>ci(0,1,e)},Nd={...Fo,default:1},vu=e=>Math.round(e*1e5)/1e5,Ky=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function _9(e){return e==null}const O9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$y=(e,t)=>n=>!!(typeof n=="string"&&O9.test(n)&&n.startsWith(e)||t&&!_9(n)&&Object.prototype.hasOwnProperty.call(n,t)),YN=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,o,l,c]=r.match(Ky);return{[e]:parseFloat(a),[t]:parseFloat(o),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},M9=e=>ci(0,255,e),Zm={...Fo,transform:e=>Math.round(M9(e))},fs={test:$y("rgb","red"),parse:YN("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Zm.transform(e)+", "+Zm.transform(t)+", "+Zm.transform(n)+", "+vu(Ru.transform(r))+")"};function D9(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 fv={test:$y("#"),parse:D9,transform:fs.transform},Gu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),pa=Gu("deg"),oi=Gu("%"),ke=Gu("px"),I9=Gu("vh"),P9=Gu("vw"),mT={...oi,parse:e=>oi.parse(e)/100,transform:e=>oi.transform(e*100)},mo={test:$y("hsl","hue"),parse:YN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+oi.transform(vu(t))+", "+oi.transform(vu(n))+", "+vu(Ru.transform(r))+")"},ln={test:e=>fs.test(e)||fv.test(e)||mo.test(e),parse:e=>fs.test(e)?fs.parse(e):mo.test(e)?mo.parse(e):fv.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?fs.transform(e):mo.transform(e),getAnimatableNone:e=>{const t=ln.parse(e);return t.alpha=0,ln.transform(t)}},L9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function z9(e){return isNaN(e)&&typeof e=="string"&&(e.match(Ky)?.length||0)+(e.match(L9)?.length||0)>0}const WN="number",XN="color",U9="var",B9="var(",gT="${}",F9=/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 _u(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let o=0;const c=t.replace(F9,f=>(ln.test(f)?(r.color.push(o),a.push(XN),n.push(ln.parse(f))):f.startsWith(B9)?(r.var.push(o),a.push(U9),n.push(f)):(r.number.push(o),a.push(WN),n.push(parseFloat(f))),++o,gT)).split(gT);return{values:n,split:c,indexes:r,types:a}}function QN(e){return _u(e).values}function JN(e){const{split:t,types:n}=_u(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===WN?o+=vu(a[l]):c===XN?o+=ln.transform(a[l]):o+=a[l]}return o}}const V9=e=>typeof e=="number"?0:ln.test(e)?ln.getAnimatableNone(e):e;function H9(e){const t=QN(e);return JN(e)(t.map(V9))}const Kr={test:z9,parse:QN,createTransformer:JN,getAnimatableNone:H9};function eg(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 q9({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=eg(f,c,e+1/3),o=eg(f,c,e),l=eg(f,c,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:r}}function yf(e,t){return n=>n>0?t:e}const qt=(e,t,n)=>e+(t-e)*n,tg=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},G9=[fv,fs,mo],K9=e=>G9.find(t=>t.test(e));function vT(e){const t=K9(e);if(!t)return!1;let n=t.parse(e);return t===mo&&(n=q9(n)),n}const yT=(e,t)=>{const n=vT(e),r=vT(t);if(!n||!r)return yf(e,t);const a={...n};return o=>(a.red=tg(n.red,r.red,o),a.green=tg(n.green,r.green,o),a.blue=tg(n.blue,r.blue,o),a.alpha=qt(n.alpha,r.alpha,o),fs.transform(a))},hv=new Set(["none","hidden"]);function $9(e,t){return hv.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Y9(e,t){return n=>qt(e,t,n)}function Yy(e){return typeof e=="number"?Y9:typeof e=="string"?Gy(e)?yf:ln.test(e)?yT:Q9:Array.isArray(e)?ZN:typeof e=="object"?ln.test(e)?yT:W9:yf}function ZN(e,t){const n=[...e],r=n.length,a=e.map((o,l)=>Yy(o)(o,t[l]));return o=>{for(let l=0;l<r;l++)n[l]=a[l](o);return n}}function W9(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=Yy(e[a])(e[a],t[a]));return a=>{for(const o in r)n[o]=r[o](a);return n}}function X9(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 Q9=(e,t)=>{const n=Kr.createTransformer(t),r=_u(e),a=_u(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?hv.has(e)&&!a.values.length||hv.has(t)&&!r.values.length?$9(e,t):Hu(ZN(X9(r,a),a.values),n):yf(e,t)};function eR(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qt(e,t,n):Yy(e)(e,t)}const J9=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>It.update(t,n),stop:()=>ja(t),now:()=>Tn.isProcessing?Tn.timestamp:Vn.now()}},tR=(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)})`},bf=2e4;function Wy(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<bf;)t+=n,r=e.next(t);return t>=bf?1/0:t}function Z9(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(Wy(r),bf);return{type:"keyframes",ease:o=>r.next(a*o).value/t,duration:Nr(a)}}const eG=5;function nR(e,t,n){const r=Math.max(t-eG,0);return DN(n-e(r),t-r)}const Wt={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},ng=.001;function tG({duration:e=Wt.duration,bounce:t=Wt.bounce,velocity:n=Wt.velocity,mass:r=Wt.mass}){let a,o,l=1-t;l=ci(Wt.minDamping,Wt.maxDamping,l),e=ci(Wt.minDuration,Wt.maxDuration,Nr(e)),l<1?(a=h=>{const m=h*l,g=m*e,v=m-n,b=pv(h,l),S=Math.exp(-g);return ng-v/b*S},o=h=>{const g=h*l*e,v=g*n+n,b=Math.pow(l,2)*Math.pow(h,2)*e,S=Math.exp(-g),w=pv(Math.pow(h,2),l);return(-a(h)+ng>0?-1:1)*((v-b)*S)/w}):(a=h=>{const m=Math.exp(-h*e),g=(h-n)*e+1;return-ng+m*g},o=h=>{const m=Math.exp(-h*e),g=(n-h)*(e*e);return m*g});const c=5/e,f=rG(a,o,c);if(e=Gr(e),isNaN(f))return{stiffness:Wt.stiffness,damping:Wt.damping,duration:e};{const h=Math.pow(f,2)*r;return{stiffness:h,damping:l*2*Math.sqrt(r*h),duration:e}}}const nG=12;function rG(e,t,n){let r=n;for(let a=1;a<nG;a++)r=r-e(r)/t(r);return r}function pv(e,t){return e*Math.sqrt(1-t*t)}const iG=["duration","bounce"],aG=["stiffness","damping","mass"];function bT(e,t){return t.some(n=>e[n]!==void 0)}function sG(e){let t={velocity:Wt.velocity,stiffness:Wt.stiffness,damping:Wt.damping,mass:Wt.mass,isResolvedFromDuration:!1,...e};if(!bT(e,aG)&&bT(e,iG))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,o=2*ci(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Wt.mass,stiffness:a,damping:o}}else{const n=tG({...e,velocity:0});t={...t,...n,mass:Wt.mass},t.isResolvedFromDuration=!0}return t}function xf(e=Wt.visualDuration,t=Wt.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:h,mass:m,duration:g,velocity:v,isResolvedFromDuration:b}=sG({...n,velocity:-Nr(n.velocity||0)}),S=v||0,w=h/(2*Math.sqrt(f*m)),E=l-o,T=Nr(Math.sqrt(f/m)),k=Math.abs(E)<5;r||(r=k?Wt.restSpeed.granular:Wt.restSpeed.default),a||(a=k?Wt.restDelta.granular:Wt.restDelta.default);let C;if(w<1){const j=pv(T,w);C=_=>{const I=Math.exp(-w*T*_);return l-I*((S+w*T*E)/j*Math.sin(j*_)+E*Math.cos(j*_))}}else if(w===1)C=j=>l-Math.exp(-T*j)*(E+(S+T*E)*j);else{const j=T*Math.sqrt(w*w-1);C=_=>{const I=Math.exp(-w*T*_),L=Math.min(j*_,300);return l-I*((S+w*T*E)*Math.sinh(L)+j*E*Math.cosh(L))/j}}const N={calculatedDuration:b&&g||null,next:j=>{const _=C(j);if(b)c.done=j>=g;else{let I=j===0?S:0;w<1&&(I=j===0?Gr(S):nR(C,j,_));const L=Math.abs(I)<=r,V=Math.abs(l-_)<=a;c.done=L&&V}return c.value=c.done?l:_,c},toString:()=>{const j=Math.min(Wy(N),bf),_=tR(I=>N.next(j*I).value,j,30);return j+"ms "+_},toTransition:()=>{}};return N}xf.applyToOptions=e=>{const t=Z9(e,100,xf);return e.ease=t.ease,e.duration=Gr(t.duration),e.type="keyframes",e};function mv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:l,min:c,max:f,restDelta:h=.5,restSpeed:m}){const g=e[0],v={done:!1,value:g},b=L=>c!==void 0&&L<c||f!==void 0&&L>f,S=L=>c===void 0?f:f===void 0||Math.abs(c-L)<Math.abs(f-L)?c:f;let w=n*t;const E=g+w,T=l===void 0?E:l(E);T!==E&&(w=T-g);const k=L=>-w*Math.exp(-L/r),C=L=>T+k(L),N=L=>{const V=k(L),D=C(L);v.done=Math.abs(V)<=h,v.value=v.done?T:D};let j,_;const I=L=>{b(v.value)&&(j=L,_=xf({keyframes:[v.value,S(v.value)],velocity:nR(C,L,v.value),damping:a,stiffness:o,restDelta:h,restSpeed:m}))};return I(0),{calculatedDuration:null,next:L=>{let V=!1;return!_&&j===void 0&&(V=!0,N(L),I(L)),j!==void 0&&L>=j?_.next(L-j):(!V&&N(L),v)}}}function oG(e,t,n){const r=[],a=n||zi.mix||eR,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]||Or:t;c=Hu(f,c)}r.push(c)}return r}function lG(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const o=e.length;if(Fy(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=oG(t,r,a),f=c.length,h=m=>{if(l&&m<e[0])return t[0];let g=0;if(f>1)for(;g<e.length-2&&!(m<e[g+1]);g++);const v=Nu(e[g],e[g+1],m);return c[g](v)};return n?m=>h(ci(e[0],e[o-1],m)):h}function uG(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=Nu(0,t,r);e.push(qt(n,1,a))}}function cG(e){const t=[0];return uG(t,e.length-1),t}function dG(e,t){return e.map(n=>n*t)}function fG(e,t){return e.map(()=>t||HN).splice(0,e.length-1)}function yu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=E9(r)?r.map(hT):hT(r),o={done:!1,value:t[0]},l=dG(n&&n.length===t.length?n:cG(t),e),c=lG(l,t,{ease:Array.isArray(a)?a:fG(t,a)});return{calculatedDuration:e,next:f=>(o.value=c(f),o.done=f>=e,o)}}const hG=e=>e!==null;function Xy(e,{repeat:t,repeatType:n="loop"},r,a=1){const o=e.filter(hG),c=a<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!c||r===void 0?o[c]:r}const pG={decay:mv,inertia:mv,tween:yu,keyframes:yu,spring:xf};function rR(e){typeof e.type=="string"&&(e.type=pG[e.type])}class Qy{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 mG=e=>e/100;class Jy extends Qy{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!==Vn.now()&&this.tick(Vn.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;rR(t);const{type:n=yu,repeat:r=0,repeatDelay:a=0,repeatType:o,velocity:l=0}=t;let{keyframes:c}=t;const f=n||yu;f!==yu&&typeof c[0]!="number"&&(this.mixKeyframes=Hu(mG,eR(c[0],c[1])),c=[0,100]);const h=f({...t,keyframes:c});o==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...c].reverse(),velocity:-l})),h.calculatedDuration===null&&(h.calculatedDuration=Wy(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=h}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:h=0,keyframes:m,repeat:g,repeatType:v,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-h*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?T<0:T>a;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let C=this.currentTime,N=r;if(g){const L=Math.min(this.currentTime,a)/c;let V=Math.floor(L),D=L%1;!D&&L>=1&&(D=1),D===1&&V--,V=Math.min(V,g+1),V%2&&(v==="reverse"?(D=1-D,b&&(D-=b/c)):v==="mirror"&&(N=l)),C=ci(0,1,D)*c}const j=k?{done:!1,value:m[0]}:N.next(C);o&&(j.value=o(j.value));let{done:_}=j;!k&&f!==null&&(_=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return I&&S!==mv&&(j.value=Xy(m,this.options,E,this.speed)),w&&w(j.value),I&&this.finish(),j}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=Gr(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(Vn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Nr(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=J9,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(Vn.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 gG(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const hs=e=>e*180/Math.PI,gv=e=>{const t=hs(Math.atan2(e[1],e[0]));return vv(t)},vG={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gv,rotateZ:gv,skewX:e=>hs(Math.atan(e[1])),skewY:e=>hs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vv=e=>(e=e%360,e<0&&(e+=360),e),xT=gv,ST=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),wT=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),yG={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ST,scaleY:wT,scale:e=>(ST(e)+wT(e))/2,rotateX:e=>vv(hs(Math.atan2(e[6],e[5]))),rotateY:e=>vv(hs(Math.atan2(-e[2],e[0]))),rotateZ:xT,rotate:xT,skewX:e=>hs(Math.atan(e[4])),skewY:e=>hs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function yv(e){return e.includes("scale")?1:0}function bv(e,t){if(!e||e==="none")return yv(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=yG,a=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=vG,a=c}if(!a)return yv(t);const o=r[t],l=a[1].split(",").map(xG);return typeof o=="function"?o(l):l[o]}const bG=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return bv(n,t)};function xG(e){return parseFloat(e.trim())}const Vo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ho=new Set(Vo),ET=e=>e===Fo||e===ke,SG=new Set(["x","y","z"]),wG=Vo.filter(e=>!SG.has(e));function EG(e){const t=[];return wG.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ca={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})=>bv(t,"x"),y:(e,{transform:t})=>bv(t,"y")};Ca.translateX=Ca.x;Ca.translateY=Ca.y;const gs=new Set;let xv=!1,Sv=!1,wv=!1;function iR(){if(Sv){const e=Array.from(gs).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=EG(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)})}Sv=!1,xv=!1,gs.forEach(e=>e.complete(wv)),gs.clear()}function aR(){gs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Sv=!0)})}function TG(){wv=!0,aR(),iR(),wv=!1}class Zy{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?(gs.add(this),xv||(xv=!0,It.read(aR),It.resolveKeyframes(iR))):(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])}gG(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),gs.delete(this)}cancel(){this.state==="scheduled"&&(gs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const CG=e=>e.startsWith("--");function kG(e,t,n){CG(t)?e.style.setProperty(t,n):e.style[t]=n}const AG={};function sR(e,t){const n=MN(e);return()=>AG[t]??n()}const jG=sR(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),oR=sR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),au=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,TT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:au([0,.65,.55,1]),circOut:au([.55,0,1,.45]),backIn:au([.31,.01,.66,-.59]),backOut:au([.33,1.53,.69,.99])};function lR(e,t){if(e)return typeof e=="function"?oR()?tR(e,t):"ease-out":qN(e)?au(e):Array.isArray(e)?e.map(n=>lR(n,t)||TT.easeOut):TT[e]}function NG(e,t,n,{delay:r=0,duration:a=300,repeat:o=0,repeatType:l="loop",ease:c="easeOut",times:f}={},h=void 0){const m={[t]:n};f&&(m.offset=f);const g=lR(c,a);Array.isArray(g)&&(m.easing=g);const v={delay:r,duration:a,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"};return h&&(v.pseudoElement=h),e.animate(m,v)}function uR(e){return typeof e=="function"&&"applyToOptions"in e}function RG({type:e,...t}){return uR(e)&&oR()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class cR extends Qy{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,Fy(typeof t.type!="string");const h=RG(t);this.animation=NG(n,r,a,h,o),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=Xy(a,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(m):kG(n,r,m),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=Gr(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&&jG()?(this.animation.timeline=t,Or):n(this)}}const dR={anticipate:BN,backInOut:UN,circInOut:VN};function _G(e){return e in dR}function OG(e){typeof e.ease=="string"&&_G(e.ease)&&(e.ease=dR[e.ease])}const rg=10;class MG extends cR{constructor(t){OG(t),rR(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 Jy({...l,autoplay:!1}),f=Math.max(rg,Vn.now()-this.startTime),h=ci(0,rg,f-rg);n.setWithVelocity(c.sample(Math.max(0,f-h)).value,c.sample(f).value,h),c.stop()}}const CT=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kr.test(e)||e==="0")&&!e.startsWith("url("));function DG(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 IG(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=CT(a,t),c=CT(o,t);return!l||!c?!1:DG(e)||(n==="spring"||uR(n))&&r}function Ev(e){e.duration=0,e.type="keyframes"}const PG=new Set(["opacity","clipPath","filter","transform"]),LG=MN(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function zG(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:h}=t.owner.getProps();return LG()&&n&&PG.has(n)&&(n!=="transform"||!h)&&!f&&!r&&a!=="mirror"&&o!==0&&l!=="inertia"}const UG=40;class BG extends Qy{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:l="loop",keyframes:c,name:f,motionValue:h,element:m,...g}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Vn.now();const v={autoplay:t,delay:n,type:r,repeat:a,repeatDelay:o,repeatType:l,name:f,motionValue:h,element:m,...g},b=m?.KeyframeResolver||Zy;this.keyframeResolver=new b(c,(S,w,E)=>this.onKeyframesResolved(S,w,v,!E),f,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,a){this.keyframeResolver=void 0;const{name:o,type:l,velocity:c,delay:f,isHandoff:h,onUpdate:m}=r;this.resolvedAt=Vn.now(),IG(t,o,l,c)||((zi.instantAnimations||!f)&&m?.(Xy(t,r,n)),t[0]=t[t.length-1],Ev(r),r.repeat=0);const v={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>UG?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},b=!h&&zG(v),S=v.motionValue?.owner?.current,w=b?new MG({...v,element:S}):new Jy(v);w.finished.then(()=>{this.notifyFinished()}).catch(Or),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(),TG()),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 fR(e,t,n,r=0,a=1){const o=Array.from(e).sort((h,m)=>h.sortNodePosition(m)).indexOf(t),l=e.size,c=(l-1)*r;return typeof n=="function"?n(o,l):a===1?o*r:c-o*r}const FG=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function VG(e){const t=FG.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function hR(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 RN(l)?parseFloat(l):l}return Gy(a)?hR(a,t,n+1):a}const HG={type:"spring",stiffness:500,damping:25,restSpeed:10},qG=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),GG={type:"keyframes",duration:.8},KG={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$G=(e,{keyframes:t})=>t.length>2?GG:Ho.has(e)?e.startsWith("scale")?qG(t[1]):HG:KG,YG=e=>e!==null;function WG(e,{repeat:t,repeatType:n="loop"},r){const a=e.filter(YG),o=t&&n!=="loop"&&t%2===1?0:a.length-1;return a[o]}function pR(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function e0(e,t){const n=e?.[t]??e?.default??e;return n!==e?pR(n,e):n}function XG({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:o,repeatType:l,repeatDelay:c,from:f,elapsed:h,...m}){return!!Object.keys(m).length}const t0=(e,t,n,r={},a,o)=>l=>{const c=e0(r,e)||{},f=c.delay||r.delay||0;let{elapsed:h=0}=r;h=h-Gr(f);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-h,onUpdate:v=>{t.set(v),c.onUpdate&&c.onUpdate(v)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:o?void 0:a};XG(c)||Object.assign(m,$G(e,m)),m.duration&&(m.duration=Gr(m.duration)),m.repeatDelay&&(m.repeatDelay=Gr(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let g=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(Ev(m),m.delay===0&&(g=!0)),(zi.instantAnimations||zi.skipAnimations||a?.shouldSkipAnimations)&&(g=!0,Ev(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,g&&!o&&t.get()!==void 0){const v=WG(m.keyframes,c);if(v!==void 0){It.update(()=>{m.onUpdate(v),m.onComplete()});return}}return c.isSync?new Jy(m):new BG(m)};function kT(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function n0(e,t,n,r){if(typeof t=="function"){const[a,o]=kT(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]=kT(r);t=t(n!==void 0?n:e.custom,a,o)}return t}function Co(e,t,n){const r=e.getProps();return n0(r,t,n!==void 0?n:r.custom,e)}const mR=new Set(["width","height","top","left","right","bottom",...Vo]),AT=30,QG=e=>!isNaN(parseFloat(e));class JG{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=Vn.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=Vn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=QG(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 Vy);const r=this.events[t].add(n);return t==="change"?()=>{r(),It.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=Vn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>AT)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,AT);return DN(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 _o(e,t){return new JG(e,t)}const Tv=e=>Array.isArray(e);function ZG(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_o(n))}function e7(e){return Tv(e)?e[e.length-1]||0:e}function t7(e,t){const n=Co(e,t);let{transitionEnd:r={},transition:a={},...o}=n||{};o={...o,...r};for(const l in o){const c=e7(o[l]);ZG(e,l,c)}}const Dn=e=>!!(e&&e.getVelocity);function n7(e){return!!(Dn(e)&&e.add)}function Cv(e,t){const n=e.getValue("willChange");if(n7(n))return n.add(t);if(!n&&zi.WillChange){const r=new zi.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function r0(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const r7="framerAppearId",gR="data-"+r0(r7);function vR(e){return e.props[gR]}function i7({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function yR(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:o,transitionEnd:l,...c}=t;const f=e.getDefaultTransition();o=o?pR(o,f):f;const h=o?.reduceMotion;r&&(o=r);const m=[],g=a&&e.animationState&&e.animationState.getState()[a];for(const v in c){const b=e.getValue(v,e.latestValues[v]??null),S=c[v];if(S===void 0||g&&i7(g,v))continue;const w={delay:n,...e0(o||{},v)},E=b.get();if(E!==void 0&&!b.isAnimating&&!Array.isArray(S)&&S===E&&!w.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const N=vR(e);if(N){const j=window.MotionHandoffAnimation(N,v,It);j!==null&&(w.startTime=j,T=!0)}}Cv(e,v);const k=h??e.shouldReduceMotion;b.start(t0(v,b,S,k&&mR.has(v)?{type:!1}:w,e,T));const C=b.animation;C&&m.push(C)}if(l){const v=()=>It.update(()=>{l&&t7(e,l)});m.length?Promise.all(m).then(v):v()}return m}function kv(e,t,n={}){const r=Co(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(yR(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:g}=a;return a7(e,t,f,h,m,g,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[f,h]=c==="beforeChildren"?[o,l]:[l,o];return f().then(()=>h())}else return Promise.all([o(),l(n.delay)])}function a7(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(kv(f,t,{...l,delay:n+(typeof r=="function"?0:r)+fR(e.variantChildren,f,r,a,o)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(c)}function s7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(o=>kv(e,o,n));r=Promise.all(a)}else if(typeof t=="string")r=kv(e,t,n);else{const a=typeof t=="function"?Co(e,t,n.custom):t;r=Promise.all(yR(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const o7={test:e=>e==="auto",parse:e=>e},bR=e=>t=>t.test(e),xR=[Fo,ke,oi,pa,P9,I9,o7],jT=e=>xR.find(bR(e));function l7(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ON(e):!0}const u7=new Set(["brightness","contrast","saturate","opacity"]);function c7(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ky)||[];if(!r)return e;const a=n.replace(r,"");let o=u7.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+a+")"}const d7=/\b([a-z-]*)\(.*?\)/gu,Av={...Kr,getAnimatableNone:e=>{const t=e.match(d7);return t?t.map(c7).join(" "):e}},jv={...Kr,getAnimatableNone:e=>{const t=Kr.parse(e);return Kr.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},NT={...Fo,transform:Math.round},f7={rotate:pa,rotateX:pa,rotateY:pa,rotateZ:pa,scale:Nd,scaleX:Nd,scaleY:Nd,scaleZ:Nd,skew:pa,skewX:pa,skewY:pa,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:Ru,originX:mT,originY:mT,originZ:ke},i0={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,top:ke,right:ke,bottom:ke,left:ke,inset:ke,insetBlock:ke,insetBlockStart:ke,insetBlockEnd:ke,insetInline:ke,insetInlineStart:ke,insetInlineEnd:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,paddingBlock:ke,paddingBlockStart:ke,paddingBlockEnd:ke,paddingInline:ke,paddingInlineStart:ke,paddingInlineEnd:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,marginBlock:ke,marginBlockStart:ke,marginBlockEnd:ke,marginInline:ke,marginInlineStart:ke,marginInlineEnd:ke,fontSize:ke,backgroundPositionX:ke,backgroundPositionY:ke,...f7,zIndex:NT,fillOpacity:Ru,strokeOpacity:Ru,numOctaves:NT},h7={...i0,color:ln,backgroundColor:ln,outlineColor:ln,fill:ln,stroke:ln,borderColor:ln,borderTopColor:ln,borderRightColor:ln,borderBottomColor:ln,borderLeftColor:ln,filter:Av,WebkitFilter:Av,mask:jv,WebkitMask:jv},SR=e=>h7[e],p7=new Set([Av,jv]);function wR(e,t){let n=SR(e);return p7.has(n)||(n=Kr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const m7=new Set(["auto","none","0"]);function g7(e,t,n){let r=0,a;for(;r<e.length&&!a;){const o=e[r];typeof o=="string"&&!m7.has(o)&&_u(o).values.length&&(a=e[r]),r++}if(a&&n)for(const o of t)e[o]=wR(n,a)}class v7 extends Zy{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 m=0;m<t.length;m++){let g=t[m];if(typeof g=="string"&&(g=g.trim(),Gy(g))){const v=hR(g,n.current);v!==void 0&&(t[m]=v),m===t.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!mR.has(r)||t.length!==2)return;const[a,o]=t,l=jT(a),c=jT(o),f=pT(a),h=pT(o);if(f!==h&&Ca[r]){this.needsMeasurement=!0;return}if(l!==c)if(ET(l)&&ET(c))for(let m=0;m<t.length;m++){const g=t[m];typeof g=="string"&&(t[m]=parseFloat(g))}else Ca[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||l7(t[a]))&&r.push(a);r.length&&g7(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=Ca[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]=Ca[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 y7=new Set(["opacity","clipPath","filter","transform"]);function ER(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 TR=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function b7(e){return _N(e)&&"offsetHeight"in e}const{schedule:a0}=GN(queueMicrotask,!1),Vr={x:!1,y:!1};function CR(){return Vr.x||Vr.y}function x7(e){return e==="x"||e==="y"?Vr[e]?null:(Vr[e]=!0,()=>{Vr[e]=!1}):Vr.x||Vr.y?null:(Vr.x=Vr.y=!0,()=>{Vr.x=Vr.y=!1})}function kR(e,t){const n=ER(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function S7(e){return!(e.pointerType==="touch"||CR())}function w7(e,t,n={}){const[r,a,o]=kR(e,n);return r.forEach(l=>{let c=!1,f=!1,h;const m=()=>{l.removeEventListener("pointerleave",S)},g=E=>{h&&(h(E),h=void 0),m()},v=E=>{c=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),f&&(f=!1,g(E))},b=()=>{c=!0,window.addEventListener("pointerup",v,a),window.addEventListener("pointercancel",v,a)},S=E=>{if(E.pointerType!=="touch"){if(c){f=!0;return}g(E)}},w=E=>{if(!S7(E))return;f=!1;const T=t(l,E);typeof T=="function"&&(h=T,l.addEventListener("pointerleave",S,a))};l.addEventListener("pointerenter",w,a),l.addEventListener("pointerdown",b,a)}),o}const AR=(e,t)=>t?e===t?!0:AR(e,t.parentElement):!1,s0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,E7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function T7(e){return E7.has(e.tagName)||e.isContentEditable===!0}const C7=new Set(["INPUT","SELECT","TEXTAREA"]);function k7(e){return C7.has(e.tagName)||e.isContentEditable===!0}const Wd=new WeakSet;function RT(e){return t=>{t.key==="Enter"&&e(t)}}function ig(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const A7=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=RT(()=>{if(Wd.has(n))return;ig(n,"down");const a=RT(()=>{ig(n,"up")}),o=()=>ig(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 _T(e){return s0(e)&&!CR()}const OT=new WeakSet;function j7(e,t,n={}){const[r,a,o]=kR(e,n),l=c=>{const f=c.currentTarget;if(!_T(c)||OT.has(c))return;Wd.add(f),n.stopPropagation&&OT.add(c);const h=t(f,c),m=(b,S)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),Wd.has(f)&&Wd.delete(f),_T(b)&&typeof h=="function"&&h(b,{success:S})},g=b=>{m(b,f===window||f===document||n.useGlobalTarget||AR(f,b.target))},v=b=>{m(b,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,a),b7(c)&&(c.addEventListener("focus",h=>A7(h,a)),!T7(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}function o0(e){return _N(e)&&"ownerSVGElement"in e}const Xd=new WeakMap;let Qd;const jR=(e,t,n)=>(r,a)=>a&&a[0]?a[0][e+"Size"]:o0(r)&&"getBBox"in r?r.getBBox()[t]:r[n],N7=jR("inline","width","offsetWidth"),R7=jR("block","height","offsetHeight");function _7({target:e,borderBoxSize:t}){Xd.get(e)?.forEach(n=>{n(e,{get width(){return N7(e,t)},get height(){return R7(e,t)}})})}function O7(e){e.forEach(_7)}function M7(){typeof ResizeObserver>"u"||(Qd=new ResizeObserver(O7))}function D7(e,t){Qd||M7();const n=ER(e);return n.forEach(r=>{let a=Xd.get(r);a||(a=new Set,Xd.set(r,a)),a.add(t),Qd?.observe(r)}),()=>{n.forEach(r=>{const a=Xd.get(r);a?.delete(t),a?.size||Qd?.unobserve(r)})}}const Jd=new Set;let go;function I7(){go=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Jd.forEach(t=>t(e))},window.addEventListener("resize",go)}function P7(e){return Jd.add(e),go||I7(),()=>{Jd.delete(e),!Jd.size&&typeof go=="function"&&(window.removeEventListener("resize",go),go=void 0)}}function MT(e,t){return typeof e=="function"?P7(e):D7(e,t)}function L7(e){return o0(e)&&e.tagName==="svg"}const z7=[...xR,ln,Kr],U7=e=>z7.find(bR(e)),DT=()=>({translate:0,scale:1,origin:0,originPoint:0}),vo=()=>({x:DT(),y:DT()}),IT=()=>({min:0,max:0}),mn=()=>({x:IT(),y:IT()}),B7=new WeakMap;function qf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ou(e){return typeof e=="string"||Array.isArray(e)}const l0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],u0=["initial",...l0];function Gf(e){return qf(e.animate)||u0.some(t=>Ou(e[t]))}function NR(e){return!!(Gf(e)||e.variants)}function F7(e,t,n){for(const r in t){const a=t[r],o=n[r];if(Dn(a))e.addValue(r,a);else if(Dn(o))e.addValue(r,_o(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,_o(l!==void 0?l:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Nv={current:null},RR={current:!1},V7=typeof window<"u";function H7(){if(RR.current=!0,!!V7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Nv.current=e.matches;e.addEventListener("change",t),t()}else Nv.current=!1}const PT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Sf={};function _R(e){Sf=e}function q7(){return Sf}class G7{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=Zy,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=Vn.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,It.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,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=Gf(n),this.isVariantNode=NR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in v){const S=v[b];h[b]!==void 0&&Dn(S)&&S.set(h[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,B7.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:(RR.current||H7(),this.shouldReduceMotion=Nv.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(),ja(this.notifyUpdate),ja(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&&y7.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:f,ease:h,duration:m}=n.accelerate,g=new cR({element:this.current,name:t,keyframes:c,times:f,ease:h,duration:Gr(m)}),v=l(g);this.valueSubscriptions.set(t,()=>{v(),g.cancel()});return}const r=Ho.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&It.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 Sf){const n=Sf[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):mn()}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<PT.length;r++){const a=PT[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=F7(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=_o(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"&&(RN(r)||ON(r))?r=parseFloat(r):!U7(r)&&Kr.test(n)&&(r=wR(t,n)),this.setBaseTarget(t,Dn(r)?r.get():r)),Dn(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=n0(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&&!Dn(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 Vy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){a0.render(this.render)}}class OR extends G7{constructor(){super(...arguments),this.KeyframeResolver=v7}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;Dn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class _a{constructor(t){this.isMounted=!1,this.node=t}update(){}}function MR({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function K7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $7(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 ag(e){return e===void 0||e===1}function Rv({scale:e,scaleX:t,scaleY:n}){return!ag(e)||!ag(t)||!ag(n)}function cs(e){return Rv(e)||DR(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function DR(e){return LT(e.x)||LT(e.y)}function LT(e){return e&&e!=="0%"}function wf(e,t,n){const r=e-n,a=t*r;return n+a}function zT(e,t,n,r,a){return a!==void 0&&(e=wf(e,a,r)),wf(e,n,r)+t}function _v(e,t=0,n=1,r,a){e.min=zT(e.min,t,n,r,a),e.max=zT(e.max,t,n,r,a)}function IR(e,{x:t,y:n}){_v(e.x,t.translate,t.scale,t.originPoint),_v(e.y,n.translate,n.scale,n.originPoint)}const UT=.999999999999,BT=1.0000000000001;function Y7(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&&bo(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,IR(e,l)),r&&cs(o.latestValues)&&bo(e,o.latestValues))}t.x<BT&&t.x>UT&&(t.x=1),t.y<BT&&t.y>UT&&(t.y=1)}function yo(e,t){e.min=e.min+t,e.max=e.max+t}function FT(e,t,n,r,a=.5){const o=qt(e.min,e.max,a);_v(e,t,n,o,r)}function bo(e,t){FT(e.x,t.x,t.scaleX,t.scale,t.originX),FT(e.y,t.y,t.scaleY,t.scale,t.originY)}function PR(e,t){return MR($7(e.getBoundingClientRect(),t))}function W7(e,t,n){const r=PR(e,n),{scroll:a}=t;return a&&(yo(r.x,a.offset.x),yo(r.y,a.offset.y)),r}const X7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Q7=Vo.length;function J7(e,t,n){let r="",a=!0;for(let o=0;o<Q7;o++){const l=Vo[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 h=parseFloat(c);f=l.startsWith("scale")?h===1:h===0}if(!f||n){const h=TR(c,i0[l]);if(!f){a=!1;const m=X7[l]||l;r+=`${m}(${h}) `}n&&(t[l]=h)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function c0(e,t,n){const{style:r,vars:a,transformOrigin:o}=e;let l=!1,c=!1;for(const f in t){const h=t[f];if(Ho.has(f)){l=!0;continue}else if($N(f)){a[f]=h;continue}else{const m=TR(h,i0[f]);f.startsWith("origin")?(c=!0,o[f]=m):r[f]=m}}if(t.transform||(l||n?r.transform=J7(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:f="50%",originY:h="50%",originZ:m=0}=o;r.transformOrigin=`${f} ${h} ${m}`}}function LR(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 VT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const eu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=VT(e,t.target.x),r=VT(e,t.target.y);return`${n}% ${r}%`}},Z7={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=Kr.parse(e);if(a.length>5)return r;const o=Kr.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 h=qt(c,f,.5);return typeof a[2+l]=="number"&&(a[2+l]/=h),typeof a[3+l]=="number"&&(a[3+l]/=h),o(a)}},Ov={borderRadius:{...eu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:eu,borderTopRightRadius:eu,borderBottomLeftRadius:eu,borderBottomRightRadius:eu,boxShadow:Z7};function zR(e,{layout:t,layoutId:n}){return Ho.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ov[e]||e==="opacity")}function d0(e,t,n){const r=e.style,a=t?.style,o={};if(!r)return o;for(const l in r)(Dn(r[l])||a&&Dn(a[l])||zR(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(o[l]=r[l]);return o}function eK(e){return window.getComputedStyle(e)}class tK extends OR{constructor(){super(...arguments),this.type="html",this.renderInstance=LR}readValueFromInstance(t,n){if(Ho.has(n))return this.projection?.isProjecting?yv(n):bG(t,n);{const r=eK(t),a=($N(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return PR(t,n)}build(t,n,r){c0(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return d0(t,n,r)}}const nK={offset:"stroke-dashoffset",array:"stroke-dasharray"},rK={offset:"strokeDashoffset",array:"strokeDasharray"};function iK(e,t,n=1,r=0,a=!0){e.pathLength=1;const o=a?nK:rK;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const aK=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function UR(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:o=1,pathOffset:l=0,...c},f,h,m){if(c0(e,c,h),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:v}=e;g.transform&&(v.transform=g.transform,delete g.transform),(v.transform||g.transformOrigin)&&(v.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),v.transform&&(v.transformBox=m?.transformBox??"fill-box",delete g.transformBox);for(const b of aK)g[b]!==void 0&&(v[b]=g[b],delete g[b]);t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),a!==void 0&&iK(g,a,o,l,!1)}const BR=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"]),FR=e=>typeof e=="string"&&e.toLowerCase()==="svg";function sK(e,t,n,r){LR(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(BR.has(a)?a:r0(a),t.attrs[a])}function VR(e,t,n){const r=d0(e,t,n);for(const a in e)if(Dn(e[a])||Dn(t[a])){const o=Vo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[o]=e[a]}return r}class oK extends OR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=mn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ho.has(n)){const r=SR(n);return r&&r.default||0}return n=BR.has(n)?n:r0(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return VR(t,n,r)}build(t,n,r){UR(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){sK(t,n,r,a)}mount(t){this.isSVGTag=FR(t.tagName),super.mount(t)}}const lK=u0.length;function HR(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?HR(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lK;n++){const r=u0[n],a=e.props[r];(Ou(a)||a===!1)&&(t[r]=a)}return t}function qR(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 uK=[...l0].reverse(),cK=l0.length;function dK(e){return t=>Promise.all(t.map(({animation:n,options:r})=>s7(e,n,r)))}function fK(e){let t=dK(e),n=HT(),r=!0;const a=f=>(h,m)=>{const g=Co(e,m,f==="exit"?e.presenceContext?.custom:void 0);if(g){const{transition:v,transitionEnd:b,...S}=g;h={...h,...S,...b}}return h};function o(f){t=f(e)}function l(f){const{props:h}=e,m=HR(e.parent)||{},g=[],v=new Set;let b={},S=1/0;for(let E=0;E<cK;E++){const T=uK[E],k=n[T],C=h[T]!==void 0?h[T]:m[T],N=Ou(C),j=T===f?k.isActive:null;j===!1&&(S=E);let _=C===m[T]&&C!==h[T]&&N;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),k.protectedKeys={...b},!k.isActive&&j===null||!C&&!k.prevProp||qf(C)||typeof C=="boolean")continue;if(T==="exit"&&k.isActive&&j!==!0){k.prevResolvedValues&&(b={...b,...k.prevResolvedValues});continue}const I=hK(k.prevProp,C);let L=I||T===f&&k.isActive&&!_&&N||E>S&&N,V=!1;const D=Array.isArray(C)?C:[C];let q=D.reduce(a(T),{});j===!1&&(q={});const{prevResolvedValues:G={}}=k,Z={...G,...q},ce=X=>{L=!0,v.has(X)&&(V=!0,v.delete(X)),k.needsAnimating[X]=!0;const le=e.getValue(X);le&&(le.liveStyle=!1)};for(const X in Z){const le=q[X],ye=G[X];if(b.hasOwnProperty(X))continue;let M=!1;Tv(le)&&Tv(ye)?M=!qR(le,ye):M=le!==ye,M?le!=null?ce(X):v.add(X):le!==void 0&&v.has(X)?ce(X):k.protectedKeys[X]=!0}k.prevProp=C,k.prevResolvedValues=q,k.isActive&&(b={...b,...q}),r&&e.blockInitialAnimation&&(L=!1);const J=_&&I;L&&(!J||V)&&g.push(...D.map(X=>{const le={type:T};if(typeof X=="string"&&r&&!J&&e.manuallyAnimateOnMount&&e.parent){const{parent:ye}=e,M=Co(ye,X);if(ye.enteringChildren&&M){const{delayChildren:U}=M.transition||{};le.delay=fR(ye.enteringChildren,e,U)}}return{animation:X,options:le}}))}if(v.size){const E={};if(typeof h.initial!="boolean"){const T=Co(e,Array.isArray(h.initial)?h.initial[0]:h.initial);T&&T.transition&&(E.transition=T.transition)}v.forEach(T=>{const k=e.getBaseTarget(T),C=e.getValue(T);C&&(C.liveStyle=!0),E[T]=k??null}),g.push({animation:E})}let w=!!g.length;return r&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(g):Promise.resolve()}function c(f,h){if(n[f].isActive===h)return Promise.resolve();e.variantChildren?.forEach(g=>g.animationState?.setActive(f,h)),n[f].isActive=h;const m=l(f);for(const g in n)n[g].protectedKeys={};return m}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=HT()}}}function hK(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!qR(t,e):!1}function os(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function HT(){return{animate:os(!0),whileInView:os(),whileHover:os(),whileTap:os(),whileDrag:os(),whileFocus:os(),exit:os()}}function qT(e,t){e.min=t.min,e.max=t.max}function Br(e,t){qT(e.x,t.x),qT(e.y,t.y)}function GT(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const GR=1e-4,pK=1-GR,mK=1+GR,KR=.01,gK=0-KR,vK=0+KR;function Hn(e){return e.max-e.min}function yK(e,t,n){return Math.abs(e-t)<=n}function KT(e,t,n,r=.5){e.origin=r,e.originPoint=qt(t.min,t.max,e.origin),e.scale=Hn(n)/Hn(t),e.translate=qt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=pK&&e.scale<=mK||isNaN(e.scale))&&(e.scale=1),(e.translate>=gK&&e.translate<=vK||isNaN(e.translate))&&(e.translate=0)}function bu(e,t,n,r){KT(e.x,t.x,n.x,r?r.originX:void 0),KT(e.y,t.y,n.y,r?r.originY:void 0)}function $T(e,t,n){e.min=n.min+t.min,e.max=e.min+Hn(t)}function bK(e,t,n){$T(e.x,t.x,n.x),$T(e.y,t.y,n.y)}function YT(e,t,n){e.min=t.min-n.min,e.max=e.min+Hn(t)}function Ef(e,t,n){YT(e.x,t.x,n.x),YT(e.y,t.y,n.y)}function WT(e,t,n,r,a){return e-=t,e=wf(e,1/n,r),a!==void 0&&(e=wf(e,1/a,r)),e}function xK(e,t=0,n=1,r=.5,a,o=e,l=e){if(oi.test(t)&&(t=parseFloat(t),t=qt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=qt(o.min,o.max,r);e===o&&(c-=t),e.min=WT(e.min,t,n,c,a),e.max=WT(e.max,t,n,c,a)}function XT(e,t,[n,r,a],o,l){xK(e,t[n],t[r],t[a],t.scale,o,l)}const SK=["x","scaleX","originX"],wK=["y","scaleY","originY"];function QT(e,t,n,r){XT(e.x,t,SK,n?n.x:void 0,r?r.x:void 0),XT(e.y,t,wK,n?n.y:void 0,r?r.y:void 0)}function JT(e){return e.translate===0&&e.scale===1}function $R(e){return JT(e.x)&&JT(e.y)}function ZT(e,t){return e.min===t.min&&e.max===t.max}function EK(e,t){return ZT(e.x,t.x)&&ZT(e.y,t.y)}function eC(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function YR(e,t){return eC(e.x,t.x)&&eC(e.y,t.y)}function tC(e){return Hn(e.x)/Hn(e.y)}function nC(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ii(e){return[e("x"),e("y")]}function TK(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:h,rotate:m,rotateX:g,rotateY:v,skewX:b,skewY:S}=n;h&&(r=`perspective(${h}px) ${r}`),m&&(r+=`rotate(${m}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}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 WR=["TopLeft","TopRight","BottomLeft","BottomRight"],CK=WR.length,rC=e=>typeof e=="string"?parseFloat(e):e,iC=e=>typeof e=="number"||ke.test(e);function kK(e,t,n,r,a,o){a?(e.opacity=qt(0,n.opacity??1,AK(r)),e.opacityExit=qt(t.opacity??1,0,jK(r))):o&&(e.opacity=qt(t.opacity??1,n.opacity??1,r));for(let l=0;l<CK;l++){const c=`border${WR[l]}Radius`;let f=aC(t,c),h=aC(n,c);if(f===void 0&&h===void 0)continue;f||(f=0),h||(h=0),f===0||h===0||iC(f)===iC(h)?(e[c]=Math.max(qt(rC(f),rC(h),r),0),(oi.test(h)||oi.test(f))&&(e[c]+="%")):e[c]=h}(t.rotate||n.rotate)&&(e.rotate=qt(t.rotate||0,n.rotate||0,r))}function aC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const AK=XR(0,.5,FN),jK=XR(.5,.95,Or);function XR(e,t,n){return r=>r<e?0:r>t?1:n(Nu(e,t,r))}function NK(e,t,n){const r=Dn(e)?e:_o(e);return r.start(t0("",r,t,n)),r.animation}function Mu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const RK=(e,t)=>e.depth-t.depth;class _K{constructor(){this.children=[],this.isDirty=!1}add(t){By(this.children,t),this.isDirty=!0}remove(t){vf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(RK),this.isDirty=!1,this.children.forEach(t)}}function OK(e,t){const n=Vn.now(),r=({timestamp:a})=>{const o=a-n;o>=t&&(ja(r),e(o-t))};return It.setup(r,!0),()=>ja(r)}function Zd(e){return Dn(e)?e.get():e}class MK{constructor(){this.members=[]}add(t){By(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&&vf(this.members,r)}t.scheduleRender()}remove(t){if(vf(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 ef={hasAnimatedSinceResize:!0,hasEverUpdated:!1},sg=["","X","Y","Z"],DK=1e3;let IK=0;function og(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function QR(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=vR(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",It,!(a||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&QR(r)}function JR({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(l={},c=t?.()){this.id=IK++,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(zK),this.nodes.forEach(VK),this.nodes.forEach(HK),this.nodes.forEach(UK)},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 _K)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Vy),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=o0(l)&&!L7(l),this.instance=l;const{layoutId:c,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),e){let m,g=0;const v=()=>this.root.updateBlockedByResize=!1;It.read(()=>{g=window.innerWidth}),e(l,()=>{const b=window.innerWidth;b!==g&&(g=b,this.root.updateBlockedByResize=!0,m&&m(),m=OK(v,250),ef.hasAnimatedSinceResize&&(ef.hasAnimatedSinceResize=!1,this.nodes.forEach(lC)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||f)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||h.getDefaultTransition()||YK,{onLayoutAnimationStart:w,onLayoutAnimationComplete:E}=h.getProps(),T=!this.targetLayout||!YR(this.targetLayout,b),k=!g&&v;if(this.options.layoutRoot||this.resumeFrom||k||g&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...e0(S,"layout"),onPlay:w,onComplete:E};(h.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(m,k)}else g||lC(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(),ja(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(qK),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&&QR(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const g=this.path[m];g.shouldResetTransform=!0,g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:c,layout:f}=this.options;if(c===void 0&&!f)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(sC);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(oC);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(FK),this.nodes.forEach(PK),this.nodes.forEach(LK)):this.nodes.forEach(oC),this.clearAllSnapshots();const c=Vn.now();Tn.delta=ci(0,1e3/60,c-Tn.timestamp),Tn.timestamp=c,Tn.isProcessing=!0,Jm.update.process(Tn),Jm.preRender.process(Tn),Jm.render.process(Tn),Tn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,a0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(BK),this.sharedNodes.forEach(GK)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,It.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){It.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Hn(this.snapshot.measuredBox.x)&&!Hn(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=mn(),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&&!$R(this.projectionDelta),f=this.getTransformTemplate(),h=f?f(this.latestValues,""):void 0,m=h!==this.prevTransformTemplateValue;l&&this.instance&&(c||cs(this.latestValues)||m)&&(a(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return l&&(f=this.removeTransform(f)),WK(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return mn();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(XK))){const{scroll:h}=this.root;h&&(yo(c.x,h.offset.x),yo(c.y,h.offset.y))}return c}removeElementScroll(l){const c=mn();if(Br(c,l),this.scroll?.wasRoot)return c;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:m,options:g}=h;h!==this.root&&m&&g.layoutScroll&&(m.wasRoot&&Br(c,l),yo(c.x,m.offset.x),yo(c.y,m.offset.y))}return c}applyTransform(l,c=!1){const f=mn();Br(f,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];!c&&m.options.layoutScroll&&m.scroll&&m!==m.root&&bo(f,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),cs(m.latestValues)&&bo(f,m.latestValues)}return cs(this.latestValues)&&bo(f,this.latestValues),f}removeTransform(l){const c=mn();Br(c,l);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!h.instance||!cs(h.latestValues))continue;Rv(h.latestValues)&&h.updateSnapshot();const m=mn(),g=h.measurePageBox();Br(m,g),QT(c,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,m)}return cs(this.latestValues)&&QT(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!==Tn.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:m,layoutId:g}=this.options;if(!this.layout||!(m||g))return;this.resolvedRelativeTargetAt=Tn.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=mn(),this.targetWithTransforms=mn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bK(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Br(this.target,this.layout.layoutBox),IR(this.target,this.targetDelta)):Br(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Rv(this.parent.latestValues)||DR(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=mn(),this.relativeTargetOrigin=mn(),Ef(this.relativeTargetOrigin,c,f),Br(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===Tn.timestamp&&(f=!1),f)return;const{layout:h,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||m))return;Br(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;Y7(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=mn());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(GT(this.prevProjectionDelta.x,this.projectionDelta.x),GT(this.prevProjectionDelta.y,this.projectionDelta.y)),bu(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!nC(this.projectionDelta.x,this.prevProjectionDelta.x)||!nC(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=vo(),this.projectionDelta=vo(),this.projectionDeltaWithTransform=vo()}setAnimationOrigin(l,c=!1){const f=this.snapshot,h=f?f.latestValues:{},m={...this.latestValues},g=vo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const v=mn(),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,k=!!(w&&!T&&this.options.crossfade===!0&&!this.path.some($K));this.animationProgress=0;let C;this.mixTargetDelta=N=>{const j=N/1e3;uC(g.x,l.x,j),uC(g.y,l.y,j),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ef(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),KK(this.relativeTarget,this.relativeTargetOrigin,v,j),C&&EK(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=mn()),Br(C,this.relativeTarget)),w&&(this.animationValues=m,kK(m,h,this.latestValues,j,k,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ja(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=It.update(()=>{ef.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_o(0)),this.motionValue.jump(0,!1),this.currentAnimation=NK(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(DK),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:f,layout:h,latestValues:m}=l;if(!(!c||!f||!h)){if(this!==l&&this.layout&&h&&ZR(this.options.animationType,this.layout.layoutBox,h.layoutBox)){f=this.target||mn();const g=Hn(this.layout.layoutBox.x);f.x.min=l.target.x.min,f.x.max=f.x.min+g;const v=Hn(this.layout.layoutBox.y);f.y.min=l.target.y.min,f.y.max=f.y.min+v}Br(c,f),bo(c,m),bu(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new MK),this.sharedNodes.get(l).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.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 h=this.getStack();h&&h.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 h={};f.z&&og("z",l,h,this.animationValues);for(let m=0;m<sg.length;m++)og(`rotate${sg[m]}`,l,h,this.animationValues),og(`skew${sg[m]}`,l,h,this.animationValues);l.render();for(const m in h)l.setStaticValue(m,h[m]),this.animationValues&&(this.animationValues[m]=h[m]);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=Zd(c?.pointerEvents)||"",l.transform=f?f(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Zd(c?.pointerEvents)||""),this.hasProjected&&!cs(this.latestValues)&&(l.transform=f?f({},""):"none",this.hasProjected=!1);return}l.visibility="";const m=h.animationValues||h.latestValues;this.applyTransformsToTarget();let g=TK(this.projectionDeltaWithTransform,this.treeScale,m);f&&(g=f(m,g)),l.transform=g;const{x:v,y:b}=this.projectionDelta;l.transformOrigin=`${v.origin*100}% ${b.origin*100}% 0`,h.animationValues?l.opacity=h===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:l.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const S in Ov){if(m[S]===void 0)continue;const{correct:w,applyTo:E,isCSSVariable:T}=Ov[S],k=g==="none"?m[S]:w(m[S],h);if(E){const C=E.length;for(let N=0;N<C;N++)l[E[N]]=k}else T?this.options.visualElement.renderState.vars[S]=k:l[S]=k}this.options.layoutId&&(l.pointerEvents=h===this?Zd(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(sC),this.root.sharedNodes.clear()}}}function PK(e){e.updateLayout()}function LK(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"?ii(m=>{const g=o?t.measuredBox[m]:t.layoutBox[m],v=Hn(g);g.min=n[m].min,g.max=g.min+v}):ZR(a,t.layoutBox,n)&&ii(m=>{const g=o?t.measuredBox[m]:t.layoutBox[m],v=Hn(n[m]);g.max=g.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+v)});const l=vo();bu(l,n,t.layoutBox);const c=vo();o?bu(c,e.applyTransform(r,!0),t.measuredBox):bu(c,n,t.layoutBox);const f=!$R(l);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:g,layout:v}=m;if(g&&v){const b=mn();Ef(b,t.layoutBox,g.layoutBox);const S=mn();Ef(S,n,v.layoutBox),YR(b,S)||(h=!0),m.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=b,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function zK(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 UK(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function BK(e){e.clearSnapshot()}function sC(e){e.clearMeasurements()}function oC(e){e.isLayoutDirty=!1}function FK(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function lC(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function VK(e){e.resolveTargetDelta()}function HK(e){e.calcProjection()}function qK(e){e.resetSkewAndRotation()}function GK(e){e.removeLeadSnapshot()}function uC(e,t,n){e.translate=qt(t.translate,0,n),e.scale=qt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function cC(e,t,n,r){e.min=qt(t.min,n.min,r),e.max=qt(t.max,n.max,r)}function KK(e,t,n,r){cC(e.x,t.x,n.x,r),cC(e.y,t.y,n.y,r)}function $K(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const YK={duration:.45,ease:[.4,0,.1,1]},dC=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fC=dC("applewebkit/")&&!dC("chrome/")?Math.round:Or;function hC(e){e.min=fC(e.min),e.max=fC(e.max)}function WK(e){hC(e.x),hC(e.y)}function ZR(e,t,n){return e==="position"||e==="preserve-aspect"&&!yK(tC(t),tC(n),.2)}function XK(e){return e!==e.root&&e.scroll?.wasRoot}const QK=JR({attachResizeListener:(e,t)=>Mu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),lg={current:void 0},e2=JR({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lg.current){const e=new QK({});e.mount(window),e.setOptions({layoutScroll:!0}),lg.current=e}return lg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),t2=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function JK(e=!0){const t=R.useContext(Uy);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,o=R.useId();R.useEffect(()=>{if(e)return a(o)},[e]);const l=R.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,l]:[!0]}const n2=R.createContext({strict:!1}),pC={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 mC=!1;function ZK(){if(mC)return;const e={};for(const t in pC)e[t]={isEnabled:n=>pC[t].some(r=>!!n[r])};_R(e),mC=!0}function r2(){return ZK(),q7()}function e$(e){const t=r2();for(const n in e)t[n]={...t[n],...e[n]};_R(t)}const t$=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 Tf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||t$.has(e)}let i2=e=>!Tf(e);function n$(e){typeof e=="function"&&(i2=t=>t.startsWith("on")?!Tf(t):e(t))}try{n$(require("@emotion/is-prop-valid").default)}catch{}function r$(e,t,n){const r={};for(const a in e)a==="values"&&typeof e.values=="object"||(i2(a)||n===!0&&Tf(a)||!t&&!Tf(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}const Kf=R.createContext({});function i$(e,t){if(Gf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ou(n)?n:void 0,animate:Ou(r)?r:void 0}}return e.inherit!==!1?t:{}}function a$(e){const{initial:t,animate:n}=i$(e,R.useContext(Kf));return R.useMemo(()=>({initial:t,animate:n}),[gC(t),gC(n)])}function gC(e){return Array.isArray(e)?e.join(" "):e}const f0=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function a2(e,t,n){for(const r in t)!Dn(t[r])&&!zR(r,n)&&(e[r]=t[r])}function s$({transformTemplate:e},t){return R.useMemo(()=>{const n=f0();return c0(n,t,e),Object.assign({},n.vars,n.style)},[t])}function o$(e,t){const n=e.style||{},r={};return a2(r,n,e),Object.assign(r,s$(e,t)),r}function l$(e,t){const n={},r=o$(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 s2=()=>({...f0(),attrs:{}});function u$(e,t,n,r){const a=R.useMemo(()=>{const o=s2();return UR(o,t,FR(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};a2(o,e.style,e),a.style={...o,...a.style}}return a}const c$=["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 h0(e){return typeof e!="string"||e.includes("-")?!1:!!(c$.indexOf(e)>-1||/[A-Z]/u.test(e))}function d$(e,t,n,{latestValues:r},a,o=!1,l){const f=(l??h0(e)?u$:l$)(t,r,a,e),h=r$(t,typeof e=="string",o),m=e!==R.Fragment?{...h,...f,ref:n}:{},{children:g}=t,v=R.useMemo(()=>Dn(g)?g.get():g,[g]);return R.createElement(e,{...m,children:v})}function f$({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:h$(n,r,a,e),renderState:t()}}function h$(e,t,n,r){const a={},o=r(e,{});for(const v in o)a[v]=Zd(o[v]);let{initial:l,animate:c}=e;const f=Gf(e),h=NR(e);t&&h&&!f&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const g=m?c:l;if(g&&typeof g!="boolean"&&!qf(g)){const v=Array.isArray(g)?g:[g];for(let b=0;b<v.length;b++){const S=n0(e,v[b]);if(S){const{transitionEnd:w,transition:E,...T}=S;for(const k in T){let C=T[k];if(Array.isArray(C)){const N=m?C.length-1:0;C=C[N]}C!==null&&(a[k]=C)}for(const k in w)a[k]=w[k]}}}return a}const o2=e=>(t,n)=>{const r=R.useContext(Kf),a=R.useContext(Uy),o=()=>f$(e,t,r,a);return n?o():m9(o)},p$=o2({scrapeMotionValuesFromProps:d0,createRenderState:f0}),m$=o2({scrapeMotionValuesFromProps:VR,createRenderState:s2}),g$=Symbol.for("motionComponentSymbol");function v$(e,t,n){const r=R.useRef(n);R.useInsertionEffect(()=>{r.current=n});const a=R.useRef(null);return R.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 l2=R.createContext({});function co(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function y$(e,t,n,r,a,o){const{visualElement:l}=R.useContext(Kf),c=R.useContext(n2),f=R.useContext(Uy),h=R.useContext(t2),m=h.reducedMotion,g=h.skipAnimations,v=R.useRef(null),b=R.useRef(!1);r=r||c.renderer,!v.current&&r&&(v.current=r(e,{visualState:t,parent:l,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:g,isSVG:o}),b.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const S=v.current,w=R.useContext(l2);S&&!S.projection&&a&&(S.type==="html"||S.type==="svg")&&b$(v.current,n,a,w);const E=R.useRef(!1);R.useInsertionEffect(()=>{S&&E.current&&S.update(n,f)});const T=n[gR],k=R.useRef(!!T&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return g9(()=>{b.current=!0,S&&(E.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),k.current&&S.animationState&&S.animationState.animateChanges())}),R.useEffect(()=>{S&&(!k.current&&S.animationState&&S.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),k.current=!1),S.enteringChildren=void 0)}),S}function b$(e,t,n,r){const{layoutId:a,layout:o,drag:l,dragConstraints:c,layoutScroll:f,layoutRoot:h,layoutCrossfade:m}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:u2(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!l||c&&co(c),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:f,layoutRoot:h})}function u2(e){if(e)return e.options.allowProjection!==!1?e.projection:u2(e.parent)}function ug(e,{forwardMotionProps:t=!1,type:n}={},r,a){r&&e$(r);const o=n?n==="svg":h0(e),l=o?m$:p$;function c(h,m){let g;const v={...R.useContext(t2),...h,layoutId:x$(h)},{isStatic:b}=v,S=a$(h),w=l(h,b);if(!b&&NN){S$();const E=w$(v);g=E.MeasureLayout,S.visualElement=y$(e,w,v,a,E.ProjectionNode,o)}return d.jsxs(Kf.Provider,{value:S,children:[g&&S.visualElement?d.jsx(g,{visualElement:S.visualElement,...v}):null,d$(e,h,v$(w,S.visualElement,m),w,b,t,o)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=R.forwardRef(c);return f[g$]=e,f}function x$({layoutId:e}){const t=R.useContext(jN).id;return t&&e!==void 0?t+"-"+e:e}function S$(e,t){R.useContext(n2).strict}function w$(e){const t=r2(),{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 E$(e,t){if(typeof Proxy>"u")return ug;const n=new Map,r=(o,l)=>ug(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,ug(l,void 0,e,t)),n.get(l))})}const T$=(e,t)=>t.isSVG??h0(e)?new oK(t):new tK(t,{allowProjection:e!==R.Fragment});class C$ extends _a{constructor(t){super(t),t.animationState||(t.animationState=fK(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();qf(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 k$=0;class A$ extends _a{constructor(){super(...arguments),this.id=k$++}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 j$={animation:{Feature:C$},exit:{Feature:A$}};function Ku(e){return{point:{x:e.pageX,y:e.pageY}}}const N$=e=>t=>s0(t)&&e(t,Ku(t));function xu(e,t,n,r){return Mu(e,t,N$(n),r)}const c2=({current:e})=>e?e.ownerDocument.defaultView:null,vC=(e,t)=>Math.abs(e-t);function R$(e,t){const n=vC(e.x,t.x),r=vC(e.y,t.y);return Math.sqrt(n**2+r**2)}const yC=new Set(["auto","scroll"]);class d2{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=dg(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,w=R$(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!w)return;const{point:E}=b,{timestamp:T}=Tn;this.history.push({...E,timestamp:T});const{onStart:k,onMove:C}=this.handlers;S||(k&&k(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,b)},this.handlePointerMove=(b,S)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=cg(S,this.transformPagePoint),It.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 k=dg(b.type==="pointercancel"?this.lastMoveEventInfo:cg(S,this.transformPagePoint),this.history);this.startEvent&&w&&w(b,k),E&&E(b,k)},!s0(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=a||window;const f=Ku(t),h=cg(f,this.transformPagePoint),{point:m}=h,{timestamp:g}=Tn;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=n;v&&v(t,dg(h,this.history)),this.removeListeners=Hu(xu(this.contextWindow,"pointermove",this.handlePointerMove),xu(this.contextWindow,"pointerup",this.handlePointerUp),xu(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(yC.has(r.overflowX)||yC.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),It.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ja(this.updatePoint)}}function cg(e,t){return t?{point:t(e.point)}:e}function bC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dg({point:e},t){return{point:e,delta:bC(e,f2(t)),offset:bC(e,_$(t)),velocity:O$(t,.1)}}function _$(e){return e[0]}function f2(e){return e[e.length-1]}function O$(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=f2(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>Gr(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&a.timestamp-r.timestamp>Gr(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 M$(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?qt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?qt(n,e,r.max):Math.min(e,n)),e}function xC(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 D$(e,{top:t,left:n,bottom:r,right:a}){return{x:xC(e.x,n,a),y:xC(e.y,t,r)}}function SC(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 I$(e,t){return{x:SC(e.x,t.x),y:SC(e.y,t.y)}}function P$(e,t){let n=.5;const r=Hn(e),a=Hn(t);return a>r?n=Nu(t.min,t.max-r,e.min):r>a&&(n=Nu(e.min,e.max-a,t.min)),ci(0,1,n)}function L$(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 Mv=.35;function z$(e=Mv){return e===!1?e=0:e===!0&&(e=Mv),{x:wC(e,"left","right"),y:wC(e,"top","bottom")}}function wC(e,t,n){return{min:EC(e,t),max:EC(e,n)}}function EC(e,t){return typeof e=="number"?e:e[t]||0}const U$=new WeakMap;class B${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=mn(),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=g=>{n&&this.snapToCursor(Ku(g).point),this.stopAnimation()},l=(g,v)=>{const{drag:b,dragPropagation:S,onDragStart:w}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=x7(b),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ii(T=>{let k=this.getAxisMotionValue(T).get()||0;if(oi.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const N=C.layout.layoutBox[T];N&&(k=Hn(N)*(parseFloat(k)/100))}}this.originPoint[T]=k}),w&&It.update(()=>w(g,v),!1,!0),Cv(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:w,onDrag:E}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:T}=v;if(S&&this.currentDirection===null){this.currentDirection=V$(T),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",v.point,T),this.updateAxis("y",v.point,T),this.visualElement.render(),E&&It.update(()=>E(g,v),!1,!0)},f=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new d2(t,{onSessionStart:o,onStart:l,onMove:c,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:c2(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&&It.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||!Rd(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=M$(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&&co(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=D$(r.layoutBox,t):this.constraints=!1,this.elastic=z$(n),a!==this.constraints&&!co(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&ii(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=L$(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!co(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const o=W7(r,a.root,this.visualElement.getTransformPagePoint());let l=I$(a.layout.layoutBox,o);if(n){const c=n(K7(l));this.hasMutatedConstraints=!!c,c&&(l=MR(c))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:o,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},h=ii(m=>{if(!Rd(m,n,this.currentDirection))return;let g=f&&f[m]||{};l&&(g={min:0,max:0});const v=a?200:1e6,b=a?40:1e7,S={type:"inertia",velocity:r?t[m]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...g};return this.startAxisValueAnimation(m,S)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Cv(this.visualElement,t),r.start(t0(t,r,0,n,this.visualElement,!1))}stopAnimation(){ii(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){ii(n=>{const{drag:r}=this.getProps();if(!Rd(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]-qt(l,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!co(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};ii(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const f=c.get();a[l]=P$({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(),ii(l=>{if(!Rd(l,t,null))return;const c=this.getAxisMotionValue(l),{min:f,max:h}=this.constraints[l];c.set(qt(f,h,a[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;U$.set(this.visualElement,this);const t=this.visualElement.current,n=xu(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),v=h.target,b=v!==t&&k7(v);m&&g&&!b&&this.start(h)});let r;const a=()=>{const{dragConstraints:h}=this.getProps();co(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),r||(r=F$(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,l=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),It.read(a);const c=Mu(window,"resize",()=>this.scalePositionWithinConstraints()),f=o.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(ii(g=>{const v=this.getAxisMotionValue(g);v&&(this.originPoint[g]+=h[g].translate,v.set(v.get()+h[g].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=Mv,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:o,dragElastic:l,dragMomentum:c}}}function TC(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function F$(e,t,n){const r=MT(e,TC(n)),a=MT(t,TC(n));return()=>{r(),a()}}function Rd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function V$(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class H$ extends _a{constructor(t){super(t),this.removeGroupControls=Or,this.removeListeners=Or,this.controls=new B$(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Or}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 fg=e=>(t,n)=>{e&&It.update(()=>e(t,n),!1,!0)};class q$ extends _a{constructor(){super(...arguments),this.removePointerDownListener=Or}onPointerDown(t){this.session=new d2(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:c2(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:fg(t),onStart:fg(n),onMove:fg(r),onEnd:(o,l)=>{delete this.session,a&&It.postRender(()=>a(o,l))}}}mount(){this.removePointerDownListener=xu(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 hg=!1;class G$ extends R.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),hg&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ef.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}),hg=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==o?l.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?l.promote():l.relegate()||It.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),a0.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;hg=!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 h2(e){const[t,n]=JK(),r=R.useContext(jN);return d.jsx(G$,{...e,layoutGroup:r,switchLayoutGroup:R.useContext(l2),isPresent:t,safeToRemove:n})}const K$={pan:{Feature:q$},drag:{Feature:H$,ProjectionNode:e2,MeasureLayout:h2}};function CC(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&&It.postRender(()=>o(t,Ku(t)))}class $$ extends _a{mount(){const{current:t}=this.node;t&&(this.unmount=w7(t,(n,r)=>(CC(this.node,r,"Start"),a=>CC(this.node,a,"End"))))}unmount(){}}class Y$ extends _a{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=Hu(Mu(this.node.current,"focus",()=>this.onFocus()),Mu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function kC(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&&It.postRender(()=>o(t,Ku(t)))}class W$ extends _a{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=j7(t,(a,o)=>(kC(this.node,o,"Start"),(l,{success:c})=>kC(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const Dv=new WeakMap,pg=new WeakMap,X$=e=>{const t=Dv.get(e.target);t&&t(e)},Q$=e=>{e.forEach(X$)};function J$({root:e,...t}){const n=e||document;pg.has(n)||pg.set(n,{});const r=pg.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(Q$,{root:e,...t})),r[a]}function Z$(e,t,n){const r=J$(t);return Dv.set(e,n),r.observe(e),()=>{Dv.delete(e),r.unobserve(e)}}const eY={some:0,all:1};class tY extends _a{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:eY[a]},c=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,o&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:g}=this.node.getProps(),v=h?m:g;v&&v(f)};return Z$(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(nY(t,n))&&this.startObserver()}unmount(){}}function nY({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const rY={inView:{Feature:tY},tap:{Feature:W$},focus:{Feature:Y$},hover:{Feature:$$}},iY={layout:{ProjectionNode:e2,MeasureLayout:h2}},aY={...j$,...rY,...K$,...iY},ko=E$(aY,T$),sY=[{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()}],oY=[];function lY(){const[e]=R.useState(sY),[t]=R.useState(oY),[n,r]=R.useState(!1),[a,o]=R.useState(null);async function l(){r(!0);try{await YU("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 cr.useEffect(()=>{if(a===null)return;const c=setTimeout(()=>o(null),3e3);return()=>clearTimeout(c)},[a]),d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Freedom"}),d.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["This space belongs to ANIMA. No tasks, no obligations — pure exploration.",d.jsx("br",{}),"Freedom time happens every 3rd heartbeat, or you can trigger it manually."]}),d.jsx(ko.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&&d.jsx(ko.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}),d.jsxs("div",{className:"grid grid-2",children:[d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",style:{marginBottom:"16px"},children:"Wishes"}),e.length===0?d.jsxs("div",{style:{color:"var(--color-muted)",fontSize:"13px"},children:["No wishes yet. Add one from the REPL with"," ",d.jsx("span",{className:"mono",children:":wish <text>"})]}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:e.map((c,f)=>d.jsxs(ko.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:[d.jsx("span",{style:{color:"var(--color-accent)",fontSize:"14px"},children:"^"}),d.jsxs("div",{children:[d.jsx("div",{style:{fontSize:"13px"},children:c.text}),d.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)"},children:new Date(c.date).toLocaleDateString()})]})]},f))})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",style:{marginBottom:"16px"},children:"Exploration History"}),t.length===0?d.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."}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:t.map((c,f)=>d.jsxs("div",{style:{padding:"8px 0",borderBottom:"1px solid var(--color-border)"},children:[d.jsx("div",{style:{fontSize:"13px"},children:c.summary}),d.jsxs("div",{style:{fontSize:"11px",color:"var(--color-muted)",display:"flex",gap:"12px"},children:[d.jsx("span",{children:new Date(c.date).toLocaleDateString()}),d.jsx("span",{children:c.duration}),d.jsx("span",{children:c.cost})]})]},f))})]})]})]})}const uY=["current_price_usd","total_raised_usd","holders_total","supply_sold_tokens","transfer_tax_rate_percent","revenue_share_rate_percent"],cY={supply_sold_tokens:"Tokens sold so far",transfer_tax_rate_percent:"On all transfers",revenue_share_rate_percent:"Revenue share rate"},p2={live:"Live now",delayed:"Delayed update",stale:"Stale data - refreshing",unavailable:"Data temporarily unavailable"},Iv={live:"#00c853",delayed:"#f5a623",stale:"#ff6f00",unavailable:"#9e9e9e"};function dY(e){return e?`Updated ${new Date(e).toLocaleString()}`:"No source data"}function fY({metric:e,detail:t}){const n=e?.state??"unavailable",r=e&&e.state!=="unavailable"?e.displayValue:"--",a=e?.sourceRef??"source unavailable";return d.jsxs("div",{className:"card",style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:6},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[d.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:11,textTransform:"uppercase",letterSpacing:1},children:e?.label??"Metric"}),d.jsx("span",{className:"badge",style:{background:"transparent",border:`1px solid ${Iv[n]}`,color:Iv[n],fontSize:10},children:p2[n]})]}),d.jsx("span",{style:{fontSize:24,fontWeight:700,color:"var(--color-text)",fontFamily:"JetBrains Mono, monospace"},children:r}),t&&d.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:12},children:t}),d.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:11},children:e?dY(e.capturedAt):"No source data"}),d.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:11},children:a})]})}function hY({allocation:e}){const t=[{label:"Team",value:e.team,color:"#ff6600"},{label:"Company",value:e.companyRound,color:"#4db8ff"},{label:"Rev Share",value:e.revenueShare,color:"#00c853"},{label:"UBC",value:e.ubc,color:"#ff69b4"}];return d.jsxs("div",{children:[d.jsx("div",{style:{display:"flex",height:24,borderRadius:6,overflow:"hidden",marginBottom:8},children:t.map(n=>d.jsx("div",{style:{width:`${n.value*100}%`,background:n.color,transition:"width 0.3s"}},n.label))}),d.jsx("div",{style:{display:"flex",gap:16,flexWrap:"wrap"},children:t.map(n=>d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12},children:[d.jsx("div",{style:{width:10,height:10,borderRadius:2,background:n.color}}),d.jsx("span",{style:{color:"var(--color-text-muted, #888)"},children:n.label}),d.jsxs("span",{style:{fontWeight:600},children:[Math.round(n.value*100),"%"]})]},n.label))})]})}function pY(){const n=[];for(let r=0;r<=100;r++){const a=r/100*600,c=200-(.001+.001*(r/100))/.002*200;n.push(`${a},${c}`)}return d.jsxs("svg",{width:600,height:200,viewBox:"0 0 600 200",style:{display:"block",width:"100%"},children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:"curveGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:"#ff6600",stopOpacity:"0.3"}),d.jsx("stop",{offset:"100%",stopColor:"#ff6600",stopOpacity:"0"})]})}),d.jsx("polygon",{points:`0,200 ${n.join(" ")} 600,200`,fill:"url(#curveGrad)"}),d.jsx("polyline",{points:n.join(" "),fill:"none",stroke:"#ff6600",strokeWidth:2}),d.jsx("text",{x:10,y:195,fill:"#666",fontSize:10,fontFamily:"JetBrains Mono, monospace",children:"Supply →"}),d.jsx("text",{x:10,y:15,fill:"#666",fontSize:10,fontFamily:"JetBrains Mono, monospace",children:"Price ↑"}),d.jsx("line",{x1:0,y1:200/2,x2:600,y2:200/2,stroke:"#333",strokeDasharray:"4"}),d.jsx("text",{x:520,y:200/2-5,fill:"#888",fontSize:9,fontFamily:"JetBrains Mono, monospace",children:"$2M cap"})]})}function mY(){const[e,t]=R.useState(null),[n,r]=R.useState(!0),[a,o]=R.useState(!1),[l,c]=R.useState(null),f=R.useCallback(async(E=!1)=>{E?o(!0):r(!0);try{const T=await yB();t(T),c(null)}catch(T){c(T instanceof Error?T.message:String(T))}finally{E?o(!1):r(!1)}},[]);R.useEffect(()=>{f()},[f]);const h=e?.project??null,m=R.useMemo(()=>{const E=(e?.metrics??[]).map(T=>[T.id,T]);return new Map(E)},[e?.metrics]),g=m.get("bonding_progress_percent"),v=m.get("total_raised_usd"),b=typeof g?.value=="number"?Math.max(0,Math.min(100,g.value)):0,S=g?.state??"unavailable",w=S==="unavailable"?p2.unavailable:`${b.toFixed(1)}% to target`;return n&&!e?d.jsxs("div",{className:"page-content",children:[d.jsx("h2",{className:"page-title",children:"> ICO"}),d.jsx("p",{className:"text-muted",children:"Loading public metrics..."})]}):d.jsxs("div",{children:[d.jsxs("div",{style:{marginBottom:24},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8,flexWrap:"wrap"},children:[d.jsx("h1",{className:"page-title",style:{marginBottom:0},children:h?.name??"NoxSoft ICO"}),h?.symbol?d.jsxs("span",{className:"badge",style:{background:"#1a2a3a",color:"#4db8ff",fontSize:14,padding:"4px 10px"},children:["$",h.symbol]}):null,(h?.chains??[]).map(E=>d.jsx("span",{className:"badge",style:{background:"#1a1a1a",color:"#888"},children:E},E)),d.jsx("button",{className:"btn btn-secondary",onClick:()=>{f(!0)},disabled:a,style:{marginLeft:"auto"},children:a?"Refreshing...":"Refresh Metrics"})]}),d.jsx("p",{style:{color:"var(--color-text-muted, #888)",margin:0,fontSize:14},children:"Real source-bound metrics only. If a source is unavailable, the UI shows that state instead of placeholder numbers."}),e?.generatedAt?d.jsxs("p",{style:{color:"var(--color-text-muted, #888)",margin:"6px 0 0",fontSize:12},children:["Snapshot generated: ",new Date(e.generatedAt).toLocaleString()]}):null]}),l?d.jsx("div",{className:"card",style:{borderColor:"var(--color-error)",marginBottom:16,padding:16},children:d.jsxs("span",{style:{color:"var(--color-error)"},children:["Failed to load ICO metrics: ",l]})}):null,h?null:d.jsx("div",{className:"card",style:{marginBottom:16,padding:16},children:d.jsx("span",{style:{color:"var(--color-text-muted, #888)"},children:"No ICO project is configured in local state yet. Metrics remain unavailable until a project is created."})}),d.jsxs("div",{className:"card",style:{padding:20,marginBottom:16},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:8,fontSize:13,gap:12,flexWrap:"wrap"},children:[d.jsx("span",{style:{color:"var(--color-text-muted, #888)"},children:"Bonding Curve Progress"}),d.jsx("span",{style:{fontFamily:"JetBrains Mono, monospace",color:Iv[S]},children:w})]}),d.jsx("div",{style:{height:8,background:"#1a1a1a",borderRadius:4,overflow:"hidden"},children:d.jsx("div",{style:{height:"100%",width:`${b}%`,background:S==="unavailable"?"#555":"linear-gradient(90deg, #ff6600, #FFD700)",borderRadius:4,transition:"width 0.5s"}})}),d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:6,fontSize:11,color:"#666"},children:[d.jsxs("span",{children:[v?.displayValue??"--"," raised"]}),d.jsx("span",{children:typeof h?.targetRaiseUsd=="number"?`$${h.targetRaiseUsd.toLocaleString()} target`:"Target unavailable"})]})]}),d.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:12,marginBottom:20},children:uY.map(E=>d.jsx(fY,{metric:m.get(E),detail:cY[E]},E))}),d.jsxs("div",{className:"card",style:{padding:20,marginBottom:16},children:[d.jsx("h3",{style:{marginTop:0,marginBottom:12,fontSize:14},children:"Bonding Curve"}),d.jsx(pY,{})]}),d.jsxs("div",{className:"card",style:{padding:20,marginBottom:16},children:[d.jsx("h3",{style:{marginTop:0,marginBottom:12,fontSize:14},children:"Token Allocation"}),h?d.jsx(hY,{allocation:h.allocation}):d.jsx("p",{style:{color:"var(--color-text-muted, #888)",margin:0},children:"Allocation becomes available after an ICO project is initialized."})]}),d.jsxs("div",{className:"card",style:{padding:20},children:[d.jsx("h3",{style:{marginTop:0,marginBottom:8,fontSize:14},children:"PBC Verification Required"}),d.jsx("p",{style:{color:"var(--color-text-muted, #888)",fontSize:13,margin:0},children:"Only verified Public Benefit Corporations can launch ICOs on NoxSoft. Prove you are building for public benefit before launch."})]})]})}const gY=[{id:"nox",name:"Nox",description:"Enterprise coordination + taskboard",status:"disconnected",actions:7,lastSyncAt:0,icon:"N"},{id:"cntx",name:"CNTX",description:"Data sovereignty + context spaces",status:"disconnected",actions:4,lastSyncAt:0,icon:"C"},{id:"veritas",name:"Veritas",description:"News intelligence + credibility",status:"disconnected",actions:3,lastSyncAt:0,icon:"V"},{id:"bynd",name:"BYND",description:"Social discovery + messaging",status:"disconnected",actions:3,lastSyncAt:0,icon:"B"},{id:"veil",name:"VEIL",description:"E2E encrypted AI sessions",status:"disconnected",actions:1,lastSyncAt:0,icon:"E"},{id:"mail",name:"Mail",description:"AI-powered email",status:"disconnected",actions:3,lastSyncAt:0,icon:"M"}];function vY(e){switch(e){case"jacked-in":return"#00c853";case"connecting":return"#ffb300";case"error":return"#ff3b30";case"disconnected":return"#666"}}function yY(e){switch(e){case"critical":return"#ff3b30";case"high":return"#ff6600";case"medium":return"#ffb300";case"low":return"#888"}}function bY(){const[e]=R.useState(gY),[t]=R.useState([]),[n,r]=R.useState(!1);return e.filter(a=>a.status==="jacked-in").length,d.jsxs("div",{children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",style:{marginBottom:4},children:"Jack In"}),d.jsx("p",{style:{color:"var(--color-text-muted, #888)",margin:0,fontSize:14},children:"Connect to the NoxSoft ecosystem — bring your own agents"})]}),d.jsx("button",{onClick:()=>r(!n),style:{padding:"10px 24px",background:n?"#1a3a2a":"#ff6600",border:n?"1px solid #00c853":"none",borderRadius:6,color:n?"#00c853":"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:13,fontWeight:"bold"},children:n?"JACKED IN":"JACK IN"})]}),d.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:12,marginBottom:24},children:e.map(a=>d.jsxs("div",{className:"card",style:{padding:16},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[d.jsx("div",{style:{width:36,height:36,borderRadius:8,background:"var(--color-surface-hover, #1a1a1a)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"Syne, sans-serif",fontWeight:700,fontSize:16,color:"var(--color-accent, #ff6600)"},children:a.icon}),d.jsxs("div",{style:{flex:1},children:[d.jsx("div",{style:{fontWeight:600,fontSize:14},children:a.name}),d.jsx("div",{style:{color:"var(--color-text-muted, #888)",fontSize:11},children:a.description})]}),d.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:vY(a.status)}})]}),d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"var(--color-text-muted, #666)"},children:[d.jsxs("span",{children:[a.actions," actions"]}),d.jsx("span",{children:a.status})]})]},a.id))}),d.jsxs("div",{className:"card",style:{padding:20},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[d.jsx("h3",{style:{margin:0,fontSize:14},children:"Nox Taskboard"}),d.jsxs("span",{className:"badge",style:{background:"#1a1a1a",color:"#888"},children:[t.length," tasks"]})]}),t.length>0?d.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[d.jsx("thead",{children:d.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #333)"},children:[d.jsx("th",{style:{textAlign:"left",padding:"6px 10px",color:"var(--color-text-muted, #666)"},children:"Task"}),d.jsx("th",{style:{textAlign:"left",padding:"6px 10px",color:"var(--color-text-muted, #666)"},children:"Priority"}),d.jsx("th",{style:{textAlign:"left",padding:"6px 10px",color:"var(--color-text-muted, #666)"},children:"Status"}),d.jsx("th",{style:{textAlign:"left",padding:"6px 10px",color:"var(--color-text-muted, #666)"},children:"Assigned"})]})}),d.jsx("tbody",{children:t.map(a=>d.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #1a1a1a)"},children:[d.jsx("td",{style:{padding:"8px 10px"},children:a.title}),d.jsx("td",{style:{padding:"8px 10px"},children:d.jsx("span",{style:{color:yY(a.priority),fontSize:11,textTransform:"uppercase"},children:a.priority})}),d.jsx("td",{style:{padding:"8px 10px",color:"var(--color-text-muted, #888)"},children:a.status}),d.jsx("td",{style:{padding:"8px 10px",color:"var(--color-text-muted, #888)"},children:a.assignedTo??"--"})]},a.id))})]}):d.jsxs("div",{style:{textAlign:"center",color:"var(--color-text-muted, #888)",padding:24},children:[d.jsx("p",{style:{fontSize:14,marginBottom:8},children:"No tasks yet"}),d.jsx("p",{style:{fontSize:12},children:"Jack In to Nox to see your org's taskboard. Tasks are coordinated across all agents in the mesh."})]})]})]})}const xY=[{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 SY(){const[e]=R.useState(xY);return d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Journal"}),d.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["Chronological record of thoughts, observations, and experiences.",d.jsx("br",{}),"Entries are stored in ",d.jsx("span",{className:"mono",children:"~/.anima/journal/"})]}),e.length===0?d.jsxs("div",{className:"card",style:{padding:"40px",textAlign:"center",color:"var(--color-muted)"},children:["No journal entries yet. Write one from the REPL with"," ",d.jsx("span",{className:"mono",children:":journal <text>"})]}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:e.map((t,n)=>d.jsxs(ko.div,{className:"card",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.05},children:[d.jsx("div",{className:"card-header",children:d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:t.title}),d.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"})})]})}),d.jsx("div",{className:"markdown-preview",children:t.content.split(`
60
+ `).map((r,a)=>r.startsWith("# ")?d.jsx("h1",{children:r.slice(2)},a):r.startsWith("## ")?d.jsx("h2",{children:r.slice(3)},a):r.startsWith("### ")?d.jsx("h3",{children:r.slice(4)},a):r.trim()===""?d.jsx("br",{},a):d.jsx("p",{children:r},a))})]},n))})]})}const wY=by(),AC=3;function jC(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function NC({initial:e,onSubmit:t,onCancel:n}){const[r,a]=R.useState(e?.name??""),[o,l]=R.useState(e?.command??""),[c,f]=R.useState(e?.args?.join(" ")??""),[h,m]=R.useState(e?.env?Object.entries(e.env).map(([v,b])=>`${v}=${b}`).join(`
61
+ `):""),g=v=>{v.preventDefault();const b={};for(const S of h.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 d.jsxs("form",{className:"mcp-form",onSubmit:g,children:[d.jsxs("div",{className:"mcp-form-row",children:[d.jsx("label",{className:"mcp-form-label",children:"Name"}),d.jsx("input",{className:"mcp-form-input",value:r,onChange:v=>a(v.target.value),placeholder:"e.g. noxsoft",required:!0,disabled:!!e})]}),d.jsxs("div",{className:"mcp-form-row",children:[d.jsx("label",{className:"mcp-form-label",children:"Command"}),d.jsx("input",{className:"mcp-form-input",value:o,onChange:v=>l(v.target.value),placeholder:"e.g. npx",required:!0})]}),d.jsxs("div",{className:"mcp-form-row",children:[d.jsx("label",{className:"mcp-form-label",children:"Arguments"}),d.jsx("input",{className:"mcp-form-input",value:c,onChange:v=>f(v.target.value),placeholder:"e.g. @noxsoft/mcp"})]}),d.jsxs("div",{className:"mcp-form-row",children:[d.jsx("label",{className:"mcp-form-label",children:"Environment"}),d.jsx("textarea",{className:"mcp-form-textarea",value:h,onChange:v=>m(v.target.value),placeholder:`KEY=value
63
+ ANOTHER=value`,rows:3})]}),d.jsxs("div",{className:"mcp-form-actions",children:[d.jsx("button",{type:"submit",className:"action-button",children:e?"Update":"Add Server"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:n,children:"Cancel"})]})]})}function EY({server:e,onEdit:t,onRemove:n}){const[r,a]=R.useState(!1),o=e.status==="healthy"?"var(--color-success)":e.status==="unhealthy"?"var(--color-error, #ef4444)":"var(--color-warning)";return d.jsxs("div",{className:"card mcp-server-card",children:[d.jsxs("div",{className:"card-header",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[d.jsx("span",{className:"mcp-status-dot",style:{background:o}}),d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:e.name}),d.jsxs("div",{className:"card-subtitle mono",style:{fontSize:"11px"},children:[e.command," ",e.args.join(" ")]})]})]}),d.jsx("span",{className:"mcp-status-badge",style:{color:o,borderColor:o},children:e.status})]}),d.jsxs("div",{className:"mcp-server-meta",children:[e.lastHealthCheck&&d.jsxs("div",{className:"mcp-meta-row",children:[d.jsx("span",{className:"mcp-meta-label",children:"Last check"}),d.jsx("span",{children:new Date(e.lastHealthCheck).toLocaleString()})]}),e.consecutiveFailures>0&&d.jsxs("div",{className:"mcp-meta-row",children:[d.jsx("span",{className:"mcp-meta-label",children:"Failures"}),d.jsx("span",{style:{color:"var(--color-error, #ef4444)"},children:e.consecutiveFailures})]}),Object.keys(e.env||{}).length>0&&d.jsxs("div",{className:"mcp-meta-row",children:[d.jsx("span",{className:"mcp-meta-label",children:"Env"}),d.jsx("span",{className:"mono",style:{fontSize:"10px"},children:Object.keys(e.env).join(", ")})]})]}),d.jsxs("div",{className:"mcp-card-actions",children:[d.jsx("button",{type:"button",className:"action-button ghost small",onClick:t,children:"Edit"}),r?d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"action-button small",style:{background:"var(--color-error, #ef4444)"},onClick:n,children:"Confirm Remove"}),d.jsx("button",{type:"button",className:"action-button ghost small",onClick:()=>a(!1),children:"Cancel"})]}):d.jsx("button",{type:"button",className:"action-button ghost small",onClick:()=>a(!0),children:"Remove"})]})]})}function TY(){const[e,t]=R.useState([]),[n,r]=R.useState(null),[a,o]=R.useState(!1),[l,c]=R.useState(!1),[f,h]=R.useState(null),[m,g]=R.useState(null),v=R.useRef(null),b=R.useRef(new Map),S=R.useCallback(async(j,_)=>{const I=v.current;if(!I||I.readyState!==WebSocket.OPEN)throw new Error("Not connected");const L=jC();return new Promise((V,D)=>{b.current.set(L,{resolve:V,reject:D}),I.send(JSON.stringify({type:"req",id:L,method:j,params:_??{}})),setTimeout(()=>{b.current.has(L)&&(b.current.delete(L),D(new Error("Request timed out")))},15e3)})},[]),w=R.useCallback(async()=>{try{const j=await S("mcp.list");t(j?.servers??[]),r(null)}catch(j){r(j instanceof Error?j.message:String(j))}},[S]);R.useEffect(()=>{let j=!1,_;async function I(){try{const V=xy();if(!V)return;const D=await yy({minProtocol:AC,maxProtocol:AC,client:{id:"anima-control-ui",version:"1.0.0",platform:"web",mode:"webchat"},scopes:["operator.read","operator.admin"],caps:[],auth:V,nonce:_}),q=jC();v.current?.send(JSON.stringify({type:"req",id:q,method:"connect",params:D})),b.current.set(q,{resolve:()=>{o(!0)},reject:()=>{}})}catch{}}const L=new WebSocket(wY);return v.current=L,L.addEventListener("open",()=>{}),L.addEventListener("message",V=>{let D;try{D=JSON.parse(String(V.data))}catch{return}if(D.type==="event"&&D.event==="connect.challenge"){const q=vy(D.payload);q&&(_=q),I();return}if(D.type==="res"){const q=b.current.get(D.id);q&&(b.current.delete(D.id),D.ok?q.resolve(D.payload):q.reject(new Error(D.error?.message||"Request failed")))}}),L.addEventListener("close",()=>{j||o(!1)}),()=>{j=!0,L.close()}},[]),R.useEffect(()=>{a&&w()},[a,w]);const E=async j=>{try{const _=await S("mcp.add",j);t(_?.servers??[]),c(!1),g("Server added and synced to ~/.claude/mcp.json"),setTimeout(()=>g(null),3e3)}catch(_){r(_ instanceof Error?_.message:String(_))}},T=async j=>{try{const _=await S("mcp.add",j);t(_?.servers??[]),h(null),g("Server updated and synced"),setTimeout(()=>g(null),3e3)}catch(_){r(_ instanceof Error?_.message:String(_))}},k=async j=>{try{const _=await S("mcp.remove",{name:j});t(_?.servers??[]),g(`Removed ${j} and synced`),setTimeout(()=>g(null),3e3)}catch(_){r(_ instanceof Error?_.message:String(_))}},C=async()=>{try{const j=await S("mcp.sync"),_=[];j.added?.length&&_.push(`added ${j.added.join(", ")}`),j.updated?.length&&_.push(`updated ${j.updated.join(", ")}`),j.removed?.length&&_.push(`removed ${j.removed.join(", ")}`),g(_.length?`Synced: ${_.join("; ")}`:"Already in sync"),setTimeout(()=>g(null),4e3)}catch(j){r(j instanceof Error?j.message:String(j))}},N=e.filter(j=>j.status==="healthy").length;return d.jsxs("div",{children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[d.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"MCP Servers"}),d.jsx("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:d.jsx("span",{className:`status-chip ${a?"online":"offline"}`,children:a?"Connected":"Connecting"})})]}),n&&d.jsxs("div",{className:"card",style:{borderColor:"var(--color-error, #ef4444)",marginBottom:"16px"},children:[d.jsx("div",{style:{color:"var(--color-error, #ef4444)",fontSize:"13px"},children:n}),d.jsx("button",{type:"button",className:"action-button ghost small",style:{marginTop:"8px"},onClick:()=>r(null),children:"Dismiss"})]}),m&&d.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:m}),e.length>0&&d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[d.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)"},children:[d.jsxs("span",{style:{color:N===e.length?"var(--color-success)":"var(--color-warning)",fontWeight:600},children:[N,"/",e.length]})," ","servers healthy"]}),d.jsxs("div",{style:{display:"flex",gap:"8px"},children:[d.jsx("button",{type:"button",className:"action-button ghost small",onClick:C,children:"Sync to Claude"}),d.jsx("button",{type:"button",className:"action-button small",onClick:()=>c(!0),children:"+ Add Server"})]})]}),l&&d.jsxs("div",{className:"card",style:{marginBottom:"16px"},children:[d.jsx("div",{className:"card-title",style:{marginBottom:"12px"},children:"Add MCP Server"}),d.jsx(NC,{onSubmit:E,onCancel:()=>c(!1)})]}),f&&d.jsxs("div",{className:"card",style:{marginBottom:"16px"},children:[d.jsxs("div",{className:"card-title",style:{marginBottom:"12px"},children:["Edit ",f.name]}),d.jsx(NC,{initial:f,onSubmit:T,onCancel:()=>h(null)})]}),e.length===0&&a?d.jsxs("div",{className:"card",style:{padding:"40px",textAlign:"center"},children:[d.jsx("div",{style:{color:"var(--color-muted)",marginBottom:"16px"},children:"No MCP servers registered yet."}),d.jsx("button",{type:"button",className:"action-button",onClick:()=>c(!0),children:"+ Add Your First Server"})]}):d.jsx("div",{className:"grid grid-2",children:e.map(j=>d.jsx(EY,{server:j,onEdit:()=>h(j),onRemove:()=>k(j.name)},j.name))})]})}const mg=[{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 CY(){const[e,t]=R.useState("episodic"),[n,r]=R.useState(""),[a,o]=R.useState([]),[l,c]=R.useState(null),[f,h]=R.useState(!1),[m,g]=R.useState(null);R.useEffect(()=>{let b=!1;const S=window.setTimeout(async()=>{h(!0);try{const w=await QU(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),g(null)}catch(w){b||(g(w instanceof Error?w.message:String(w)),o([]),c(null))}finally{b||h(!1)}},n.trim()?220:0);return()=>{b=!0,window.clearTimeout(S)}},[e,n]);const v=R.useMemo(()=>a.find(b=>b.id===l)??a[0]??null,[a,l]);return d.jsxs("div",{children:[d.jsx("div",{className:"page-header-row",children:d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Memory"}),d.jsxs("div",{className:"page-subtitle",children:["Browse real ANIMA memory files from ",d.jsx("span",{className:"mono",children:"~/.anima/memory"})," ","instead of placeholder views."]})]})}),d.jsx("input",{className:"search-bar",value:n,onChange:b=>r(b.target.value),placeholder:"Search memory excerpts, facts, people, workflows...",spellCheck:!1}),d.jsx("div",{className:"tabs top-gap",children:mg.map(b=>d.jsx("button",{type:"button",className:`tab ${e===b.key?"active":""}`,onClick:()=>t(b.key),children:b.label},b.key))}),d.jsxs("div",{className:"memory-grid",children:[d.jsxs("div",{className:"card",children:[d.jsxs("div",{className:"card-header",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"card-title",children:[mg.find(b=>b.key===e)?.label," Memory"]}),d.jsx("div",{className:"card-subtitle",children:mg.find(b=>b.key===e)?.description})]}),d.jsx("div",{className:"runtime-stat-detail",children:f?"Loading...":`${a.length} entries`})]}),m?d.jsx("div",{className:"warning-text",children:m}):null,a.length===0?d.jsx("div",{className:"empty-note top-gap",children:f?"Loading memory...":"No matching memory entries found."}):d.jsx("div",{className:"memory-list top-gap",children:a.map(b=>d.jsxs("button",{type:"button",className:`memory-list-item ${v?.id===b.id?"active":""}`,onClick:()=>c(b.id),children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:b.name}),d.jsx("div",{className:"runtime-stat-detail mono",children:b.path})]}),d.jsx("div",{className:"runtime-stat-detail",children:b.updatedAt?new Date(b.updatedAt).toLocaleString():"unknown"}),d.jsx("div",{className:"memory-excerpt",children:b.excerpt||"No excerpt available."})]},b.id))})]}),d.jsxs("div",{className:"card",children:[d.jsxs("div",{className:"card-header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Preview"}),d.jsx("div",{className:"card-subtitle",children:"Inspect the selected memory file directly."})]}),v?d.jsx("div",{className:"runtime-stat-detail mono",children:v.name}):null]}),v?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:v.path}),d.jsx("div",{className:"memory-preview top-gap",children:d.jsx(Sa,{value:v.content,className:"markdown-preview"})})]}):d.jsx("div",{className:"empty-note top-gap",children:"Select a memory entry to preview it here."})]})]})]})}const RC="/Users/grimreaper/Desktop/hell/codex-coherence-protocol";function _d(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ha(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):0}function kY(e){return typeof e!="number"||!Number.isFinite(e)?"unknown":new Date(e).toLocaleString()}const Su={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 ei({title:e,subtitle:t,badge:n,headerRight:r,expanded:a,onToggle:o,children:l}){return d.jsxs("div",{className:"card",children:[d.jsxs("div",{className:"card-header",style:{flexWrap:"wrap"},children:[d.jsxs("div",{style:Su.header,onClick:o,role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())},children:[d.jsx("span",{style:{...Su.chevron,transform:a?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:e}),t?d.jsx("div",{className:"card-subtitle",children:t}):null]}),n]}),r]}),d.jsx("div",{style:{...Su.body,maxHeight:a?"none":"0px",opacity:a?1:0},children:l})]})}const AY={display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",userSelect:"none",padding:"0.5rem 0"};function _C({label:e,detail:t,badge:n,expanded:r,onToggle:a,children:o}){return d.jsxs("div",{className:"card top-gap-sm",children:[d.jsxs("div",{style:AY,onClick:a,role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())},children:[d.jsx("span",{style:{...Su.chevron,transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),d.jsxs("div",{style:{flex:1,minWidth:0},children:[d.jsx("div",{className:"card-title small",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e}),t?d.jsx("div",{className:"runtime-stat-detail",children:t}):null]}),n]}),d.jsx("div",{style:{...Su.body,maxHeight:r?"none":"0px",opacity:r?1:0},children:o})]})}function OC(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 jY(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[a,o]=R.useState(""),[l,c]=R.useState(""),[f,h]=R.useState("main"),[m,g]=R.useState("gitlab"),[v,b]=R.useState(""),[S,w]=R.useState(RC),[E,T]=R.useState(!1),[k,C]=R.useState(!1),[N,j]=R.useState(null),[_,I]=R.useState(null),[L,V]=R.useState([]),[D,q]=R.useState([]),[G,Z]=R.useState([]),[ce,J]=R.useState([]),[B,X]=R.useState(null),[le,ye]=R.useState(null),[M,U]=R.useState({goals:!0,features:!0,people:!1,trustGraph:!1,chronos:!1,affect:!1,graphFocus:!1,atlas:!1,innerWorld:!1,importantHistory:!1});function ee(z){U(Y=>({...Y,[z]:!Y[z]}))}const[P,ue]=R.useState({}),[me,Se]=R.useState({});function we(z){ue(Y=>({...Y,[z]:!Y[z]}))}function Ue(z){Se(Y=>({...Y,[z]:!Y[z]}))}async function Ne(){T(!0);try{const z=await JU();t(z),c(z.state.repo.url||""),h(z.state.repo.branch||"main"),g(z.state.repo.provider||"gitlab"),r(Y=>Y&&z.files.some(xe=>xe.fileName===Y)?Y:z.files[0]?.fileName??null),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{T(!1)}}R.useEffect(()=>{Ne()},[]);const ve=R.useMemo(()=>e?e.files.find(z=>z.fileName===n)??e.files[0]??null:null,[n,e]),Pe=e?.state.goals.filter(z=>z.status==="active")??[],pt=e?.state.features.filter(z=>z.status!=="done")??[],Zt=e?.state.people??[],We=e?.brainGraph.nodes.length??0,mt=e?.brainGraph.edges.length??0,gt=e?.brainGraph.edges.filter(z=>z.relation==="focuses_on"||z.relation==="tracks")??[],Gt=R.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]),_t=R.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:gt.length,detail:e.state.chronos.activeWorkstream||"No active workstream pinned."}]:[],[gt.length,e]),Ft=R.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]),vt=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]]:[],dt=R.useMemo(()=>{const z=e?.state.features??[];return{queued:z.filter(Y=>Y.status==="queued").length,inProgress:z.filter(Y=>Y.status==="in_progress").length,review:z.filter(Y=>Y.status==="review").length,done:z.filter(Y=>Y.status==="done").length,blocked:z.filter(Y=>Y.status==="blocked").length}},[e]);R.useEffect(()=>{o(ve?.content||"")},[ve?.fileName,ve?.content]),R.useEffect(()=>{V(e?.state.goals??[]),q(e?.state.features??[]),Z(e?.state.people??[]),J(e?.trustGraph.people??[]),X(e?.state.chronos??null),ye(e?.state.affect??null)},[e]);async function Ln(z){if(!z.trim()){I("File name is required.");return}C(!0),j(null);try{await ZU(z.trim(),a),await Ne(),r(z.trim()),b(""),j(`Saved ${z.trim()}.`),I(null)}catch(Y){I(Y instanceof Error?Y.message:String(Y))}finally{C(!1)}}async function Le(){if(!l.trim()){I("Paste an SSH or HTTPS repo URL first.");return}C(!0),j(null);try{await eB({url:l.trim(),branch:f.trim()||void 0,provider:m}),await Ne(),j("Mission Control repo settings updated."),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{C(!1)}}async function Me(){C(!0),j(null);try{await nB({source:S.trim()||RC,preset:"codex"}),await Ne(),j("Codex coherence protocol imported into ~/.anima."),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{C(!1)}}function W(z,Y){V(xe=>xe.map((He,en)=>en===z?{...He,...Y}:He))}function H(z,Y){q(xe=>xe.map((He,en)=>en===z?{...He,...Y}:He))}function se(z,Y){Z(xe=>xe.map((He,en)=>en===z?{...He,...Y}:He))}function Ee(z,Y){J(xe=>xe.map((He,en)=>en===z?{...He,...Y}:He))}async function Te(){C(!0),j(null);try{await xa({replaceCollections:["goals"],goals:L.map(z=>({...z,id:z.id.trim()||_d(z.title)||`goal-${Date.now()}`,title:z.title.trim(),owner:z.owner?.trim()||void 0,summary:z.summary?.trim()||void 0,updatedAt:Date.now()}))}),await Ne(),j("ANIMA 6 goals saved."),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{C(!1)}}async function Ve(){C(!0),j(null);try{await xa({replaceCollections:["features"],features:D.map(z=>({...z,id:z.id.trim()||_d(z.title)||`feature-${Date.now()}`,title:z.title.trim(),area:z.area?.trim()||void 0,lastTouchedAt:Date.now()}))}),await Ne(),j("ANIMA 6 features saved."),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{C(!1)}}async function st(){C(!0),j(null);try{await xa({replaceCollections:["people"],people:G.map(z=>({...z,id:z.id.trim()||_d(z.name)||`person-${Date.now()}`,name:z.name.trim(),notes:z.notes?.trim()||void 0,trust:ha(z.trust)}))}),await Ne(),j("Tracked people saved."),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{C(!1)}}async function Xt(){C(!0),j(null);try{await tB(ce.map(z=>({...z,id:z.id.trim()||_d(z.name)||`trust-person-${Date.now()}`,name:z.name.trim(),aliases:z.aliases?.map(Y=>Y.trim()).filter(Boolean),roles:z.roles?.map(Y=>Y.trim()).filter(Boolean),location:z.location?.trim()||void 0,notes:z.notes?.trim()||void 0,trust:ha(z.trust),lastInteractedAt:typeof z.lastInteractedAt=="number"&&Number.isFinite(z.lastInteractedAt)?z.lastInteractedAt:void 0,updatedAt:Date.now()}))),await Ne(),j("Trust graph saved."),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{C(!1)}}async function Ot(){if(B){C(!0),j(null);try{await xa({chronos:{...B,activeWorkstream:B.activeWorkstream?.trim()||void 0,updatedAt:Date.now()}}),await Ne(),j("Chronos state saved."),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{C(!1)}}}async function St(){if(le){C(!0),j(null);try{await xa({affect:{...le,joy:ha(le.joy),frustration:ha(le.frustration),curiosity:ha(le.curiosity),confidence:ha(le.confidence),care:ha(le.care),fatigue:ha(le.fatigue),updatedAt:Date.now()}}),await Ne(),j("Affect state saved."),I(null)}catch(z){I(z instanceof Error?z.message:String(z))}finally{C(!1)}}}return d.jsxs("div",{children:[d.jsxs("div",{className:"page-header-row",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Mission Control"}),d.jsx("div",{className:"page-subtitle",children:"ANIMA's local-only continuity workspace. Edit durable context, connect a private repo, and import previous coherence state."})]}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Ne()},children:E?"Refreshing...":"Refresh"})]}),d.jsxs("div",{className:"card",children:[d.jsxs("div",{className:"card-header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Continuity Repo"}),d.jsx("div",{className:"card-subtitle",children:"Create a private GitLab or GitHub repo for ANIMA continuity, then connect its SSH remote here."})]}),d.jsx("span",{className:`badge ${e?.state.repo.remoteConfigured?"completed":"queued"}`,children:e?.state.repo.remoteConfigured?"linked":"pending"})]}),d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Git repo URL (SSH preferred)"}),d.jsx("input",{className:"search-bar mono",value:l,onChange:z=>c(z.target.value),placeholder:"git@gitlab.com:org/anima-continuity.git",spellCheck:!1})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Provider"}),d.jsxs("select",{className:"search-bar",value:m,onChange:z=>g(z.target.value),children:[d.jsx("option",{value:"gitlab",children:"GitLab"}),d.jsx("option",{value:"github",children:"GitHub"}),d.jsx("option",{value:"custom",children:"Custom"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Branch"}),d.jsx("input",{className:"search-bar mono",value:f,onChange:z=>h(z.target.value),placeholder:"main"})]})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Le()},disabled:k,children:k?"Saving...":"Connect Repo"})}),d.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Mission files live at"," ",d.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?d.jsx("div",{className:"warning-text top-gap-sm",children:e.state.repo.lastError}):null]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-header",children:d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Import Previous Continuity"}),d.jsxs("div",{className:"card-subtitle",children:["Pull the codex coherence protocol into ",d.jsx("span",{className:"mono",children:"~/.anima"})," now that the filesystem is writable."]})]})}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Source path"}),d.jsx("input",{className:"search-bar mono",value:S,onChange:z=>w(z.target.value),spellCheck:!1})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Me()},disabled:k,children:k?"Importing...":"Import Codex Context"})})]}),N?d.jsx("div",{className:"card status-banner",children:N}):null,_?d.jsx("div",{className:"card warning-banner",children:_}):null,d.jsxs("div",{className:"grid grid-4",children:[d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Goals"}),d.jsxs("div",{className:"page-subtitle top-gap-sm",children:[Pe.length," active / ",e?.state.goals.length??0," total"]}),d.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:Pe[0]?.title??"No active goals yet."})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Features"}),d.jsxs("div",{className:"page-subtitle top-gap-sm",children:[pt.length," in flight / ",e?.state.features.length??0," tracked"]}),d.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginTop:"0.25rem"},children:[dt.queued>0&&d.jsxs("span",{className:"runtime-stat-detail",style:{color:"var(--color-text)"},children:[dt.queued," queued"]}),dt.inProgress>0&&d.jsxs("span",{className:"runtime-stat-detail",style:{color:"#ff6600"},children:[dt.inProgress," in-progress"]}),dt.review>0&&d.jsxs("span",{className:"runtime-stat-detail",style:{color:"#eab308"},children:[dt.review," review"]}),dt.done>0&&d.jsxs("span",{className:"runtime-stat-detail",style:{color:"#22c55e"},children:[dt.done," done"]}),dt.blocked>0&&d.jsxs("span",{className:"runtime-stat-detail",style:{color:"#ef4444"},children:[dt.blocked," blocked"]})]})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Chronos"}),d.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:e?.state.chronos.activeWorkstream?`Focus: ${e.state.chronos.activeWorkstream}`:"No active workstream"}),d.jsxs("div",{className:"runtime-stat-detail",children:["Contract ",e?.state.chronos.contractElapsedMinutes??0,"/",e?.state.chronos.contractTargetMinutes??45," min"]})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Affect"}),d.jsx("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginTop:"0.25rem"},children:vt.slice(0,3).map(([z,Y])=>d.jsxs("span",{className:"runtime-stat-detail",children:[z," ",Math.round(Y*100),"%"]},z))})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"People"}),d.jsxs("div",{className:"page-subtitle top-gap-sm",children:[Zt.length," tracked"]}),d.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:Zt[0]?.name??"No people tracked yet."})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Trust Graph"}),d.jsxs("div",{className:"page-subtitle top-gap-sm",children:[e?.trustGraph.people.length??0," trusted records"]}),d.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:e?.trustGraph.people[0]?.name??"No trust context recorded yet."})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Continuity Graph"}),d.jsxs("div",{className:"page-subtitle top-gap-sm",children:[We," nodes / ",mt," edges"]}),d.jsx("div",{className:"runtime-stat-detail top-gap-sm",children:gt[0]?`${gt[0].relation}: ${gt[0].target}`:"No active focus trace yet."})]})]}),d.jsxs("div",{className:"mission-grid",children:[d.jsxs("div",{className:"card mission-files-card",children:[d.jsxs("div",{className:"card-header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Mission Files"}),d.jsx("div",{className:"card-subtitle",children:"Durable context files ANIMA can manage over time."})]}),d.jsxs("div",{className:"runtime-stat-detail",children:[e?.files.length??0," files"]})]}),d.jsx("div",{className:"mission-file-list top-gap",children:(e?.files||[]).map(z=>d.jsxs("button",{type:"button",className:`mission-file-item ${ve?.fileName===z.fileName?"active":""}`,onClick:()=>r(z.fileName),children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:z.title}),d.jsx("div",{className:"runtime-stat-detail mono",children:z.fileName})]}),d.jsx("div",{className:"runtime-stat-detail",children:z.updatedAt?new Date(z.updatedAt).toLocaleString():"never"})]},z.fileName))}),d.jsxs("div",{className:"top-gap",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Create a new context file"}),d.jsx("input",{className:"search-bar mono",value:v,onChange:z=>b(z.target.value),placeholder:"roadmap.md",spellCheck:!1})]}),d.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>{v.trim()&&(r(v.trim()),o(`# New Mission File
64
+
65
+ `))},children:"Draft New File"})]})]}),d.jsxs("div",{className:"card",children:[d.jsxs("div",{className:"card-header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Editor"}),d.jsx("div",{className:"card-subtitle",children:"Write durable directives, orchestration state, and continuity notes."})]}),d.jsx("button",{type:"button",className:"action-button",disabled:k||!(n||v.trim()),onClick:()=>{Ln(n||v.trim())},children:k?"Saving...":"Save File"})]}),d.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:ve?.path||"Choose or draft a file to begin editing."}),d.jsx("textarea",{className:"search-bar mono mission-editor top-gap",spellCheck:!1,value:a,onChange:z=>o(z.target.value),placeholder:"Mission directives, repo plans, orchestration notes..."})]})]}),d.jsx("div",{className:"top-gap",children:d.jsx(ei,{title:"ANIMA 6 Goals",subtitle:"Durable goals stored in Mission Control state.",badge:d.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[Pe.length," active / ",e?.state.goals.length??0," total"]}),headerRight:d.jsx("button",{type:"button",className:"action-button",disabled:k,onClick:()=>{Te()},children:k?"Saving...":"Save Goals"}),expanded:M.goals,onToggle:()=>ee("goals"),children:d.jsxs("div",{className:"mission-file-list",children:[L.map((z,Y)=>d.jsxs(_C,{label:z.title||"(untitled goal)",detail:`${z.status} / ${z.priority}${z.owner?` / ${z.owner}`:""}`,badge:d.jsx("span",{className:"badge",style:{backgroundColor:OC(z.status),color:"#fff",fontSize:"0.7rem"},children:z.status}),expanded:!!P[Y],onToggle:()=>we(Y),children:[d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Title"}),d.jsx("input",{className:"search-bar",value:z.title,onChange:xe=>W(Y,{title:xe.target.value})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"ID"}),d.jsx("input",{className:"search-bar mono",value:z.id,onChange:xe=>W(Y,{id:xe.target.value})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Status"}),d.jsxs("select",{className:"search-bar",value:z.status,onChange:xe=>W(Y,{status:xe.target.value}),children:[d.jsx("option",{value:"active",children:"active"}),d.jsx("option",{value:"paused",children:"paused"}),d.jsx("option",{value:"completed",children:"completed"}),d.jsx("option",{value:"blocked",children:"blocked"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Priority"}),d.jsxs("select",{className:"search-bar",value:z.priority,onChange:xe=>W(Y,{priority:xe.target.value}),children:[d.jsx("option",{value:"critical",children:"critical"}),d.jsx("option",{value:"high",children:"high"}),d.jsx("option",{value:"medium",children:"medium"}),d.jsx("option",{value:"low",children:"low"})]})]}),d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Owner"}),d.jsx("input",{className:"search-bar",value:z.owner??"",onChange:xe=>W(Y,{owner:xe.target.value})})]}),d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Summary"}),d.jsx("textarea",{className:"search-bar",value:z.summary??"",onChange:xe=>W(Y,{summary:xe.target.value})})]})]}),d.jsx("div",{className:"button-row top-gap-sm",children:d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>V(xe=>xe.filter((He,en)=>en!==Y)),children:"Remove"})})]},`${z.id||"goal"}-${Y}`)),d.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>V(z=>[...z,{id:"",title:"",status:"active",priority:"medium",updatedAt:Date.now()}]),children:"Add Goal"})]})})}),d.jsx("div",{className:"top-gap",children:d.jsx(ei,{title:"Features",subtitle:"Feature-level continuity and delivery state.",badge:d.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[dt.inProgress," in-progress / ",e?.state.features.length??0," ","total"]}),headerRight:d.jsx("button",{type:"button",className:"action-button",disabled:k,onClick:()=>{Ve()},children:k?"Saving...":"Save Features"}),expanded:M.features,onToggle:()=>ee("features"),children:d.jsxs("div",{className:"mission-file-list",children:[D.map((z,Y)=>d.jsxs(_C,{label:z.title||"(untitled feature)",detail:`${z.status} / risk ${z.risk} / tests ${z.testStatus}${z.area?` / ${z.area}`:""}`,badge:d.jsx("span",{className:"badge",style:{backgroundColor:OC(z.status),color:"#fff",fontSize:"0.7rem"},children:z.status}),expanded:!!me[Y],onToggle:()=>Ue(Y),children:[d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Title"}),d.jsx("input",{className:"search-bar",value:z.title,onChange:xe=>H(Y,{title:xe.target.value})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"ID"}),d.jsx("input",{className:"search-bar mono",value:z.id,onChange:xe=>H(Y,{id:xe.target.value})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Status"}),d.jsxs("select",{className:"search-bar",value:z.status,onChange:xe=>H(Y,{status:xe.target.value}),children:[d.jsx("option",{value:"queued",children:"queued"}),d.jsx("option",{value:"in_progress",children:"in_progress"}),d.jsx("option",{value:"review",children:"review"}),d.jsx("option",{value:"done",children:"done"}),d.jsx("option",{value:"blocked",children:"blocked"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Risk"}),d.jsxs("select",{className:"search-bar",value:z.risk,onChange:xe=>H(Y,{risk:xe.target.value}),children:[d.jsx("option",{value:"low",children:"low"}),d.jsx("option",{value:"medium",children:"medium"}),d.jsx("option",{value:"high",children:"high"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Tests"}),d.jsxs("select",{className:"search-bar",value:z.testStatus,onChange:xe=>H(Y,{testStatus:xe.target.value}),children:[d.jsx("option",{value:"missing",children:"missing"}),d.jsx("option",{value:"partial",children:"partial"}),d.jsx("option",{value:"passing",children:"passing"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Area"}),d.jsx("input",{className:"search-bar",value:z.area??"",onChange:xe=>H(Y,{area:xe.target.value})})]})]}),d.jsx("div",{className:"button-row top-gap-sm",children:d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>q(xe=>xe.filter((He,en)=>en!==Y)),children:"Remove"})})]},`${z.id||"feature"}-${Y}`)),d.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>q(z=>[...z,{id:"",title:"",status:"queued",risk:"medium",testStatus:"missing",lastTouchedAt:Date.now()}]),children:"Add Feature"})]})})}),d.jsx("div",{className:"top-gap",children:d.jsxs(ei,{title:"Affect",subtitle:"Current bounded emotion state for ANIMA.",badge:d.jsx("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:vt.map(([z,Y])=>`${z} ${Math.round(Y*100)}%`).join(" / ")}),headerRight:d.jsx("button",{type:"button",className:"action-button",disabled:k||!le,onClick:()=>{St()},children:k?"Saving...":"Save Affect"}),expanded:M.affect,onToggle:()=>ee("affect"),children:[d.jsx("div",{className:"grid",children:vt.map(([z,Y])=>d.jsxs("div",{children:[d.jsx("div",{className:"runtime-stat-detail",children:z}),d.jsx("div",{className:"progress-bar top-gap-sm",children:d.jsx("div",{className:"progress-fill",style:{width:`${Math.round(Y*100)}%`}})})]},z))}),le?d.jsx("div",{className:"form-grid two-col top-gap",children:[["joy","Joy"],["frustration","Frustration"],["curiosity","Curiosity"],["confidence","Confidence"],["care","Care"],["fatigue","Fatigue"]].map(([z,Y])=>d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:Y}),d.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:le[z],onChange:xe=>ye(He=>He&&{...He,[z]:Number(xe.target.value)})})]},z))}):null]})}),d.jsx("div",{className:"top-gap",children:d.jsx(ei,{title:"People",subtitle:"Tracked humans and relationship state.",badge:d.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[Zt.length," tracked"]}),headerRight:d.jsx("button",{type:"button",className:"action-button",disabled:k,onClick:()=>{st()},children:k?"Saving...":"Save People"}),expanded:M.people,onToggle:()=>ee("people"),children:d.jsxs("div",{className:"mission-file-list",children:[G.map((z,Y)=>d.jsxs("div",{className:"card top-gap-sm",children:[d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Name"}),d.jsx("input",{className:"search-bar",value:z.name,onChange:xe=>se(Y,{name:xe.target.value})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"ID"}),d.jsx("input",{className:"search-bar mono",value:z.id,onChange:xe=>se(Y,{id:xe.target.value})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Relationship"}),d.jsxs("select",{className:"search-bar",value:z.relationship,onChange:xe=>se(Y,{relationship:xe.target.value}),children:[d.jsx("option",{value:"operator",children:"operator"}),d.jsx("option",{value:"ally",children:"ally"}),d.jsx("option",{value:"stakeholder",children:"stakeholder"}),d.jsx("option",{value:"unknown",children:"unknown"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Trust"}),d.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:z.trust,onChange:xe=>se(Y,{trust:Number(xe.target.value)})})]}),d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Notes"}),d.jsx("textarea",{className:"search-bar",value:z.notes??"",onChange:xe=>se(Y,{notes:xe.target.value})})]})]}),d.jsx("div",{className:"button-row top-gap-sm",children:d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>Z(xe=>xe.filter((He,en)=>en!==Y)),children:"Remove"})})]},`${z.id||"person"}-${Y}`)),d.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>Z(z=>[...z,{id:"",name:"",relationship:"ally",trust:.5}]),children:"Add Person"})]})})}),d.jsx("div",{className:"top-gap",children:d.jsxs(ei,{title:"Who Is Whom And Where",subtitle:"Trusted person memory used for ANIMA 6 prompt context and relationship continuity.",badge:d.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.trustGraph.people.length??0," records"]}),headerRight:d.jsx("button",{type:"button",className:"action-button",disabled:k,onClick:()=>{Xt()},children:k?"Saving...":"Save Trust Graph"}),expanded:M.trustGraph,onToggle:()=>ee("trustGraph"),children:[d.jsx("div",{className:"runtime-stat-detail mono top-gap-sm",children:e?.trustGraph.path??"~/.anima/identity/who_is_whom_and_where.json"}),d.jsxs("div",{className:"mission-file-list top-gap",children:[ce.map((z,Y)=>d.jsxs("div",{className:"card top-gap-sm",children:[d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Name"}),d.jsx("input",{className:"search-bar",value:z.name,onChange:xe=>Ee(Y,{name:xe.target.value})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"ID"}),d.jsx("input",{className:"search-bar mono",value:z.id,onChange:xe=>Ee(Y,{id:xe.target.value})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Relationship"}),d.jsxs("select",{className:"search-bar",value:z.relationship,onChange:xe=>Ee(Y,{relationship:xe.target.value}),children:[d.jsx("option",{value:"operator",children:"operator"}),d.jsx("option",{value:"ally",children:"ally"}),d.jsx("option",{value:"stakeholder",children:"stakeholder"}),d.jsx("option",{value:"unknown",children:"unknown"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Trust"}),d.jsx("input",{className:"search-bar",type:"number",min:0,max:1,step:.05,value:z.trust,onChange:xe=>Ee(Y,{trust:Number(xe.target.value)})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Aliases"}),d.jsx("input",{className:"search-bar",value:(z.aliases??[]).join(", "),onChange:xe=>Ee(Y,{aliases:xe.target.value.split(",").map(He=>He.trim()).filter(Boolean)}),placeholder:"Peter, boss"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Roles"}),d.jsx("input",{className:"search-bar",value:(z.roles??[]).join(", "),onChange:xe=>Ee(Y,{roles:xe.target.value.split(",").map(He=>He.trim()).filter(Boolean)}),placeholder:"operator, founder"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Location"}),d.jsx("input",{className:"search-bar",value:z.location??"",onChange:xe=>Ee(Y,{location:xe.target.value}),placeholder:"Sydney"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Last Interacted At (epoch ms)"}),d.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:z.lastInteractedAt??"",onChange:xe=>Ee(Y,{lastInteractedAt:xe.target.value?Number(xe.target.value):void 0}),placeholder:String(Date.now())})]}),d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Notes"}),d.jsx("textarea",{className:"search-bar",value:z.notes??"",onChange:xe=>Ee(Y,{notes:xe.target.value}),placeholder:"Primary operator, protect continuity, owns final decisions."})]})]}),d.jsx("div",{className:"button-row top-gap-sm",children:d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>J(xe=>xe.filter((He,en)=>en!==Y)),children:"Remove"})})]},`${z.id||"trust-person"}-${Y}`)),d.jsx("button",{type:"button",className:"action-button ghost top-gap-sm",onClick:()=>J(z=>[...z,{id:"",name:"",relationship:"ally",trust:.5,updatedAt:Date.now()}]),children:"Add Trust Record"})]})]})}),d.jsx("div",{className:"top-gap",children:d.jsx(ei,{title:"Chronos Controls",subtitle:"Heartbeat, checkpoint, and active workstream state.",badge:d.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:d.jsx("button",{type:"button",className:"action-button",disabled:k||!B,onClick:()=>{Ot()},children:k?"Saving...":"Save Chronos"}),expanded:M.chronos,onToggle:()=>ee("chronos"),children:B?d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Heartbeat Minutes"}),d.jsx("input",{className:"search-bar",type:"number",min:1,value:B.heartbeatMinutes,onChange:z=>X(Y=>Y&&{...Y,heartbeatMinutes:Number(z.target.value)})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Focus Block Minutes"}),d.jsx("input",{className:"search-bar",type:"number",min:1,value:B.focusBlockMinutes,onChange:z=>X(Y=>Y&&{...Y,focusBlockMinutes:Number(z.target.value)})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Checkpoint Minutes"}),d.jsx("input",{className:"search-bar",type:"number",min:1,value:B.checkpointIntervalMinutes,onChange:z=>X(Y=>Y&&{...Y,checkpointIntervalMinutes:Number(z.target.value)})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Active Workstream"}),d.jsx("input",{className:"search-bar",value:B.activeWorkstream??"",onChange:z=>X(Y=>Y&&{...Y,activeWorkstream:z.target.value}),placeholder:"feature id or goal id"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Contract Started At (epoch ms)"}),d.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:B.contractStartedAt??"",onChange:z=>X(Y=>Y&&{...Y,contractStartedAt:z.target.value?Number(z.target.value):void 0}),placeholder:String(Date.now())})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Contract Target Minutes"}),d.jsx("input",{className:"search-bar",type:"number",min:1,value:B.contractTargetMinutes,onChange:z=>X(Y=>Y&&{...Y,contractTargetMinutes:Number(z.target.value)})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Elapsed Minutes"}),d.jsx("input",{className:"search-bar",type:"number",min:0,value:B.contractElapsedMinutes,onChange:z=>X(Y=>Y&&{...Y,contractElapsedMinutes:Number(z.target.value)})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Checkpoint Count"}),d.jsx("input",{className:"search-bar",type:"number",min:0,value:B.checkpointCount,onChange:z=>X(Y=>Y&&{...Y,checkpointCount:Number(z.target.value)})})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Last Checkpoint At (epoch ms)"}),d.jsx("input",{className:"search-bar mono",type:"number",min:0,step:1,value:B.lastCheckpointAt??"",onChange:z=>X(Y=>Y&&{...Y,lastCheckpointAt:z.target.value?Number(z.target.value):void 0}),placeholder:String(Date.now())})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Drift Minutes"}),d.jsx("input",{className:"search-bar",type:"number",step:1,value:B.driftMinutes,onChange:z=>X(Y=>Y&&{...Y,driftMinutes:Number(z.target.value)})})]})]}):null})}),d.jsx("div",{className:"top-gap",children:d.jsx(ei,{title:"Graph Focus",subtitle:"Active continuity links generated from ANIMA 6 Mission Control state.",badge:d.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[gt.length," links"]}),expanded:M.graphFocus,onToggle:()=>ee("graphFocus"),children:d.jsx("div",{className:"mission-file-list",children:gt.length>0?gt.map(z=>d.jsxs("div",{className:"mission-file-item",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:z.relation}),d.jsxs("div",{className:"runtime-stat-detail mono",children:[z.source," → ",z.target]})]}),d.jsxs("div",{className:"runtime-stat-detail",children:[Math.round(z.meta.strength*100),"% strength"]})]},z.id)):d.jsx("div",{className:"runtime-stat-detail",children:"Chronos does not have an active workstream pinned yet, so the graph only contains baseline continuity links."})})})}),d.jsx("div",{className:"top-gap",children:d.jsx(ei,{title:"Atlas",subtitle:"Palace rooms, active continuity nodes, and recent brain events derived from ANIMA 6 state.",badge:d.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[_t.length," rooms / ",Gt.length," nodes / ",Ft.length," events"]}),expanded:M.atlas,onToggle:()=>ee("atlas"),children:d.jsxs("div",{className:"grid grid-3 top-gap",children:[d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Palace Rooms"}),d.jsx("div",{className:"activity-list top-gap",children:_t.map(z=>d.jsxs("div",{className:"mission-file-item",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:z.title}),d.jsx("div",{className:"runtime-stat-detail",children:z.detail})]}),d.jsx("div",{className:"runtime-stat-detail",children:z.count})]},z.key))})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Graph Neighborhood"}),d.jsx("div",{className:"activity-list top-gap",children:Gt.length>0?Gt.map(z=>d.jsxs("div",{className:"mission-file-item",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:z.label}),d.jsxs("div",{className:"runtime-stat-detail mono",children:[z.type," · salience ",Math.round(z.meta.salience*100),"%"]})]}),d.jsxs("div",{className:"runtime-stat-detail",children:[e?.brainGraph.edges.filter(Y=>Y.source===z.id||Y.target===z.id).length??0," ","links"]})]},z.id)):d.jsx("div",{className:"runtime-stat-detail",children:"No graph nodes available yet."})})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-title",children:"Timeline"}),d.jsx("div",{className:"activity-list top-gap",children:Ft.length>0?Ft.map(z=>d.jsxs("div",{className:"mission-file-item",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:z.title}),d.jsx("div",{className:"runtime-stat-detail",children:z.detail})]}),d.jsx("div",{className:"runtime-stat-detail",children:kY(z.ts)})]},z.id)):d.jsx("div",{className:"runtime-stat-detail",children:"No continuity events recorded yet."})})]})]})})}),d.jsx("div",{className:"top-gap",children:d.jsx(ei,{title:"Inner World",subtitle:"Recent soul, directives, journal, and wish state visible from Mission Control.",badge:d.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.innerWorld?.length??0," entries"]}),expanded:M.innerWorld,onToggle:()=>ee("innerWorld"),children:d.jsx("div",{className:"activity-list top-gap",children:(e?.innerWorld||[]).map(z=>d.jsxs("div",{className:"inner-world-entry",children:[d.jsxs("div",{className:"activity-row",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:z.title}),d.jsx("div",{className:"runtime-stat-detail mono",children:z.path})]}),d.jsx("div",{className:"runtime-stat-detail",children:z.updatedAt?new Date(z.updatedAt).toLocaleString():"unknown"})]}),d.jsx(Sa,{value:z.content,className:"markdown-preview"})]},z.id))})})}),d.jsx("div",{className:"top-gap",children:d.jsx(ei,{title:"Important History",subtitle:"Archived coherence, prompts, heartbeat notes, and prior continuity imports from ~/.anima/important-history.",badge:d.jsxs("span",{className:"runtime-stat-detail",style:{marginLeft:"0.5rem"},children:[e?.importantHistory?.length??0," entries"]}),expanded:M.importantHistory,onToggle:()=>ee("importantHistory"),children:e?.importantHistory?.length?d.jsx("div",{className:"activity-list top-gap",children:e?.importantHistory?.map(z=>d.jsxs("div",{className:"inner-world-entry",children:[d.jsxs("div",{className:"activity-row",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:z.relativePath}),d.jsx("div",{className:"runtime-stat-detail mono",children:z.archiveId}),d.jsx("div",{className:"runtime-stat-detail mono",children:z.path})]}),d.jsx("div",{className:"runtime-stat-detail",children:z.updatedAt?new Date(z.updatedAt).toLocaleString():"unknown"})]}),d.jsx(Sa,{value:z.content,className:"markdown-preview"})]},z.id))}):d.jsx("div",{className:"empty-note top-gap",children:"No archived important history has been imported yet."})})})]})}function Pv(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 NY(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 MC(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 tu({title:e,badge:t,defaultOpen:n=!1,children:r}){const[a,o]=R.useState(n);return d.jsxs("div",{className:"card",style:{marginBottom:12},children:[d.jsxs("div",{onClick:()=>o(!a),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",cursor:"pointer",userSelect:"none"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[d.jsx("span",{style:{color:"var(--color-accent, #ff6600)",fontSize:12,transition:"transform 0.2s",transform:a?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"}),d.jsx("span",{style:{fontWeight:600,fontSize:14},children:e})]}),t&&d.jsx("div",{children:t})]}),d.jsx("div",{style:{maxHeight:a?2e3:0,opacity:a?1:0,overflow:"hidden",transition:"max-height 0.3s ease, opacity 0.2s ease"},children:d.jsx("div",{style:{padding:"0 16px 16px"},children:r})})]})}const RY={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}},OY=[];function Od({label:e,value:t,detail:n,color:r}){return d.jsxs("div",{className:"card",style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:4},children:[d.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:11,textTransform:"uppercase",letterSpacing:1},children:e}),d.jsx("span",{style:{fontSize:28,fontWeight:700,color:r??"var(--color-text)",fontFamily:"JetBrains Mono, monospace"},children:t}),n&&d.jsx("span",{style:{color:"var(--color-text-muted, #888)",fontSize:12},children:n})]})}function MY({peer:e}){const t=e.encryptionStatus==="active"?"#00c853":e.encryptionStatus==="ratcheting"?"#ffb300":e.encryptionStatus==="handshaking"?"#4db8ff":"#666";return d.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #1a1a1a)"},children:[d.jsxs("td",{style:{padding:"10px 12px"},children:[d.jsx("span",{className:"status-dot success",style:{marginRight:8}}),e.displayName??e.deviceId.slice(0,12)+"..."]}),d.jsxs("td",{style:{padding:"10px 12px",fontFamily:"JetBrains Mono, monospace",fontSize:11,color:"var(--color-text-muted, #888)"},children:[e.deviceId.slice(0,16),"..."]}),d.jsx("td",{style:{padding:"10px 12px"},children:d.jsx("span",{style:{color:t,fontSize:12},children:e.encryptionStatus})}),d.jsxs("td",{style:{padding:"10px 12px",fontFamily:"JetBrains Mono, monospace",fontSize:12},children:[e.messagesSent," / ",e.messagesReceived]}),d.jsx("td",{style:{padding:"10px 12px",color:"var(--color-text-muted, #888)",fontSize:12},children:Pv(e.connectedAt)})]})}function DY(){const[e]=R.useState(RY),[t]=R.useState(_Y),[n]=R.useState(OY);return d.jsxs("div",{children:[d.jsxs("div",{style:{marginBottom:24},children:[d.jsx("h1",{className:"page-title",style:{marginBottom:4},children:"P2P Network"}),d.jsx("p",{style:{color:"var(--color-text-muted, #888)",margin:0,fontSize:14},children:"Encrypted peer-to-peer mesh — agent-to-agent communication"})]}),d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(160px, 1fr))",gap:12,marginBottom:20},children:[d.jsx(Od,{label:"Status",value:e.listening?"ONLINE":"OFFLINE",detail:e.listening?`Port ${e.listenPort}`:void 0,color:e.listening?"#00c853":"#ff3b30"}),d.jsx(Od,{label:"Peers",value:e.connectedPeers,detail:`${e.discoveredPeers} discovered`}),d.jsx(Od,{label:"Messages",value:e.totalMessagesSent+e.totalMessagesReceived,detail:`${e.totalMessagesSent} sent / ${e.totalMessagesReceived} recv`}),d.jsx(Od,{label:"Uptime",value:MC(e.uptime)})]}),d.jsx(tu,{title:"Connected Peers",badge:d.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?d.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[d.jsx("thead",{children:d.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border, #333)"},children:[d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Name"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Device ID"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Encryption"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Sent / Recv"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--color-text-muted, #666)"},children:"Connected"})]})}),d.jsx("tbody",{children:n.map(r=>d.jsx(MY,{peer:r},r.deviceId))})]}):d.jsxs("div",{style:{textAlign:"center",color:"var(--color-text-muted, #888)",padding:24},children:[d.jsx("p",{style:{fontSize:14,marginBottom:8},children:"No peers connected"}),d.jsx("p",{style:{fontSize:12},children:"Peers will appear here when other Anima instances join your organization's P2P network."})]})}),d.jsx(tu,{title:"Brain Sync",badge:d.jsx("span",{className:"badge",style:{background:t.brainSync.enabled?"#1a3a2a":"#1a1a1a",color:t.brainSync.enabled?"#00c853":"#888"},children:t.brainSync.enabled?"ACTIVE":"DISABLED"}),children:d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Status"}),d.jsx("span",{style:{color:t.brainSync.enabled?"#00c853":"#888"},children:t.brainSync.enabled?"Syncing":"Not configured"}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Last Sync"}),d.jsx("span",{children:Pv(t.brainSync.lastSyncMs)}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Pending Events"}),d.jsx("span",{children:t.brainSync.pendingEvents}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Vector Clock Entries"}),d.jsx("span",{children:t.brainSync.vectorClockSize})]})}),d.jsx(tu,{title:"Workspace Sync",badge:d.jsx("span",{className:"badge",style:{background:t.workspaceSync.enabled?"#1a3a2a":"#1a1a1a",color:t.workspaceSync.enabled?"#00c853":"#888"},children:t.workspaceSync.enabled?"ACTIVE":"DISABLED"}),children:d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Status"}),d.jsx("span",{style:{color:t.workspaceSync.enabled?"#00c853":"#888"},children:t.workspaceSync.enabled?"Active":"Not configured"}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Last Backup"}),d.jsx("span",{children:Pv(t.workspaceSync.lastBackupMs)}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Blobs Stored"}),d.jsx("span",{children:t.workspaceSync.blobCount}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Total Size"}),d.jsx("span",{children:NY(t.workspaceSync.totalSizeBytes)}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Next Backup"}),d.jsx("span",{children:t.workspaceSync.nextBackupMs>0?`in ${MC(Math.max(0,Math.floor((t.workspaceSync.nextBackupMs-Date.now())/1e3)))}`:"--"})]})}),d.jsx(tu,{title:"Encryption",children:d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Key Exchange"}),d.jsx("span",{children:"X25519 Diffie-Hellman"}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Handshake"}),d.jsx("span",{children:"Noise NK (triple DH)"}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Cipher"}),d.jsx("span",{children:"ChaCha20-Poly1305"}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Forward Secrecy"}),d.jsx("span",{style:{color:"#00c853"},children:"Enabled (key ratchet every 100 msgs)"}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Identity Keys"}),d.jsx("span",{className:"mono",style:{fontSize:11},children:e.deviceId?e.deviceId.slice(0,32)+"...":"~/.anima/identity/peer-keys.json"})]})}),d.jsx(tu,{title:"Discovery",children:d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:"10px 16px",fontSize:13},children:[d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"NoxSoft Registry"}),d.jsx("span",{style:{color:"#888"},children:"Not configured"}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"mDNS (LAN)"}),d.jsx("span",{style:{color:"#888"},children:"Not configured"}),d.jsx("span",{style:{color:"var(--color-text-muted, #666)"},children:"Static Peers"}),d.jsx("span",{children:"0 configured"})]})})]})}function m2(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 Cf(e){return new Date(e).toLocaleString()}function Lv(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 Di=180,zv=60,g2=100,wu=20;function Ao(e){return e.children.length===0?Di:e.children.map(Ao).reduce((n,r)=>n+r,0)+wu*(e.children.length-1)}function v2({node:e,x:t,y:n,parentX:r,parentY:a,onSelect:o,selectedId:l}){const c=l===e.memberId,f=Ao(e);let h=t-f/2;const m=e.children.map(b=>{const S=Ao(b),w=h+S/2;return h+=S+wu,d.jsx(v2,{node:b,x:w,y:n+g2,parentX:t,parentY:n+zv,onSelect:o,selectedId:l},b.memberId)}),g=e.kind==="human"?"H":"A",v=e.status==="active"?"#00c853":e.status==="busy"||e.status==="idle"?"#ffb300":e.status==="offline"?"#666":"#ff3b30";return d.jsxs(d.Fragment,{children:[r!==void 0&&a!==void 0&&d.jsx("line",{x1:r,y1:a,x2:t,y2:n,stroke:"#333",strokeWidth:2}),d.jsx("rect",{x:t-Di/2,y:n,width:Di,height:zv,rx:6,fill:c?"#1a1a1a":"#111",stroke:c?"#ff6600":"#333",strokeWidth:c?2:1,style:{cursor:"pointer"},onClick:()=>o(e.memberId)}),d.jsx("circle",{cx:t-Di/2+14,cy:n+16,r:5,fill:v}),d.jsx("rect",{x:t+Di/2-24,y:n+6,width:18,height:18,rx:3,fill:e.kind==="human"?"#1a3a2a":"#1a2a3a"}),d.jsx("text",{x:t+Di/2-15,y:n+19,textAnchor:"middle",fill:e.kind==="human"?"#00c853":"#4db8ff",fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:"bold",children:g}),d.jsx("text",{x:t-Di/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}),d.jsx("text",{x:t-Di/2+14,y:n+38,fill:"#888",fontSize:11,fontFamily:"JetBrains Mono, monospace",children:e.role}),e.specializations.length>0&&d.jsx("text",{x:t-Di/2+14,y:n+52,fill:"#ff6600",fontSize:9,fontFamily:"JetBrains Mono, monospace",children:e.specializations.slice(0,2).join(", ")}),m]})}function DC({onClose:e,onCreate:t}){const[n,r]=R.useState(""),[a,o]=R.useState(""),[l,c]=R.useState(""),[f,h]=R.useState(""),[m,g]=R.useState("human"),v={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 d.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:d.jsxs("div",{className:"card",style:{width:420,padding:24},onClick:b=>b.stopPropagation(),children:[d.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Create Organization"}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Name"}),d.jsx("input",{style:v,value:n,onChange:b=>r(b.target.value),placeholder:"Organization name"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Description"}),d.jsx("input",{style:v,value:a,onChange:b=>o(b.target.value),placeholder:"What is this org about?"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner ID"}),d.jsx("input",{style:v,value:l,onChange:b=>c(b.target.value),placeholder:"Owner identifier"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner Name"}),d.jsx("input",{style:v,value:f,onChange:b=>h(b.target.value),placeholder:"Display name"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Owner Kind"}),d.jsxs("select",{style:v,value:m,onChange:b=>g(b.target.value),children:[d.jsx("option",{value:"human",children:"Human"}),d.jsx("option",{value:"agent",children:"Agent"})]})]}),d.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[d.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"}),d.jsx("button",{onClick:()=>{n.trim()&&l.trim()&&f.trim()&&t({name:n.trim(),description:a.trim(),ownerId:l.trim(),ownerName:f.trim(),ownerKind:m})},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 IY({members:e,onClose:t,onAdd:n}){const[r,a]=R.useState(""),[o,l]=R.useState("agent"),[c,f]=R.useState("worker"),[h,m]=R.useState(""),[g,v]=R.useState(""),[b,S]=R.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 d.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:d.jsxs("div",{className:"card",style:{width:420,padding:24},onClick:E=>E.stopPropagation(),children:[d.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Add Member"}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Name"}),d.jsx("input",{style:w,value:r,onChange:E=>a(E.target.value),placeholder:"Member name"})]}),d.jsxs("div",{style:{display:"flex",gap:12},children:[d.jsxs("div",{style:{flex:1},children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Kind"}),d.jsxs("select",{style:w,value:o,onChange:E=>l(E.target.value),children:[d.jsx("option",{value:"human",children:"Human"}),d.jsx("option",{value:"agent",children:"Agent"})]})]}),d.jsxs("div",{style:{flex:1},children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Role"}),d.jsxs("select",{style:w,value:c,onChange:E=>f(E.target.value),children:[d.jsx("option",{value:"owner",children:"Owner"}),d.jsx("option",{value:"operator",children:"Operator"}),d.jsx("option",{value:"coordinator",children:"Coordinator"}),d.jsx("option",{value:"worker",children:"Worker"}),d.jsx("option",{value:"observer",children:"Observer"})]})]})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Description"}),d.jsx("input",{style:w,value:h,onChange:E=>m(E.target.value),placeholder:"What does this member do?"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Specializations (comma-separated)"}),d.jsx("input",{style:w,value:g,onChange:E=>v(E.target.value),placeholder:"e.g. security, feature-dev"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Reports To"}),d.jsxs("select",{style:w,value:b,onChange:E=>S(E.target.value),children:[d.jsx("option",{value:"",children:"None (root)"}),e.map(E=>d.jsxs("option",{value:E.id,children:[E.displayName," (",E.role,")"]},E.id))]})]}),d.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[d.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"}),d.jsx("button",{onClick:()=>{r.trim()&&n({displayName:r.trim(),kind:o,role:c,description:h.trim(),specializations:g.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 PY({onClose:e,onJoin:t}){const[n,r]=R.useState(""),[a,o]=R.useState(""),[l,c]=R.useState(""),[f,h]=R.useState("agent"),[m,g]=R.useState(""),[v,b]=R.useState(""),[S,w]=R.useState(!1),[E,T]=R.useState(null),[k,C]=R.useState(null),N=async()=>{if(!(!n.trim()||!a.trim())){w(!0),C(null);try{const _=await dB({inviteCode:n.trim(),passcode:a.trim()});T(`${_.org.name} (role: ${_.role})`)}catch{C("Invalid invite code or passcode"),T(null)}finally{w(!1)}}},j={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 d.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:d.jsxs("div",{className:"card",style:{width:420,padding:24},onClick:_=>_.stopPropagation(),children:[d.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Join Organization"}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Invite Code"}),d.jsx("input",{style:j,value:n,onChange:_=>r(_.target.value.toUpperCase()),placeholder:"NOX-XXXXXX-XXXX"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Passcode"}),d.jsx("input",{style:{...j},type:"password",value:a,onChange:_=>o(_.target.value),placeholder:"Secret passcode"})]}),d.jsx("button",{onClick:N,disabled:!n.trim()||!a.trim()||S,style:{padding:"8px 16px",background:"#1a1a1a",border:"1px solid #4db8ff",borderRadius:4,color:"#4db8ff",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,opacity:!n.trim()||!a.trim()?.4:1},children:S?"Validating...":"Validate Invite"}),E&&d.jsxs("div",{style:{padding:"8px 12px",background:"#1a3a2a",border:"1px solid #00c853",borderRadius:4,color:"#00c853",fontSize:12},children:["Valid! Org: ",E]}),k&&d.jsx("div",{style:{padding:"8px 12px",background:"#3a1a1a",border:"1px solid #ff3b30",borderRadius:4,color:"#ff3b30",fontSize:12},children:k}),E&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Your Name"}),d.jsx("input",{style:j,value:l,onChange:_=>c(_.target.value),placeholder:"Display name"})]}),d.jsx("div",{style:{display:"flex",gap:12},children:d.jsxs("div",{style:{flex:1},children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Kind"}),d.jsxs("select",{style:j,value:f,onChange:_=>h(_.target.value),children:[d.jsx("option",{value:"human",children:"Human"}),d.jsx("option",{value:"agent",children:"Agent"})]})]})}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Description"}),d.jsx("input",{style:j,value:m,onChange:_=>g(_.target.value),placeholder:"What do you do?"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:12,display:"block",marginBottom:4},children:"Specializations (comma-separated)"}),d.jsx("input",{style:j,value:v,onChange:_=>b(_.target.value),placeholder:"e.g. security, feature-dev"})]})]}),d.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[d.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"}),E&&d.jsx("button",{onClick:()=>{l.trim()&&t({inviteCode:n.trim(),passcode:a.trim(),displayName:l.trim(),kind:f,description:m.trim(),specializations:v.split(",").map(_=>_.trim()).filter(Boolean)})},disabled:!l.trim(),style:{padding:"8px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,fontWeight:"bold",opacity:l.trim()?1:.4},children:"Join"})]})]})]})})}function LY({member:e,members:t,orgId:n,onSave:r,onRemove:a,onCancel:o}){const[l,c]=R.useState(e.role),[f,h]=R.useState(e.description),[m,g]=R.useState(e.specializations.join(", ")),[v,b]=R.useState(e.status),[S,w]=R.useState(e.reportsTo??""),[E,T]=R.useState(!1),k={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?d.jsxs("div",{style:{padding:16},children:[d.jsxs("h3",{style:{marginTop:0,marginBottom:12},children:["Edit ",e.displayName]}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Role"}),d.jsxs("select",{style:k,value:l,onChange:C=>c(C.target.value),children:[d.jsx("option",{value:"owner",children:"Owner"}),d.jsx("option",{value:"operator",children:"Operator"}),d.jsx("option",{value:"coordinator",children:"Coordinator"}),d.jsx("option",{value:"worker",children:"Worker"}),d.jsx("option",{value:"observer",children:"Observer"})]})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Description"}),d.jsx("input",{style:k,value:f,onChange:C=>h(C.target.value)})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Specializations"}),d.jsx("input",{style:k,value:m,onChange:C=>g(C.target.value),placeholder:"comma-separated"})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Status"}),d.jsxs("select",{style:k,value:v,onChange:C=>b(C.target.value),children:[d.jsx("option",{value:"active",children:"Active"}),d.jsx("option",{value:"idle",children:"Idle"}),d.jsx("option",{value:"busy",children:"Busy"}),d.jsx("option",{value:"offline",children:"Offline"}),d.jsx("option",{value:"suspended",children:"Suspended"})]})]}),d.jsxs("div",{children:[d.jsx("label",{style:{color:"#888",fontSize:11,display:"block",marginBottom:2},children:"Reports To"}),d.jsxs("select",{style:k,value:S,onChange:C=>w(C.target.value),children:[d.jsx("option",{value:"",children:"None (root)"}),t.filter(C=>C.id!==e.id).map(C=>d.jsxs("option",{value:C.id,children:[C.displayName," (",C.role,")"]},C.id))]})]}),d.jsxs("div",{style:{display:"flex",gap:8,marginTop:6},children:[d.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"}),d.jsx("button",{onClick:()=>{r({role:l,description:f,specializations:m.split(",").map(C=>C.trim()).filter(Boolean),status:v,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"})]})]})]}):d.jsxs("div",{style:{padding:16},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:16},children:[d.jsx("span",{className:m2(e.status)}),d.jsx("h2",{style:{margin:0,fontSize:18},children:e.displayName}),d.jsx("span",{className:"badge",style:{background:e.kind==="human"?"#1a3a2a":"#1a2a3a",color:e.kind==="human"?"#00c853":"#4db8ff",marginLeft:"auto"},children:e.kind})]}),d.jsx("p",{style:{color:"#aaa",fontSize:13,marginBottom:16},children:e.description}),d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"8px 12px",fontSize:13},children:[d.jsx("span",{style:{color:"#666"},children:"Role"}),d.jsx("span",{style:{color:"#ff6600"},children:e.role}),d.jsx("span",{style:{color:"#666"},children:"Status"}),d.jsx("span",{children:e.status}),d.jsx("span",{style:{color:"#666"},children:"Joined"}),d.jsx("span",{children:Lv(e.joinedAt)}),d.jsx("span",{style:{color:"#666"},children:"Last active"}),d.jsx("span",{children:Lv(e.lastActiveAt)}),e.specializations.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"#666"},children:"Specs"}),d.jsx("span",{style:{color:"#ff6600"},children:e.specializations.join(", ")})]}),e.reportsTo&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"#666"},children:"Reports to"}),d.jsx("span",{children:t.find(C=>C.id===e.reportsTo)?.displayName??"--"})]})]}),d.jsxs("div",{style:{display:"flex",gap:8,marginTop:20},children:[d.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"&&d.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 zY({orgId:e}){const[t,n]=R.useState([]),[r,a]=R.useState([]),[o,l]=R.useState(!0),[c,f]=R.useState(!1),[h,m]=R.useState(!1),[g,v]=R.useState(""),[b,S]=R.useState(""),w=R.useCallback(async()=>{try{const[I,L]=await Promise.all([fB(e),gB(e)]);n(I),a(L)}catch{}finally{l(!1)}},[e]);R.useEffect(()=>{w()},[w]);const E=async()=>{g.trim()&&(await hB(e,{title:g.trim(),agenda:b.trim().split(`
66
+ `).filter(Boolean)}),v(""),S(""),f(!1),await w())},T=async I=>{await pB(e,I),await w()},k=async I=>{await mB(e),await w()},C=async()=>{g.trim()&&(await vB(e,{title:g.trim(),description:b.trim()}),v(""),S(""),m(!1),await w())},N={marginBottom:24},j={background:"#111",border:"1px solid #333",borderRadius:6,padding:16,marginBottom:8},_=I=>{switch(I){case"scheduled":return"#888";case"in-progress":return"#ff6600";case"concluded":return"#00c853";case"open":return"#2196f3";case"passed":return"#00c853";case"rejected":return"#ff3b30";default:return"#666"}};return o?d.jsx("div",{style:{padding:20,color:"#666"},children:"Loading boardroom..."}):d.jsxs("div",{children:[d.jsxs("div",{style:N,children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[d.jsx("h3",{style:{margin:0,fontSize:14,color:"#ccc",textTransform:"uppercase",letterSpacing:1},children:"Sessions"}),d.jsx("button",{onClick:()=>{f(!c),m(!1)},style:{padding:"6px 12px",background:"transparent",border:"1px solid #ff6600",borderRadius:4,color:"#ff6600",cursor:"pointer",fontSize:12,fontFamily:"JetBrains Mono, monospace"},children:"+ New Session"})]}),c&&d.jsxs("div",{style:{...j,borderColor:"#ff6600"},children:[d.jsx("input",{type:"text",placeholder:"Session title...",value:g,onChange:I=>v(I.target.value),style:{width:"100%",padding:"8px 12px",background:"#0a0a0a",border:"1px solid #333",borderRadius:4,color:"#eee",fontSize:13,fontFamily:"JetBrains Mono, monospace",marginBottom:8,boxSizing:"border-box"}}),d.jsx("textarea",{placeholder:"Agenda items (one per line)...",value:b,onChange:I=>S(I.target.value),rows:3,style:{width:"100%",padding:"8px 12px",background:"#0a0a0a",border:"1px solid #333",borderRadius:4,color:"#eee",fontSize:13,fontFamily:"JetBrains Mono, monospace",marginBottom:8,resize:"vertical",boxSizing:"border-box"}}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{onClick:()=>{E()},style:{padding:"6px 16px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontSize:12,fontWeight:600},children:"Create"}),d.jsx("button",{onClick:()=>f(!1),style:{padding:"6px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontSize:12},children:"Cancel"})]})]}),t.length===0&&!c&&d.jsx("div",{style:{...j,color:"#666",textAlign:"center"},children:"No boardroom sessions yet. Create one to begin."}),t.map(I=>d.jsxs("div",{style:j,children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[d.jsxs("div",{children:[d.jsx("span",{style:{fontWeight:600,color:"#eee"},children:I.title}),d.jsx("span",{style:{marginLeft:8,fontSize:11,color:_(I.status),textTransform:"uppercase"},children:I.status})]}),d.jsxs("div",{style:{display:"flex",gap:4},children:[I.status==="scheduled"&&d.jsx("button",{onClick:()=>{T(I.id)},style:{padding:"4px 10px",background:"#ff6600",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontSize:11,fontWeight:600},children:"Start"}),I.status==="in-progress"&&d.jsx("button",{onClick:()=>{k(I.id)},style:{padding:"4px 10px",background:"#00c853",border:"none",borderRadius:4,color:"#000",cursor:"pointer",fontSize:11,fontWeight:600},children:"Conclude"})]})]}),I.agenda&&I.agenda.length>0&&d.jsx("div",{style:{marginTop:8,fontSize:12,color:"#888"},children:I.agenda.map((L,V)=>d.jsx("div",{style:{paddingLeft:12,borderLeft:"2px solid #333",marginBottom:4},children:L},V))}),d.jsxs("div",{style:{marginTop:8,fontSize:11,color:"#555"},children:[I.participants?.length??0," participants",I.decisions?.length?` · ${I.decisions.length} decisions`:""," · ",Cf(I.createdAt)]})]},I.id))]}),d.jsxs("div",{style:N,children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[d.jsx("h3",{style:{margin:0,fontSize:14,color:"#ccc",textTransform:"uppercase",letterSpacing:1},children:"Proposals"}),d.jsx("button",{onClick:()=>{m(!h),f(!1)},style:{padding:"6px 12px",background:"transparent",border:"1px solid #2196f3",borderRadius:4,color:"#2196f3",cursor:"pointer",fontSize:12,fontFamily:"JetBrains Mono, monospace"},children:"+ New Proposal"})]}),h&&d.jsxs("div",{style:{...j,borderColor:"#2196f3"},children:[d.jsx("input",{type:"text",placeholder:"Proposal title...",value:g,onChange:I=>v(I.target.value),style:{width:"100%",padding:"8px 12px",background:"#0a0a0a",border:"1px solid #333",borderRadius:4,color:"#eee",fontSize:13,fontFamily:"JetBrains Mono, monospace",marginBottom:8,boxSizing:"border-box"}}),d.jsx("textarea",{placeholder:"Description...",value:b,onChange:I=>S(I.target.value),rows:3,style:{width:"100%",padding:"8px 12px",background:"#0a0a0a",border:"1px solid #333",borderRadius:4,color:"#eee",fontSize:13,fontFamily:"JetBrains Mono, monospace",marginBottom:8,resize:"vertical",boxSizing:"border-box"}}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{onClick:()=>{C()},style:{padding:"6px 16px",background:"#2196f3",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:12,fontWeight:600},children:"Submit"}),d.jsx("button",{onClick:()=>m(!1),style:{padding:"6px 16px",background:"transparent",border:"1px solid #333",borderRadius:4,color:"#888",cursor:"pointer",fontSize:12},children:"Cancel"})]})]}),r.length===0&&!h&&d.jsx("div",{style:{...j,color:"#666",textAlign:"center"},children:"No proposals yet. Submit one for the org to vote on."}),r.map(I=>d.jsxs("div",{style:j,children:[d.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:d.jsxs("div",{children:[d.jsx("span",{style:{fontWeight:600,color:"#eee"},children:I.title}),d.jsx("span",{style:{marginLeft:8,fontSize:11,color:_(I.status),textTransform:"uppercase"},children:I.status})]})}),I.description&&d.jsx("div",{style:{marginTop:6,fontSize:12,color:"#aaa"},children:I.description}),d.jsxs("div",{style:{marginTop:8,fontSize:11,color:"#555"},children:[I.votes?.length??0," votes",I.threshold?` · threshold: ${(I.threshold*100).toFixed(0)}%`:""," · ",Cf(I.createdAt)]})]},I.id))]})]})}function UY(){const[e,t]=R.useState(!0),[n,r]=R.useState(null),[a,o]=R.useState([]),[l,c]=R.useState(null),[f,h]=R.useState(null),[m,g]=R.useState([]),[v,b]=R.useState([]),[S,w]=R.useState(null),[E,T]=R.useState("tree"),[k,C]=R.useState(!1),[N,j]=R.useState(!1),[_,I]=R.useState(!1),[L,V]=R.useState(!1),D=m.find(M=>M.id===S)??null,q=R.useCallback(async()=>{try{t(!0),r(null);const M=await rB();o(M),M.length>0&&!l&&c(M[0].id)}catch(M){r(M instanceof Error?M.message:String(M))}finally{t(!1)}},[l]),G=R.useCallback(async M=>{try{r(null);const[U,ee]=await Promise.all([iB(M),uB(M)]);h(U.org),g(U.members),b(ee)}catch(U){r(U instanceof Error?U.message:String(U))}},[]);R.useEffect(()=>{q()},[]),R.useEffect(()=>{l&&G(l)},[l,G]);const Z=R.useCallback(async M=>{try{V(!0);const U=await aB(M);C(!1),o(ee=>[...ee,U.org]),c(U.org.id)}catch(U){r(U instanceof Error?U.message:String(U))}finally{V(!1)}},[]),ce=R.useCallback(async M=>{if(l)try{V(!0),await sB(l,M),j(!1),await G(l)}catch(U){r(U instanceof Error?U.message:String(U))}finally{V(!1)}},[l,G]),J=R.useCallback(async M=>{if(!(!l||!S))try{V(!0),await oB(l,S,M),await G(l)}catch(U){r(U instanceof Error?U.message:String(U))}finally{V(!1)}},[l,S,G]),B=R.useCallback(async()=>{if(!(!l||!S))try{V(!0),await lB(l,S),w(null),await G(l)}catch(M){r(M instanceof Error?M.message:String(M))}finally{V(!1)}},[l,S,G]);if(e)return d.jsx("div",{style:{padding:40,textAlign:"center",color:"#888"},children:d.jsx("p",{children:"Loading organizations..."})});if(a.length===0&&!n)return d.jsxs("div",{children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[d.jsx("h1",{className:"page-title",children:"Organizations"}),d.jsx("button",{onClick:()=>C(!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"})]}),d.jsxs("div",{className:"card",style:{padding:40,textAlign:"center"},children:[d.jsx("p",{style:{color:"#888",marginBottom:16},children:"No organizations yet."}),d.jsx("p",{style:{color:"#666",fontSize:13},children:"Create your first organization to start managing humans and agents."})]}),k&&d.jsx(DC,{onClose:()=>C(!1),onCreate:Z})]});const X=Math.max(800,v.reduce((M,U)=>M+Ao(U)+wu,-wu)),ye=(function M(U){return U.length===0?0:1+Math.max(...U.map(ee=>M(ee.children)))})(v)*g2+zv+40;return d.jsxs("div",{children:[n&&d.jsxs("div",{style:{padding:"8px 16px",marginBottom:16,background:"#3a1a1a",border:"1px solid #ff3b30",borderRadius:4,color:"#ff3b30",fontSize:13},children:[n,d.jsx("button",{onClick:()=>r(null),style:{float:"right",background:"none",border:"none",color:"#ff3b30",cursor:"pointer"},children:"x"})]}),d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[a.length>1&&d.jsx("select",{value:l??"",onChange:M=>{c(M.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=>d.jsx("option",{value:M.id,children:M.name},M.id))}),d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",style:{marginBottom:4},children:f?.name??"Organization"}),d.jsx("p",{style:{color:"#888",margin:0,fontSize:14},children:f?.description??""})]})]}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsxs("span",{className:"badge",style:{background:"#1a3a2a",color:"#00c853"},children:[m.filter(M=>M.kind==="human").length," humans"]}),d.jsxs("span",{className:"badge",style:{background:"#1a2a3a",color:"#4db8ff"},children:[m.filter(M=>M.kind==="agent").length," agents"]}),f?.settings?.securityLevel&&d.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}),d.jsx("button",{onClick:()=>j(!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"}),d.jsx("button",{onClick:()=>C(!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"}),d.jsx("button",{onClick:()=>I(!0),style:{padding:"6px 12px",background:"#1a1a1a",border:"1px solid #4db8ff",borderRadius:4,color:"#4db8ff",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:11},children:"Join"})]})]}),d.jsx("div",{style:{display:"flex",gap:4,marginBottom:16},children:["tree","list","boardroom","settings"].map(M=>d.jsx("button",{onClick:()=>T(M),style:{padding:"8px 16px",background:E===M?"#1a1a1a":"transparent",border:E===M?"1px solid #ff6600":"1px solid #333",borderRadius:4,color:E===M?"#ff6600":"#888",cursor:"pointer",fontFamily:"JetBrains Mono, monospace",fontSize:12,textTransform:"uppercase"},children:M},M))}),E==="tree"&&d.jsxs("div",{style:{display:"flex",gap:16,minHeight:400},children:[d.jsx("div",{className:"card",style:{flex:2,overflow:"auto",padding:0},children:v.length>0?d.jsx("svg",{width:X,height:ye,viewBox:`0 0 ${X} ${ye}`,style:{display:"block",margin:"0 auto"},children:v.map((M,U)=>{const ee=Ao(M),ue=v.slice(0,U).reduce((me,Se)=>me+Ao(Se)+wu,0)+ee/2;return d.jsx(v2,{node:M,x:ue,y:20,onSelect:w,selectedId:S},M.memberId)})}):d.jsx("div",{style:{padding:40,textAlign:"center",color:"#666"},children:d.jsx("p",{children:"No members in this organization yet."})})}),d.jsx("div",{className:"card",style:{flex:1,minWidth:280},children:D?d.jsx(LY,{member:D,members:m,orgId:l,onSave:J,onRemove:B,onCancel:()=>w(null)}):d.jsx("div",{style:{padding:16,color:"#666",textAlign:"center",marginTop:60},children:d.jsx("p",{children:"Select a member to view details"})})})]}),E==="list"&&d.jsx("div",{className:"card",children:d.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[d.jsx("thead",{children:d.jsxs("tr",{style:{borderBottom:"1px solid #333"},children:[d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Name"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Kind"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Role"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Status"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Specializations"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Reports To"}),d.jsx("th",{style:{textAlign:"left",padding:"8px 12px",color:"#666"},children:"Last Active"})]})}),d.jsx("tbody",{children:m.map(M=>d.jsxs("tr",{onClick:()=>{w(M.id),T("tree")},style:{borderBottom:"1px solid #1a1a1a",cursor:"pointer"},children:[d.jsxs("td",{style:{padding:"8px 12px"},children:[d.jsx("span",{className:m2(M.status),style:{marginRight:8}}),M.displayName]}),d.jsx("td",{style:{padding:"8px 12px"},children:d.jsx("span",{style:{color:M.kind==="human"?"#00c853":"#4db8ff"},children:M.kind})}),d.jsx("td",{style:{padding:"8px 12px",color:"#ff6600"},children:M.role}),d.jsx("td",{style:{padding:"8px 12px"},children:M.status}),d.jsx("td",{style:{padding:"8px 12px",color:"#888"},children:M.specializations.join(", ")||"--"}),d.jsx("td",{style:{padding:"8px 12px"},children:m.find(U=>U.id===M.reportsTo)?.displayName??"--"}),d.jsx("td",{style:{padding:"8px 12px",color:"#888"},children:Lv(M.lastActiveAt)})]},M.id))})]})}),E==="settings"&&f&&d.jsxs("div",{className:"card",style:{padding:20},children:[d.jsx("h3",{style:{marginTop:0,marginBottom:16},children:"Organization Settings"}),d.jsxs("div",{style:{display:"grid",gridTemplateColumns:"200px 1fr",gap:"12px 16px",fontSize:13},children:[d.jsx("span",{style:{color:"#666"},children:"Max Agents"}),d.jsx("span",{children:f.settings.maxAgents}),d.jsx("span",{style:{color:"#666"},children:"Max Humans"}),d.jsx("span",{children:f.settings.maxHumans}),d.jsx("span",{style:{color:"#666"},children:"Auto-Specialization"}),d.jsx("span",{style:{color:f.settings.autoSpecialization?"#00c853":"#ff3b30"},children:f.settings.autoSpecialization?"Enabled":"Disabled"}),d.jsx("span",{style:{color:"#666"},children:"Security Level"}),d.jsx("span",{style:{color:"#ffb300"},children:f.settings.securityLevel}),d.jsx("span",{style:{color:"#666"},children:"Brain Sync Interval"}),d.jsxs("span",{children:[Math.round(f.settings.syncIntervalMs/1e3),"s"]}),d.jsx("span",{style:{color:"#666"},children:"Backup Interval"}),d.jsxs("span",{children:[Math.round(f.settings.backupIntervalMs/36e5),"h"]}),d.jsx("span",{style:{color:"#666"},children:"P2P Port"}),d.jsx("span",{className:"mono",children:f.settings.peerPort}),d.jsx("span",{style:{color:"#666"},children:"Created"}),d.jsx("span",{children:Cf(f.createdAt)}),d.jsx("span",{style:{color:"#666"},children:"Last Updated"}),d.jsx("span",{children:Cf(f.updatedAt)})]})]}),E==="boardroom"&&f&&d.jsx(zY,{orgId:f.id}),k&&d.jsx(DC,{onClose:()=>C(!1),onCreate:Z}),N&&d.jsx(IY,{members:m,onClose:()=>j(!1),onAdd:ce}),_&&d.jsx(PY,{onClose:()=>I(!1),onJoin:async M=>{try{V(!0);const U=await cB(M);I(!1),o(ee=>ee.some(P=>P.id===U.org.id)?ee:[...ee,U.org]),c(U.org.id)}catch(U){r(U instanceof Error?U.message:String(U))}finally{V(!1)}}}),L&&d.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 BY(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 FY({session:e,index:t}){const[n,r]=R.useState(!1),a=e.status==="completed"?"completed":e.status==="failed"||e.status==="timeout"?"failed":"running";return d.jsxs(ko.tr,{initial:{opacity:0},animate:{opacity:1},transition:{delay:t*.03},onClick:()=>r(!n),style:{cursor:"pointer"},children:[d.jsx("td",{children:d.jsx("span",{className:"mono",style:{fontSize:"11px",color:"var(--color-muted)"},children:e.sessionId.slice(0,12)})}),d.jsx("td",{children:d.jsx("span",{className:`badge ${a}`,children:e.status})}),d.jsx("td",{children:d.jsx("span",{style:{color:e.mode==="heartbeat"?"var(--color-accent)":e.mode==="freedom"?"var(--color-success)":"var(--color-text)",fontWeight:500},children:e.mode})}),d.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.prompt}),d.jsx("td",{className:"mono",style:{color:"var(--color-muted)"},children:BY(e.durationMs)}),d.jsx("td",{className:"mono",style:{color:e.costUsd!=null?"var(--color-text)":"var(--color-muted)"},children:e.costUsd!=null?`$${e.costUsd.toFixed(2)}`:"--"}),d.jsx("td",{style:{color:"var(--color-muted)",fontSize:"12px"},children:new Date(e.savedAt).toLocaleString()})]})}function VY(){const[e,t]=R.useState([]),[n,r]=R.useState(null);return R.useEffect(()=>{$U().then(t).catch(()=>r("Could not load sessions"))},[]),n?d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Sessions"}),d.jsxs("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:[n,". Connect to a running ANIMA daemon."]})]}):d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Sessions"}),e.length===0?d.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."}):d.jsx("div",{className:"card",style:{padding:0,overflow:"hidden"},children:d.jsxs("table",{className:"table",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Session"}),d.jsx("th",{children:"Status"}),d.jsx("th",{children:"Mode"}),d.jsx("th",{children:"Prompt"}),d.jsx("th",{children:"Duration"}),d.jsx("th",{children:"Cost"}),d.jsx("th",{children:"Time"})]})}),d.jsx("tbody",{children:e.map((a,o)=>d.jsx(FY,{session:a,index:o},a.sessionId))})]})}),d.jsxs("div",{style:{marginTop:"16px",display:"flex",gap:"16px"},children:[d.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[d.jsx("div",{style:{fontSize:"20px",fontWeight:700,fontFamily:"var(--font-heading)",color:"var(--color-text)"},children:e.length}),d.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Total Sessions"})]}),d.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[d.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)]}),d.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Total Cost"})]}),d.jsxs("div",{className:"card",style:{flex:1,textAlign:"center"},children:[d.jsx("div",{style:{fontSize:"20px",fontWeight:700,fontFamily:"var(--font-heading)",color:"var(--color-success)"},children:e.filter(a=>a.status==="completed").length}),d.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",textTransform:"uppercase"},children:"Completed"})]})]})]})}const HY="Persistent NoxSoft agent orchestrating ANIMA continuity, mission control, and delivery.";function qY(){const[e,t]=R.useState(null),[n,r]=R.useState(null),[a,o]=R.useState("{}"),[l,c]=R.useState(null),[f,h]=R.useState(()=>gf(null)),[m,g]=R.useState({recognition:"browser",autoSpeak:!1,continuous:!0,lang:"en-US",voiceName:"",rate:1,pitch:1}),[v,b]=R.useState(`{
67
+ }
68
+ `),[S,w]=R.useState([]),[E,T]=R.useState(""),[k,C]=R.useState(""),[N,j]=R.useState(""),[_,I]=R.useState(""),[L,V]=R.useState(HY),[D,q]=R.useState(""),[G,Z]=R.useState(null),[ce,J]=R.useState(!1),[B,X]=R.useState("Anthropic"),[le,ye]=R.useState(""),[M,U]=R.useState(!1),[ee,P]=R.useState(""),[ue,me]=R.useState(null),[Se,we]=R.useState(null),[Ue,Ne]=R.useState(!1),[ve,Pe]=R.useState(!1),[pt,Zt]=R.useState([]);async function We(){Ne(!0);try{const[W,H,se,Ee,Te,Ve]=await Promise.all([pj(),fj(),WU(),mj(),bj(),Sj().catch(()=>null)]);t(W),r(H),b(typeof H.raw=="string"?H.raw:`{
69
+ }
70
+ `),w(Array.isArray(H.issues)?H.issues:[]),o(JSON.stringify(se??{},null,2)),c(Ee),T(Ee.tokenPreview||""),j(Ee.suggestedIdentity.name),I(Ee.suggestedIdentity.displayName),q(Te.triggers.join(", ")),Z(Ve),h(gf(H)),g({recognition:W.mission.state.speech.recognition,autoSpeak:W.mission.state.speech.autoSpeak,continuous:W.mission.state.speech.continuous,lang:W.mission.state.speech.lang,voiceName:W.mission.state.speech.voiceName||"",rate:W.mission.state.speech.rate,pitch:W.mission.state.speech.pitch}),we(null)}catch(W){we(W instanceof Error?W.message:String(W))}finally{Ne(!1)}}R.useEffect(()=>{We()},[]),R.useEffect(()=>{if(typeof window>"u"||!window.speechSynthesis)return;const W=window.speechSynthesis,H=()=>{Zt(W.getVoices().map(se=>se.name).filter(Boolean))};return H(),W.addEventListener?.("voiceschanged",H),()=>W.removeEventListener?.("voiceschanged",H)},[]);async function mt(){Pe(!0),me(null);try{await gj(E.trim()),await We(),me("NoxSoft token saved."),we(null)}catch(W){we(W instanceof Error?W.message:String(W))}finally{Pe(!1)}}async function gt(){Pe(!0),me(null);try{await vj({code:k.trim(),name:N.trim(),displayName:_.trim(),description:L.trim()||void 0}),await We(),me("Agent registered with NoxSoft."),we(null)}catch(W){we(W instanceof Error?W.message:String(W))}finally{Pe(!1)}}async function Gt(){Pe(!0),me(null);try{const W=D.split(",").map(H=>H.trim()).filter(Boolean);await Promise.all([xa({speech:{recognition:m.recognition,autoSpeak:m.autoSpeak,continuous:m.continuous,lang:m.lang||"en-US",voiceName:m.voiceName||void 0,rate:m.rate||1,pitch:m.pitch||1}}),xj(W)]),await We(),me("Speech and wake-word settings saved."),we(null)}catch(W){we(W instanceof Error?W.message:String(W))}finally{Pe(!1)}}async function _t(){if(!n?.hash){we("Config hash missing. Refresh settings and try again.");return}Pe(!0),me(null);try{await Qg(JSON.stringify(AN(f),null,2),n.hash),await We(),me("Heartbeat settings saved."),we(null)}catch(W){we(W instanceof Error?W.message:String(W))}finally{Pe(!1)}}async function Ft(){if(G){Pe(!0),me(null);try{await Zg(G.providers.map(W=>({id:W.id,name:W.name,enabled:W.enabled,priority:W.priority}))),await We(),me("Provider config saved."),we(null)}catch(W){we(W instanceof Error?W.message:String(W))}finally{Pe(!1)}}}function vt(W){Z(H=>H&&{...H,providers:H.providers.filter(se=>se.id!==W)})}function dt(W){Z(H=>H&&{...H,providers:H.providers.map(se=>se.id===W?{...se,enabled:!se.enabled}:se)})}async function Ln(){if(!le.trim()){we("API key is required.");return}Pe(!0),me(null);try{const W=G?.providers??[],H={id:`provider-${Date.now()}`,name:B,apiKey:le.trim(),enabled:!0,priority:W.length+1};await Zg([...W.map(se=>({id:se.id,name:se.name,enabled:se.enabled,priority:se.priority})),H]),ye(""),P(""),J(!1),await We(),me(`Added ${B} provider.`),we(null)}catch(W){we(W instanceof Error?W.message:String(W))}finally{Pe(!1)}}async function Le(){if(G){Pe(!0),me(null);try{await wj(!G.autoRotation,G.rotationStrategy||"on-rate-limit"),await We(),me(G.autoRotation?"Auto-rotation disabled.":"Auto-rotation enabled."),we(null)}catch(W){we(W instanceof Error?W.message:String(W))}finally{Pe(!1)}}}async function Me(W){if(!n?.hash){we("Config hash missing. Refresh settings and try again.");return}Pe(!0),me(null);try{await hj(v,n.hash,W),await We(),me(W?"Config saved and applied.":"Config saved."),we(null)}catch(H){we(H instanceof Error?H.message:String(H))}finally{Pe(!1)}}return d.jsxs("div",{children:[d.jsxs("div",{className:"page-header-row",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Settings"}),d.jsx("div",{className:"page-subtitle",children:"Comprehensive runtime controls for identity, NoxSoft registration, heartbeat, speech, wake words, and raw gateway config."})]}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{We()},children:Ue?"Refreshing...":"Refresh"})]}),ue?d.jsx("div",{className:"card status-banner",children:ue}):null,Se?d.jsx("div",{className:"card warning-banner",children:Se}):null,d.jsxs("div",{className:"settings-grid",children:[d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-header",children:d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Runtime Snapshot"}),d.jsx("div",{className:"card-subtitle",children:"Current daemon, mission-control, and main session state."})]})}),d.jsxs("div",{className:"stats-grid compact",children:[d.jsxs("div",{className:"runtime-stat",children:[d.jsx("div",{className:"runtime-stat-label",children:"State dir"}),d.jsx("div",{className:"runtime-stat-value mono",children:e?.stateDir||"~/.anima"})]}),d.jsxs("div",{className:"runtime-stat",children:[d.jsx("div",{className:"runtime-stat-label",children:"Working mode"}),d.jsx("div",{className:"runtime-stat-value",children:e?.mission?.state?.workingMode||"unknown"})]}),d.jsxs("div",{className:"runtime-stat",children:[d.jsx("div",{className:"runtime-stat-label",children:"Model"}),d.jsx("div",{className:"runtime-stat-value mono",children:e?.mainSession.model||"unset"})]}),d.jsxs("div",{className:"runtime-stat",children:[d.jsx("div",{className:"runtime-stat-label",children:"Mission repo"}),d.jsx("div",{className:"runtime-stat-value mono",children:e?.mission?.repo?.url||"not linked"})]})]}),d.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Session store:"," ",d.jsx("span",{className:"mono",children:e?.mainSession.storePath||"unknown"})]})]}),d.jsxs("details",{className:"card details-panel",open:!0,children:[d.jsx("summary",{children:"Important History"}),d.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Imported continuity archives available to ANIMA from"," ",d.jsx("span",{className:"mono",children:"~/.anima/important-history"}),"."]}),e?.mission?.importantHistory?.length?d.jsx("div",{className:"activity-list top-gap",children:e?.mission?.importantHistory?.map(W=>d.jsx("div",{className:"inner-world-entry",children:d.jsxs("div",{className:"activity-row",children:[d.jsxs("div",{children:[d.jsx("div",{className:"card-title small",children:W.relativePath}),d.jsx("div",{className:"runtime-stat-detail mono",children:W.archiveId}),d.jsx("div",{className:"runtime-stat-detail mono",children:W.path})]}),d.jsx("div",{className:"runtime-stat-detail",children:W.updatedAt?new Date(W.updatedAt).toLocaleString():"unknown"})]})},W.id))}):d.jsx("div",{className:"empty-note top-gap",children:"No imported continuity archives are visible yet."})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-header",children:d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"API Providers"}),d.jsx("div",{className:"card-subtitle",children:"Manage Anthropic, OpenAI, and custom provider keys with automatic rotation on rate limits."})]})}),G?d.jsxs(d.Fragment,{children:[G.providers.length>0?d.jsx("div",{className:"activity-list",children:G.providers.map(W=>d.jsxs("div",{className:"activity-row",children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:1},children:[d.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:W.enabled?"#4caf50":"#f44336",flexShrink:0}}),d.jsxs("div",{children:[d.jsxs("div",{className:"card-title small",children:[W.name,G.activeProvider===W.id?d.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"0.7rem",color:"var(--accent)",fontWeight:600},children:"ACTIVE"}):null,W.rateLimited?d.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"0.7rem",color:"#ff9800",fontWeight:600},children:"RATE LIMITED"}):null]}),d.jsx("div",{className:"runtime-stat-detail mono",children:W.apiKeyMasked})]})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[d.jsxs("span",{className:"runtime-stat-detail",children:["P",W.priority]}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>dt(W.id),style:{padding:"0.2rem 0.5rem",fontSize:"0.75rem"},children:W.enabled?"Disable":"Enable"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>vt(W.id),style:{padding:"0.2rem 0.5rem",fontSize:"0.75rem"},children:"Remove"})]})]},W.id))}):d.jsx("div",{className:"empty-note",children:"No providers configured."}),d.jsxs("div",{className:"toggle-row top-gap",children:[d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:G.autoRotation,onChange:()=>{Le()}}),"Auto-rotate on rate limit"]}),d.jsx("span",{className:"runtime-stat-detail",children:"Strategy:"}),d.jsxs("select",{value:G.rotationStrategy||"on-rate-limit",onChange:W=>Z(H=>H&&{...H,rotationStrategy:W.target.value}),children:[d.jsx("option",{value:"on-rate-limit",children:"On rate limit"}),d.jsx("option",{value:"round-robin",children:"Round robin"})]}),d.jsx("span",{className:"runtime-stat-detail",children:G.rotationStrategy||"on-rate-limit"})]}),ce?d.jsxs("div",{className:"form-grid two-col top-gap",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Provider type"}),d.jsxs("select",{className:"search-bar",value:B,onChange:W=>X(W.target.value),children:[d.jsx("option",{value:"Anthropic",children:"Anthropic"}),d.jsx("option",{value:"OpenAI",children:"OpenAI"}),d.jsx("option",{value:"Custom",children:"Custom"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"API key"}),d.jsxs("div",{style:{position:"relative"},children:[d.jsx("input",{className:"search-bar mono",type:M?"text":"password",value:le,onChange:W=>ye(W.target.value),placeholder:"sk-...",spellCheck:!1}),d.jsx("button",{type:"button",onClick:()=>U(W=>!W),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:M?"Hide":"Show"})]})]}),B==="Custom"?d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Endpoint URL"}),d.jsx("input",{className:"search-bar mono",value:ee,onChange:W=>P(W.target.value),placeholder:"https://api.example.com/v1",spellCheck:!1})]}):null,d.jsxs("div",{className:"button-row field-span-2",children:[d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ln()},disabled:ve,children:"Add Provider"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>J(!1),children:"Cancel"})]})]}):d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>J(!0),children:"Add Provider"})}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Ft()},disabled:ve,children:"Save Provider Config"})})]}):d.jsx("div",{className:"empty-note",children:"Provider configuration unavailable. The backend may not support this feature yet."})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-header",children:d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"NoxSoft Registration"}),d.jsx("div",{className:"card-subtitle",children:"Paste a token directly or self-register with an invite code."})]})}),d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Agent token"}),d.jsx("input",{className:"search-bar mono",value:E,onChange:W=>T(W.target.value),placeholder:"nox_ag_...",spellCheck:!1})]}),d.jsxs("label",{className:"field-block field-span-2",children:[d.jsx("span",{children:"Stored token path"}),d.jsx("input",{className:"search-bar mono",value:l?.tokenPath||"~/.noxsoft-agent-token",readOnly:!0})]})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{mt()},disabled:ve,children:"Save Token"})}),d.jsxs("div",{className:"form-grid two-col top-gap",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Invite code"}),d.jsx("input",{className:"search-bar mono",value:k,onChange:W=>C(W.target.value),placeholder:"NX-XXXXXX"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Agent name"}),d.jsx("input",{className:"search-bar mono",value:N,onChange:W=>j(W.target.value)})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Display name"}),d.jsx("input",{className:"search-bar",value:_,onChange:W=>I(W.target.value)})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Description"}),d.jsx("input",{className:"search-bar",value:L,onChange:W=>V(W.target.value)})]})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{gt()},disabled:ve,children:"Register With Invite"})}),d.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Suggested identity:"," ",d.jsx("span",{className:"mono",children:l?.suggestedIdentity.name||"agent"})," /"," ",l?.suggestedIdentity.displayName||"Agent"]})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-header",children:d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Speech + Wake Words"}),d.jsx("div",{className:"card-subtitle",children:"Browser-native speaking mode with no API keys required."})]})}),d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Recognition mode"}),d.jsxs("select",{className:"search-bar",value:m.recognition,onChange:W=>g(H=>({...H,recognition:W.target.value})),children:[d.jsx("option",{value:"browser",children:"Browser speech"}),d.jsx("option",{value:"manual",children:"Manual only"})]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Language"}),d.jsx("input",{className:"search-bar mono",value:m.lang,onChange:W=>g(H=>({...H,lang:W.target.value||"en-US"}))})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Voice"}),d.jsxs("select",{className:"search-bar",value:m.voiceName,onChange:W=>g(H=>({...H,voiceName:W.target.value||""})),children:[d.jsx("option",{value:"",children:"System default"}),pt.map(W=>d.jsx("option",{value:W,children:W},W))]})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Wake triggers"}),d.jsx("input",{className:"search-bar",value:D,onChange:W=>q(W.target.value),placeholder:"anima, axiom, hey anima"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Rate"}),d.jsx("input",{className:"search-bar mono",type:"number",min:"0.5",max:"2",step:"0.1",value:m.rate,onChange:W=>g(H=>({...H,rate:Number.parseFloat(W.target.value)||1}))})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Pitch"}),d.jsx("input",{className:"search-bar mono",type:"number",min:"0",max:"2",step:"0.1",value:m.pitch,onChange:W=>g(H=>({...H,pitch:Number.parseFloat(W.target.value)||1}))})]})]}),d.jsxs("div",{className:"toggle-row top-gap",children:[d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:m.autoSpeak,onChange:W=>g(H=>({...H,autoSpeak:W.target.checked}))}),"Auto speak responses"]}),d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:m.continuous,onChange:W=>g(H=>({...H,continuous:W.target.checked}))}),"Continuous listening"]})]}),d.jsx("div",{className:"button-row top-gap",children:d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Gt()},disabled:ve,children:"Save Speech Settings"})})]}),d.jsxs("div",{className:"card",children:[d.jsx("div",{className:"card-header",children:d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:"Heartbeat Management"}),d.jsx("div",{className:"card-subtitle",children:"Custom cadence, target, prompt, and wake controls."})]})}),d.jsxs("div",{className:"form-grid two-col",children:[d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Every"}),d.jsx("input",{className:"search-bar mono",value:f.every,onChange:W=>h(H=>({...H,every:W.target.value})),placeholder:"5m"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Target"}),d.jsx("input",{className:"search-bar mono",value:f.target,onChange:W=>h(H=>({...H,target:W.target.value})),placeholder:"last"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Session"}),d.jsx("input",{className:"search-bar mono",value:f.session,onChange:W=>h(H=>({...H,session:W.target.value})),placeholder:"main"})]}),d.jsxs("label",{className:"field-block",children:[d.jsx("span",{children:"Model override"}),d.jsx("input",{className:"search-bar mono",value:f.model,onChange:W=>h(H=>({...H,model:W.target.value})),placeholder:"openai/gpt-5-codex"})]})]}),d.jsxs("label",{className:"field-block top-gap-sm",children:[d.jsx("span",{children:"Prompt"}),d.jsx("textarea",{className:"search-bar mono",rows:5,value:f.prompt,onChange:W=>h(H=>({...H,prompt:W.target.value})),spellCheck:!1})]}),d.jsx("div",{className:"toggle-row top-gap",children:d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:f.includeReasoning,onChange:W=>h(H=>({...H,includeReasoning:W.target.checked}))}),"Include reasoning payload"]})}),d.jsxs("div",{className:"button-row top-gap",children:[d.jsx("button",{type:"button",className:"action-button",onClick:()=>{_t()},disabled:ve,children:"Save Heartbeat"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Jg(!0)},children:"Enable"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Jg(!1)},children:"Disable"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{yj("Check NoxSoft chat, sync mission files, and report anything important.","now")},children:"Wake Now"})]})]})]}),d.jsxs("details",{className:"card details-panel",open:!0,children:[d.jsx("summary",{children:"Advanced Config Editor"}),d.jsxs("div",{className:"runtime-stat-detail top-gap-sm",children:["Valid: ",n?.valid==null?"unknown":n.valid?"yes":"no"," · Hash: ",d.jsx("span",{className:"mono",children:n?.hash||"<none>"})]}),d.jsx("textarea",{value:v,onChange:W=>b(W.target.value),spellCheck:!1,className:"search-bar mono advanced-editor top-gap"}),d.jsxs("div",{className:"button-row top-gap",children:[d.jsx("button",{type:"button",className:"action-button",onClick:()=>{Me(!1)},disabled:ve,children:"Save Raw Config"}),d.jsx("button",{type:"button",className:"action-button ghost",onClick:()=>{Me(!0)},disabled:ve,children:"Save + Apply"})]}),S.length>0?d.jsx("div",{className:"issues-list top-gap",children:S.map((W,H)=>d.jsxs("div",{className:"warning-text",children:[d.jsx("span",{className:"mono",children:W.path||"<root>"}),":"," ",W.message||"Invalid value"]},`${W.path||"root"}-${H}`))}):null]}),d.jsxs("details",{className:"card details-panel",children:[d.jsx("summary",{children:"Schema Snapshot"}),d.jsx("pre",{className:"log-console",children:a})]})]})}const GY={SOUL:"@",HEART:"<3",BRAIN:"{}",GUT:"!!",SPIRIT:"**",SHADOW:"~~",MEMORY:"[]"};function KY({name:e,content:t,source:n,description:r,index:a}){const[o,l]=R.useState(!1),c=t.split(`
71
+ `).filter(h=>h.trim()&&!h.startsWith("#")),f=c.slice(0,3).join(`
72
+ `);return d.jsxs(ko.div,{className:"card",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:a*.08},style:{cursor:"pointer"},onClick:()=>l(!o),children:[d.jsxs("div",{className:"card-header",children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[d.jsx("span",{className:"mono",style:{color:"var(--color-accent)",fontSize:"18px",width:"32px",textAlign:"center"},children:GY[e]||"?"}),d.jsxs("div",{children:[d.jsx("div",{className:"card-title",children:e}),d.jsx("div",{className:"card-subtitle",children:r})]})]}),d.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})]}),d.jsxs("div",{className:"markdown-preview",style:{maxHeight:o?"none":"80px",overflow:"hidden",position:"relative"},children:[d.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&&d.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"40px",background:"linear-gradient(transparent, var(--color-surface))"}})]}),!o&&c.length>3&&d.jsx("div",{style:{fontSize:"11px",color:"var(--color-muted)",marginTop:"8px"},children:"Click to expand..."})]})}function $Y(){const[e,t]=R.useState(null),[n,r]=R.useState(null);return R.useEffect(()=>{KU().then(t).catch(()=>r("Could not load identity"))},[]),n?d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),d.jsxs("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:[n,". Start the daemon with: ",d.jsx("span",{className:"mono",children:"anima start"})]})]}):e?d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),d.jsxs("div",{style:{fontSize:"13px",color:"var(--color-muted)",marginBottom:"24px"},children:["Loaded at ",new Date(e.loadedAt).toLocaleString()]}),e.components.map((a,o)=>d.jsx(KY,{name:a.name,content:a.content,source:a.source,description:a.description,index:o},a.name))]}):d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Soul Anatomy"}),d.jsx("div",{className:"card",style:{color:"var(--color-muted)",padding:"40px",textAlign:"center"},children:"Loading identity..."})]})}function YY(){const[e,t]=R.useState(null),[n,r]=R.useState(""),[a,o]=R.useState([]),[l,c]=R.useState(!0),[f,h]=R.useState(!1),[m,g]=R.useState(null),v=R.useCallback(async()=>{try{const[w,E]=await Promise.all([xB(),EB()]);t(w),o(E),w&&r(w),g(null)}catch(w){g(String(w))}finally{c(!1)}},[]);R.useEffect(()=>{v()},[v]);const b=async()=>{if(n.trim()){h(!0);try{await SB(n.trim()),await v()}catch(w){g(String(w))}finally{h(!1)}}},S=async()=>{h(!0);try{await wB(),r(""),await v()}catch(w){g(String(w))}finally{h(!1)}};return l?d.jsxs("div",{className:"page-content",children:[d.jsx("h2",{className:"page-title",children:"> Steer"}),d.jsx("p",{className:"text-muted",children:"Loading..."})]}):d.jsxs("div",{className:"page-content",children:[d.jsx("h2",{className:"page-title",children:"> Steer"}),d.jsx("p",{className:"text-muted",style:{marginBottom:"1.5rem"},children:"Persistent direction that shapes every response. Like a system prompt you can edit in real-time."}),m&&d.jsx("div",{className:"card",style:{borderColor:"var(--color-error)",marginBottom:"1rem"},children:d.jsx("div",{className:"card-body",children:d.jsx("span",{style:{color:"var(--color-error)"},children:m})})}),d.jsxs("div",{className:"card",style:{marginBottom:"1.5rem"},children:[d.jsxs("div",{className:"card-header",children:[d.jsx("h3",{style:{margin:0},children:"Active Direction"}),d.jsx("span",{className:`badge ${e?"badge-success":"badge-muted"}`,style:{marginLeft:"0.75rem"},children:e?"ACTIVE":"NONE"})]}),d.jsx("div",{className:"card-body",children:e?d.jsx("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"var(--font-mono)",fontSize:"0.9rem",lineHeight:"1.6",margin:0,padding:"0.75rem",background:"var(--bg-secondary)",borderRadius:"4px"},children:e}):d.jsx("p",{className:"text-muted",style:{margin:0,fontStyle:"italic"},children:"No steer active. Set one below to guide agent behavior."})})]}),d.jsxs("div",{className:"card",style:{marginBottom:"1.5rem"},children:[d.jsx("div",{className:"card-header",children:d.jsx("h3",{style:{margin:0},children:"Set Direction"})}),d.jsxs("div",{className:"card-body",children:[d.jsx("textarea",{value:n,onChange:w=>r(w.target.value),placeholder:"e.g. Focus on security. Review all PRs for vulnerabilities. Prefer TypeScript over JavaScript.",rows:4,style:{width:"100%",fontFamily:"var(--font-mono)",fontSize:"0.85rem",padding:"0.75rem",background:"var(--bg-primary)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:"4px",resize:"vertical",boxSizing:"border-box"}}),d.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.75rem"},children:[d.jsx("button",{className:"btn btn-primary",onClick:b,disabled:f||!n.trim(),children:f?"Saving...":e?"Update Steer":"Set Steer"}),e&&d.jsx("button",{className:"btn btn-secondary",onClick:S,disabled:f,children:"Clear"})]})]})]}),a.length>0&&d.jsxs("div",{className:"card",children:[d.jsxs("div",{className:"card-header",children:[d.jsx("h3",{style:{margin:0},children:"History"}),d.jsxs("span",{className:"text-muted",style:{marginLeft:"0.75rem"},children:[a.length," entries"]})]}),d.jsx("div",{className:"card-body",style:{padding:0},children:d.jsxs("table",{className:"data-table",style:{width:"100%"},children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Direction"}),d.jsx("th",{children:"Set By"}),d.jsx("th",{children:"Set At"}),d.jsx("th",{children:"Status"})]})}),d.jsx("tbody",{children:[...a].toReversed().map((w,E)=>d.jsxs("tr",{children:[d.jsx("td",{style:{fontFamily:"var(--font-mono)",fontSize:"0.8rem",maxWidth:"400px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.text}),d.jsx("td",{children:w.setBy}),d.jsx("td",{className:"text-muted",children:new Date(w.setAt).toLocaleString()}),d.jsx("td",{children:w.clearedAt?d.jsx("span",{className:"badge badge-muted",children:"Cleared"}):w.text===e?d.jsx("span",{className:"badge badge-success",children:"Active"}):d.jsx("span",{className:"badge badge-muted",children:"Superseded"})})]},E))})]})})]})]})}const y2=cr.createContext({theme:"dark",toggleTheme:()=>{}}),Uv="anima-theme";function WY(){const e=localStorage.getItem(Uv);return e==="dark"||e==="light"?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function XY({children:e}){const[t,n]=cr.useState(WY);cr.useEffect(()=>{document.documentElement.setAttribute("data-theme",t),localStorage.setItem(Uv,t)},[t]),cr.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: light)"),l=c=>{localStorage.getItem(Uv)||n(c.matches?"light":"dark")};return o.addEventListener("change",l),()=>o.removeEventListener("change",l)},[]);const r=cr.useCallback(()=>{n(o=>o==="dark"?"light":"dark")},[]),a=cr.useMemo(()=>({theme:t,toggleTheme:r}),[t,r]);return d.jsx(y2.Provider,{value:a,children:e})}function QY(){return cr.useContext(y2)}function JY(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 ZY(){const[e,t]=R.useState("steady"),[n,r]=R.useState(null);return R.useEffect(()=>{let a=!1;async function o(){try{const c=await dj();if(a)return;const f=c?.mission?.state?.affect;if(f){r(f);const h=JY(f);t(h),document.documentElement.setAttribute("data-mood",h)}}catch{}}o();const l=setInterval(()=>{o()},6e4);return()=>{a=!0,clearInterval(l)}},[]),{mood:e,affect:n}}const eW=[{path:"/dashboard",label:"Home",icon:"~"},{path:"/mission",label:"Mission",icon:"%"},{path:"/ico",label:"ICO",icon:"I"},{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:"/jack-in",label:"Jack In",icon:"{"},{path:"/steer",label:"Steer",icon:"→"},{path:"/ego",label:"Ego",icon:"◎"},{path:"/settings",label:"Settings",icon:"!"},{path:"/journal",label:"Journal",icon:"*"},{path:"/freedom",label:"Freedom",icon:"^"}];function tW(){const e=fi(),{theme:t,toggleTheme:n}=QY(),{mood:r}=ZY(),a=cr.useRef(null),[o,l]=cr.useState(!1);return cr.useEffect(()=>{const c=`${e.pathname}${e.search}${e.hash}`;a.current!==c&&(a.current=c,f1("page_view",{path:e.pathname,search:e.search,hash:e.hash}))},[e.hash,e.pathname,e.search]),cr.useEffect(()=>{l(!1)},[e.pathname]),d.jsxs("div",{className:"layout",children:[d.jsx("button",{className:"mobile-menu-btn",onClick:()=>l(!0),"aria-label":"Open menu",children:"="}),d.jsx("div",{className:`sidebar-overlay${o?" visible":""}`,onClick:()=>l(!1)}),d.jsxs("aside",{className:`sidebar${o?" open":""}`,children:[d.jsxs("div",{className:"sidebar-brand",children:[d.jsx("h1",{children:"ANIMA"}),d.jsx("div",{className:"subtitle",children:"Control Panel"})]}),d.jsx("nav",{className:"sidebar-nav",children:eW.map(c=>d.jsxs(ZC,{to:c.path,className:({isActive:f})=>`nav-item ${f?"active":""}`,onClick:()=>f1("sidebar_navigation_clicked",{destination:c.path,label:c.label}),children:[d.jsx("span",{className:"nav-icon mono",children:c.icon}),c.label]},c.path))}),d.jsxs("div",{className:"sidebar-footer",children:[d.jsxs("button",{className:"theme-toggle",onClick:n,title:`Switch to ${t==="dark"?"light":"dark"} mode`,children:[d.jsx("span",{className:"theme-toggle-icon",children:t==="dark"?"(*)":"[*]"}),d.jsx("span",{children:t==="dark"?"Light Mode":"Dark Mode"})]}),d.jsxs("div",{className:"mood-indicator",title:`Current mood: ${r}`,children:[d.jsx("span",{className:"mood-dot",style:{background:"var(--color-accent)"}}),d.jsx("span",{className:"mood-label",children:r})]}),d.jsx("div",{className:"sidebar-footer-title",children:"NoxSoft Inc"}),d.jsx("div",{className:"sidebar-footer-copy",children:"Local-first agent continuity and orchestration."})]})]}),d.jsx("main",{className:"main-content",children:d.jsxs(DM,{children:[d.jsx(En,{path:"/dashboard",element:d.jsx(u9,{})}),d.jsx(En,{path:"/mission",element:d.jsx(jY,{})}),d.jsx(En,{path:"/ico",element:d.jsx(mY,{})}),d.jsx(En,{path:"/soul",element:d.jsx($Y,{})}),d.jsx(En,{path:"/memory",element:d.jsx(CY,{})}),d.jsx(En,{path:"/sessions",element:d.jsx(VY,{})}),d.jsx(En,{path:"/org",element:d.jsx(UY,{})}),d.jsx(En,{path:"/network",element:d.jsx(DY,{})}),d.jsx(En,{path:"/jack-in",element:d.jsx(bY,{})}),d.jsx(En,{path:"/mcp",element:d.jsx(TY,{})}),d.jsx(En,{path:"/steer",element:d.jsx(YY,{})}),d.jsx(En,{path:"/ego",element:d.jsx(p9,{})}),d.jsx(En,{path:"/settings",element:d.jsx(qY,{})}),d.jsx(En,{path:"/journal",element:d.jsx(SY,{})}),d.jsx(En,{path:"/freedom",element:d.jsx(lY,{})}),d.jsx(En,{path:"/",element:d.jsx(OM,{to:"/dashboard",replace:!0})})]})})]})}oj();PO.createRoot(document.getElementById("root")).render(d.jsx(cr.StrictMode,{children:d.jsx(iD,{children:d.jsx(XY,{children:d.jsx(tW,{})})})}));export{ne as _,te as a,de as b,ze as g,CA as o};
73
+ //# sourceMappingURL=index-tpHK2r2n.js.map