@yuriai/web 0.2.27 → 0.2.29-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/dist/assets/AgentAvatar-GVufO03R.js +1 -0
  2. package/dist/assets/AssistantContactStatus-AG7iGeRF.js +3 -0
  3. package/dist/assets/{AssistantUnreadBadge-BssH-RvV.js → AssistantUnreadBadge-BMCaH0Cc.js} +1 -1
  4. package/dist/assets/{AssistantView-CxQv-9Ms.js → AssistantView-C5ACV-pb.js} +1 -1
  5. package/dist/assets/{DiagramView-DPpG0fwx.js → DiagramView-DJDzscnd.js} +1 -1
  6. package/dist/assets/{FadeInOnReveal-S6UbimjB.js → FadeInOnReveal-8NiBU75a.js} +1 -1
  7. package/dist/assets/{GuiPluginSurface-BOf0JA1T.js → GuiPluginSurface-DfLl4Gd9.js} +1 -1
  8. package/dist/assets/{GuiPluginWindow-OrYkfQ4m.js → GuiPluginWindow-CW0-Tapi.js} +1 -1
  9. package/dist/assets/{Icon-BE4mEwzV.js → Icon-CLLDJn-P.js} +1 -1
  10. package/dist/assets/{ImageLoadingPlaceholder-CBFJC_KD.js → ImageLoadingPlaceholder-DTWzB26a.js} +1 -1
  11. package/dist/assets/LoadingImage-B89ghYMH.js +1 -0
  12. package/dist/assets/MarkdownRenderer-YzZqs3v5.js +2 -0
  13. package/dist/assets/{MarkdownRendererImpl-Cv6UnGG7.js → MarkdownRendererImpl-BjjAFHTQ.js} +3 -3
  14. package/dist/assets/MarkstreamRendererImpl-D8tam--u.js +3 -0
  15. package/dist/assets/{MobileDetailNavigation-CK4KbkeS.js → MobileDetailNavigation-B-AuJG6R.js} +1 -1
  16. package/dist/assets/{MobileResizableSheet-Deidw1br.js → MobileResizableSheet-CAj4YGtu.js} +1 -1
  17. package/dist/assets/{MobileShareBridge-CO_OWEfq.js → MobileShareBridge-B8X_MEk1.js} +2 -2
  18. package/dist/assets/MobileTabPageHeader-vvveBlBV.js +2 -0
  19. package/dist/assets/MultiRunWindow-C0dOS6fA.js +1 -0
  20. package/dist/assets/{OnboardingScreen-C8ld4wO7.js → OnboardingScreen-BdU6Tyax.js} +1 -1
  21. package/dist/assets/{OverlayScrollbar-B3auC2WH.js → OverlayScrollbar-CzQC0JQI.js} +1 -1
  22. package/dist/assets/SettingsView-C0HSdVvS.css +1 -0
  23. package/dist/assets/SettingsView-aWGqxCrZ.js +30 -0
  24. package/dist/assets/SettingsWindow-rX0TNPNO.js +1 -0
  25. package/dist/assets/{TerminalView-CwRB6Yyr.js → TerminalView-BArR-jEl.js} +3 -3
  26. package/dist/assets/ToolOutputDialog-Bdwio4o_.js +10 -0
  27. package/dist/assets/YuriLogo-BZC0ckt0.js +1 -0
  28. package/dist/assets/{appThemeRegistry-B6woJIX5.js → appThemeRegistry-DOuA757r.js} +1 -1
  29. package/dist/assets/appearance--vFosLNi.js +1 -0
  30. package/dist/assets/{assistant-attachment-cache-B_qRvy-k.js → assistant-attachment-cache-DMw2Smc8.js} +1 -1
  31. package/dist/assets/{button-BXxwtxsG.js → button-BF2cNEuq.js} +1 -1
  32. package/dist/assets/{capgoAdapter-C5HFS-rx.js → capgoAdapter-BBnW57us.js} +1 -1
  33. package/dist/assets/collapsible-CS5qCQRU.js +1 -0
  34. package/dist/assets/context-menu-C6l4ycZG.js +1 -0
  35. package/dist/assets/desktopRelayRestore-C7pjf6fE.js +1 -0
  36. package/dist/assets/{device-BcRP6Tjd.js → device-DN1GigI_.js} +1 -1
  37. package/dist/assets/{diagram-DyY8dxjZ.js → diagram-D9-jif9d.js} +1 -1
  38. package/dist/assets/dialog-r7RRePv5.js +1 -0
  39. package/dist/assets/{dropdown-menu.styles-DGaALKP0.js → dropdown-menu.styles-CX8oXdks.js} +1 -1
  40. package/dist/assets/es-C8kGYKZo.js +15 -0
  41. package/dist/assets/{fileMentionTouchSelection-C4dvP8GY.js → fileMentionTouchSelection-dpFpcetU.js} +2 -2
  42. package/dist/assets/{fileQueries-BeXkd3o6.js → fileQueries-DWj9yB2g.js} +1 -1
  43. package/dist/assets/{fileReferenceActions-CrIAce3K.js → fileReferenceActions-BBLYnGEx.js} +1 -1
  44. package/dist/assets/{fr-CEgiRlfa.js → fr-BV_9HcN9.js} +3 -3
  45. package/dist/assets/{gitApi-D2G9ny2O.js → gitApi-b2Mo4rXl.js} +1 -1
  46. package/dist/assets/{gitApiHttp-B7vYwgBh.js → gitApiHttp-DGAlAuET.js} +4 -4
  47. package/dist/assets/host-DB6QzbOw.js +1 -0
  48. package/dist/assets/image-loading-BUouaouB.js +1 -0
  49. package/dist/assets/input-DvF_mp0Y.js +1 -0
  50. package/dist/assets/insertionBoundaries-BviApxnS.js +1 -0
  51. package/dist/assets/{ja-CX-_p9jZ.js → ja-CIMpz4Z2.js} +3 -3
  52. package/dist/assets/{ko-D5xlLYJM.js → ko-DPUsuWV1.js} +3 -3
  53. package/dist/assets/magpie-BuRvkGVQ.svg +1 -0
  54. package/dist/assets/main-BchAIbLD.js +2 -0
  55. package/dist/assets/main-Cp31rg32.js +169 -0
  56. package/dist/assets/{markdownHeightCache-D2VWb_4E.js → markdownHeightCache-D02GlOiy.js} +1 -1
  57. package/dist/assets/{markdownTheme-hpURsgju.js → markdownTheme-CHNl6tUv.js} +1 -1
  58. package/dist/assets/{mcpQueries-DQ3KthDF.js → mcpQueries-Cksi876R.js} +1 -1
  59. package/dist/assets/miniChat-BbuRxk9z.js +2 -0
  60. package/dist/assets/mobile-CBiiV7GW.js +2 -0
  61. package/dist/assets/{mobileBackNavigation-BJqt3oHk.js → mobileBackNavigation-BsbWBz8h.js} +1 -1
  62. package/dist/assets/multirun-Ce977k1P.js +3 -0
  63. package/dist/assets/native-CILcYDJz.js +1 -0
  64. package/dist/assets/{native-config-BIY0Cr-l.js → native-config-5BNfonUF.js} +1 -1
  65. package/dist/assets/persistence-Dta0OwIa.js +3 -0
  66. package/dist/assets/{pl-BjH81A_q.js → pl-ChxP5OZm.js} +3 -3
  67. package/dist/assets/projectMeta-KTYl7ter.js +1 -0
  68. package/dist/assets/pt-BR-9N8nJVqC.js +15 -0
  69. package/dist/assets/{queue-abort-optimistic-CS5jTJq-.js → queue-abort-optimistic-CJmevpBJ.js} +1 -1
  70. package/dist/assets/{react-DRe85o5s.js → react-Bwr5-XPi.js} +1 -1
  71. package/dist/assets/readiness-CdCOcZnK.js +1 -0
  72. package/dist/assets/renderElectronMiniChatApp-wFpIvOFT.js +2 -0
  73. package/dist/assets/renderMobileApp-QJ2XwXGj.js +28 -0
  74. package/dist/assets/{runtime-file-download-Cf1WxfeW.js → runtime-file-download-o29morT6.js} +1 -1
  75. package/dist/assets/{runtime-file-resource-UJjHUF2C.js → runtime-file-resource-qB_oVdE6.js} +1 -1
  76. package/dist/assets/{runtimeConfig-BX8JirIc.js → runtimeConfig-IuT6iZ4x.js} +1 -1
  77. package/dist/assets/runtimeEndpointReset-DEWSVYyD.js +149 -0
  78. package/dist/assets/scheduledTaskNavigation-BqkeRfVc.js +1 -0
  79. package/dist/assets/sessionLookup-mvlGQJTe.js +1 -0
  80. package/dist/assets/sortable-tabs-strip-Dc4Jr4ml.js +1 -0
  81. package/dist/assets/{speechSettingsQueries-CC0fusUo.js → speechSettingsQueries-DEGyglgn.js} +2 -2
  82. package/dist/assets/src-DME3XM8W.css +2 -0
  83. package/dist/assets/{store-CkIHVrmT.js → store-BPYoxYhv.js} +4 -4
  84. package/dist/assets/{terminalApi-rl9mZAlB.js → terminalApi-CPVNQ5DH.js} +1 -1
  85. package/dist/assets/{textarea-7eTptEtD.js → textarea-CIhiRPB2.js} +1 -1
  86. package/dist/assets/theme-validation-BGYdrOu7.js +1 -0
  87. package/dist/assets/themes-BgDJcxRc.js +1 -0
  88. package/dist/assets/tooltip-BoAbDVNP.js +1 -0
  89. package/dist/assets/{touch-gestures-K2_ZOkKW.js → touch-gestures-CErgaXZ7.js} +1 -1
  90. package/dist/assets/types-COEinOJU.js +2 -0
  91. package/dist/assets/uk-C-aeGNQI.js +15 -0
  92. package/dist/assets/{useAppFontEffects-Ck2PdQRx.js → useAppFontEffects-C__cAJlw.js} +54 -54
  93. package/dist/assets/{useAssistantUIStore-CfaQV3ID.js → useAssistantUIStore-CYyXdd5c.js} +1 -1
  94. package/dist/assets/useDesktopWindowControlsLayout-BYt7I5so.js +1 -0
  95. package/dist/assets/{useEffectiveDirectory-CNCQfN_x.js → useEffectiveDirectory-CcDsvhjq.js} +1 -1
  96. package/dist/assets/{useFontPreferences-DeqW9nRx.js → useFontPreferences-UzjDmx4b.js} +1 -1
  97. package/dist/assets/useMobileNavigationStore-BgM0EvUr.js +17 -0
  98. package/dist/assets/{useThemeSystem-CGF5jnIh.js → useThemeSystem-CNzUUkFn.js} +1 -1
  99. package/dist/assets/useUIStore-BDZCXouA.js +1 -0
  100. package/dist/assets/{useWorkerHighlightedLines-CN_RGaSw.js → useWorkerHighlightedLines-ZOArIAed.js} +1 -1
  101. package/dist/assets/vendor-base-ui-CzHs0bHY.js +1 -0
  102. package/dist/assets/{vendor-cmdk-C3oBVL9X.js → vendor-cmdk-C_tivUtr.js} +1 -1
  103. package/dist/assets/vendor-codemirror-autocomplete-C0FrlFqZ.js +12 -0
  104. package/dist/assets/vendor-codemirror-commands-5saeUOVY.js +1 -0
  105. package/dist/assets/vendor-codemirror-lang-angular-Cm7vBE3E.js +23 -0
  106. package/dist/assets/vendor-codemirror-lang-cpp-BjixvwC2.js +1 -0
  107. package/dist/assets/vendor-codemirror-lang-go-DFb2d_8t.js +11 -0
  108. package/dist/assets/vendor-codemirror-lang-java-CHitPigf.js +1 -0
  109. package/dist/assets/vendor-codemirror-lang-jinja-B8yrwpok.js +1 -0
  110. package/dist/assets/{vendor-codemirror-lang-json-mLulNbwB.js → vendor-codemirror-lang-json-DowyFczU.js} +1 -1
  111. package/dist/assets/{vendor-codemirror-lang-less-CNvptX3P.js → vendor-codemirror-lang-less-B1_0-sTl.js} +1 -1
  112. package/dist/assets/vendor-codemirror-lang-liquid-FIsA7YFN.js +1 -0
  113. package/dist/assets/vendor-codemirror-lang-markdown-npWBZIoE.js +6 -0
  114. package/dist/assets/vendor-codemirror-lang-php-wyEc0fdz.js +1 -0
  115. package/dist/assets/vendor-codemirror-lang-python-OPRdU26g.js +9 -0
  116. package/dist/assets/{vendor-codemirror-lang-rust-CtafR0gt.js → vendor-codemirror-lang-rust-DgovszuH.js} +1 -1
  117. package/dist/assets/vendor-codemirror-lang-sass-BdU-i07o.js +1 -0
  118. package/dist/assets/{vendor-codemirror-lang-sql-C6q09UUZ.js → vendor-codemirror-lang-sql-DUutq98l.js} +2 -2
  119. package/dist/assets/{vendor-codemirror-lang-vue-DIB78UsR.js → vendor-codemirror-lang-vue-CuRNbe8H.js} +1 -1
  120. package/dist/assets/{vendor-codemirror-lang-wast-C_JVdOCF.js → vendor-codemirror-lang-wast-CGFAOCoB.js} +1 -1
  121. package/dist/assets/vendor-codemirror-lang-xml-CMKBqGXF.js +1 -0
  122. package/dist/assets/{vendor-codemirror-lang-yaml-BO0hIfQM.js → vendor-codemirror-lang-yaml-CH9a1QiY.js} +1 -1
  123. package/dist/assets/{vendor-codemirror-language-data-Ctd4WxgW.js → vendor-codemirror-language-data-B3pLWvv-.js} +2 -2
  124. package/dist/assets/vendor-codemirror-search-hZY-L2l8.js +2 -0
  125. package/dist/assets/{vendor-dnd-kit-accessibility-DxpFzZhi.js → vendor-dnd-kit-accessibility-BOtnpZt5.js} +1 -1
  126. package/dist/assets/{vendor-dnd-kit-core-B3g3zWQd.js → vendor-dnd-kit-core-DK4OoOTr.js} +1 -1
  127. package/dist/assets/{vendor-dnd-kit-sortable-BKewx0Py.js → vendor-dnd-kit-sortable-Cv69eQm1.js} +1 -1
  128. package/dist/assets/{vendor-framer-motion-C1twy-GF.js → vendor-framer-motion-DDMKlXiP.js} +1 -1
  129. package/dist/assets/vendor-lodash-es-BS45jPoZ.js +1 -0
  130. package/dist/assets/{vendor-markstream-react-BlbOg72y.js → vendor-markstream-react-DfLaSG3W.js} +3 -3
  131. package/dist/assets/vendor-motion-C9oiAdx-.js +1 -0
  132. package/dist/assets/{vendor-pierre-diffs-Bj9Nqn6w.js → vendor-pierre-diffs-BFiZ3IhI.js} +2 -2
  133. package/dist/assets/{vendor-react-D5d-V1vN.js → vendor-react-DlzBev0S.js} +1 -1
  134. package/dist/assets/{vendor-react-drawio-C-iPmmED.js → vendor-react-drawio-Dyg1-39Q.js} +1 -1
  135. package/dist/assets/vendor-reactuses-core-DWo5Wn6R.js +1 -0
  136. package/dist/assets/{vendor-replit-codemirror-vim-DCdAdxvE.js → vendor-replit-codemirror-vim-BmQmU1lR.js} +6 -6
  137. package/dist/assets/{vendor-sonner-r2EJnfoo.js → vendor-sonner-BEHGipm5.js} +1 -1
  138. package/dist/assets/{vendor-stream-diffs-BnLmeqg2.js → vendor-stream-diffs-wcQxoPZk.js} +2 -2
  139. package/dist/assets/{vendor-tanstack-react-query-C4SG3JZB.js → vendor-tanstack-react-query-B2psfNaU.js} +1 -1
  140. package/dist/assets/{vendor-tanstack-react-virtual-BeZn51tF.js → vendor-tanstack-react-virtual-DSFNK3qc.js} +1 -1
  141. package/dist/assets/{vendor-zustand-B43HCgwC.js → vendor-zustand-vDaAPGfl.js} +1 -1
  142. package/dist/assets/zh-CN-DOchDQti.js +15 -0
  143. package/dist/assets/zh-TW-Dtigv2CE.js +15 -0
  144. package/dist/index.html +18 -18
  145. package/dist/mini-chat.html +18 -18
  146. package/dist/mobile.html +18 -18
  147. package/package.json +2 -1
  148. package/server/lib/assistants/DOCUMENTATION.md +7 -0
  149. package/server/lib/assistants/channel-output.integration.test.js +15 -1
  150. package/server/lib/assistants/harness.js +1 -0
  151. package/server/lib/assistants/harness.test.js +16 -0
  152. package/server/lib/config-sync/DOCUMENTATION.md +1 -0
  153. package/server/lib/config-sync/config-sync.test.js +22 -0
  154. package/server/lib/config-sync/constants.js +0 -3
  155. package/server/lib/gui-customization/DOCUMENTATION.md +45 -0
  156. package/server/lib/gui-customization/session-skill.js +58 -0
  157. package/server/lib/gui-customization/session-skill.test.js +53 -0
  158. package/server/lib/gui-customization/skill/SKILL.md +33 -0
  159. package/server/lib/gui-customization/skill/references/appearance.md +79 -0
  160. package/server/lib/gui-customization/skill/references/file-previews.md +113 -0
  161. package/server/lib/gui-customization/skill/references/global-pages.md +81 -0
  162. package/server/lib/gui-customization/skill/references/gui-api.md +37 -0
  163. package/server/lib/gui-customization/skill/references/preview-exports.md +74 -0
  164. package/server/lib/gui-customization/skill/references/workflow.md +81 -0
  165. package/server/lib/opencode/DOCUMENTATION.md +74 -1
  166. package/server/lib/opencode/config-entity-routes.js +2 -4
  167. package/server/lib/opencode/config-entity-routes.test.js +16 -13
  168. package/server/lib/opencode/core-routes.js +2 -0
  169. package/server/lib/opencode/core-routes.test.js +2 -2
  170. package/server/lib/opencode/custom-provider-models.d.ts +2 -0
  171. package/server/lib/opencode/custom-provider-models.js +71 -0
  172. package/server/lib/opencode/custom-provider-models.test.js +90 -0
  173. package/server/lib/opencode/custom-provider.d.ts +2 -0
  174. package/server/lib/opencode/custom-provider.js +107 -0
  175. package/server/lib/opencode/custom-provider.test.js +211 -0
  176. package/server/lib/opencode/feature-routes-runtime.js +5 -0
  177. package/server/lib/opencode/provider-catalog.js +14 -0
  178. package/server/lib/opencode/provider-catalog.test.js +15 -0
  179. package/server/lib/opencode/provider-configuration.test.js +64 -0
  180. package/server/lib/opencode/provider-model-config.d.ts +1 -0
  181. package/server/lib/opencode/provider-model-config.js +39 -0
  182. package/server/lib/opencode/provider-model-config.test.js +69 -0
  183. package/server/lib/opencode/provider-sources.d.ts +10 -0
  184. package/server/lib/opencode/provider-sources.js +52 -0
  185. package/server/lib/opencode/provider-sources.test.js +73 -0
  186. package/server/lib/opencode/providers.d.ts +5 -0
  187. package/server/lib/opencode/providers.js +28 -0
  188. package/server/lib/opencode/routes.js +50 -1
  189. package/server/lib/remote-desktop/DOCUMENTATION.md +6 -2
  190. package/server/lib/remote-desktop/runtime.js +3 -2
  191. package/server/lib/remote-desktop/runtime.test.js +20 -0
  192. package/server/lib/scheduled-tasks/session-skill.js +3 -0
  193. package/server/lib/scheduled-tasks/session-skill.test.js +4 -2
  194. package/shared/custom-provider-protocol.d.ts +4 -0
  195. package/shared/custom-provider-protocol.js +32 -0
  196. package/dist/assets/AgentAvatar-DNm_jMna.js +0 -1
  197. package/dist/assets/AssistantContactStatus-BPRpgMFh.js +0 -3
  198. package/dist/assets/LoadingImage-NLq7_P-i.js +0 -1
  199. package/dist/assets/MarkdownRenderer-BaMotAOQ.js +0 -2
  200. package/dist/assets/MarkstreamRendererImpl-Rb9O6wkW.js +0 -3
  201. package/dist/assets/MobileTabPageHeader-DbC8L6A4.js +0 -2
  202. package/dist/assets/MultiRunWindow-DtVW9NTV.js +0 -1
  203. package/dist/assets/SettingsView-BRIvklfP.css +0 -1
  204. package/dist/assets/SettingsView-Cm7woZWl.js +0 -29
  205. package/dist/assets/SettingsWindow-CdL4PFxW.js +0 -1
  206. package/dist/assets/ToolOutputDialog-B4BfmoVH.js +0 -10
  207. package/dist/assets/YuriLogo-BOx0s0Ue.js +0 -1
  208. package/dist/assets/collapsible-BEm0787p.js +0 -1
  209. package/dist/assets/context-menu-DUwvVUDY.js +0 -1
  210. package/dist/assets/desktopRelayRestore-D1UX7HW2.js +0 -1
  211. package/dist/assets/dialog-CLca6ojn.js +0 -1
  212. package/dist/assets/es-CrsHvgue.js +0 -15
  213. package/dist/assets/host-CnVx34Dh.js +0 -1
  214. package/dist/assets/image-loading-D5UhMj7Z.js +0 -1
  215. package/dist/assets/input-D59Q2pm8.js +0 -1
  216. package/dist/assets/insertionBoundaries-CedfTSM5.js +0 -1
  217. package/dist/assets/main-CxpUooVS.js +0 -2
  218. package/dist/assets/main-Dpm4KxWX.js +0 -169
  219. package/dist/assets/miniChat-CTdj8Ug9.js +0 -2
  220. package/dist/assets/mobile-ChbA3Q8j.js +0 -2
  221. package/dist/assets/multirun-BILeETbd.js +0 -3
  222. package/dist/assets/native-BYMhr-xH.js +0 -1
  223. package/dist/assets/persistence-CWuLIq1J.js +0 -3
  224. package/dist/assets/projectMeta-B9_Uh8YH.js +0 -1
  225. package/dist/assets/pt-BR-Dp5oK2x3.js +0 -15
  226. package/dist/assets/readiness-BNIgH81X.js +0 -1
  227. package/dist/assets/renderElectronMiniChatApp-asOqV7FB.js +0 -2
  228. package/dist/assets/renderMobileApp-DAfque7-.js +0 -28
  229. package/dist/assets/runtimeEndpointReset-CFQgUiUr.js +0 -149
  230. package/dist/assets/scheduledTaskNavigation-EomDNVu2.js +0 -1
  231. package/dist/assets/sessionLookup-BxAaxPOw.js +0 -1
  232. package/dist/assets/sortable-tabs-strip-DpbW5MqX.js +0 -1
  233. package/dist/assets/src-BMKjN2ip.css +0 -2
  234. package/dist/assets/tooltip-BPwoSTzO.js +0 -1
  235. package/dist/assets/types-CUtSV1V8.js +0 -2
  236. package/dist/assets/uk-BEfkaLtM.js +0 -15
  237. package/dist/assets/useDesktopWindowControlsLayout-DxxOUZj1.js +0 -1
  238. package/dist/assets/useMobileNavigationStore-BmVr5a5c.js +0 -17
  239. package/dist/assets/useUIStore-C6CE42oh.js +0 -1
  240. package/dist/assets/vendor-base-ui-BQjbsJ43.js +0 -1
  241. package/dist/assets/vendor-codemirror-autocomplete-7c2L_4dM.js +0 -12
  242. package/dist/assets/vendor-codemirror-commands-B8KrBQ9B.js +0 -1
  243. package/dist/assets/vendor-codemirror-lang-angular-DXOgWEVj.js +0 -23
  244. package/dist/assets/vendor-codemirror-lang-cpp-Dh8C3xqP.js +0 -1
  245. package/dist/assets/vendor-codemirror-lang-go-BXAJ1_dh.js +0 -11
  246. package/dist/assets/vendor-codemirror-lang-java-DAyCHRhk.js +0 -1
  247. package/dist/assets/vendor-codemirror-lang-jinja-0TICrMfO.js +0 -1
  248. package/dist/assets/vendor-codemirror-lang-liquid-8g5seytq.js +0 -1
  249. package/dist/assets/vendor-codemirror-lang-markdown-CV1IO6Qs.js +0 -6
  250. package/dist/assets/vendor-codemirror-lang-php-xP7rf28_.js +0 -1
  251. package/dist/assets/vendor-codemirror-lang-python-YM2WVLHF.js +0 -9
  252. package/dist/assets/vendor-codemirror-lang-sass-B4iav_Ps.js +0 -1
  253. package/dist/assets/vendor-codemirror-lang-xml-DIuzY_d4.js +0 -1
  254. package/dist/assets/vendor-codemirror-search-DiPwvA-6.js +0 -2
  255. package/dist/assets/vendor-lodash-es-DfLbG5Af.js +0 -1
  256. package/dist/assets/vendor-motion-BmLx2V78.js +0 -1
  257. package/dist/assets/vendor-reactuses-core-BcebBLwF.js +0 -1
  258. package/dist/assets/zh-CN-DipfA56P.js +0 -15
  259. package/dist/assets/zh-TW-B7pXMVjt.js +0 -15
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-hePW80VL.js";import{at as t,rt as n}from"./vendor-base-ui-BQjbsJ43.js";var r=e((e=>{var n=t().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return n.H.useMemoCache(e)}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,oe());else{var t=n(l);t!==null&&le(x,t.startTime-e)}}var ee=!1,te=-1,ne=5,re=-1;function ie(){return g?!0:!(e.unstable_now()-re<ne)}function ae(){if(g=!1,ee){var t=e.unstable_now();re=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ie());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&le(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?oe():ee=!1}}}var oe;if(typeof y==`function`)oe=function(){y(ae)};else if(typeof MessageChannel<`u`){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=ae,oe=function(){ce.postMessage(null)}}else oe=function(){_(ae,0)};function le(t,n){te=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ne=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,le(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,oe()))),r},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=e(((e,t)=>{t.exports=a()})),s=e((e=>{var r=o(),i=t(),a=n();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case te:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var pe=Array.isArray,S=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function w(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function T(e,t){ge++,he[ge]=e.current,e.current=t}var ve=_e(null),ye=_e(null),be=_e(null),xe=_e(null);function Se(e,t){switch(T(be,t),T(ye,e),T(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}w(ve),T(ve,e)}function Ce(){w(ve),w(ye),w(be)}function we(e){e.memoizedState!==null&&T(xe,e);var t=ve.current,n=Hd(t,e.type);t!==n&&(T(ye,e),T(ve,n))}function Te(e){ye.current===e&&(w(ve),w(ye)),xe.current===e&&(w(xe),Qf._currentValue=me)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
1
+ import{t as e}from"./rolldown-runtime-hePW80VL.js";import{at as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";var r=e((e=>{var t=n().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,oe());else{var t=n(l);t!==null&&le(x,t.startTime-e)}}var ee=!1,te=-1,ne=5,re=-1;function ie(){return g?!0:!(e.unstable_now()-re<ne)}function ae(){if(g=!1,ee){var t=e.unstable_now();re=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ie());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&le(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?oe():ee=!1}}}var oe;if(typeof y==`function`)oe=function(){y(ae)};else if(typeof MessageChannel<`u`){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=ae,oe=function(){ce.postMessage(null)}}else oe=function(){_(ae,0)};function le(t,n){te=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ne=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,le(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,oe()))),r},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=e(((e,t)=>{t.exports=a()})),s=e((e=>{var r=o(),i=n(),a=t();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case te:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var pe=Array.isArray,S=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function w(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function T(e,t){ge++,he[ge]=e.current,e.current=t}var ve=_e(null),ye=_e(null),be=_e(null),xe=_e(null);function Se(e,t){switch(T(be,t),T(ye,e),T(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}w(ve),T(ve,e)}function Ce(){w(ve),w(ye),w(be)}function we(e){e.memoizedState!==null&&T(xe,e);var t=ve.current,n=Hd(t,e.type);t!==n&&(T(ye,e),T(ve,n))}function Te(e){ye.current===e&&(w(ve),w(ye)),xe.current===e&&(w(xe),Qf._currentValue=me)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
2
2
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
3
  `+Ee+e+De}var ke=!1;function Ae(e,t){if(!e||ke)return``;ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
4
  `),l=s.split(`
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{at as t}from"./vendor-base-ui-BQjbsJ43.js";var n=e(t(),1),r=(e,t,n)=>{let r=new URL(e??`https://embed.diagrams.net`),i=new URLSearchParams;return i.append(`embed`,`1`),i.append(`proto`,`json`),n&&i.append(`configure`,`1`),t&&Object.keys(t).forEach(e=>{let n=t[e];n!==void 0&&(typeof n==`boolean`?i.append(e,n?`1`:`0`):i.append(e,n.toString()))}),r.search=i.toString(),r.toString()};function i(e,t,n){if(!(!e.origin.includes(`embed.diagrams.net`)&&n&&!n.includes(e.origin)&&!e.origin.includes(n)))try{let n=JSON.parse(e.data);if(n.event in t){let e=t[n.event];e&&e(n)}}catch{}}var a=e=>{let t=(t,n)=>{e.current?.contentWindow?.postMessage(JSON.stringify({action:t,...n}),`*`)};return{load:e=>{t(`load`,e)},configure:e=>{t(`configure`,e)},merge:e=>{t(`merge`,e)},dialog:e=>{t(`dialog`,e)},prompt:e=>{t(`prompt`,e)},template:e=>{t(`template`,e)},layout:e=>{t(`layout`,e)},draft:e=>{t(`draft`,e)},status:e=>{t(`status`,e)},spinner:e=>{t(`spinner`,e)},exportDiagram:e=>{t(`export`,e)}}},o=(0,n.forwardRef)((e,t)=>{let{autosave:o=!1,baseUrl:s,urlParameters:c,configuration:l,xml:u,csv:d,exportFormat:f,onAutoSave:p,onSave:m,onClose:h,onLoad:g,onConfigure:_,onDraft:v,onExport:y,onMerge:b,onPrompt:x,onTemplate:S}=e,C=(0,n.useRef)(null),w=a(C),T=r(s,c,!!l),[E,D]=(0,n.useState)(!1),O=e=>{i(e,{init:()=>{D(!0)},load:e=>{g&&g(e)},configure:e=>{l&&w.configure({config:l}),_&&_(e)},autosave:e=>{p&&p(e)},save:e=>{w.exportDiagram({format:f||`xmlsvg`,exit:e.exit,parentEvent:`save`})},exit:e=>{h&&h(e)},draft:e=>{v&&v(e)},export:e=>{m&&m({event:`save`,xml:e.data,parentEvent:e.message.parentEvent||`export`}),y&&y(e),e.message.exit&&h&&h({event:`exit`,modified:!0,parentEvent:e.message.parentEvent||`export`})},merge:e=>{b&&b(e)},prompt:e=>{x&&x(e)},template:e=>{S&&S(e)}},s)};return(0,n.useImperativeHandle)(t,()=>({...w}),[]),(0,n.useEffect)(()=>{let e={};E&&(e=u?f===`xmlpng`?{xmlpng:u}:{xml:u}:d?{descriptor:{format:`csv`,data:d}}:{xml:``},e={...e,autosave:o},w.load(e))},[E,u,d,o]),(0,n.useEffect)(()=>(window.addEventListener(`message`,O),()=>{window.removeEventListener(`message`,O)}),[]),n.createElement(`iframe`,{className:`diagrams-iframe`,src:T,ref:C,allow:`clipboard-read; clipboard-write`,title:`Diagrams.net`,style:{width:`100%`,height:`100%`,minWidth:`400px`,minHeight:`400px`,border:`none`}})});export{o as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{st as t}from"./vendor-base-ui-CzHs0bHY.js";var n=e(t(),1),r=(e,t,n)=>{let r=new URL(e??`https://embed.diagrams.net`),i=new URLSearchParams;return i.append(`embed`,`1`),i.append(`proto`,`json`),n&&i.append(`configure`,`1`),t&&Object.keys(t).forEach(e=>{let n=t[e];n!==void 0&&(typeof n==`boolean`?i.append(e,n?`1`:`0`):i.append(e,n.toString()))}),r.search=i.toString(),r.toString()};function i(e,t,n){if(!(!e.origin.includes(`embed.diagrams.net`)&&n&&!n.includes(e.origin)&&!e.origin.includes(n)))try{let n=JSON.parse(e.data);if(n.event in t){let e=t[n.event];e&&e(n)}}catch{}}var a=e=>{let t=(t,n)=>{e.current?.contentWindow?.postMessage(JSON.stringify({action:t,...n}),`*`)};return{load:e=>{t(`load`,e)},configure:e=>{t(`configure`,e)},merge:e=>{t(`merge`,e)},dialog:e=>{t(`dialog`,e)},prompt:e=>{t(`prompt`,e)},template:e=>{t(`template`,e)},layout:e=>{t(`layout`,e)},draft:e=>{t(`draft`,e)},status:e=>{t(`status`,e)},spinner:e=>{t(`spinner`,e)},exportDiagram:e=>{t(`export`,e)}}},o=(0,n.forwardRef)((e,t)=>{let{autosave:o=!1,baseUrl:s,urlParameters:c,configuration:l,xml:u,csv:d,exportFormat:f,onAutoSave:p,onSave:m,onClose:h,onLoad:g,onConfigure:_,onDraft:v,onExport:y,onMerge:b,onPrompt:x,onTemplate:S}=e,C=(0,n.useRef)(null),w=a(C),T=r(s,c,!!l),[E,D]=(0,n.useState)(!1),O=e=>{i(e,{init:()=>{D(!0)},load:e=>{g&&g(e)},configure:e=>{l&&w.configure({config:l}),_&&_(e)},autosave:e=>{p&&p(e)},save:e=>{w.exportDiagram({format:f||`xmlsvg`,exit:e.exit,parentEvent:`save`})},exit:e=>{h&&h(e)},draft:e=>{v&&v(e)},export:e=>{m&&m({event:`save`,xml:e.data,parentEvent:e.message.parentEvent||`export`}),y&&y(e),e.message.exit&&h&&h({event:`exit`,modified:!0,parentEvent:e.message.parentEvent||`export`})},merge:e=>{b&&b(e)},prompt:e=>{x&&x(e)},template:e=>{S&&S(e)}},s)};return(0,n.useImperativeHandle)(t,()=>({...w}),[]),(0,n.useEffect)(()=>{let e={};E&&(e=u?f===`xmlpng`?{xmlpng:u}:{xml:u}:d?{descriptor:{format:`csv`,data:d}}:{xml:``},e={...e,autosave:o},w.load(e))},[E,u,d,o]),(0,n.useEffect)(()=>(window.addEventListener(`message`,O),()=>{window.removeEventListener(`message`,O)}),[]),n.createElement(`iframe`,{className:`diagrams-iframe`,src:T,ref:C,allow:`clipboard-read; clipboard-write`,title:`Diagrams.net`,style:{width:`100%`,height:`100%`,minWidth:`400px`,minHeight:`400px`,border:`none`}})});export{o as t};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{it as n,st as r}from"./vendor-base-ui-CzHs0bHY.js";import{n as i,t as a}from"./vendor-lodash-es-BS45jPoZ.js";import"./vendor-js-cookie-hSOiFTtX.js";var o=t(((e,t)=>{(function(){var e=typeof window<`u`&&window.document!==void 0?window.document:{},n=t!==void 0&&t.exports,r=(function(){for(var t,n=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],r=0,i=n.length,a={};r<i;r++)if(t=n[r],t&&t[1]in e){for(r=0;r<t.length;r++)a[n[0][r]]=t[r];return a}return!1})(),i={change:r.fullscreenchange,error:r.fullscreenerror},a={request:function(t,n){return new Promise(function(i,a){var o=function(){this.off(`change`,o),i()}.bind(this);this.on(`change`,o),t||=e.documentElement;var s=t[r.requestFullscreen](n);s instanceof Promise&&s.then(o).catch(a)}.bind(this))},exit:function(){return new Promise(function(t,n){if(!this.isFullscreen){t();return}var i=function(){this.off(`change`,i),t()}.bind(this);this.on(`change`,i);var a=e[r.exitFullscreen]();a instanceof Promise&&a.then(i).catch(n)}.bind(this))},toggle:function(e,t){return this.isFullscreen?this.exit():this.request(e,t)},onchange:function(e){this.on(`change`,e)},onerror:function(e){this.on(`error`,e)},on:function(t,n){var r=i[t];r&&e.addEventListener(r,n,!1)},off:function(t,n){var r=i[t];r&&e.removeEventListener(r,n,!1)},raw:r};if(!r){n?t.exports={isEnabled:!1}:window.screenfull={isEnabled:!1};return}Object.defineProperties(a,{isFullscreen:{get:function(){return!!e[r.fullscreenElement]}},element:{enumerable:!0,get:function(){return e[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!e[r.fullscreenEnabled]}}}),n?t.exports=a:window.screenfull=a})()})),s=e(r(),1),c=n();o();var l;function u(e){return typeof e==`function`}var d=typeof window<`u`,f=typeof navigator<`u`;d&&(l=window)!=null&&l.navigator?.userAgent&&/iP(?:ad|hone|od)/.test(window.navigator.userAgent);var p=d?s.useLayoutEffect:s.useEffect,m=e=>{let t=(0,s.useRef)(e);return p(()=>{t.current=e},[e]),t};function h(e,...t){e&&e.addEventListener&&e.addEventListener(...t)}function g(e,...t){e&&e.removeEventListener&&e.removeEventListener(...t)}var _=typeof window<`u`?window:void 0,v={};function y(e){console.error(e)}function b(e,t){if(!d)return;if(!e)return t;let n;return n=u(e)?e():`current`in e?e.current:e,n}var x=e=>(e+1)%1e6;function S(){let[,e]=(0,s.useReducer)(x,0);return e}var C=(e,t,n)=>{let r=(0,s.useRef)(void 0),i=S();r.current||=t,p(()=>{n(t,r.current)||(r.current=t,i())}),(0,s.useEffect)(e,r.current)},w=(e,t)=>{C(e,t,a)};function T(e,t){let n=(0,s.useRef)(e);n.current=e;let r;return r=e?typeof e==`object`&&`current`in e?e:b(e,t):t??null,{key:r,ref:n}}function E(e,t,n,r=v){let i=m(t),{key:a,ref:o}=T(n,_);w(()=>{let t=b(o.current,_);if(!(t&&t.addEventListener))return;let n=e=>i.current(e);return h(t,e,n,r),()=>{t&&t.removeEventListener&&g(t,e,n)}},[e,a,r])}function D(){}var O=d?E:D,k=e=>{(0,s.useEffect)(()=>{e?.()},[])},A={passive:!0},j=(e,t,n=!0)=>{let r=m(t),i=t=>{if(!n)return;let i=b(e);if(!i)return;let a=t.composedPath();i===t.target||a.includes(i)||r.current(t)};O(`mousedown`,i,_,A),O(`touchstart`,i,_,A)},M=e=>{let t=(0,s.useRef)(e);return p(()=>{t.current=e},[e]),(0,s.useCallback)((...e)=>{let n=t.current;return n(...e)},[])},N=(e,t,n=v)=>{let{immediate:r,controls:i}=n,a=m(e),o=(0,s.useRef)(!1),c=(0,s.useRef)(null),l=()=>{c.current&&clearInterval(c.current)},u=M(()=>{o.current=!0,c.current=setInterval(()=>a.current(),t||0)}),d=M(()=>{o.current=!1,l()});return(0,s.useEffect)(()=>{if(r&&a.current(),!i&&t!==null)return u(),()=>{l()}},[t,r]),{isActive:o,pause:d,resume:u}};function P(e){return e==null||e===void 0?`any`:e instanceof Set?`set`:e instanceof Map?`map`:e instanceof Date?`date`:typeof e==`boolean`?`boolean`:typeof e==`string`?`string`:typeof e==`object`||Array.isArray(e)?`object`:Number.isNaN(e)?`any`:`number`}var F=`reactuse:storage`;function I(e){window.dispatchEvent(new CustomEvent(F,{detail:e}))}var L={boolean:{read:e=>e===`true`,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function R(e,t,n=()=>d?sessionStorage:void 0,r=v){let i,{onError:a=y,effectStorageValue:o,mountStorageValue:l,listenToStorageChanges:f=!0}=r,p=m(l??o),h=m(a);try{i=n()}catch(e){h.current(e)}let g=P(t),_=m(r.serializer??L[g]),b=(0,s.useRef)(i);b.current=i;let x=(0,s.useRef)(t);x.current=t;let S=(0,s.useRef)(void 0),C=(0,s.useRef)(e),w=(0,s.useRef)(t??null);C.current!==e&&(C.current=e,S.current=void 0,w.current=t??null);let T=(0,s.useRef)(null),E=(0,s.useRef)(()=>{let e=b.current,t=x.current??null;if(!e)return S.current===void 0?t:S.current===null?null:w.current;try{let n=e.getItem(C.current);if(n===null)return S.current===null?null:t;if(n===S.current)return w.current;let r=_.current.read(n);return S.current=n,w.current=r,r}catch(e){return h.current(e),t}}).current,D=(0,s.useRef)(()=>x.current??null).current,k=(0,s.useRef)(e=>(T.current=e,()=>{T.current=null})).current,A=(0,c.useSyncExternalStore)(k,E,D),j=(e,t,n)=>{(e===null||e===C.current)&&(n&&n!==b.current||(t===null&&(S.current=null,w.current=null),T.current==null||T.current.call(T)))};return O(`storage`,e=>{f&&j(e.key,e.newValue,e.storageArea)}),O(F,e=>{j(e.detail.key,e.detail.newValue,e.detail.storageArea)}),(0,s.useEffect)(()=>{let n=_.current,r=p.current,a=(r?u(r)?r():r:t)??null;try{if(i?.getItem(e)==null&&a!==null){let t=n.write(a);i?.setItem(e,t),S.current=void 0,T.current==null||T.current.call(T),i&&I({key:e,newValue:t,storageArea:i})}}catch(e){h.current(e)}},[e,i]),[A,M(t=>{let n=u(t)?t(E()):t,r;if(n===null)i?.removeItem(e),S.current=null,w.current=null,r=null;else try{let t=_.current.write(n);i?.setItem(e,t),S.current=t,w.current=n,r=t}catch(e){h.current(e);return}T.current==null||T.current.call(T),i&&I({key:e,newValue:r,storageArea:i})})]}function z(e){let t=m(e);(0,s.useEffect)(()=>()=>{t.current()},[t])}var B=(e,t,n)=>{let r=m(e),a=(0,s.useMemo)(()=>i((...e)=>r.current(...e),t,n),[JSON.stringify(n),t]);return z(()=>{a.cancel()}),{run:a,cancel:a.cancel,flush:a.flush}},V=(e,t,n)=>{let[r,i]=(0,s.useState)(e),{run:a}=B(()=>{i(e)},t,n);return(0,s.useEffect)(()=>{a()},[a,e]),r};function H(e){return e===void 0?d?document.visibilityState:`visible`:e}function U(e){let[t,n]=(0,s.useState)(H(e));return O(`visibilitychange`,()=>{n(document.visibilityState)},()=>document),(0,s.useEffect)(()=>{n(document.visibilityState)},[]),t}var W=(e,t,n=v)=>{let r=m(t),i=(0,s.useRef)(),{key:a,ref:o}=T(e),c=(0,s.useCallback)(()=>{i.current&&i.current.disconnect()},[]);return w(()=>{let e=b(o.current);if(e)return i.current=new ResizeObserver(r.current),i.current.observe(e,n),c},[a,n]),c},G=(e,t,n=v)=>{let r=m(t),i=(0,s.useRef)(),{key:a,ref:o}=T(e),c=(0,s.useCallback)(()=>{i.current&&i.current.disconnect()},[]);return w(()=>{let e=b(o.current);if(e)return i.current=new IntersectionObserver(r.current,n),i.current.observe(e),c},[a,n]),c};s.useEffect;function K(e,t,n=v){return R(e,t,()=>d?localStorage:void 0,n)}function q(e,t){return t===void 0?d?window.matchMedia(e).matches:!1:t}var J=(e,t)=>{let[n,r]=(0,s.useState)(q(e,t));return(0,s.useEffect)(()=>{let t=!0,n=window.matchMedia(e),i=()=>{t&&r(!!n.matches)};return`addEventListener`in n?n.addEventListener(`change`,i):n.addListener==null||n.addListener.call(n,i),r(n.matches),()=>{t=!1,`removeEventListener`in n?n.removeEventListener(`change`,i):n.removeListener==null||n.removeListener.call(n,i)}},[e]),n},Y=(e,t,n=v)=>{let r=m(e),i=(0,s.useRef)(),{key:a,ref:o}=T(t),c=(0,s.useCallback)(()=>{i.current&&i.current.disconnect()},[]);return w(()=>{let e=b(o.current);if(e)return i.current=new MutationObserver(r.current),i.current.observe(e,n),c},[a,n]),c},X=f?navigator:void 0;X&&(X.connection||X.mozConnection||X.webkitConnection),s.useEffect,s.useLayoutEffect;var Z=(e,t,n=v)=>{let{immediate:r=!0}=n,[i,a]=(0,s.useState)(()=>r),o=m(e),c=(0,s.useRef)(),l=M(()=>{a(!1),c.current&&clearTimeout(c.current)}),u=M((...e)=>{c&&clearTimeout(c.current),c.current=setTimeout(()=>{a(!1),o.current(...e)},t),a(!0)});return(0,s.useEffect)(()=>(r&&u(),l),[l,r,t,u]),[i,u,l]};s.useLayoutEffect,s.use;export{O as a,p as c,J as d,k as f,z as g,Z as h,M as i,m as l,W as m,V as n,G as o,Y as p,U as r,N as s,j as t,K as u};
@@ -1,4 +1,4 @@
1
- import{$ as e,A as t,B as n,H as r,K as i,M as a,U as o,V as s,Z as c,dt as l,ft as u,lt as d,ot as f,p,pt as m,ut as h,x as g,y as _}from"./vendor-codemirror-autocomplete-7c2L_4dM.js";import{c as v,f as y,i as b,l as x,m as S,n as C,p as w,r as T,t as E,u as D}from"./vendor-codemirror-commands-B8KrBQ9B.js";import{n as O,t as k,u as ee}from"./vendor-codemirror-search-DiPwvA-6.js";function te(e){var t=e.Pos;function n(e,t,n){if(t.line===n.line&&t.ch>=n.ch-1){var r=e.getLine(t.line).charCodeAt(t.ch);55296<=r&&r<=55551&&(n.ch+=1)}return{start:t,end:n}}var r=[{keys:`<Left>`,type:`keyToKey`,toKeys:`h`},{keys:`<Right>`,type:`keyToKey`,toKeys:`l`},{keys:`<Up>`,type:`keyToKey`,toKeys:`k`},{keys:`<Down>`,type:`keyToKey`,toKeys:`j`},{keys:`g<Up>`,type:`keyToKey`,toKeys:`gk`},{keys:`g<Down>`,type:`keyToKey`,toKeys:`gj`},{keys:`<Space>`,type:`keyToKey`,toKeys:`l`},{keys:`<BS>`,type:`keyToKey`,toKeys:`h`},{keys:`<Del>`,type:`keyToKey`,toKeys:`x`},{keys:`<C-Space>`,type:`keyToKey`,toKeys:`W`},{keys:`<C-BS>`,type:`keyToKey`,toKeys:`B`},{keys:`<S-Space>`,type:`keyToKey`,toKeys:`w`},{keys:`<S-BS>`,type:`keyToKey`,toKeys:`b`},{keys:`<C-n>`,type:`keyToKey`,toKeys:`j`},{keys:`<C-p>`,type:`keyToKey`,toKeys:`k`},{keys:`<C-[>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-c>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-[>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`<C-c>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`<C-Esc>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-Esc>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`s`,type:`keyToKey`,toKeys:`cl`,context:`normal`},{keys:`s`,type:`keyToKey`,toKeys:`c`,context:`visual`},{keys:`S`,type:`keyToKey`,toKeys:`cc`,context:`normal`},{keys:`S`,type:`keyToKey`,toKeys:`VdO`,context:`visual`},{keys:`<Home>`,type:`keyToKey`,toKeys:`0`},{keys:`<End>`,type:`keyToKey`,toKeys:`$`},{keys:`<PageUp>`,type:`keyToKey`,toKeys:`<C-b>`},{keys:`<PageDown>`,type:`keyToKey`,toKeys:`<C-f>`},{keys:`<CR>`,type:`keyToKey`,toKeys:`j^`,context:`normal`},{keys:`<Ins>`,type:`keyToKey`,toKeys:`i`,context:`normal`},{keys:`<Ins>`,type:`action`,action:`toggleOverwrite`,context:`insert`},{keys:`H`,type:`motion`,motion:`moveToTopLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`M`,type:`motion`,motion:`moveToMiddleLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`L`,type:`motion`,motion:`moveToBottomLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`h`,type:`motion`,motion:`moveByCharacters`,motionArgs:{forward:!1}},{keys:`l`,type:`motion`,motion:`moveByCharacters`,motionArgs:{forward:!0}},{keys:`j`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,linewise:!0}},{keys:`k`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!1,linewise:!0}},{keys:`gj`,type:`motion`,motion:`moveByDisplayLines`,motionArgs:{forward:!0}},{keys:`gk`,type:`motion`,motion:`moveByDisplayLines`,motionArgs:{forward:!1}},{keys:`w`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!1}},{keys:`W`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:`e`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:`E`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:`b`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1}},{keys:`B`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:`ge`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:`gE`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:`{`,type:`motion`,motion:`moveByParagraph`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`}`,type:`motion`,motion:`moveByParagraph`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`(`,type:`motion`,motion:`moveBySentence`,motionArgs:{forward:!1}},{keys:`)`,type:`motion`,motion:`moveBySentence`,motionArgs:{forward:!0}},{keys:`<C-f>`,type:`motion`,motion:`moveByPage`,motionArgs:{forward:!0}},{keys:`<C-b>`,type:`motion`,motion:`moveByPage`,motionArgs:{forward:!1}},{keys:`<C-d>`,type:`motion`,motion:`moveByScroll`,motionArgs:{forward:!0,explicitRepeat:!0}},{keys:`<C-u>`,type:`motion`,motion:`moveByScroll`,motionArgs:{forward:!1,explicitRepeat:!0}},{keys:`gg`,type:`motion`,motion:`moveToLineOrEdgeOfDocument`,motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:`G`,type:`motion`,motion:`moveToLineOrEdgeOfDocument`,motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:`g$`,type:`motion`,motion:`moveToEndOfDisplayLine`},{keys:`g^`,type:`motion`,motion:`moveToStartOfDisplayLine`},{keys:`g0`,type:`motion`,motion:`moveToStartOfDisplayLine`},{keys:`0`,type:`motion`,motion:`moveToStartOfLine`},{keys:`^`,type:`motion`,motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`+`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,toFirstChar:!0}},{keys:`-`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!1,toFirstChar:!0}},{keys:`_`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:`$`,type:`motion`,motion:`moveToEol`,motionArgs:{inclusive:!0}},{keys:`%`,type:`motion`,motion:`moveToMatchedSymbol`,motionArgs:{inclusive:!0,toJumplist:!0}},{keys:`f<character>`,type:`motion`,motion:`moveToCharacter`,motionArgs:{forward:!0,inclusive:!0}},{keys:`F<character>`,type:`motion`,motion:`moveToCharacter`,motionArgs:{forward:!1}},{keys:`t<character>`,type:`motion`,motion:`moveTillCharacter`,motionArgs:{forward:!0,inclusive:!0}},{keys:`T<character>`,type:`motion`,motion:`moveTillCharacter`,motionArgs:{forward:!1}},{keys:`;`,type:`motion`,motion:`repeatLastCharacterSearch`,motionArgs:{forward:!0}},{keys:`,`,type:`motion`,motion:`repeatLastCharacterSearch`,motionArgs:{forward:!1}},{keys:`'<register>`,type:`motion`,motion:`goToMark`,motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:`motion`,motion:`goToMark`,motionArgs:{toJumplist:!0}},{keys:"]`",type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!0}},{keys:"[`",type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!1}},{keys:`]'`,type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!0,linewise:!0}},{keys:`['`,type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!1,linewise:!0}},{keys:`]p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:`[p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:`]<character>`,type:`motion`,motion:`moveToSymbol`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`[<character>`,type:`motion`,motion:`moveToSymbol`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`|`,type:`motion`,motion:`moveToColumn`},{keys:`o`,type:`motion`,motion:`moveToOtherHighlightedEnd`,context:`visual`},{keys:`O`,type:`motion`,motion:`moveToOtherHighlightedEnd`,motionArgs:{sameLine:!0},context:`visual`},{keys:`d`,type:`operator`,operator:`delete`},{keys:`y`,type:`operator`,operator:`yank`},{keys:`c`,type:`operator`,operator:`change`},{keys:`=`,type:`operator`,operator:`indentAuto`},{keys:`>`,type:`operator`,operator:`indent`,operatorArgs:{indentRight:!0}},{keys:`<`,type:`operator`,operator:`indent`,operatorArgs:{indentRight:!1}},{keys:`g~`,type:`operator`,operator:`changeCase`},{keys:`gu`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!0},isEdit:!0},{keys:`gU`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!1},isEdit:!0},{keys:`n`,type:`motion`,motion:`findNext`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`N`,type:`motion`,motion:`findNext`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`gn`,type:`motion`,motion:`findAndSelectNextInclusive`,motionArgs:{forward:!0}},{keys:`gN`,type:`motion`,motion:`findAndSelectNextInclusive`,motionArgs:{forward:!1}},{keys:`gq`,type:`operator`,operator:`hardWrap`},{keys:`gw`,type:`operator`,operator:`hardWrap`,operatorArgs:{keepCursor:!0}},{keys:`g?`,type:`operator`,operator:`rot13`},{keys:`x`,type:`operatorMotion`,operator:`delete`,motion:`moveByCharacters`,motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:`X`,type:`operatorMotion`,operator:`delete`,motion:`moveByCharacters`,motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:`D`,type:`operatorMotion`,operator:`delete`,motion:`moveToEol`,motionArgs:{inclusive:!0},context:`normal`},{keys:`D`,type:`operator`,operator:`delete`,operatorArgs:{linewise:!0},context:`visual`},{keys:`Y`,type:`operatorMotion`,operator:`yank`,motion:`expandToLine`,motionArgs:{linewise:!0},context:`normal`},{keys:`Y`,type:`operator`,operator:`yank`,operatorArgs:{linewise:!0},context:`visual`},{keys:`C`,type:`operatorMotion`,operator:`change`,motion:`moveToEol`,motionArgs:{inclusive:!0},context:`normal`},{keys:`C`,type:`operator`,operator:`change`,operatorArgs:{linewise:!0},context:`visual`},{keys:`~`,type:`operatorMotion`,operator:`changeCase`,motion:`moveByCharacters`,motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:`normal`},{keys:`~`,type:`operator`,operator:`changeCase`,context:`visual`},{keys:`<C-u>`,type:`operatorMotion`,operator:`delete`,motion:`moveToStartOfLine`,context:`insert`},{keys:`<C-w>`,type:`operatorMotion`,operator:`delete`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1},context:`insert`},{keys:`<C-w>`,type:`idle`,context:`normal`},{keys:`<C-i>`,type:`action`,action:`jumpListWalk`,actionArgs:{forward:!0}},{keys:`<C-o>`,type:`action`,action:`jumpListWalk`,actionArgs:{forward:!1}},{keys:`<C-e>`,type:`action`,action:`scroll`,actionArgs:{forward:!0,linewise:!0}},{keys:`<C-y>`,type:`action`,action:`scroll`,actionArgs:{forward:!1,linewise:!0}},{keys:`a`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`charAfter`},context:`normal`},{keys:`A`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`eol`},context:`normal`},{keys:`A`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`endOfSelectedArea`},context:`visual`},{keys:`i`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`inplace`},context:`normal`},{keys:`gi`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`lastEdit`},context:`normal`},{keys:`I`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`firstNonBlank`},context:`normal`},{keys:`gI`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`bol`},context:`normal`},{keys:`I`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`startOfSelectedArea`},context:`visual`},{keys:`o`,type:`action`,action:`newLineAndEnterInsertMode`,isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:`normal`},{keys:`O`,type:`action`,action:`newLineAndEnterInsertMode`,isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:`normal`},{keys:`v`,type:`action`,action:`toggleVisualMode`},{keys:`V`,type:`action`,action:`toggleVisualMode`,actionArgs:{linewise:!0}},{keys:`<C-v>`,type:`action`,action:`toggleVisualMode`,actionArgs:{blockwise:!0}},{keys:`<C-q>`,type:`action`,action:`toggleVisualMode`,actionArgs:{blockwise:!0}},{keys:`gv`,type:`action`,action:`reselectLastSelection`},{keys:`J`,type:`action`,action:`joinLines`,isEdit:!0},{keys:`gJ`,type:`action`,action:`joinLines`,actionArgs:{keepSpaces:!0},isEdit:!0},{keys:`p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:`P`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:`r<character>`,type:`action`,action:`replace`,isEdit:!0},{keys:`@<register>`,type:`action`,action:`replayMacro`},{keys:`q<register>`,type:`action`,action:`enterMacroRecordMode`},{keys:`R`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{replace:!0},context:`normal`},{keys:`R`,type:`operator`,operator:`change`,operatorArgs:{linewise:!0,fullLine:!0},context:`visual`,exitVisualBlock:!0},{keys:`u`,type:`action`,action:`undo`,context:`normal`},{keys:`u`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!0},context:`visual`,isEdit:!0},{keys:`U`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!1},context:`visual`,isEdit:!0},{keys:`<C-r>`,type:`action`,action:`redo`},{keys:`m<register>`,type:`action`,action:`setMark`},{keys:`"<register>`,type:`action`,action:`setRegister`},{keys:`<C-r><register>`,type:`action`,action:`insertRegister`,context:`insert`,isEdit:!0},{keys:`<C-o>`,type:`action`,action:`oneNormalCommand`,context:`insert`},{keys:`zz`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`center`}},{keys:`z.`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`center`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`zt`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`top`}},{keys:`z<CR>`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`top`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`zb`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`bottom`}},{keys:`z-`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`bottom`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`.`,type:`action`,action:`repeatLastEdit`},{keys:`<C-a>`,type:`action`,action:`incrementNumberToken`,isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:`<C-x>`,type:`action`,action:`incrementNumberToken`,isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:`<C-t>`,type:`action`,action:`indent`,actionArgs:{indentRight:!0},context:`insert`},{keys:`<C-d>`,type:`action`,action:`indent`,actionArgs:{indentRight:!1},context:`insert`},{keys:`a<register>`,type:`motion`,motion:`textObjectManipulation`},{keys:`i<register>`,type:`motion`,motion:`textObjectManipulation`,motionArgs:{textObjectInner:!0}},{keys:`/`,type:`search`,searchArgs:{forward:!0,querySrc:`prompt`,toJumplist:!0}},{keys:`?`,type:`search`,searchArgs:{forward:!1,querySrc:`prompt`,toJumplist:!0}},{keys:`*`,type:`search`,searchArgs:{forward:!0,querySrc:`wordUnderCursor`,wholeWordOnly:!0,toJumplist:!0}},{keys:`#`,type:`search`,searchArgs:{forward:!1,querySrc:`wordUnderCursor`,wholeWordOnly:!0,toJumplist:!0}},{keys:`g*`,type:`search`,searchArgs:{forward:!0,querySrc:`wordUnderCursor`,toJumplist:!0}},{keys:`g#`,type:`search`,searchArgs:{forward:!1,querySrc:`wordUnderCursor`,toJumplist:!0}},{keys:`:`,type:`ex`}],i=Object.create(null),a=r.length,o=[{name:`colorscheme`,shortName:`colo`},{name:`map`},{name:`imap`,shortName:`im`},{name:`nmap`,shortName:`nm`},{name:`vmap`,shortName:`vm`},{name:`omap`,shortName:`om`},{name:`noremap`,shortName:`no`},{name:`nnoremap`,shortName:`nn`},{name:`vnoremap`,shortName:`vn`},{name:`inoremap`,shortName:`ino`},{name:`onoremap`,shortName:`ono`},{name:`unmap`},{name:`mapclear`,shortName:`mapc`},{name:`nmapclear`,shortName:`nmapc`},{name:`vmapclear`,shortName:`vmapc`},{name:`imapclear`,shortName:`imapc`},{name:`omapclear`,shortName:`omapc`},{name:`write`,shortName:`w`},{name:`undo`,shortName:`u`},{name:`redo`,shortName:`red`},{name:`set`,shortName:`se`},{name:`setlocal`,shortName:`setl`},{name:`setglobal`,shortName:`setg`},{name:`sort`,shortName:`sor`},{name:`substitute`,shortName:`s`,possiblyAsync:!0},{name:`startinsert`,shortName:`start`},{name:`nohlsearch`,shortName:`noh`},{name:`yank`,shortName:`y`},{name:`delmarks`,shortName:`delm`},{name:`marks`,excludeFromCommandHistory:!0},{name:`registers`,shortName:`reg`,excludeFromCommandHistory:!0},{name:`vglobal`,shortName:`v`},{name:`delete`,shortName:`d`},{name:`join`,shortName:`j`},{name:`normal`,shortName:`norm`},{name:`global`,shortName:`g`}],s=pe(``);function c(t){t.setOption(`disableInput`,!0),t.setOption(`showCursorWhenSelecting`,!1),e.signal(t,`vim-mode-change`,{mode:`normal`}),t.on(`cursorActivity`,Jt),j(t),e.on(t.getInputField(),`paste`,u(t))}function l(t){t.setOption(`disableInput`,!1),t.off(`cursorActivity`,Jt),e.off(t.getInputField(),`paste`,u(t)),t.state.vim=null,Et&&clearTimeout(Et)}function u(e){var t=e.state.vim;return t.onPasteFn||=function(){t.insertMode||(e.setCursor(V(e.getCursor(),0,1)),we.enterInsertMode(e,{},t))},t.onPasteFn}var d=/[\d]/,f=[e.isWordChar,function(t){return t&&!e.isWordChar(t)&&!/\s/.test(t)}],p=[function(e){return/\S/.test(e)}],m=[`<`,`>`],h=[`-`,`"`,`.`,`:`,`_`,`/`,`+`],g=/^\w$/,_=/^[A-Z]$/;try{_=RegExp(`^[\\p{Lu}]$`,`u`)}catch{}function v(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function y(e){return/^[a-z]$/.test(e)}function b(e){return`()[]{}`.indexOf(e)!=-1}function x(e){return d.test(e)}function S(e){return _.test(e)}function C(e){return/^\s*$/.test(e)}function w(e){return`.?!`.indexOf(e)!=-1}function T(e,t){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}var E={};function D(e,t,n,r,i){if(t===void 0&&!i)throw Error(`defaultValue is required unless callback is provided`);if(n||=`string`,E[e]={type:n,defaultValue:t,callback:i},r)for(var a=0;a<r.length;a++)E[r[a]]=E[e];t&&O(e,t)}function O(e,t,n,r){var i=E[e];r||={};var a=r.scope;if(!i)return Error(`Unknown option: `+e);if(i.type==`boolean`){if(t&&t!==!0)return Error(`Invalid argument: `+e+`=`+t);t!==!1&&(t=!0)}i.callback?(a!==`local`&&i.callback(t,void 0),a!==`global`&&n&&i.callback(t,n)):(a!==`local`&&(i.value=i.type==`boolean`?!!t:t),a!==`global`&&n&&(n.state.vim.options[e]={value:t}))}function k(e,t,n){var r=E[e];n||={};var i=n.scope;if(!r)return Error(`Unknown option: `+e);if(r.callback){let e=t&&r.callback(void 0,t);return i!==`global`&&e!==void 0?e:i===`local`?void 0:r.callback()}return(i!==`global`&&t&&t.state.vim.options[e]||i!==`local`&&r||{}).value}D(`filetype`,void 0,`string`,[`ft`],function(e,t){if(t!==void 0){if(e===void 0){let e=t.getOption(`mode`);return e==`null`?``:e}{let n=e==``?`null`:e;t.setOption(`mode`,n)}}}),D(`textwidth`,80,`number`,[`tw`],function(e,t){if(t!==void 0){if(e===void 0)return t.getOption(`textwidth`);var n=Math.round(e);n>1&&t.setOption(`textwidth`,n)}});var ee=function(){var e=100,t=-1,n=0,r=0,i=Array(e);function a(a,o,s){var c=i[t%e];function l(n){var r=++t%e,o=i[r];o&&o.clear(),i[r]=a.setBookmark(n)}if(c){var u=c.find();u&&!U(u,o)&&l(o)}else l(o);l(s),n=t,r=t-e+1,r<0&&(r=0)}function o(a,o){t+=o,t>n?t=n:t<r&&(t=r);var s=i[(e+t)%e];if(s&&!s.find()){var c=o>0?1:-1,l,u=a.getCursor();do if(t+=c,s=i[(e+t)%e],s&&(l=s.find())&&!U(u,l))break;while(t<n&&t>r)}return s}function s(e,n){var r=t,i=o(e,n);return t=r,i&&i.find()}return{cachedCursor:void 0,add:a,find:s,move:o}},te=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class A{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=te()}exitMacroRecordMode(){var e=M.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1}enterMacroRecordMode(e,t){var n=M.registerController.getRegister(t);if(n){if(n.clear(),this.latestRegister=t,e.openDialog){var r=Z(`span`,{class:`cm-vim-message`},`recording @`+t);this.onRecordingDone=e.openDialog(r,function(){},{bottom:!0})}this.isRecording=!0}}}function j(e){return e.state.vim||(e.state.vim={inputState:new me,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new t(0,0),head:new t(0,0)},options:{},expectLiteralNext:!1,status:``}),e.state.vim}var M;function ne(){for(var e in M={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:ee(),macroModeState:new A,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:``},registerController:new _e({}),searchHistoryController:new ve,exCommandHistoryController:new ve},E){var t=E[e];t.value=t.defaultValue}}class re{constructor(e,t){this.keyName=e,this.key=t.key,this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.shiftKey=t.shiftKey}}var ie,N={enterVimMode:c,leaveVimMode:l,buildKeyMap:function(){},getRegisterController:function(){return M.registerController},resetVimGlobalState_:ne,getVimGlobalState_:function(){return M},maybeInitVimState_:j,suppressErrorLogging:!1,InsertModeKey:re,map:function(e,t,n){$.map(e,t,n)},unmap:function(e,t){return $.unmap(e,t)},noremap:function(e,t,n){$.map(e,t,n,!0)},mapclear:function(e){var t=r.length,n=a,i=r.slice(0,t-n);if(r=r.slice(t-n),e)for(var o=i.length-1;o>=0;o--){var s=i[o];if(e!==s.context)if(s.context)this._mapCommand(s);else{var c=[`normal`,`insert`,`visual`];for(var l in c)if(c[l]!==e){var u=Object.assign({},s);u.context=c[l],this._mapCommand(u)}}}},langmap:fe,vimKeyFromEvent:de,setOption:O,getOption:k,defineOption:D,defineEx:function(e,t,n){if(!t)t=e;else if(e.indexOf(t)!==0)throw Error(`(Vim.defineEx) "`+t+`" is not a prefix of "`+e+`", command not registered`);It[e]=n,$.commandMap_[t]={name:e,shortName:t,type:`api`}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if(typeof r==`function`)return r()},multiSelectHandleKey:tn,findKey:function(t,n,i){var a=j(t),o=t;function s(){var e=M.macroModeState;if(e.isRecording){if(n==`q`)return e.exitMacroRecordMode(),I(o),!0;i!=`mapping`&&Wt(e,n)}}function c(){if(n==`<Esc>`){if(a.visualMode)J(o);else if(a.insertMode)Rt(o);else return;return I(o),!0}}function l(){if(c())return!0;a.inputState.keyBuffer.push(n);var e=a.inputState.keyBuffer.join(``),t=n.length==1,i=ye.matchCommand(e,r,a.inputState,`insert`),s=a.inputState.changeQueue;if(i.type==`none`)return I(o),!1;if(i.type==`partial`){if(i.expectLiteralNext&&(a.expectLiteralNext=!0),ie&&window.clearTimeout(ie),ie=t&&window.setTimeout(function(){a.insertMode&&a.inputState.keyBuffer.length&&I(o)},k(`insertModeEscKeysTimeout`)),t){var l=o.listSelections();(!s||s.removed.length!=l.length)&&(s=a.inputState.changeQueue=new he),s.inserted+=n;for(var u=0;u<l.length;u++){var d=G(l[u].anchor,l[u].head),f=K(l[u].anchor,l[u].head),p=o.getRange(d,o.state.overwrite?V(f,0,1):f);s.removed[u]=(s.removed[u]||``)+p}}return!t}if(i.type==`full`&&(a.inputState.keyBuffer.length=0),a.expectLiteralNext=!1,ie&&window.clearTimeout(ie),i.command&&s){for(var l=o.listSelections(),u=0;u<l.length;u++){var m=l[u].head;o.replaceRange(s.removed[u]||``,V(m,0,-s.inserted.length),m,`+input`)}M.macroModeState.lastInsertModeChanges.changes.pop()}return i.command||I(o),i.command}function u(){if(s()||c())return!0;a.inputState.keyBuffer.push(n);var e=a.inputState.keyBuffer.join(``);if(/^[1-9]\d*$/.test(e))return!0;var t=/^(\d*)(.*)$/.exec(e);if(!t)return I(o),!1;var i=a.visualMode?`visual`:`normal`,l=t[2]||t[1];a.inputState.operatorShortcut&&a.inputState.operatorShortcut.slice(-1)==l&&(l=a.inputState.operatorShortcut);var u=ye.matchCommand(l,r,a.inputState,i);return u.type==`none`?(I(o),!1):u.type==`partial`?(u.expectLiteralNext&&(a.expectLiteralNext=!0),!0):u.type==`clear`?(I(o),!0):(a.expectLiteralNext=!1,a.inputState.keyBuffer.length=0,t=/^(\d*)(.*)$/.exec(e),t&&t[1]&&t[1]!=`0`&&a.inputState.pushRepeatDigit(t[1]),u.command)}var d=a.insertMode?l():u();if(d===!1)return!a.insertMode&&(n.length===1||e.isMac&&/<A-.>/.test(n))?function(){return!0}:void 0;if(d===!0)return function(){return!0};if(d)return function(){return o.operation(function(){o.curOp.isVimOp=!0;try{if(typeof d!=`object`)return;d.type==`keyToKey`?F(o,d.toKeys,d):ye.processCommand(o,a,d)}catch(e){throw o.state.vim=void 0,j(o),N.suppressErrorLogging,e}return!0})}},handleEx:function(e,t){$.processCommand(e,t)},defineMotion:be,defineAction:Te,defineOperator:Ce,mapCommand:Ht,_mapCommand:zt,defineRegister:ge,exitVisualMode:J,exitInsertMode:Rt},ae=[],oe=!1,P;function se(e){if(!P)throw Error(`No prompt to send key to`);if(e[0]==`<`){var t=e.toLowerCase().slice(1,-1);if(t=t.split(`-`).pop()||``,t==`lt`)e=`<`;else if(t==`space`)e=` `;else if(t==`cr`)e=`
1
+ import{$ as e,H as t,N as n,U as r,V as i,W as a,ct as o,dt as s,ft as c,ht as l,j as u,mt as d,p as f,pt as p,q as m,tt as h,x as g,y as _}from"./vendor-codemirror-autocomplete-C0FrlFqZ.js";import{c as v,f as y,i as b,l as x,m as S,n as C,p as w,r as T,t as E,u as D}from"./vendor-codemirror-commands-5saeUOVY.js";import{n as O,t as k,u as ee}from"./vendor-codemirror-search-hZY-L2l8.js";function te(e){var t=e.Pos;function n(e,t,n){if(t.line===n.line&&t.ch>=n.ch-1){var r=e.getLine(t.line).charCodeAt(t.ch);55296<=r&&r<=55551&&(n.ch+=1)}return{start:t,end:n}}var r=[{keys:`<Left>`,type:`keyToKey`,toKeys:`h`},{keys:`<Right>`,type:`keyToKey`,toKeys:`l`},{keys:`<Up>`,type:`keyToKey`,toKeys:`k`},{keys:`<Down>`,type:`keyToKey`,toKeys:`j`},{keys:`g<Up>`,type:`keyToKey`,toKeys:`gk`},{keys:`g<Down>`,type:`keyToKey`,toKeys:`gj`},{keys:`<Space>`,type:`keyToKey`,toKeys:`l`},{keys:`<BS>`,type:`keyToKey`,toKeys:`h`},{keys:`<Del>`,type:`keyToKey`,toKeys:`x`},{keys:`<C-Space>`,type:`keyToKey`,toKeys:`W`},{keys:`<C-BS>`,type:`keyToKey`,toKeys:`B`},{keys:`<S-Space>`,type:`keyToKey`,toKeys:`w`},{keys:`<S-BS>`,type:`keyToKey`,toKeys:`b`},{keys:`<C-n>`,type:`keyToKey`,toKeys:`j`},{keys:`<C-p>`,type:`keyToKey`,toKeys:`k`},{keys:`<C-[>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-c>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-[>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`<C-c>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`<C-Esc>`,type:`keyToKey`,toKeys:`<Esc>`},{keys:`<C-Esc>`,type:`keyToKey`,toKeys:`<Esc>`,context:`insert`},{keys:`s`,type:`keyToKey`,toKeys:`cl`,context:`normal`},{keys:`s`,type:`keyToKey`,toKeys:`c`,context:`visual`},{keys:`S`,type:`keyToKey`,toKeys:`cc`,context:`normal`},{keys:`S`,type:`keyToKey`,toKeys:`VdO`,context:`visual`},{keys:`<Home>`,type:`keyToKey`,toKeys:`0`},{keys:`<End>`,type:`keyToKey`,toKeys:`$`},{keys:`<PageUp>`,type:`keyToKey`,toKeys:`<C-b>`},{keys:`<PageDown>`,type:`keyToKey`,toKeys:`<C-f>`},{keys:`<CR>`,type:`keyToKey`,toKeys:`j^`,context:`normal`},{keys:`<Ins>`,type:`keyToKey`,toKeys:`i`,context:`normal`},{keys:`<Ins>`,type:`action`,action:`toggleOverwrite`,context:`insert`},{keys:`H`,type:`motion`,motion:`moveToTopLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`M`,type:`motion`,motion:`moveToMiddleLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`L`,type:`motion`,motion:`moveToBottomLine`,motionArgs:{linewise:!0,toJumplist:!0}},{keys:`h`,type:`motion`,motion:`moveByCharacters`,motionArgs:{forward:!1}},{keys:`l`,type:`motion`,motion:`moveByCharacters`,motionArgs:{forward:!0}},{keys:`j`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,linewise:!0}},{keys:`k`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!1,linewise:!0}},{keys:`gj`,type:`motion`,motion:`moveByDisplayLines`,motionArgs:{forward:!0}},{keys:`gk`,type:`motion`,motion:`moveByDisplayLines`,motionArgs:{forward:!1}},{keys:`w`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!1}},{keys:`W`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:`e`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:`E`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:`b`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1}},{keys:`B`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:`ge`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:`gE`,type:`motion`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:`{`,type:`motion`,motion:`moveByParagraph`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`}`,type:`motion`,motion:`moveByParagraph`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`(`,type:`motion`,motion:`moveBySentence`,motionArgs:{forward:!1}},{keys:`)`,type:`motion`,motion:`moveBySentence`,motionArgs:{forward:!0}},{keys:`<C-f>`,type:`motion`,motion:`moveByPage`,motionArgs:{forward:!0}},{keys:`<C-b>`,type:`motion`,motion:`moveByPage`,motionArgs:{forward:!1}},{keys:`<C-d>`,type:`motion`,motion:`moveByScroll`,motionArgs:{forward:!0,explicitRepeat:!0}},{keys:`<C-u>`,type:`motion`,motion:`moveByScroll`,motionArgs:{forward:!1,explicitRepeat:!0}},{keys:`gg`,type:`motion`,motion:`moveToLineOrEdgeOfDocument`,motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:`G`,type:`motion`,motion:`moveToLineOrEdgeOfDocument`,motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:`g$`,type:`motion`,motion:`moveToEndOfDisplayLine`},{keys:`g^`,type:`motion`,motion:`moveToStartOfDisplayLine`},{keys:`g0`,type:`motion`,motion:`moveToStartOfDisplayLine`},{keys:`0`,type:`motion`,motion:`moveToStartOfLine`},{keys:`^`,type:`motion`,motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`+`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,toFirstChar:!0}},{keys:`-`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!1,toFirstChar:!0}},{keys:`_`,type:`motion`,motion:`moveByLines`,motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:`$`,type:`motion`,motion:`moveToEol`,motionArgs:{inclusive:!0}},{keys:`%`,type:`motion`,motion:`moveToMatchedSymbol`,motionArgs:{inclusive:!0,toJumplist:!0}},{keys:`f<character>`,type:`motion`,motion:`moveToCharacter`,motionArgs:{forward:!0,inclusive:!0}},{keys:`F<character>`,type:`motion`,motion:`moveToCharacter`,motionArgs:{forward:!1}},{keys:`t<character>`,type:`motion`,motion:`moveTillCharacter`,motionArgs:{forward:!0,inclusive:!0}},{keys:`T<character>`,type:`motion`,motion:`moveTillCharacter`,motionArgs:{forward:!1}},{keys:`;`,type:`motion`,motion:`repeatLastCharacterSearch`,motionArgs:{forward:!0}},{keys:`,`,type:`motion`,motion:`repeatLastCharacterSearch`,motionArgs:{forward:!1}},{keys:`'<register>`,type:`motion`,motion:`goToMark`,motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:`motion`,motion:`goToMark`,motionArgs:{toJumplist:!0}},{keys:"]`",type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!0}},{keys:"[`",type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!1}},{keys:`]'`,type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!0,linewise:!0}},{keys:`['`,type:`motion`,motion:`jumpToMark`,motionArgs:{forward:!1,linewise:!0}},{keys:`]p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:`[p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:`]<character>`,type:`motion`,motion:`moveToSymbol`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`[<character>`,type:`motion`,motion:`moveToSymbol`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`|`,type:`motion`,motion:`moveToColumn`},{keys:`o`,type:`motion`,motion:`moveToOtherHighlightedEnd`,context:`visual`},{keys:`O`,type:`motion`,motion:`moveToOtherHighlightedEnd`,motionArgs:{sameLine:!0},context:`visual`},{keys:`d`,type:`operator`,operator:`delete`},{keys:`y`,type:`operator`,operator:`yank`},{keys:`c`,type:`operator`,operator:`change`},{keys:`=`,type:`operator`,operator:`indentAuto`},{keys:`>`,type:`operator`,operator:`indent`,operatorArgs:{indentRight:!0}},{keys:`<`,type:`operator`,operator:`indent`,operatorArgs:{indentRight:!1}},{keys:`g~`,type:`operator`,operator:`changeCase`},{keys:`gu`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!0},isEdit:!0},{keys:`gU`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!1},isEdit:!0},{keys:`n`,type:`motion`,motion:`findNext`,motionArgs:{forward:!0,toJumplist:!0}},{keys:`N`,type:`motion`,motion:`findNext`,motionArgs:{forward:!1,toJumplist:!0}},{keys:`gn`,type:`motion`,motion:`findAndSelectNextInclusive`,motionArgs:{forward:!0}},{keys:`gN`,type:`motion`,motion:`findAndSelectNextInclusive`,motionArgs:{forward:!1}},{keys:`gq`,type:`operator`,operator:`hardWrap`},{keys:`gw`,type:`operator`,operator:`hardWrap`,operatorArgs:{keepCursor:!0}},{keys:`g?`,type:`operator`,operator:`rot13`},{keys:`x`,type:`operatorMotion`,operator:`delete`,motion:`moveByCharacters`,motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:`X`,type:`operatorMotion`,operator:`delete`,motion:`moveByCharacters`,motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:`D`,type:`operatorMotion`,operator:`delete`,motion:`moveToEol`,motionArgs:{inclusive:!0},context:`normal`},{keys:`D`,type:`operator`,operator:`delete`,operatorArgs:{linewise:!0},context:`visual`},{keys:`Y`,type:`operatorMotion`,operator:`yank`,motion:`expandToLine`,motionArgs:{linewise:!0},context:`normal`},{keys:`Y`,type:`operator`,operator:`yank`,operatorArgs:{linewise:!0},context:`visual`},{keys:`C`,type:`operatorMotion`,operator:`change`,motion:`moveToEol`,motionArgs:{inclusive:!0},context:`normal`},{keys:`C`,type:`operator`,operator:`change`,operatorArgs:{linewise:!0},context:`visual`},{keys:`~`,type:`operatorMotion`,operator:`changeCase`,motion:`moveByCharacters`,motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:`normal`},{keys:`~`,type:`operator`,operator:`changeCase`,context:`visual`},{keys:`<C-u>`,type:`operatorMotion`,operator:`delete`,motion:`moveToStartOfLine`,context:`insert`},{keys:`<C-w>`,type:`operatorMotion`,operator:`delete`,motion:`moveByWords`,motionArgs:{forward:!1,wordEnd:!1},context:`insert`},{keys:`<C-w>`,type:`idle`,context:`normal`},{keys:`<C-i>`,type:`action`,action:`jumpListWalk`,actionArgs:{forward:!0}},{keys:`<C-o>`,type:`action`,action:`jumpListWalk`,actionArgs:{forward:!1}},{keys:`<C-e>`,type:`action`,action:`scroll`,actionArgs:{forward:!0,linewise:!0}},{keys:`<C-y>`,type:`action`,action:`scroll`,actionArgs:{forward:!1,linewise:!0}},{keys:`a`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`charAfter`},context:`normal`},{keys:`A`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`eol`},context:`normal`},{keys:`A`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`endOfSelectedArea`},context:`visual`},{keys:`i`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`inplace`},context:`normal`},{keys:`gi`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`lastEdit`},context:`normal`},{keys:`I`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`firstNonBlank`},context:`normal`},{keys:`gI`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`bol`},context:`normal`},{keys:`I`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{insertAt:`startOfSelectedArea`},context:`visual`},{keys:`o`,type:`action`,action:`newLineAndEnterInsertMode`,isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:`normal`},{keys:`O`,type:`action`,action:`newLineAndEnterInsertMode`,isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:`normal`},{keys:`v`,type:`action`,action:`toggleVisualMode`},{keys:`V`,type:`action`,action:`toggleVisualMode`,actionArgs:{linewise:!0}},{keys:`<C-v>`,type:`action`,action:`toggleVisualMode`,actionArgs:{blockwise:!0}},{keys:`<C-q>`,type:`action`,action:`toggleVisualMode`,actionArgs:{blockwise:!0}},{keys:`gv`,type:`action`,action:`reselectLastSelection`},{keys:`J`,type:`action`,action:`joinLines`,isEdit:!0},{keys:`gJ`,type:`action`,action:`joinLines`,actionArgs:{keepSpaces:!0},isEdit:!0},{keys:`p`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:`P`,type:`action`,action:`paste`,isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:`r<character>`,type:`action`,action:`replace`,isEdit:!0},{keys:`@<register>`,type:`action`,action:`replayMacro`},{keys:`q<register>`,type:`action`,action:`enterMacroRecordMode`},{keys:`R`,type:`action`,action:`enterInsertMode`,isEdit:!0,actionArgs:{replace:!0},context:`normal`},{keys:`R`,type:`operator`,operator:`change`,operatorArgs:{linewise:!0,fullLine:!0},context:`visual`,exitVisualBlock:!0},{keys:`u`,type:`action`,action:`undo`,context:`normal`},{keys:`u`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!0},context:`visual`,isEdit:!0},{keys:`U`,type:`operator`,operator:`changeCase`,operatorArgs:{toLower:!1},context:`visual`,isEdit:!0},{keys:`<C-r>`,type:`action`,action:`redo`},{keys:`m<register>`,type:`action`,action:`setMark`},{keys:`"<register>`,type:`action`,action:`setRegister`},{keys:`<C-r><register>`,type:`action`,action:`insertRegister`,context:`insert`,isEdit:!0},{keys:`<C-o>`,type:`action`,action:`oneNormalCommand`,context:`insert`},{keys:`zz`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`center`}},{keys:`z.`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`center`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`zt`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`top`}},{keys:`z<CR>`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`top`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`zb`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`bottom`}},{keys:`z-`,type:`action`,action:`scrollToCursor`,actionArgs:{position:`bottom`},motion:`moveToFirstNonWhiteSpaceCharacter`},{keys:`.`,type:`action`,action:`repeatLastEdit`},{keys:`<C-a>`,type:`action`,action:`incrementNumberToken`,isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:`<C-x>`,type:`action`,action:`incrementNumberToken`,isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:`<C-t>`,type:`action`,action:`indent`,actionArgs:{indentRight:!0},context:`insert`},{keys:`<C-d>`,type:`action`,action:`indent`,actionArgs:{indentRight:!1},context:`insert`},{keys:`a<register>`,type:`motion`,motion:`textObjectManipulation`},{keys:`i<register>`,type:`motion`,motion:`textObjectManipulation`,motionArgs:{textObjectInner:!0}},{keys:`/`,type:`search`,searchArgs:{forward:!0,querySrc:`prompt`,toJumplist:!0}},{keys:`?`,type:`search`,searchArgs:{forward:!1,querySrc:`prompt`,toJumplist:!0}},{keys:`*`,type:`search`,searchArgs:{forward:!0,querySrc:`wordUnderCursor`,wholeWordOnly:!0,toJumplist:!0}},{keys:`#`,type:`search`,searchArgs:{forward:!1,querySrc:`wordUnderCursor`,wholeWordOnly:!0,toJumplist:!0}},{keys:`g*`,type:`search`,searchArgs:{forward:!0,querySrc:`wordUnderCursor`,toJumplist:!0}},{keys:`g#`,type:`search`,searchArgs:{forward:!1,querySrc:`wordUnderCursor`,toJumplist:!0}},{keys:`:`,type:`ex`}],i=Object.create(null),a=r.length,o=[{name:`colorscheme`,shortName:`colo`},{name:`map`},{name:`imap`,shortName:`im`},{name:`nmap`,shortName:`nm`},{name:`vmap`,shortName:`vm`},{name:`omap`,shortName:`om`},{name:`noremap`,shortName:`no`},{name:`nnoremap`,shortName:`nn`},{name:`vnoremap`,shortName:`vn`},{name:`inoremap`,shortName:`ino`},{name:`onoremap`,shortName:`ono`},{name:`unmap`},{name:`mapclear`,shortName:`mapc`},{name:`nmapclear`,shortName:`nmapc`},{name:`vmapclear`,shortName:`vmapc`},{name:`imapclear`,shortName:`imapc`},{name:`omapclear`,shortName:`omapc`},{name:`write`,shortName:`w`},{name:`undo`,shortName:`u`},{name:`redo`,shortName:`red`},{name:`set`,shortName:`se`},{name:`setlocal`,shortName:`setl`},{name:`setglobal`,shortName:`setg`},{name:`sort`,shortName:`sor`},{name:`substitute`,shortName:`s`,possiblyAsync:!0},{name:`startinsert`,shortName:`start`},{name:`nohlsearch`,shortName:`noh`},{name:`yank`,shortName:`y`},{name:`delmarks`,shortName:`delm`},{name:`marks`,excludeFromCommandHistory:!0},{name:`registers`,shortName:`reg`,excludeFromCommandHistory:!0},{name:`vglobal`,shortName:`v`},{name:`delete`,shortName:`d`},{name:`join`,shortName:`j`},{name:`normal`,shortName:`norm`},{name:`global`,shortName:`g`}],s=pe(``);function c(t){t.setOption(`disableInput`,!0),t.setOption(`showCursorWhenSelecting`,!1),e.signal(t,`vim-mode-change`,{mode:`normal`}),t.on(`cursorActivity`,Jt),j(t),e.on(t.getInputField(),`paste`,u(t))}function l(t){t.setOption(`disableInput`,!1),t.off(`cursorActivity`,Jt),e.off(t.getInputField(),`paste`,u(t)),t.state.vim=null,Et&&clearTimeout(Et)}function u(e){var t=e.state.vim;return t.onPasteFn||=function(){t.insertMode||(e.setCursor(V(e.getCursor(),0,1)),we.enterInsertMode(e,{},t))},t.onPasteFn}var d=/[\d]/,f=[e.isWordChar,function(t){return t&&!e.isWordChar(t)&&!/\s/.test(t)}],p=[function(e){return/\S/.test(e)}],m=[`<`,`>`],h=[`-`,`"`,`.`,`:`,`_`,`/`,`+`],g=/^\w$/,_=/^[A-Z]$/;try{_=RegExp(`^[\\p{Lu}]$`,`u`)}catch{}function v(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function y(e){return/^[a-z]$/.test(e)}function b(e){return`()[]{}`.indexOf(e)!=-1}function x(e){return d.test(e)}function S(e){return _.test(e)}function C(e){return/^\s*$/.test(e)}function w(e){return`.?!`.indexOf(e)!=-1}function T(e,t){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}var E={};function D(e,t,n,r,i){if(t===void 0&&!i)throw Error(`defaultValue is required unless callback is provided`);if(n||=`string`,E[e]={type:n,defaultValue:t,callback:i},r)for(var a=0;a<r.length;a++)E[r[a]]=E[e];t&&O(e,t)}function O(e,t,n,r){var i=E[e];r||={};var a=r.scope;if(!i)return Error(`Unknown option: `+e);if(i.type==`boolean`){if(t&&t!==!0)return Error(`Invalid argument: `+e+`=`+t);t!==!1&&(t=!0)}i.callback?(a!==`local`&&i.callback(t,void 0),a!==`global`&&n&&i.callback(t,n)):(a!==`local`&&(i.value=i.type==`boolean`?!!t:t),a!==`global`&&n&&(n.state.vim.options[e]={value:t}))}function k(e,t,n){var r=E[e];n||={};var i=n.scope;if(!r)return Error(`Unknown option: `+e);if(r.callback){let e=t&&r.callback(void 0,t);return i!==`global`&&e!==void 0?e:i===`local`?void 0:r.callback()}return(i!==`global`&&t&&t.state.vim.options[e]||i!==`local`&&r||{}).value}D(`filetype`,void 0,`string`,[`ft`],function(e,t){if(t!==void 0){if(e===void 0){let e=t.getOption(`mode`);return e==`null`?``:e}{let n=e==``?`null`:e;t.setOption(`mode`,n)}}}),D(`textwidth`,80,`number`,[`tw`],function(e,t){if(t!==void 0){if(e===void 0)return t.getOption(`textwidth`);var n=Math.round(e);n>1&&t.setOption(`textwidth`,n)}});var ee=function(){var e=100,t=-1,n=0,r=0,i=Array(e);function a(a,o,s){var c=i[t%e];function l(n){var r=++t%e,o=i[r];o&&o.clear(),i[r]=a.setBookmark(n)}if(c){var u=c.find();u&&!U(u,o)&&l(o)}else l(o);l(s),n=t,r=t-e+1,r<0&&(r=0)}function o(a,o){t+=o,t>n?t=n:t<r&&(t=r);var s=i[(e+t)%e];if(s&&!s.find()){var c=o>0?1:-1,l,u=a.getCursor();do if(t+=c,s=i[(e+t)%e],s&&(l=s.find())&&!U(u,l))break;while(t<n&&t>r)}return s}function s(e,n){var r=t,i=o(e,n);return t=r,i&&i.find()}return{cachedCursor:void 0,add:a,find:s,move:o}},te=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class A{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=te()}exitMacroRecordMode(){var e=M.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1}enterMacroRecordMode(e,t){var n=M.registerController.getRegister(t);if(n){if(n.clear(),this.latestRegister=t,e.openDialog){var r=Z(`span`,{class:`cm-vim-message`},`recording @`+t);this.onRecordingDone=e.openDialog(r,function(){},{bottom:!0})}this.isRecording=!0}}}function j(e){return e.state.vim||(e.state.vim={inputState:new me,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new t(0,0),head:new t(0,0)},options:{},expectLiteralNext:!1,status:``}),e.state.vim}var M;function ne(){for(var e in M={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:ee(),macroModeState:new A,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:``},registerController:new _e({}),searchHistoryController:new ve,exCommandHistoryController:new ve},E){var t=E[e];t.value=t.defaultValue}}class re{constructor(e,t){this.keyName=e,this.key=t.key,this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.shiftKey=t.shiftKey}}var ie,N={enterVimMode:c,leaveVimMode:l,buildKeyMap:function(){},getRegisterController:function(){return M.registerController},resetVimGlobalState_:ne,getVimGlobalState_:function(){return M},maybeInitVimState_:j,suppressErrorLogging:!1,InsertModeKey:re,map:function(e,t,n){$.map(e,t,n)},unmap:function(e,t){return $.unmap(e,t)},noremap:function(e,t,n){$.map(e,t,n,!0)},mapclear:function(e){var t=r.length,n=a,i=r.slice(0,t-n);if(r=r.slice(t-n),e)for(var o=i.length-1;o>=0;o--){var s=i[o];if(e!==s.context)if(s.context)this._mapCommand(s);else{var c=[`normal`,`insert`,`visual`];for(var l in c)if(c[l]!==e){var u=Object.assign({},s);u.context=c[l],this._mapCommand(u)}}}},langmap:fe,vimKeyFromEvent:de,setOption:O,getOption:k,defineOption:D,defineEx:function(e,t,n){if(!t)t=e;else if(e.indexOf(t)!==0)throw Error(`(Vim.defineEx) "`+t+`" is not a prefix of "`+e+`", command not registered`);It[e]=n,$.commandMap_[t]={name:e,shortName:t,type:`api`}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if(typeof r==`function`)return r()},multiSelectHandleKey:tn,findKey:function(t,n,i){var a=j(t),o=t;function s(){var e=M.macroModeState;if(e.isRecording){if(n==`q`)return e.exitMacroRecordMode(),I(o),!0;i!=`mapping`&&Wt(e,n)}}function c(){if(n==`<Esc>`){if(a.visualMode)J(o);else if(a.insertMode)Rt(o);else return;return I(o),!0}}function l(){if(c())return!0;a.inputState.keyBuffer.push(n);var e=a.inputState.keyBuffer.join(``),t=n.length==1,i=ye.matchCommand(e,r,a.inputState,`insert`),s=a.inputState.changeQueue;if(i.type==`none`)return I(o),!1;if(i.type==`partial`){if(i.expectLiteralNext&&(a.expectLiteralNext=!0),ie&&window.clearTimeout(ie),ie=t&&window.setTimeout(function(){a.insertMode&&a.inputState.keyBuffer.length&&I(o)},k(`insertModeEscKeysTimeout`)),t){var l=o.listSelections();(!s||s.removed.length!=l.length)&&(s=a.inputState.changeQueue=new he),s.inserted+=n;for(var u=0;u<l.length;u++){var d=G(l[u].anchor,l[u].head),f=K(l[u].anchor,l[u].head),p=o.getRange(d,o.state.overwrite?V(f,0,1):f);s.removed[u]=(s.removed[u]||``)+p}}return!t}if(i.type==`full`&&(a.inputState.keyBuffer.length=0),a.expectLiteralNext=!1,ie&&window.clearTimeout(ie),i.command&&s){for(var l=o.listSelections(),u=0;u<l.length;u++){var m=l[u].head;o.replaceRange(s.removed[u]||``,V(m,0,-s.inserted.length),m,`+input`)}M.macroModeState.lastInsertModeChanges.changes.pop()}return i.command||I(o),i.command}function u(){if(s()||c())return!0;a.inputState.keyBuffer.push(n);var e=a.inputState.keyBuffer.join(``);if(/^[1-9]\d*$/.test(e))return!0;var t=/^(\d*)(.*)$/.exec(e);if(!t)return I(o),!1;var i=a.visualMode?`visual`:`normal`,l=t[2]||t[1];a.inputState.operatorShortcut&&a.inputState.operatorShortcut.slice(-1)==l&&(l=a.inputState.operatorShortcut);var u=ye.matchCommand(l,r,a.inputState,i);return u.type==`none`?(I(o),!1):u.type==`partial`?(u.expectLiteralNext&&(a.expectLiteralNext=!0),!0):u.type==`clear`?(I(o),!0):(a.expectLiteralNext=!1,a.inputState.keyBuffer.length=0,t=/^(\d*)(.*)$/.exec(e),t&&t[1]&&t[1]!=`0`&&a.inputState.pushRepeatDigit(t[1]),u.command)}var d=a.insertMode?l():u();if(d===!1)return!a.insertMode&&(n.length===1||e.isMac&&/<A-.>/.test(n))?function(){return!0}:void 0;if(d===!0)return function(){return!0};if(d)return function(){return o.operation(function(){o.curOp.isVimOp=!0;try{if(typeof d!=`object`)return;d.type==`keyToKey`?F(o,d.toKeys,d):ye.processCommand(o,a,d)}catch(e){throw o.state.vim=void 0,j(o),N.suppressErrorLogging,e}return!0})}},handleEx:function(e,t){$.processCommand(e,t)},defineMotion:be,defineAction:Te,defineOperator:Ce,mapCommand:Ht,_mapCommand:zt,defineRegister:ge,exitVisualMode:J,exitInsertMode:Rt},ae=[],oe=!1,P;function se(e){if(!P)throw Error(`No prompt to send key to`);if(e[0]==`<`){var t=e.toLowerCase().slice(1,-1);if(t=t.split(`-`).pop()||``,t==`lt`)e=`<`;else if(t==`space`)e=` `;else if(t==`cr`)e=`
2
2
  `;else if(ue[t]){var n=P.value||``,r={key:ue[t],target:{value:n,selectionEnd:n.length,selectionStart:n.length}};P.onKeyDown&&P.onKeyDown(r,P.value,a),P&&P.onKeyUp&&P.onKeyUp(r,P.value,a);return}}if(e==`
3
3
  `){var i=P;P=null,i.onClose&&i.onClose(i.value)}else P.value=(P.value||``)+e;function a(e){P&&(typeof e==`string`?P.value=e:P=null)}}function F(e,t,n){var r=oe;if(n){if(ae.indexOf(n)!=-1)return;ae.push(n),oe=n.noremap!=0}try{for(var i=j(e),a=/<(?:[CSMA]-)*\w+>|./gi,o;o=a.exec(t);){var s=o[0],c=i.insertMode;if(P){se(s);continue}if(!N.handleKey(e,s,`mapping`)&&c&&i.insertMode){if(s[0]==`<`){var l=s.toLowerCase().slice(1,-1);if(l=l.split(`-`).pop()||``,l==`lt`)s=`<`;else if(l==`space`)s=` `;else if(l==`cr`)s=`
4
4
  `;else if(ue.hasOwnProperty(l)){s=ue[l],Qt(e,s);continue}else s=s[0],a.lastIndex=o.index+1}e.replaceSelection(s)}}}finally{if(ae.pop(),oe=ae.length?r:!1,!ae.length&&P){var u=P;P=null,St(e,u)}}}var ce={Return:`CR`,Backspace:`BS`,Delete:`Del`,Escape:`Esc`,Insert:`Ins`,ArrowLeft:`Left`,ArrowRight:`Right`,ArrowUp:`Up`,ArrowDown:`Down`,Enter:`CR`," ":`Space`},le={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},ue={};`Left|Right|Up|Down|End|Home`.split(`|`).concat(Object.keys(ce)).forEach(function(e){ue[(ce[e]||``).toLowerCase()]=ue[e.toLowerCase()]=e});function de(t,n){var r=t.key;if(!le[r]){r.length>1&&r[0]==`n`&&(r=r.replace(`Numpad`,``)),r=ce[r]||r;var a=``;if(t.ctrlKey&&(a+=`C-`),t.altKey&&(a+=`A-`),t.metaKey&&(a+=`M-`),e.isMac&&a==`A-`&&r.length==1&&(a=a.slice(2)),(a||r.length>1)&&t.shiftKey&&(a+=`S-`),n&&!n.expectLiteralNext&&r.length==1){if(s.keymap&&r in s.keymap)(s.remapCtrl!=0||!a)&&(r=s.keymap[r]);else if(r.charCodeAt(0)>128&&!i[r]){var o=t.code?.slice(-1)||``;t.shiftKey||(o=o.toLowerCase()),o&&(r=o,!a&&t.altKey&&(a=`A-`))}}return a+=r,a.length>1&&(a=`<`+a+`>`),a}}function fe(e,t){s.string!==e&&(s=pe(e)),s.remapCtrl=t}function pe(e){let t={};if(!e)return{keymap:t,string:``};function n(e){return e.split(/\\?(.)/).filter(Boolean)}return e.split(/((?:[^\\,]|\\.)+),/).map(e=>{if(!e)return;let r=e.split(/((?:[^\\;]|\\.)+);/);if(r.length==3){let e=n(r[1]),i=n(r[2]);if(e.length!==i.length)return;for(let n=0;n<e.length;++n)t[e[n]]=i[n]}else if(r.length==1){let r=n(e);if(r.length%2!=0)return;for(let e=0;e<r.length;e+=2)t[r[e]]=r[e+1]}}),{keymap:t,string:e}}D(`langmap`,void 0,`string`,[`lmap`],function(e,t){if(e===void 0)return s.string;fe(e)});class me{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)}getRepeat(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(``),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(``),10))),e}}function I(t,n){t.state.vim.inputState=new me,t.state.vim.expectLiteralNext=!1,e.signal(t,`vim-command-done`,n)}function he(){this.removed=[],this.inserted=``}class L{constructor(e,t,n){this.clear(),this.keyBuffer=[e||``],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!n}setText(e,t,n){this.keyBuffer=[e||``],this.linewise=!!t,this.blockwise=!!n}pushText(e,t){t&&(this.linewise||this.keyBuffer.push(`
@@ -31,9 +31,9 @@ mark line col
31
31
  `),g=s==`decimal`?/(-?)([\d]+)/:s==`hex`?/(-?)(?:0x)?([0-9a-f]+)/i:s==`octal`?/([0-7]+)/:null,_=s==`decimal`?10:s==`hex`?16:s==`octal`?8:void 0,v=[],y=[];if(s||c)for(var b=0;b<h.length;b++){var x=c?h[b].match(c):null;x&&x[0]!=``?v.push(x):g&&g.exec(h[b])?v.push(h[b]):y.push(h[b])}else y=h;function S(e,t){if(i){var n=e;e=t,t=n}a&&(e=e.toLowerCase(),t=t.toLowerCase());var r=g&&g.exec(e),o=g&&g.exec(t);return!r||!o?e<t?-1:1:parseInt((r[1]+r[2]).toLowerCase(),_)-parseInt((o[1]+o[2]).toLowerCase(),_)}function C(e,t){if(i){var n=e;e=t,t=n}return a&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}if(v.sort(c?C:S),c)for(var b=0;b<v.length;b++)v[b]=v[b].input;else s||y.sort(S);if(h=i?v.concat(y):y.concat(v),o){var w=h,T;h=[];for(var b=0;b<w.length;b++)w[b]!=T&&h.push(w[b]),T=w[b]}n.replaceRange(h.join(`
32
32
  `),p,m)},vglobal:function(e,t){this.global(e,t)},normal:function(e,t){var n=!1,r=t.argString;if(r&&r[0]==`!`&&(r=r.slice(1),n=!0),r=r.trimStart(),!r){Q(e,`Argument is required.`);return}var i=t.line;if(typeof i==`number`)for(var a=isNaN(t.lineEnd)?i:t.lineEnd,o=i;o<=a;o++)e.setCursor(o,0),F(e,t.argString.trimStart(),{noremap:n}),e.state.vim.insertMode&&Rt(e,!0);else F(e,t.argString.trimStart(),{noremap:n}),e.state.vim.insertMode&&Rt(e,!0)},global:function(e,t){var n=t.argString;if(!n){Q(e,`Regular Expression missing from global`);return}var r=t.commandName[0]===`v`;n[0]===`!`&&t.commandName[0]===`g`&&(r=!0,n=n.slice(1));var i=t.line===void 0?e.firstLine():t.line,a=t.lineEnd||t.line||e.lastLine(),o=dt(n),s=n,c=``;if(o&&o.length&&(s=o[0],c=o.slice(1,o.length).join(`/`)),s)try{wt(e,s,!0,!0)}catch{Q(e,`Invalid regex: `+s);return}for(var l=X(e).getQuery(),u=[],d=i;d<=a;d++){var f=e.getLine(d);l.test(f)!==r&&u.push(c?e.getLineHandle(d):f)}if(!c){Q(e,u.join(`
33
33
  `));return}var p=0,m=function(){if(p<u.length){var t=u[p++],n=e.getLineNumber(t);if(n==null){m();return}var r=n+1+c;$.processCommand(e,r,{callback:m})}else e.releaseLineHandles&&e.releaseLineHandles()};m()},substitute:function(e,n){if(!e.getSearchCursor)throw Error(`Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.`);var r=n.argString,i=r?pt(r,r[0]):[],a=``,o=``,s,c,l,u=!1,d=!1;if(i&&i.length)a=i[0],k(`pcre`)&&a!==``&&(a=new RegExp(a).source),o=i[1],o!==void 0&&(o=k(`pcre`)?yt(o.replace(/([^\\])&/g,`$1$$&`)):_t(o),M.lastSubstituteReplacePart=o),s=i[2]?i[2].split(` `):[];else if(r&&r.length){Q(e,`Substitutions should be of the form :s/pattern/replace/`);return}if(s&&(c=s[0],l=parseInt(s[1]),c&&(c.indexOf(`c`)!=-1&&(u=!0),c.indexOf(`g`)!=-1&&(d=!0),a=k(`pcre`)?a+`/`+c:a.replace(/\//g,`\\/`)+`/`+c)),a)try{wt(e,a,!0,!0)}catch{Q(e,`Invalid regex: `+a);return}if(o||=M.lastSubstituteReplacePart,o===void 0){Q(e,`No previous substitute regular expression`);return}var f=X(e).getQuery(),p=n.line===void 0?e.getCursor().line:n.line,m=n.lineEnd||p;p==e.firstLine()&&m==e.lastLine()&&(m=1/0),l&&(p=m,m=p+l-1);var h=z(e,new t(p,0)),g=e.getSearchCursor(f,h);Lt(e,u,d,p,m,g,f,o,n.callback)},startinsert:function(e,t){F(e,t.argString==`!`?`A`:`i`,{})},redo:e.commands.redo,undo:e.commands.undo,write:function(t){e.commands.save?e.commands.save(t):t.save&&t.save()},nohlsearch:function(e){At(e)},yank:function(e){var t=H(e.getCursor()).line,n=e.getLine(t);M.registerController.pushText(`0`,`yank`,n,!0,!0)},delete:function(e,n){var r=n.selectionLine,i=isNaN(n.selectionLineEnd)?r:n.selectionLineEnd;Se.delete(e,{linewise:!0},[{anchor:new t(r,0),head:new t(i+1,0)}])},join:function(e,n){var r=n.selectionLine,i=isNaN(n.selectionLineEnd)?r:n.selectionLineEnd;e.setCursor(new t(r,0)),we.joinLines(e,{repeat:i-r},e.state.vim)},delmarks:function(t,n){if(!n.argString||!je(n.argString)){Q(t,`Argument required`);return}for(var r=t.state.vim,i=new e.StringStream(je(n.argString));!i.eol();){i.eatSpace();var a=i.pos;if(!i.match(/[a-zA-Z]/,!1)){Q(t,`Invalid argument: `+n.argString.substring(a));return}var o=i.next();if(i.match(`-`,!0)){if(!i.match(/[a-zA-Z]/,!1)){Q(t,`Invalid argument: `+n.argString.substring(a));return}var s=o,c=i.next();if(s&&c&&y(s)==y(c)){var l=s.charCodeAt(0),u=c.charCodeAt(0);if(l>=u){Q(t,`Invalid argument: `+n.argString.substring(a));return}for(var d=0;d<=u-l;d++){var f=String.fromCharCode(l+d);delete r.marks[f]}}else{Q(t,`Invalid argument: `+s+`-`);return}}else o&&delete r.marks[o]}}},$=new Ft;N.defineEx(`version`,`ve`,e=>{Q(e,`Codemirror-vim version: 6.3.0`)});function Lt(t,n,r,i,a,o,s,c,l){t.state.vim.exMode=!0;var u=!1,d=0,f,p,m;function h(){t.operation(function(){for(;!u;)g(),v();y()})}function g(){var e=``,n=o.match||o.pos&&o.pos.match;e=n?c.replace(/\$(\d{1,3}|[$&])/g,function(e,t){if(t==`$`)return`$`;if(t==`&`)return n[0];for(var r=t;parseInt(r)>=n.length&&r.length>0;)r=r.slice(0,r.length-1);return r?n[r]+t.slice(r.length,t.length):e}):t.getRange(o.from(),o.to()).replace(s,c);var r=o.to().line;o.replace(e),p=o.to().line,a+=p-r,m=p<r}function _(){var e=f&&H(o.to()),t=o.findNext();return t&&!t[0]&&e&&U(o.from(),e)&&(t=o.findNext()),t&&d++,t}function v(){for(;_()&&jt(o.from(),i,a);)if(!(!r&&o.from().line==p&&!m)){t.scrollIntoView(o.from(),30),t.setSelection(o.from(),o.to()),f=o.from(),u=!1;return}u=!0}function y(e){if(e&&e(),t.focus(),f){t.setCursor(f);var n=t.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=f.ch}l?l():u&&Q(t,(d?`Found `+d+` matches`:`No matches found`)+` for pattern: `+s+(k(`pcre`)?` (set nopcre to use Vim regexps)`:``))}function b(n,r,i){switch(e.e_stop(n),de(n)){case`y`:g(),v();break;case`n`:v();break;case`a`:var a=l;l=void 0,t.operation(h),l=a;break;case`l`:g();case`q`:case`<Esc>`:case`<C-c>`:case`<C-[>`:y(i)}return u&&y(i),!0}if(v(),u){Q(t,`No matches for `+s+(k(`pcre`)?` (set nopcre to use vim regexps)`:``));return}if(!n){h(),l&&l();return}St(t,{prefix:Z(`span`,`replace with `,Z(`strong`,c),` (y/n/a/q/l)`),onKeyDown:b})}function Rt(t,n){var r=t.state.vim,i=M.macroModeState,a=M.registerController.getRegister(`.`),o=i.isPlaying,s=i.lastInsertModeChanges;o||(t.off(`change`,qt),r.insertEnd&&r.insertEnd.clear(),r.insertEnd=void 0,e.off(t.getInputField(),`keydown`,Xt)),!o&&r.insertModeRepeat&&r.insertModeRepeat>1&&(Zt(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,n||t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption(`keyMap`,`vim`),t.setOption(`disableInput`,!0),t.toggleOverwrite(!1),a.setText(s.changes.join(``)),e.signal(t,`vim-mode-change`,{mode:`normal`}),i.isRecording&&Gt(i)}function zt(e){r.unshift(e),e.keys&&Bt(e.keys)}function Bt(e){e.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(e){e&&(i[e]||(i[e]=0),i[e]++)})}function Vt(e){e.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(e){i[e]&&i[e]--})}function Ht(e,t,n,r,i){var a={keys:e,type:t};for(var o in a[t]=n,a[t+`Args`]=r,i)a[o]=i[o];zt(a)}D(`insertModeEscKeysTimeout`,200,`number`);function Ut(e,t,n,r){var i=M.registerController.getRegister(r);if(r==`:`){i.keyBuffer[0]&&$.processCommand(e,i.keyBuffer[0]),n.isPlaying=!1;return}var a=i.keyBuffer,o=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var s=0;s<a.length;s++)for(var c=a[s],l,u,d=/<(?:[CSMA]-)*\w+>|./gi;l=d.exec(c);)if(u=l[0],N.handleKey(e,u,`macro`),t.insertMode){var f=i.insertModeChanges[o++].changes;M.macroModeState.lastInsertModeChanges.changes=f,$t(e,f,1),Rt(e)}n.isPlaying=!1}function Wt(e,t){if(!e.isPlaying){var n=e.latestRegister,r=M.registerController.getRegister(n);r&&r.pushText(t)}}function Gt(e){if(!e.isPlaying){var t=e.latestRegister,n=M.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function Kt(e,t){if(!e.isPlaying){var n=e.latestRegister,r=M.registerController.getRegister(n);r&&r.pushSearchQuery&&r.pushSearchQuery(t)}}function qt(e,t){var n=M.macroModeState,r=n.lastInsertModeChanges;if(!n.isPlaying)for(var i=e.state.vim;t;){if(r.expectCursorActivityForChange=!0,r.ignoreCount>1)r.ignoreCount--;else if(t.origin==`+input`||t.origin==`paste`||t.origin===void 0){var a=e.listSelections().length;a>1&&(r.ignoreCount=a);var o=t.text.join(`
34
- `);if(r.maybeReset&&=(r.changes=[],!1),o)if(e.state.overwrite&&!/\n/.test(o))r.changes.push([o]);else{if(o.length>1){var s=i&&i.insertEnd&&i.insertEnd.find(),c=e.getCursor();if(s&&s.line==c.line){var l=s.ch-c.ch;l>0&&l<o.length&&(r.changes.push([o,l]),o=``)}}o&&r.changes.push(o)}}t=t.next}}function Jt(e){var t=e.state.vim;if(t.insertMode){var n=M.macroModeState;if(n.isPlaying)return;var r=n.lastInsertModeChanges;r.expectCursorActivityForChange?r.expectCursorActivityForChange=!1:(r.maybeReset=!0,t.insertEnd&&t.insertEnd.clear(),t.insertEnd=e.setBookmark(e.getCursor(),{insertLeft:!0}))}else e.curOp?.isVimOp||Yt(e,t)}function Yt(t,n){var r=t.getCursor(`anchor`),i=t.getCursor(`head`);if(n.visualMode&&!t.somethingSelected()?J(t,!1):!n.visualMode&&!n.insertMode&&t.somethingSelected()&&(n.visualMode=!0,n.visualLine=!1,e.signal(t,`vim-mode-change`,{mode:`visual`})),n.visualMode){var a=W(i,r)?0:-1,o=W(i,r)?-1:0;i=V(i,0,a),r=V(r,0,o),n.sel={anchor:r,head:i},rt(t,n,`<`,G(i,r)),rt(t,n,`>`,K(i,r))}else n.insertMode||(n.lastHPos=t.getCursor().ch)}function Xt(t){var n=M.macroModeState.lastInsertModeChanges,r=e.keyName?e.keyName(t):t.key;r&&(r.indexOf(`Delete`)!=-1||r.indexOf(`Backspace`)!=-1)&&(n.maybeReset&&=(n.changes=[],!1),n.changes.push(new re(r,t)))}function Zt(e,t,n,r){var i=M.macroModeState;i.isPlaying=!0;var a=t.lastEditActionCommand,o=t.inputState;function s(){a?ye.processAction(e,t,a):ye.evalInput(e,t)}function c(n){if(i.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var r=i.lastInsertModeChanges;$t(e,r.changes,n)}}if(t.inputState=t.lastEditInputState,a&&a.interlaceInsertRepeat)for(var l=0;l<n;l++)s(),c(1);else r||s(),c(n);t.inputState=o,t.insertMode&&!r&&Rt(e),i.isPlaying=!1}function Qt(t,n){e.lookupKey(n,`vim-insert`,function(n){return typeof n==`string`?e.commands[n](t):n(t),!0})}function $t(e,t,n){var r=e.getCursor(`head`),i=M.macroModeState.lastInsertModeChanges.visualBlock;i&&(Fe(e,r,i+1),n=e.listSelections().length,e.setCursor(r));for(var a=0;a<n;a++){i&&e.setCursor(V(r,a,0));for(var o=0;o<t.length;o++){var s=t[o];if(s instanceof re)Qt(e,s.keyName);else if(typeof s==`string`)e.replaceSelection(s);else{var c=e.getCursor(),l=V(c,0,s[0].length-(s[1]||0));e.replaceRange(s[0],c,s[1]?c:l),e.setCursor(l)}}}i&&e.setCursor(V(r,0,1))}function en(e){var t=new e.constructor;return Object.keys(e).forEach(function(n){if(n!=`insertEnd`){var r=e[n];Array.isArray(r)?r=r.slice():r&&typeof r==`object`&&r.constructor!=Object&&(r=en(r)),t[n]=r}}),e.sel&&(t.sel={head:e.sel.head&&H(e.sel.head),anchor:e.sel.anchor&&H(e.sel.anchor)}),t}function tn(e,t,n){var r=j(e),i=e,a=!1,r=N.maybeInitVimState_(i),o=r.visualBlock||r.wasInVisualBlock;if(i.state.closeVimNotification){var s=i.state.closeVimNotification;if(i.state.closeVimNotification=null,s(),t==`<CR>`)return I(i),!0}var c=i.isInMultiSelectMode();if(r.wasInVisualBlock&&!c?r.wasInVisualBlock=!1:c&&r.visualBlock&&(r.wasInVisualBlock=!0),t==`<Esc>`&&!r.insertMode&&!r.visualMode&&c&&r.status==`<Esc>`)I(i);else if(o||!c||i.inVirtualSelectionMode)a=N.handleKey(i,t,n);else{var l=en(r),u=r.inputState.changeQueueList||[];i.operation(function(){i.curOp&&(i.curOp.isVimOp=!0);var e=0;i.forEachSelection(function(){i.state.vim.inputState.changeQueue=u[e];var r=i.getCursor(`head`),o=i.getCursor(`anchor`),s=W(r,o)?0:-1,c=W(r,o)?-1:0;r=V(r,0,s),o=V(o,0,c),i.state.vim.sel.head=r,i.state.vim.sel.anchor=o,a=N.handleKey(i,t,n),i.virtualSelection&&(u[e]=i.state.vim.inputState.changeQueue,i.state.vim=en(l)),e++}),i.curOp?.cursorActivity&&!a&&(i.curOp.cursorActivity=!1),i.state.vim=r,r.inputState.changeQueueList=u,r.inputState.changeQueue=null},!0)}return a&&!r.visualMode&&!r.insertMode&&r.visualMode!=i.somethingSelected()&&Yt(i,r),a}return ne(),N}function A(e,t){var n=t.ch,r=t.line+1;r<1&&(r=1,n=0),r>e.lines&&(r=e.lines,n=Number.MAX_VALUE);var i=e.line(r);return Math.min(i.from+Math.max(0,n),i.to)}function j(e,t){let n=e.lineAt(t);return{line:n.number-1,ch:t-n.from}}var M=class{constructor(e,t){this.line=e,this.ch=t}};function ne(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{var r=e._handlers||={};r[t]=(r[t]||[]).concat(n)}}function re(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{var r=e._handlers,i=r&&r[t];if(i){var a=i.indexOf(n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function ie(e,t,...n){var r=e._handlers?.[t];if(r)for(var i=0;i<r.length;++i)r[i](...n)}function N(e,...t){if(e)for(var n=0;n<e.length;++n)e[n](...t)}var ae;try{ae=RegExp(`[\\w\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{ae=/[\w]/}function oe(e,t){var n=e.cm6;if(!n.state.readOnly){var r=`input.type.compose`;if(e.curOp&&(e.curOp.lastChange||(r=`input.type.compose.start`)),t.annotations)try{t.annotations.some(function(e){e.value==`input`&&(e.value=r)})}catch(e){console.error(e)}else t.userEvent=r;return n.dispatch(t)}}function P(e,t){e.curOp&&(e.curOp.$changeStart=void 0),(t?S:w)(e.cm6);let n=e.curOp?.$changeStart;n!=null&&e.cm6.dispatch({selection:{anchor:n}})}var se={Left:e=>c(e.cm6,{key:`Left`},`editor`),Right:e=>c(e.cm6,{key:`Right`},`editor`),Up:e=>c(e.cm6,{key:`Up`},`editor`),Down:e=>c(e.cm6,{key:`Down`},`editor`),Backspace:e=>c(e.cm6,{key:`Backspace`},`editor`),Delete:e=>c(e.cm6,{key:`Delete`},`editor`)},F=class e{openDialog(e,t,n){return pe(this,e,t,n)}openNotification(e,t){return ue(this,e,t)}constructor(e){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=e,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(e,t){ne(this,e,t)}off(e,t){re(this,e,t)}signal(e,t,n){ie(this,e,t,n)}indexFromPos(e){return A(this.cm6.state.doc,e)}posFromIndex(e){return j(this.cm6.state.doc,e)}foldCode(e){let t=this.cm6,n=t.state.selection.ranges,r=this.cm6.state.doc,i=A(r,e),a=f.create([f.range(i,i)],0).ranges;t.state.selection.ranges=a,g(t),t.state.selection.ranges=n}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(e,t){typeof e==`object`&&(t=e.ch,e=e.line);var n=A(this.cm6.state.doc,{line:e,ch:t||0});this.cm6.dispatch({selection:{anchor:n}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(e){var t=this.cm6.state.selection.main,n=e==`head`||!e?t.head:e==`anchor`?t.anchor:e==`start`?t.from:e==`end`?t.to:null;if(n==null)throw Error(`Invalid cursor type`);return this.posFromIndex(n)}listSelections(){var e=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(t=>({anchor:j(e,t.anchor),head:j(e,t.head)}))}setSelections(e,t){var n=this.cm6.state.doc,r=e.map(e=>{var t=A(n,e.head),r=A(n,e.anchor);return t==r?f.cursor(t,1):f.range(r,t)});this.cm6.dispatch({selection:f.create(r,t)})}setSelection(e,t,n){this.setSelections([{anchor:e,head:t}],0),n&&n.origin==`*mouse`&&this.onBeforeEndOperation()}getLine(e){var t=this.cm6.state.doc;return e<0||e>=t.lines?``:this.cm6.state.doc.line(e+1).text}getLineHandle(e){return this.$lineHandleChanges||=[],{row:e,index:this.indexFromPos(new M(e,0))}}getLineNumber(e){var t=this.$lineHandleChanges;if(!t)return null;for(var n=e.index,r=0;r<t.length;r++)if(n=t[r].changes.mapPos(n,1,d.TrackAfter),n==null)return null;var i=this.posFromIndex(n);return i.ch==0?i.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(e,t){var n=this.cm6.state.doc;return this.cm6.state.sliceDoc(A(n,e),A(n,t))}replaceRange(e,t,n,r){n||=t;var i=this.cm6.state.doc,a=A(i,t),o=A(i,n);oe(this,{changes:{from:a,to:o,insert:e}})}replaceSelection(e){oe(this,this.cm6.state.replaceSelection(e))}replaceSelections(e){var t=this.cm6.state.selection.ranges.map((t,n)=>({from:t.from,to:t.to,insert:e[n]||``}));oe(this,{changes:t})}getSelection(){return this.getSelections().join(`
35
- `)}getSelections(){var e=this.cm6;return e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(e=>!e.empty)}getInputField(){return this.cm6.contentDOM}clipPos(e){var t=this.cm6.state.doc,n=e.ch,r=e.line+1;r<1&&(r=1,n=0),r>t.lines&&(r=t.lines,n=Number.MAX_VALUE);var i=t.line(r);return n=Math.min(Math.max(0,n),i.to-i.from),new M(r-1,n)}getValue(){return this.cm6.state.doc.toString()}setValue(e){var t=this.cm6;return t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e},selection:f.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(e,t){var n=this.cm6.state,r=A(n.doc,e),i=a(n,r+1,-1);return i&&i.end||(i=a(n,r,1),i&&i.end)?{to:j(n.doc,i.end.from)}:{to:void 0}}scanForBracket(e,t,n,r){return he(this,e,t,n,r)}indentLine(e,t){t?this.indentMore():this.indentLess()}indentMore(){x(this.cm6)}indentLess(){v(this.cm6)}execCommand(t){if(t==`indentAuto`)e.commands.indentAuto(this);else if(t==`goLineLeft`)T(this.cm6);else if(t==`goLineRight`){b(this.cm6);let e=this.cm6.state,t=e.selection.main.head;t<e.doc.length&&e.sliceDoc(t,t+1)!==`
36
- `&&E(this.cm6)}else t+``}setBookmark(e,t){var n=t?.insertLeft?1:-1,r=this.indexFromPos(e);return new ve(this,r,n)}addOverlay({query:e}){let t=new O({regexp:!0,search:e.source,caseSensitive:!/i/.test(e.flags)});if(t.valid){t.forVim=!0,this.cm6Query=t;let e=ee.of(t);return this.cm6.dispatch({effects:e}),t}}removeOverlay(e){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let t=ee.of(this.cm6Query);this.cm6.dispatch({effects:t})}getSearchCursor(e,t){var n=this,r=null,i=null,a=!1;t.ch??=Number.MAX_VALUE;var o=A(n.cm6.state.doc,t),s=e.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(e,t){return t||`\\`+e});function c(t,n=0,r=t.length){return new k(t,s,{ignoreCase:e.ignoreCase},n,r)}function l(e){var t=n.cm6.state.doc;if(e>t.length)return null;let r=c(t,e).next();return r.done?null:r.value}var u=1e4;function d(e,t){var r=n.cm6.state.doc;for(let n=1;;n++){let i=Math.max(e,t-n*u),a=c(r,i,t),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==e||o.from>i+10))return o;if(i==e)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var t=n.cm6.state.doc;return r=e?d(0,r?a?r.to-1:r.from:o):l(r?a?r.to+1:r.to:o),i=r&&{from:j(t,r.from),to:j(t,r.to),match:r.match},a=r?r.from==r.to:!1,r&&r.match},from:function(){return i?.from},to:function(){return i?.to},replace:function(e){r&&(oe(n,{changes:{from:r.from,to:r.to,insert:e}}),r.to=r.from+e.length,i&&(i.to=j(n.cm6.state.doc,r.to)))},get match(){return i&&i.match}}}findPosV(e,t,n,r){let{cm6:i}=this,a=i.state.doc,o=n==`page`?i.dom.clientHeight:0,s=A(a,e),c=f.cursor(s,1,void 0,r),l=Math.round(Math.abs(t));for(let e=0;e<l;e++)n==`page`?c=i.moveVertically(c,t>0,o):n==`line`&&(c=i.moveVertically(c,t>0));let u=j(a,c.head);return(t<0&&c.head==0&&r!=0&&e.line==0&&e.ch!=0||t>0&&c.head==a.length&&u.ch!=r&&e.line==u.line)&&(u.hitSide=!0),u}charCoords(e,t){var n=this.cm6.contentDOM.getBoundingClientRect(),r=A(this.cm6.state.doc,e),i=this.cm6.coordsAtPos(r),a=-n.top;return{left:(i?.left||0)-n.left,top:(i?.top||0)+a,bottom:(i?.bottom||0)+a}}coordsChar(e,t){var n=this.cm6.contentDOM.getBoundingClientRect(),r=this.cm6.posAtCoords({x:e.left+n.left,y:e.top+n.top})||0;return j(this.cm6.state.doc,r)}getScrollInfo(){var e=this.cm6.scrollDOM;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight,width:e.scrollWidth,clientHeight:e.clientHeight,clientWidth:e.clientWidth}}scrollTo(e,t){e!=null&&(this.cm6.scrollDOM.scrollLeft=e),t!=null&&(this.cm6.scrollDOM.scrollTop=t)}scrollIntoView(e,t){if(e){var n=this.indexFromPos(e);this.cm6.dispatch({effects:r.scrollIntoView(n)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:`scroll`})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption(`mode`)}}setSize(e,t){this.cm6.dom.style.width=e+4+`px`,this.cm6.dom.style.height=t+`px`,this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(e){this.$lineHandleChanges&&this.$lineHandleChanges.push(e);for(let t in this.marks)this.marks[t].update(e.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(t=>t.map(e.changes)));var t=this.curOp=this.curOp||{};e.changes.iterChanges((e,n,r,i,a)=>{(t.$changeStart==null||t.$changeStart>r)&&(t.$changeStart=r),this.$lastChangeEndOffset=i;var o={text:a.toJSON()};t.lastChange?t.lastChange.next=t.lastChange=o:t.lastChange=t.change=o},!0),t.changeHandlers||=this._handlers.change&&this._handlers.change.slice()}onSelectionChange(){var e=this.curOp=this.curOp||{};e.cursorActivityHandlers||=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice(),this.curOp.cursorActivity=!0}operation(e,t){this.curOp||={$d:0},this.curOp.$d++;try{var n=e()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return n}onBeforeEndOperation(){var e=this.curOp,t=!1;e&&(e.change&&N(e.changeHandlers,this,e.change),e&&e.cursorActivity&&(N(e.cursorActivityHandlers,this,null),e.isVimOp&&(t=!0)),this.curOp=null),t&&this.scrollIntoView()}moveH(e,t){if(t==`char`){var n=this.getCursor();this.setCursor(n.line,n.ch+e)}}setOption(e,t){switch(e){case`keyMap`:this.state.keyMap=t;break;case`textwidth`:this.state.textwidth=t}}getOption(e){switch(e){case`firstLineNumber`:return 1;case`tabSize`:return this.cm6.state.tabSize||4;case`readOnly`:return this.cm6.state.readOnly;case`indentWithTabs`:return this.cm6.state.facet(t)==` `;case`indentUnit`:return this.cm6.state.facet(t).length||2;case`textwidth`:return this.state.textwidth;case`keyMap`:return this.state.keyMap||`vim`}}toggleOverwrite(e){this.state.overwrite=e}getTokenTypeAt(e){var t=this.indexFromPos(e),n=(_(this.cm6.state,t)?.resolve(t))?.type?.name||``;return/comment/i.test(n)?`comment`:/string/i.test(n)?`string`:``}overWriteSelection(e){var t=this.cm6.state.doc,n=this.cm6.state.selection,r=n.ranges.map(e=>{if(e.empty){var n=e.to<t.length?t.sliceString(e.from,e.to+1):``;if(n&&!/\n/.test(n))return f.range(e.from,e.to+1)}return e});this.cm6.dispatch({selection:f.create(r,n.mainIndex)}),this.replaceSelection(e)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(e){var t=this.cm6.state.selection;this.virtualSelection=f.create(t.ranges,t.mainIndex);for(var n=0;n<this.virtualSelection.ranges.length;n++){var r=this.virtualSelection.ranges[n];r&&(this.cm6.dispatch({selection:f.create([r])}),e(),this.virtualSelection.ranges[n]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(e){return ye(this,e)}};F.isMac=typeof navigator<`u`&&/Mac/.test(navigator.platform),F.Pos=M,F.StringStream=p,F.commands={cursorCharLeft:function(e){C(e.cm6)},redo:function(e){P(e,!1)},undo:function(e){P(e,!0)},newlineAndIndent:function(e){y({state:e.cm6.state,dispatch:t=>oe(e,t)})},indentAuto:function(e){D(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},F.isWordChar=function(e){return ae.test(e)},F.keys=se,F.addClass=function(e,t){},F.rmClass=function(e,t){},F.e_preventDefault=function(e){e.preventDefault()},F.e_stop=function(e){var t,n;(t=e?.stopPropagation)==null||t.call(e),(n=e?.preventDefault)==null||n.call(e)},F.lookupKey=function(e,t,n){var r=F.keys[e];!r&&/^Arrow/.test(e)&&(r=F.keys[e.slice(5)]),r&&n(r)},F.on=ne,F.off=re,F.signal=ie,F.findMatchingTag=L,F.findEnclosingTag=ge,F.keyName=void 0;function ce(e,t,n){var r=document.createElement(`div`);return r.appendChild(t),r}function le(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}function ue(e,t,n){le(e,s);var r=ce(e,t,n&&n.bottom),i=!1,a,o=n&&n.duration!==void 0?n.duration:5e3;function s(){i||(i=!0,clearTimeout(a),r.remove(),fe(e,r))}return r.onclick=function(e){e.preventDefault(),s()},de(e,r),o&&(a=setTimeout(s,o)),s}function de(e,t){var n=e.state.dialog;e.state.dialog=t,t.style.flex=`1`,t&&n!==t&&(n&&n.contains(document.activeElement)&&e.focus(),n&&n.parentElement?n.parentElement.replaceChild(t,n):n&&n.remove(),F.signal(e,`dialog`))}function fe(e,t){e.state.dialog==t&&(e.state.dialog=null,F.signal(e,`dialog`))}function pe(e,t,n,r){r||={},le(e,void 0);var i=ce(e,t,r.bottom),a=!1;de(e,i);function o(t){if(typeof t==`string`)s.value=t;else{if(a)return;a=!0,fe(e,i),e.state.dialog||e.focus(),r.onClose&&r.onClose(i)}}var s=i.getElementsByTagName(`input`)[0];return s&&(r.value&&(s.value=r.value,r.selectValueOnOpen!==!1&&s.select()),r.onInput&&F.on(s,`input`,function(e){r.onInput(e,s.value,o)}),r.onKeyUp&&F.on(s,`keyup`,function(e){r.onKeyUp(e,s.value,o)}),F.on(s,`keydown`,function(e){r&&r.onKeyDown&&r.onKeyDown(e,s.value,o)||(e.keyCode==13&&n&&n(s.value),(e.keyCode==27||r.closeOnEnter!==!1&&e.keyCode==13)&&(s.blur(),F.e_stop(e),o()))}),r.closeOnBlur!==!1&&F.on(s,`blur`,function(){setTimeout(function(){document.activeElement!==s&&o()})}),s.focus()),o}var me={"(":`)>`,")":`(<`,"[":`]>`,"]":`[<`,"{":`}>`,"}":`{<`,"<":`>>`,">":`<<`};function I(e){return e&&e.bracketRegex||/[(){}[\]]/}function he(e,t,n,r,i){for(var a=i&&i.maxScanLineLength||1e4,o=i&&i.maxScanLines||1e3,s=[],c=I(i),l=n>0?Math.min(t.line+o,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-o),u=t.line;u!=l;u+=n){var d=e.getLine(u);if(d){var f=n>0?0:d.length-1,p=n>0?d.length:-1;if(!(d.length>a))for(u==t.line&&(f=t.ch-+(n<0));f!=p;f+=n){var m=d.charAt(f);if(c.test(m)){var h=me[m];if(h&&h.charAt(1)==`>`==n>0)s.push(m);else if(s.length)s.pop();else return{pos:new M(u,f),ch:m}}}}}return u-n!=(n>0?e.lastLine():e.firstLine())&&null}function L(e,t){return null}function ge(e,t){var n=e.cm6.state,r=e.indexFromPos(t);r<n.doc.length&&n.sliceDoc(r,r+1)==`<`&&r++;for(var i=_(n,r)?.resolve(r)||null;i;){if(i.firstChild?.type.name==`OpenTag`&&i.lastChild?.type.name==`CloseTag`)return{open:_e(n.doc,i.firstChild),close:_e(n.doc,i.lastChild)};i=i.parent}}function _e(e,t){return{from:j(e,t.from),to:j(e,t.to)}}var ve=class{constructor(e,t,n){this.cm=e,this.id=e.$mid++,this.offset=t,this.assoc=n,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,d.TrackDel))}};function ye(e,t){for(var n=t.column||e.getOption(`textwidth`)||80,r=t.allowMerge!=0,i=Math.min(t.from,t.to),a=Math.max(t.from,t.to);i<=a;){var o=e.getLine(i);if(o.length>n){var s=p(o,n,5);if(s){var c=/^\s*/.exec(o)?.[0];e.replaceRange(`
37
- `+c,new M(i,s.start),new M(i,s.end))}a++}else if(r&&/\S/.test(o)&&i!=a){var l=e.getLine(i+1);if(l&&/\S/.test(l)){var u=o.replace(/\s+$/,``),d=l.replace(/^\s+/,``),f=u+` `+d,s=p(f,n,5);s&&s.start>u.length||f.length<n?(e.replaceRange(` `,new M(i,u.length),new M(i+1,l.length-d.length)),i--,a--):u.length<o.length&&e.replaceRange(``,new M(i,u.length),new M(i,o.length))}}i++}return i;function p(e,t,n){if(!(e.length<t)){var r=e.slice(0,t),i=e.slice(t),a=/^(?:(\s+)|(\S+)(\s+))/.exec(i),o=/(?:(\s+)|(\s+)(\S+))$/.exec(r),s=0,c=0;if(o&&!o[2]&&(s=t-o[1].length,c=t),a&&!a[2]&&(s||=t,c=t+a[1].length),s)return{start:s,end:c};if(o&&o[2]&&o.index>n)return{start:o.index,end:o.index+o[2].length};if(a&&a[2])return s=t+a[2].length,{start:s,end:s+a[3].length}}}}var R=i||function(){let e={cursorBlinkRate:1200};return function(){return e}}(),be=class{constructor(e,t,n,r,i,a,o,s,c,l){this.left=e,this.top=t,this.height=n,this.fontFamily=r,this.fontSize=i,this.fontWeight=a,this.color=o,this.className=s,this.letter=c,this.partial=l}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,e.style.height=this.height+`px`,e.style.lineHeight=this.height+`px`,e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?`transparent`:this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},xe=class{constructor(e,t){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=t,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement(`div`)),this.cursorLayer.className=`cm-cursorLayer cm-vimCursorLayer`,this.cursorLayer.setAttribute(`aria-hidden`,`true`),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=R(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+`ms`}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`),Se(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let n of e.selection.ranges){let r=n==e.selection.main,i=Te(this.cm,this.view,n,r);i&&t.push(i)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((e,t)=>!e.eq(this.cursors[t]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent=``;for(let t of e)this.cursorLayer.appendChild(t.draw())}else e.forEach((e,n)=>e.adjust(t[n]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function Se(e){return R(e.startState)!=R(e.state)}var Ce=h.highest(r.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:`transparent !important`},"&::selection":{backgroundColor:`transparent !important`},caretColor:`transparent !important`},".cm-fat-cursor":{position:`absolute`,background:`#ff9696`,border:`none`,whiteSpace:`pre`},"&:not(.cm-focused) .cm-fat-cursor":{background:`none`,outline:`solid 1px #ff9696`,color:`transparent !important`}}));function we(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==s.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Te(e,t,n,r){var i;let a=n.head,o=!1,s=1,c=e.state.vim;if(c&&(!c.insertMode||e.state.overwrite)){if(o=!0,c.visualBlock&&!r)return null;n.anchor<n.head&&(a<t.state.doc.length&&t.state.sliceDoc(a,a+1))!=`
34
+ `);if(r.maybeReset&&=(r.changes=[],!1),o)if(e.state.overwrite&&!/\n/.test(o))r.changes.push([o]);else{if(o.length>1){var s=i&&i.insertEnd&&i.insertEnd.find(),c=e.getCursor();if(s&&s.line==c.line){var l=s.ch-c.ch;l>0&&l<o.length&&(r.changes.push([o,l]),o=``)}}o&&r.changes.push(o)}}t=t.next}}function Jt(e){var t=e.state.vim;if(t.insertMode){var n=M.macroModeState;if(n.isPlaying)return;var r=n.lastInsertModeChanges;r.expectCursorActivityForChange?r.expectCursorActivityForChange=!1:(r.maybeReset=!0,t.insertEnd&&t.insertEnd.clear(),t.insertEnd=e.setBookmark(e.getCursor(),{insertLeft:!0}))}else e.curOp?.isVimOp||Yt(e,t)}function Yt(t,n){var r=t.getCursor(`anchor`),i=t.getCursor(`head`);if(n.visualMode&&!t.somethingSelected()?J(t,!1):!n.visualMode&&!n.insertMode&&t.somethingSelected()&&(n.visualMode=!0,n.visualLine=!1,e.signal(t,`vim-mode-change`,{mode:`visual`})),n.visualMode){var a=W(i,r)?0:-1,o=W(i,r)?-1:0;i=V(i,0,a),r=V(r,0,o),n.sel={anchor:r,head:i},rt(t,n,`<`,G(i,r)),rt(t,n,`>`,K(i,r))}else n.insertMode||(n.lastHPos=t.getCursor().ch)}function Xt(t){var n=M.macroModeState.lastInsertModeChanges,r=e.keyName?e.keyName(t):t.key;r&&(r.indexOf(`Delete`)!=-1||r.indexOf(`Backspace`)!=-1)&&(n.maybeReset&&=(n.changes=[],!1),n.changes.push(new re(r,t)))}function Zt(e,t,n,r){var i=M.macroModeState;i.isPlaying=!0;var a=t.lastEditActionCommand,o=t.inputState;function s(){a?ye.processAction(e,t,a):ye.evalInput(e,t)}function c(n){if(i.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var r=i.lastInsertModeChanges;$t(e,r.changes,n)}}if(t.inputState=t.lastEditInputState,a&&a.interlaceInsertRepeat)for(var l=0;l<n;l++)s(),c(1);else r||s(),c(n);t.inputState=o,t.insertMode&&!r&&Rt(e),i.isPlaying=!1}function Qt(t,n){e.lookupKey(n,`vim-insert`,function(n){return typeof n==`string`?e.commands[n](t):n(t),!0})}function $t(e,t,n){var r=e.getCursor(`head`),i=M.macroModeState.lastInsertModeChanges.visualBlock;i&&(Fe(e,r,i+1),n=e.listSelections().length,e.setCursor(r));for(var a=0;a<n;a++){i&&e.setCursor(V(r,a,0));for(var o=0;o<t.length;o++){var s=t[o];if(s instanceof re)Qt(e,s.keyName);else if(typeof s==`string`)e.replaceSelection(s);else{var c=e.getCursor(),l=V(c,0,s[0].length-(s[1]||0));e.replaceRange(s[0],c,s[1]?c:l),e.setCursor(l)}}}i&&e.setCursor(V(r,0,1))}function en(e){var t=new e.constructor;return Object.keys(e).forEach(function(n){if(n!=`insertEnd`){var r=e[n];Array.isArray(r)?r=r.slice():r&&typeof r==`object`&&r.constructor!=Object&&(r=en(r)),t[n]=r}}),e.sel&&(t.sel={head:e.sel.head&&H(e.sel.head),anchor:e.sel.anchor&&H(e.sel.anchor)}),t}function tn(e,t,n){var r=j(e),i=e,a=!1,r=N.maybeInitVimState_(i),o=r.visualBlock||r.wasInVisualBlock;if(i.state.closeVimNotification){var s=i.state.closeVimNotification;if(i.state.closeVimNotification=null,s(),t==`<CR>`)return I(i),!0}var c=i.isInMultiSelectMode();if(r.wasInVisualBlock&&!c?r.wasInVisualBlock=!1:c&&r.visualBlock&&(r.wasInVisualBlock=!0),t==`<Esc>`&&!r.insertMode&&!r.visualMode&&c&&r.status==`<Esc>`)I(i);else if(o||!c||i.inVirtualSelectionMode)a=N.handleKey(i,t,n);else{var l=en(r),u=r.inputState.changeQueueList||[];i.operation(function(){i.curOp&&(i.curOp.isVimOp=!0);var e=0;i.forEachSelection(function(){i.state.vim.inputState.changeQueue=u[e];var r=i.getCursor(`head`),o=i.getCursor(`anchor`),s=W(r,o)?0:-1,c=W(r,o)?-1:0;r=V(r,0,s),o=V(o,0,c),i.state.vim.sel.head=r,i.state.vim.sel.anchor=o,a=N.handleKey(i,t,n),i.virtualSelection&&(u[e]=i.state.vim.inputState.changeQueue,i.state.vim=en(l)),e++}),i.curOp?.cursorActivity&&!a&&(i.curOp.cursorActivity=!1),i.state.vim=r,r.inputState.changeQueueList=u,r.inputState.changeQueue=null},!0)}return a&&!r.visualMode&&!r.insertMode&&r.visualMode!=i.somethingSelected()&&Yt(i,r),a}return ne(),N}function A(e,t){var n=t.ch,r=t.line+1;r<1&&(r=1,n=0),r>e.lines&&(r=e.lines,n=Number.MAX_VALUE);var i=e.line(r);return Math.min(i.from+Math.max(0,n),i.to)}function j(e,t){let n=e.lineAt(t);return{line:n.number-1,ch:t-n.from}}var M=class{constructor(e,t){this.line=e,this.ch=t}};function ne(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{var r=e._handlers||={};r[t]=(r[t]||[]).concat(n)}}function re(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{var r=e._handlers,i=r&&r[t];if(i){var a=i.indexOf(n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function ie(e,t,...n){var r=e._handlers?.[t];if(r)for(var i=0;i<r.length;++i)r[i](...n)}function N(e,...t){if(e)for(var n=0;n<e.length;++n)e[n](...t)}var ae;try{ae=RegExp(`[\\w\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{ae=/[\w]/}function oe(e,t){var n=e.cm6;if(!n.state.readOnly){var r=`input.type.compose`;if(e.curOp&&(e.curOp.lastChange||(r=`input.type.compose.start`)),t.annotations)try{t.annotations.some(function(e){e.value==`input`&&(e.value=r)})}catch(e){console.error(e)}else t.userEvent=r;return n.dispatch(t)}}function P(e,t){e.curOp&&(e.curOp.$changeStart=void 0),(t?S:w)(e.cm6);let n=e.curOp?.$changeStart;n!=null&&e.cm6.dispatch({selection:{anchor:n}})}var se={Left:t=>e(t.cm6,{key:`Left`},`editor`),Right:t=>e(t.cm6,{key:`Right`},`editor`),Up:t=>e(t.cm6,{key:`Up`},`editor`),Down:t=>e(t.cm6,{key:`Down`},`editor`),Backspace:t=>e(t.cm6,{key:`Backspace`},`editor`),Delete:t=>e(t.cm6,{key:`Delete`},`editor`)},F=class e{openDialog(e,t,n){return pe(this,e,t,n)}openNotification(e,t){return ue(this,e,t)}constructor(e){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=e,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(e,t){ne(this,e,t)}off(e,t){re(this,e,t)}signal(e,t,n){ie(this,e,t,n)}indexFromPos(e){return A(this.cm6.state.doc,e)}posFromIndex(e){return j(this.cm6.state.doc,e)}foldCode(e){let t=this.cm6,n=t.state.selection.ranges,r=this.cm6.state.doc,i=A(r,e),a=o.create([o.range(i,i)],0).ranges;t.state.selection.ranges=a,g(t),t.state.selection.ranges=n}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(e,t){typeof e==`object`&&(t=e.ch,e=e.line);var n=A(this.cm6.state.doc,{line:e,ch:t||0});this.cm6.dispatch({selection:{anchor:n}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(e){var t=this.cm6.state.selection.main,n=e==`head`||!e?t.head:e==`anchor`?t.anchor:e==`start`?t.from:e==`end`?t.to:null;if(n==null)throw Error(`Invalid cursor type`);return this.posFromIndex(n)}listSelections(){var e=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(t=>({anchor:j(e,t.anchor),head:j(e,t.head)}))}setSelections(e,t){var n=this.cm6.state.doc,r=e.map(e=>{var t=A(n,e.head),r=A(n,e.anchor);return t==r?o.cursor(t,1):o.range(r,t)});this.cm6.dispatch({selection:o.create(r,t)})}setSelection(e,t,n){this.setSelections([{anchor:e,head:t}],0),n&&n.origin==`*mouse`&&this.onBeforeEndOperation()}getLine(e){var t=this.cm6.state.doc;return e<0||e>=t.lines?``:this.cm6.state.doc.line(e+1).text}getLineHandle(e){return this.$lineHandleChanges||=[],{row:e,index:this.indexFromPos(new M(e,0))}}getLineNumber(e){var t=this.$lineHandleChanges;if(!t)return null;for(var n=e.index,r=0;r<t.length;r++)if(n=t[r].changes.mapPos(n,1,s.TrackAfter),n==null)return null;var i=this.posFromIndex(n);return i.ch==0?i.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(e,t){var n=this.cm6.state.doc;return this.cm6.state.sliceDoc(A(n,e),A(n,t))}replaceRange(e,t,n,r){n||=t;var i=this.cm6.state.doc,a=A(i,t),o=A(i,n);oe(this,{changes:{from:a,to:o,insert:e}})}replaceSelection(e){oe(this,this.cm6.state.replaceSelection(e))}replaceSelections(e){var t=this.cm6.state.selection.ranges.map((t,n)=>({from:t.from,to:t.to,insert:e[n]||``}));oe(this,{changes:t})}getSelection(){return this.getSelections().join(`
35
+ `)}getSelections(){var e=this.cm6;return e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(e=>!e.empty)}getInputField(){return this.cm6.contentDOM}clipPos(e){var t=this.cm6.state.doc,n=e.ch,r=e.line+1;r<1&&(r=1,n=0),r>t.lines&&(r=t.lines,n=Number.MAX_VALUE);var i=t.line(r);return n=Math.min(Math.max(0,n),i.to-i.from),new M(r-1,n)}getValue(){return this.cm6.state.doc.toString()}setValue(e){var t=this.cm6;return t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e},selection:o.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(e,t){var r=this.cm6.state,i=A(r.doc,e),a=n(r,i+1,-1);return a&&a.end||(a=n(r,i,1),a&&a.end)?{to:j(r.doc,a.end.from)}:{to:void 0}}scanForBracket(e,t,n,r){return he(this,e,t,n,r)}indentLine(e,t){t?this.indentMore():this.indentLess()}indentMore(){x(this.cm6)}indentLess(){v(this.cm6)}execCommand(t){if(t==`indentAuto`)e.commands.indentAuto(this);else if(t==`goLineLeft`)T(this.cm6);else if(t==`goLineRight`){b(this.cm6);let e=this.cm6.state,t=e.selection.main.head;t<e.doc.length&&e.sliceDoc(t,t+1)!==`
36
+ `&&E(this.cm6)}else t+``}setBookmark(e,t){var n=t?.insertLeft?1:-1,r=this.indexFromPos(e);return new ve(this,r,n)}addOverlay({query:e}){let t=new O({regexp:!0,search:e.source,caseSensitive:!/i/.test(e.flags)});if(t.valid){t.forVim=!0,this.cm6Query=t;let e=ee.of(t);return this.cm6.dispatch({effects:e}),t}}removeOverlay(e){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let t=ee.of(this.cm6Query);this.cm6.dispatch({effects:t})}getSearchCursor(e,t){var n=this,r=null,i=null,a=!1;t.ch??=Number.MAX_VALUE;var o=A(n.cm6.state.doc,t),s=e.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(e,t){return t||`\\`+e});function c(t,n=0,r=t.length){return new k(t,s,{ignoreCase:e.ignoreCase},n,r)}function l(e){var t=n.cm6.state.doc;if(e>t.length)return null;let r=c(t,e).next();return r.done?null:r.value}var u=1e4;function d(e,t){var r=n.cm6.state.doc;for(let n=1;;n++){let i=Math.max(e,t-n*u),a=c(r,i,t),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==e||o.from>i+10))return o;if(i==e)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var t=n.cm6.state.doc;return r=e?d(0,r?a?r.to-1:r.from:o):l(r?a?r.to+1:r.to:o),i=r&&{from:j(t,r.from),to:j(t,r.to),match:r.match},a=r?r.from==r.to:!1,r&&r.match},from:function(){return i?.from},to:function(){return i?.to},replace:function(e){r&&(oe(n,{changes:{from:r.from,to:r.to,insert:e}}),r.to=r.from+e.length,i&&(i.to=j(n.cm6.state.doc,r.to)))},get match(){return i&&i.match}}}findPosV(e,t,n,r){let{cm6:i}=this,a=i.state.doc,s=n==`page`?i.dom.clientHeight:0,c=A(a,e),l=o.cursor(c,1,void 0,r),u=Math.round(Math.abs(t));for(let e=0;e<u;e++)n==`page`?l=i.moveVertically(l,t>0,s):n==`line`&&(l=i.moveVertically(l,t>0));let d=j(a,l.head);return(t<0&&l.head==0&&r!=0&&e.line==0&&e.ch!=0||t>0&&l.head==a.length&&d.ch!=r&&e.line==d.line)&&(d.hitSide=!0),d}charCoords(e,t){var n=this.cm6.contentDOM.getBoundingClientRect(),r=A(this.cm6.state.doc,e),i=this.cm6.coordsAtPos(r),a=-n.top;return{left:(i?.left||0)-n.left,top:(i?.top||0)+a,bottom:(i?.bottom||0)+a}}coordsChar(e,t){var n=this.cm6.contentDOM.getBoundingClientRect(),r=this.cm6.posAtCoords({x:e.left+n.left,y:e.top+n.top})||0;return j(this.cm6.state.doc,r)}getScrollInfo(){var e=this.cm6.scrollDOM;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight,width:e.scrollWidth,clientHeight:e.clientHeight,clientWidth:e.clientWidth}}scrollTo(e,t){e!=null&&(this.cm6.scrollDOM.scrollLeft=e),t!=null&&(this.cm6.scrollDOM.scrollTop=t)}scrollIntoView(e,t){if(e){var n=this.indexFromPos(e);this.cm6.dispatch({effects:r.scrollIntoView(n)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:`scroll`})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption(`mode`)}}setSize(e,t){this.cm6.dom.style.width=e+4+`px`,this.cm6.dom.style.height=t+`px`,this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(e){this.$lineHandleChanges&&this.$lineHandleChanges.push(e);for(let t in this.marks)this.marks[t].update(e.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(t=>t.map(e.changes)));var t=this.curOp=this.curOp||{};e.changes.iterChanges((e,n,r,i,a)=>{(t.$changeStart==null||t.$changeStart>r)&&(t.$changeStart=r),this.$lastChangeEndOffset=i;var o={text:a.toJSON()};t.lastChange?t.lastChange.next=t.lastChange=o:t.lastChange=t.change=o},!0),t.changeHandlers||=this._handlers.change&&this._handlers.change.slice()}onSelectionChange(){var e=this.curOp=this.curOp||{};e.cursorActivityHandlers||=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice(),this.curOp.cursorActivity=!0}operation(e,t){this.curOp||={$d:0},this.curOp.$d++;try{var n=e()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return n}onBeforeEndOperation(){var e=this.curOp,t=!1;e&&(e.change&&N(e.changeHandlers,this,e.change),e&&e.cursorActivity&&(N(e.cursorActivityHandlers,this,null),e.isVimOp&&(t=!0)),this.curOp=null),t&&this.scrollIntoView()}moveH(e,t){if(t==`char`){var n=this.getCursor();this.setCursor(n.line,n.ch+e)}}setOption(e,t){switch(e){case`keyMap`:this.state.keyMap=t;break;case`textwidth`:this.state.textwidth=t}}getOption(e){switch(e){case`firstLineNumber`:return 1;case`tabSize`:return this.cm6.state.tabSize||4;case`readOnly`:return this.cm6.state.readOnly;case`indentWithTabs`:return this.cm6.state.facet(u)==` `;case`indentUnit`:return this.cm6.state.facet(u).length||2;case`textwidth`:return this.state.textwidth;case`keyMap`:return this.state.keyMap||`vim`}}toggleOverwrite(e){this.state.overwrite=e}getTokenTypeAt(e){var t=this.indexFromPos(e),n=(_(this.cm6.state,t)?.resolve(t))?.type?.name||``;return/comment/i.test(n)?`comment`:/string/i.test(n)?`string`:``}overWriteSelection(e){var t=this.cm6.state.doc,n=this.cm6.state.selection,r=n.ranges.map(e=>{if(e.empty){var n=e.to<t.length?t.sliceString(e.from,e.to+1):``;if(n&&!/\n/.test(n))return o.range(e.from,e.to+1)}return e});this.cm6.dispatch({selection:o.create(r,n.mainIndex)}),this.replaceSelection(e)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(e){var t=this.cm6.state.selection;this.virtualSelection=o.create(t.ranges,t.mainIndex);for(var n=0;n<this.virtualSelection.ranges.length;n++){var r=this.virtualSelection.ranges[n];r&&(this.cm6.dispatch({selection:o.create([r])}),e(),this.virtualSelection.ranges[n]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(e){return ye(this,e)}};F.isMac=typeof navigator<`u`&&/Mac/.test(navigator.platform),F.Pos=M,F.StringStream=f,F.commands={cursorCharLeft:function(e){C(e.cm6)},redo:function(e){P(e,!1)},undo:function(e){P(e,!0)},newlineAndIndent:function(e){y({state:e.cm6.state,dispatch:t=>oe(e,t)})},indentAuto:function(e){D(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},F.isWordChar=function(e){return ae.test(e)},F.keys=se,F.addClass=function(e,t){},F.rmClass=function(e,t){},F.e_preventDefault=function(e){e.preventDefault()},F.e_stop=function(e){var t,n;(t=e?.stopPropagation)==null||t.call(e),(n=e?.preventDefault)==null||n.call(e)},F.lookupKey=function(e,t,n){var r=F.keys[e];!r&&/^Arrow/.test(e)&&(r=F.keys[e.slice(5)]),r&&n(r)},F.on=ne,F.off=re,F.signal=ie,F.findMatchingTag=L,F.findEnclosingTag=ge,F.keyName=void 0;function ce(e,t,n){var r=document.createElement(`div`);return r.appendChild(t),r}function le(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}function ue(e,t,n){le(e,s);var r=ce(e,t,n&&n.bottom),i=!1,a,o=n&&n.duration!==void 0?n.duration:5e3;function s(){i||(i=!0,clearTimeout(a),r.remove(),fe(e,r))}return r.onclick=function(e){e.preventDefault(),s()},de(e,r),o&&(a=setTimeout(s,o)),s}function de(e,t){var n=e.state.dialog;e.state.dialog=t,t.style.flex=`1`,t&&n!==t&&(n&&n.contains(document.activeElement)&&e.focus(),n&&n.parentElement?n.parentElement.replaceChild(t,n):n&&n.remove(),F.signal(e,`dialog`))}function fe(e,t){e.state.dialog==t&&(e.state.dialog=null,F.signal(e,`dialog`))}function pe(e,t,n,r){r||={},le(e,void 0);var i=ce(e,t,r.bottom),a=!1;de(e,i);function o(t){if(typeof t==`string`)s.value=t;else{if(a)return;a=!0,fe(e,i),e.state.dialog||e.focus(),r.onClose&&r.onClose(i)}}var s=i.getElementsByTagName(`input`)[0];return s&&(r.value&&(s.value=r.value,r.selectValueOnOpen!==!1&&s.select()),r.onInput&&F.on(s,`input`,function(e){r.onInput(e,s.value,o)}),r.onKeyUp&&F.on(s,`keyup`,function(e){r.onKeyUp(e,s.value,o)}),F.on(s,`keydown`,function(e){r&&r.onKeyDown&&r.onKeyDown(e,s.value,o)||(e.keyCode==13&&n&&n(s.value),(e.keyCode==27||r.closeOnEnter!==!1&&e.keyCode==13)&&(s.blur(),F.e_stop(e),o()))}),r.closeOnBlur!==!1&&F.on(s,`blur`,function(){setTimeout(function(){document.activeElement!==s&&o()})}),s.focus()),o}var me={"(":`)>`,")":`(<`,"[":`]>`,"]":`[<`,"{":`}>`,"}":`{<`,"<":`>>`,">":`<<`};function I(e){return e&&e.bracketRegex||/[(){}[\]]/}function he(e,t,n,r,i){for(var a=i&&i.maxScanLineLength||1e4,o=i&&i.maxScanLines||1e3,s=[],c=I(i),l=n>0?Math.min(t.line+o,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-o),u=t.line;u!=l;u+=n){var d=e.getLine(u);if(d){var f=n>0?0:d.length-1,p=n>0?d.length:-1;if(!(d.length>a))for(u==t.line&&(f=t.ch-+(n<0));f!=p;f+=n){var m=d.charAt(f);if(c.test(m)){var h=me[m];if(h&&h.charAt(1)==`>`==n>0)s.push(m);else if(s.length)s.pop();else return{pos:new M(u,f),ch:m}}}}}return u-n!=(n>0?e.lastLine():e.firstLine())&&null}function L(e,t){return null}function ge(e,t){var n=e.cm6.state,r=e.indexFromPos(t);r<n.doc.length&&n.sliceDoc(r,r+1)==`<`&&r++;for(var i=_(n,r)?.resolve(r)||null;i;){if(i.firstChild?.type.name==`OpenTag`&&i.lastChild?.type.name==`CloseTag`)return{open:_e(n.doc,i.firstChild),close:_e(n.doc,i.lastChild)};i=i.parent}}function _e(e,t){return{from:j(e,t.from),to:j(e,t.to)}}var ve=class{constructor(e,t,n){this.cm=e,this.id=e.$mid++,this.offset=t,this.assoc=n,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,s.TrackDel))}};function ye(e,t){for(var n=t.column||e.getOption(`textwidth`)||80,r=t.allowMerge!=0,i=Math.min(t.from,t.to),a=Math.max(t.from,t.to);i<=a;){var o=e.getLine(i);if(o.length>n){var s=p(o,n,5);if(s){var c=/^\s*/.exec(o)?.[0];e.replaceRange(`
37
+ `+c,new M(i,s.start),new M(i,s.end))}a++}else if(r&&/\S/.test(o)&&i!=a){var l=e.getLine(i+1);if(l&&/\S/.test(l)){var u=o.replace(/\s+$/,``),d=l.replace(/^\s+/,``),f=u+` `+d,s=p(f,n,5);s&&s.start>u.length||f.length<n?(e.replaceRange(` `,new M(i,u.length),new M(i+1,l.length-d.length)),i--,a--):u.length<o.length&&e.replaceRange(``,new M(i,u.length),new M(i,o.length))}}i++}return i;function p(e,t,n){if(!(e.length<t)){var r=e.slice(0,t),i=e.slice(t),a=/^(?:(\s+)|(\S+)(\s+))/.exec(i),o=/(?:(\s+)|(\s+)(\S+))$/.exec(r),s=0,c=0;if(o&&!o[2]&&(s=t-o[1].length,c=t),a&&!a[2]&&(s||=t,c=t+a[1].length),s)return{start:s,end:c};if(o&&o[2]&&o.index>n)return{start:o.index,end:o.index+o[2].length};if(a&&a[2])return s=t+a[2].length,{start:s,end:s+a[3].length}}}}var R=m||function(){let e={cursorBlinkRate:1200};return function(){return e}}(),be=class{constructor(e,t,n,r,i,a,o,s,c,l){this.left=e,this.top=t,this.height=n,this.fontFamily=r,this.fontSize=i,this.fontWeight=a,this.color=o,this.className=s,this.letter=c,this.partial=l}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,e.style.height=this.height+`px`,e.style.lineHeight=this.height+`px`,e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?`transparent`:this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},xe=class{constructor(e,t){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=t,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement(`div`)),this.cursorLayer.className=`cm-cursorLayer cm-vimCursorLayer`,this.cursorLayer.setAttribute(`aria-hidden`,`true`),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=R(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+`ms`}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`),Se(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let n of e.selection.ranges){let r=n==e.selection.main,i=Te(this.cm,this.view,n,r);i&&t.push(i)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((e,t)=>!e.eq(this.cursors[t]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent=``;for(let t of e)this.cursorLayer.appendChild(t.draw())}else e.forEach((e,n)=>e.adjust(t[n]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function Se(e){return R(e.startState)!=R(e.state)}var Ce=c.highest(r.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:`transparent !important`},"&::selection":{backgroundColor:`transparent !important`},caretColor:`transparent !important`},".cm-fat-cursor":{position:`absolute`,background:`#ff9696`,border:`none`,whiteSpace:`pre`},"&:not(.cm-focused) .cm-fat-cursor":{background:`none`,outline:`solid 1px #ff9696`,color:`transparent !important`}}));function we(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==t.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function Te(e,t,n,r){var i;let a=n.head,o=!1,s=1,c=e.state.vim;if(c&&(!c.insertMode||e.state.overwrite)){if(o=!0,c.visualBlock&&!r)return null;n.anchor<n.head&&(a<t.state.doc.length&&t.state.sliceDoc(a,a+1))!=`
38
38
  `&&a--,e.state.overwrite?s=.2:c.status&&(s=.5)}if(o){let e=a<t.state.doc.length&&t.state.sliceDoc(a,a+1);e&&/[\uDC00-\uDFFF]/.test(e)&&a>1&&(a--,e=t.state.sliceDoc(a,a+1));let n=t.coordsAtPos(a,1);if(!n)return null;let o=we(t),c=t.domAtPos(a),u=c?c.node:t.contentDOM;for(u instanceof Text&&c.offset>=u.data.length&&u.parentElement?.nextSibling&&(u=u.parentElement?.nextSibling,c={node:u,offset:0});c&&c.node instanceof HTMLElement;)u=c.node,c={node:c.node.childNodes[c.offset],offset:0};if(!(u instanceof HTMLElement)){if(!u.parentNode)return null;u=u.parentNode}let d=getComputedStyle(u),f=n.left,p=(i=t).coordsForChar?.call(i,a);if(p&&(f=p.left),!e||e==`
39
- `||e==`\r`)e=`\xA0`;else if(e==` `){e=`\xA0`;var l=t.coordsAtPos(a+1,-1);l&&(f=l.left-(l.left-n.left)/parseInt(d.tabSize))}else/[\uD800-\uDBFF]/.test(e)&&a<t.state.doc.length-1&&(e+=t.state.sliceDoc(a+1,a+2));let m=n.bottom-n.top;return new be((f-o.left)/t.scaleX,(n.top-o.top+m*(1-s))/t.scaleY,m*s/t.scaleY,d.fontFamily,d.fontSize,d.fontWeight,d.color,r?`cm-fat-cursor cm-cursor-primary`:`cm-fat-cursor cm-cursor-secondary`,e,s!=1)}return null}var z=typeof navigator<`u`&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),B=te(F),V=r.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:`none`},".cm-vim-panel":{padding:`0px 10px`,fontFamily:`monospace`,minHeight:`1.3em`,display:`flex`},".cm-vim-panel input":{border:`none`,outline:`none`,backgroundColor:`inherit`},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`}}),Ee=o.fromClass(class{constructor(e){this.status=``,this.query=null,this.decorations=n.none,this.waitForCopy=!1,this.lastKeydown=``,this.useNextTextInput=!1,this.compositionText=``,this.view=e;let t=this.cm=new F(e);B.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new xe(e,t),this.updateClass(),this.cm.on(`vim-command-done`,()=>{t.state.vim&&(t.state.vim.status=``),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on(`vim-mode-change`,e=>{t.state.vim&&(t.state.vim.mode=e.mode,e.subMode&&(t.state.vim.mode+=` block`),t.state.vim.status=``,this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on(`dialog`,()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:ke.of(!!this.cm.state.dialog)})}),this.dom=document.createElement(`span`),this.spacer=document.createElement(`span`),this.spacer.style.flex=`1`,this.statusButton=document.createElement(`span`),this.statusButton.onclick=e=>{B.handleKey(this.cm,`<Esc>`,`user`),this.cm.focus()},this.statusButton.style.cssText=`cursor: pointer`}update(e){if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let t of e.transactions)for(let e of t.effects)if(e.is(ee))if(!e.value?.forVim)this.highlight(null);else{let t=e.value.create();this.highlight(t)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove(`cm-vimMode`):this.view.scrollDOM.classList.add(`cm-vimMode`)}updateStatus(){let e=this.cm.state.statusbar,t=this.cm.state.vim;if(!e||!t)return;let n=this.cm.state.dialog;if(n)n.parentElement!=e&&(e.textContent=``,e.appendChild(n));else{e.textContent=``;var r=(t.mode||`normal`).toUpperCase();t.insertModeReturn&&(r+=`(C-O)`),this.statusButton.textContent=`--${r}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){B.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=n.none;let{view:t}=this,r=new l;for(let n=0,i=t.visibleRanges,a=i.length;n<a;n++){let{from:o,to:s}=i[n];for(;n<a-1&&s>i[n+1].from-500;)s=i[++n].to;e.highlight(t.state,o,s,(e,t)=>{r.add(e,t,Oe)})}return this.decorations=r.finish()}handleKey(e,t){let n=this.cm,r=n.state.vim;if(!r)return;let i=B.vimKeyFromEvent(e,r);if(F.signal(this.cm,`inputEvent`,{type:`handleKey`,key:i}),!i)return;if(i==`<Esc>`&&!r.insertMode&&!r.visualMode&&this.query){let e=r.searchState_;e&&(n.removeOverlay(e.getOverlay()),e.setOverlay(null))}if(i===`<C-c>`&&!F.isMac&&n.somethingSelected())return this.waitForCopy=!0,!0;r.status=(r.status||``)+i;let a=B.multiSelectHandleKey(n,i,`user`);return r=B.maybeInitVimState_(n),!a&&r.insertMode&&n.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(a=!0,n.overWriteSelection(e.key)):e.key==`Backspace`&&(a=!0,F.commands.cursorCharLeft(n))),a&&(F.signal(this.cm,`vim-keypress`,i),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!a}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var e=this.cm,t=e.state.vim;t&&(t.insertMode?e.setSelection(e.getCursor(),e.getCursor()):e.operation(()=>{e.curOp&&(e.curOp.isVimOp=!0),B.handleKey(e,`<Esc>`,`user`)}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,F.signal(this.cm,`inputEvent`,e)},compositionupdate:function(e,t){F.signal(this.cm,`inputEvent`,e)},compositionend:function(e,t){F.signal(this.cm,`inputEvent`,e)},keypress:function(e,t){F.signal(this.cm,`inputEvent`,e),this.lastKeydown==`Dead`&&this.handleKey(e,t)},keydown:function(e,t){F.signal(this.cm,`inputEvent`,e),this.lastKeydown=e.key,this.lastKeydown==`Unidentified`||this.lastKeydown==`Process`||this.lastKeydown==`Dead`?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,t))}},provide:()=>[r.inputHandler.of((e,t,n,r)=>{var i=K(e);if(!i)return!1;var a=i.state?.vim,o=i.state.vimPlugin;if(a&&!a.insertMode&&!i.curOp?.isVimOp){if(r===`\0\0`)return!0;if(F.signal(i,`inputEvent`,{type:`text`,text:r,from:t,to:n}),r.length==1&&o.useNextTextInput){if(a.expectLiteralNext&&e.composing)return o.compositionText=r,!1;if(o.compositionText){var s=o.compositionText;o.compositionText=``;var c=e.state.selection.main.head;if(s===e.state.sliceDoc(c-s.length,c)){var l=i.getCursor();i.replaceRange(``,i.posFromIndex(c-s.length),l)}}return o.handleKey({key:r,preventDefault:()=>{},stopPropagation:()=>{}}),De(e),!0}}return!1})],decorations:e=>e.decorations});function De(e){var t=e.scrollDOM.parentElement;if(t){if(z){e.contentDOM.textContent=`\0\0`,e.contentDOM.dispatchEvent(new CustomEvent(`compositionend`));return}var n=e.scrollDOM.nextSibling,r=window.getSelection(),i=r&&{anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,n);try{i&&r&&(r.setPosition(i.anchorNode,i.anchorOffset),i.focusNode&&r.extend(i.focusNode,i.focusOffset))}catch(e){console.error(e)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent(`compositionend`))}}var Oe=n.mark({class:`cm-searchMatch`}),ke=u.define(),H=m.define({create:()=>!1,update(e,t){for(let n of t.effects)n.is(ke)&&(e=n.value);return e},provide:t=>e.from(t,e=>e?U:null)});function U(e){let t=document.createElement(`div`);t.className=`cm-vim-panel`;let n=e.cm;return n.state.dialog&&t.appendChild(n.state.dialog),{top:!1,dom:t}}function W(e){let t=document.createElement(`div`);t.className=`cm-vim-panel`;let n=e.cm;return n.state.statusbar=t,n.state.vimPlugin.updateStatus(),{dom:t}}function G(t={}){return[V,Ee,Ce,t.status?e.of(W):H]}function K(e){return e.cm||null}export{G as n,K as t};
39
+ `||e==`\r`)e=`\xA0`;else if(e==` `){e=`\xA0`;var l=t.coordsAtPos(a+1,-1);l&&(f=l.left-(l.left-n.left)/parseInt(d.tabSize))}else/[\uD800-\uDBFF]/.test(e)&&a<t.state.doc.length-1&&(e+=t.state.sliceDoc(a+1,a+2));let m=n.bottom-n.top;return new be((f-o.left)/t.scaleX,(n.top-o.top+m*(1-s))/t.scaleY,m*s/t.scaleY,d.fontFamily,d.fontSize,d.fontWeight,d.color,r?`cm-fat-cursor cm-cursor-primary`:`cm-fat-cursor cm-cursor-secondary`,e,s!=1)}return null}var z=typeof navigator<`u`&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),B=te(F),V=r.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:`none`},".cm-vim-panel":{padding:`0px 10px`,fontFamily:`monospace`,minHeight:`1.3em`,display:`flex`},".cm-vim-panel input":{border:`none`,outline:`none`,backgroundColor:`inherit`},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`}}),Ee=a.fromClass(class{constructor(e){this.status=``,this.query=null,this.decorations=i.none,this.waitForCopy=!1,this.lastKeydown=``,this.useNextTextInput=!1,this.compositionText=``,this.view=e;let t=this.cm=new F(e);B.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new xe(e,t),this.updateClass(),this.cm.on(`vim-command-done`,()=>{t.state.vim&&(t.state.vim.status=``),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on(`vim-mode-change`,e=>{t.state.vim&&(t.state.vim.mode=e.mode,e.subMode&&(t.state.vim.mode+=` block`),t.state.vim.status=``,this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on(`dialog`,()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:ke.of(!!this.cm.state.dialog)})}),this.dom=document.createElement(`span`),this.spacer=document.createElement(`span`),this.spacer.style.flex=`1`,this.statusButton=document.createElement(`span`),this.statusButton.onclick=e=>{B.handleKey(this.cm,`<Esc>`,`user`),this.cm.focus()},this.statusButton.style.cssText=`cursor: pointer`}update(e){if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let t of e.transactions)for(let e of t.effects)if(e.is(ee))if(!e.value?.forVim)this.highlight(null);else{let t=e.value.create();this.highlight(t)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove(`cm-vimMode`):this.view.scrollDOM.classList.add(`cm-vimMode`)}updateStatus(){let e=this.cm.state.statusbar,t=this.cm.state.vim;if(!e||!t)return;let n=this.cm.state.dialog;if(n)n.parentElement!=e&&(e.textContent=``,e.appendChild(n));else{e.textContent=``;var r=(t.mode||`normal`).toUpperCase();t.insertModeReturn&&(r+=`(C-O)`),this.statusButton.textContent=`--${r}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){B.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=i.none;let{view:t}=this,n=new p;for(let r=0,i=t.visibleRanges,a=i.length;r<a;r++){let{from:o,to:s}=i[r];for(;r<a-1&&s>i[r+1].from-500;)s=i[++r].to;e.highlight(t.state,o,s,(e,t)=>{n.add(e,t,Oe)})}return this.decorations=n.finish()}handleKey(e,t){let n=this.cm,r=n.state.vim;if(!r)return;let i=B.vimKeyFromEvent(e,r);if(F.signal(this.cm,`inputEvent`,{type:`handleKey`,key:i}),!i)return;if(i==`<Esc>`&&!r.insertMode&&!r.visualMode&&this.query){let e=r.searchState_;e&&(n.removeOverlay(e.getOverlay()),e.setOverlay(null))}if(i===`<C-c>`&&!F.isMac&&n.somethingSelected())return this.waitForCopy=!0,!0;r.status=(r.status||``)+i;let a=B.multiSelectHandleKey(n,i,`user`);return r=B.maybeInitVimState_(n),!a&&r.insertMode&&n.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(a=!0,n.overWriteSelection(e.key)):e.key==`Backspace`&&(a=!0,F.commands.cursorCharLeft(n))),a&&(F.signal(this.cm,`vim-keypress`,i),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!a}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var e=this.cm,t=e.state.vim;t&&(t.insertMode?e.setSelection(e.getCursor(),e.getCursor()):e.operation(()=>{e.curOp&&(e.curOp.isVimOp=!0),B.handleKey(e,`<Esc>`,`user`)}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,F.signal(this.cm,`inputEvent`,e)},compositionupdate:function(e,t){F.signal(this.cm,`inputEvent`,e)},compositionend:function(e,t){F.signal(this.cm,`inputEvent`,e)},keypress:function(e,t){F.signal(this.cm,`inputEvent`,e),this.lastKeydown==`Dead`&&this.handleKey(e,t)},keydown:function(e,t){F.signal(this.cm,`inputEvent`,e),this.lastKeydown=e.key,this.lastKeydown==`Unidentified`||this.lastKeydown==`Process`||this.lastKeydown==`Dead`?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,t))}},provide:()=>[r.inputHandler.of((e,t,n,r)=>{var i=K(e);if(!i)return!1;var a=i.state?.vim,o=i.state.vimPlugin;if(a&&!a.insertMode&&!i.curOp?.isVimOp){if(r===`\0\0`)return!0;if(F.signal(i,`inputEvent`,{type:`text`,text:r,from:t,to:n}),r.length==1&&o.useNextTextInput){if(a.expectLiteralNext&&e.composing)return o.compositionText=r,!1;if(o.compositionText){var s=o.compositionText;o.compositionText=``;var c=e.state.selection.main.head;if(s===e.state.sliceDoc(c-s.length,c)){var l=i.getCursor();i.replaceRange(``,i.posFromIndex(c-s.length),l)}}return o.handleKey({key:r,preventDefault:()=>{},stopPropagation:()=>{}}),De(e),!0}}return!1})],decorations:e=>e.decorations});function De(e){var t=e.scrollDOM.parentElement;if(t){if(z){e.contentDOM.textContent=`\0\0`,e.contentDOM.dispatchEvent(new CustomEvent(`compositionend`));return}var n=e.scrollDOM.nextSibling,r=window.getSelection(),i=r&&{anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,n);try{i&&r&&(r.setPosition(i.anchorNode,i.anchorOffset),i.focusNode&&r.extend(i.focusNode,i.focusOffset))}catch(e){console.error(e)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent(`compositionend`))}}var Oe=i.mark({class:`cm-searchMatch`}),ke=d.define(),H=l.define({create:()=>!1,update(e,t){for(let n of t.effects)n.is(ke)&&(e=n.value);return e},provide:e=>h.from(e,e=>e?U:null)});function U(e){let t=document.createElement(`div`);t.className=`cm-vim-panel`;let n=e.cm;return n.state.dialog&&t.appendChild(n.state.dialog),{top:!1,dom:t}}function W(e){let t=document.createElement(`div`);t.className=`cm-vim-panel`;let n=e.cm;return n.state.statusbar=t,n.state.vimPlugin.updateStatus(),{dom:t}}function G(e={}){return[V,Ee,Ce,e.status?h.of(W):H]}function K(e){return e.cm||null}export{G as n,K as t};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{at as n,rt as r}from"./vendor-base-ui-BQjbsJ43.js";var i=e({Toaster:()=>j,toast:()=>y}),a=t(n(),1),o=t(r(),1);function s(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var c=e=>{switch(e){case`success`:return d;case`info`:return p;case`warning`:return f;case`error`:return m;default:return null}},l=Array(12).fill(0),u=({visible:e,className:t})=>a.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},a.createElement(`div`,{className:`sonner-spinner`},l.map((e,t)=>a.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),d=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),f=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),p=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),m=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ee=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},a.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),a.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),te=()=>{let[e,t]=a.useState(document.hidden);return a.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},h=1,g=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:h++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,o,s=r.then(async e=>{if(o=[`resolve`,e],a.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(v(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||h++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_=(e,t)=>{let n=t?.id||h++;return g.addToast({title:e,...t,id:n}),n},v=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,y=Object.assign(_,{success:g.success,info:g.info,warning:g.warning,error:g.error,custom:g.custom,message:g.message,promise:g.promise,dismiss:g.dismiss,loading:g.loading},{getHistory:()=>g.toasts,getToasts:()=>g.getActiveToasts()});s(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function b(e){return e.label!==void 0}var ne=3,x=`24px`,S=`16px`,C=4e3,w=356,re=14,T=45,E=200;function D(...e){return e.filter(Boolean).join(` `)}function ie(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var O=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:o,visibleToasts:s,heights:l,index:d,toasts:f,expanded:p,removeToast:m,defaultRichColors:h,closeButton:g,style:_,cancelButtonStyle:v,actionButtonStyle:y,className:ne=``,descriptionClassName:x=``,duration:S,position:w,gap:re,expandByDefault:O,classNames:k,icons:A,closeButtonAriaLabel:j=`Close toast`}=e,[M,N]=a.useState(null),[P,ae]=a.useState(null),[F,I]=a.useState(!1),[L,R]=a.useState(!1),[z,B]=a.useState(!1),[V,oe]=a.useState(!1),[se,H]=a.useState(!1),[ce,U]=a.useState(0),[le,ue]=a.useState(0),W=a.useRef(n.duration||S||C),de=a.useRef(null),G=a.useRef(null),fe=d===0,pe=d+1<=s,K=n.type,q=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,J=a.useMemo(()=>l.findIndex(e=>e.toastId===n.id)||0,[l,n.id]),ge=a.useMemo(()=>n.closeButton??g,[n.closeButton,g]),_e=a.useMemo(()=>n.duration||S||C,[n.duration,S]),Y=a.useRef(0),X=a.useRef(0),ve=a.useRef(0),Z=a.useRef(null),[ye,be]=w.split(`-`),xe=a.useMemo(()=>l.reduce((e,t,n)=>n>=J?e:e+t.height,0),[l,J]),Se=te(),Ce=n.invert||t,Q=K===`loading`;X.current=a.useMemo(()=>J*re+xe,[J,xe]),a.useEffect(()=>{W.current=_e},[_e]),a.useEffect(()=>{I(!0)},[]),a.useEffect(()=>{let e=G.current;if(e){let t=e.getBoundingClientRect().height;return ue(t),o(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>o(e=>e.filter(e=>e.toastId!==n.id))}},[o,n.id]),a.useLayoutEffect(()=>{if(!F)return;let e=G.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ue(r),o(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[F,n.title,n.description,o,n.id,n.jsx,n.action,n.cancel]);let $=a.useCallback(()=>{R(!0),U(X.current),o(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{m(n)},E)},[n,m,o,X]);a.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return p||i||Se?(()=>{if(ve.current<Y.current){let e=new Date().getTime()-Y.current;W.current-=e}ve.current=new Date().getTime()})():W.current!==1/0&&(Y.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[p,i,n,K,Se,$]),a.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return A?.loading?a.createElement(`div`,{className:D(k?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},A.loading):a.createElement(u,{className:D(k?.loader,n?.classNames?.loader),visible:K===`loading`})}let Te=n.icon||A?.[K]||c(K);return a.createElement(`li`,{tabIndex:0,ref:G,className:D(ne,me,k?.toast,n?.classNames?.toast,k?.default,k?.[K],n?.classNames?.[K]),"data-sonner-toast":``,"data-rich-colors":n.richColors??h,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":F,"data-promise":!!n.promise,"data-swiped":se,"data-removed":L,"data-visible":pe,"data-y-position":ye,"data-x-position":be,"data-index":d,"data-front":fe,"data-swiping":z,"data-dismissible":q,"data-type":K,"data-invert":Ce,"data-swipe-out":V,"data-swipe-direction":P,"data-expanded":!!(p||O&&F),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${L?ce:X.current}px`,"--initial-height":O?`auto`:`${le}px`,..._,...n.style},onDragEnd:()=>{B(!1),N(null),Z.current=null},onPointerDown:e=>{e.button!==2&&(Q||!q||(de.current=new Date,U(X.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(B(!0),Z.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(V||!q)return;Z.current=null;let e=Number(G.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(G.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=M===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=T||a>.11){U(X.current),n.onDismiss==null||n.onDismiss.call(n,n),ae(M===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),oe(!0);return}var o,s;(o=G.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=G.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),H(!1),B(!1),N(null)},onPointerMove:t=>{var n,r;if(!Z.current||!q||window.getSelection()?.toString().length>0)return;let i=t.clientY-Z.current.y,a=t.clientX-Z.current.x,o=e.swipeDirections??ie(w);!M&&(Math.abs(a)>1||Math.abs(i)>1)&&N(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(M===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(M===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&H(!0),(n=G.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=G.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx&&K!==`loading`?a.createElement(`button`,{"aria-label":j,"data-disabled":Q,"data-close-button":!0,onClick:Q||!q?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:D(k?.closeButton,n?.classNames?.closeButton)},A?.close??ee):null,(K||n.icon||n.promise)&&n.icon!==null&&(A?.[K]!==null||n.icon)?a.createElement(`div`,{"data-icon":``,className:D(k?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,a.createElement(`div`,{"data-content":``,className:D(k?.content,n?.classNames?.content)},a.createElement(`div`,{"data-title":``,className:D(k?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?a.createElement(`div`,{"data-description":``,className:D(x,he,k?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),a.isValidElement(n.cancel)?n.cancel:n.cancel&&b(n.cancel)?a.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||v,onClick:e=>{b(n.cancel)&&q&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:D(k?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,a.isValidElement(n.action)?n.action:n.action&&b(n.action)?a.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||y,onClick:e=>{b(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:D(k?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function k(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function A(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?S:x;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var j=a.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:m,duration:ee,style:te,visibleToasts:h=ne,toastOptions:_,dir:v=k(),gap:y=re,icons:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=a.useState([]),T=a.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),E=a.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,ie]=a.useState([]),[j,M]=a.useState(!1),[N,P]=a.useState(!1),[ae,F]=a.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),I=a.useRef(null),L=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),R=a.useRef(null),z=a.useRef(!1),B=a.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||g.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return a.useEffect(()=>g.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{o.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),a.useEffect(()=>{if(p!==`system`){F(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?F(`dark`):F(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{F(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{F(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),a.useEffect(()=>{S.length<=1&&M(!1)},[S]),a.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;M(!0),(t=I.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===I.current||I.current?.contains(document.activeElement))&&M(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),a.useEffect(()=>{if(I.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,z.current=!1)}},[I.current]),a.createElement(`section`,{ref:t,"aria-label":`${x} ${L}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[i,o]=t.split(`-`);return T.length?a.createElement(`ol`,{key:t,dir:v===`auto`?k():v,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":ae,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${w}px`,"--gap":`${y}px`,...te,...A(d,f)},onBlur:e=>{z.current&&!e.currentTarget.contains(e.relatedTarget)&&(z.current=!1,R.current&&=(R.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||z.current||(z.current=!0,R.current=e.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{N||M(!1)},onDragEnd:()=>M(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||P(!0)},onPointerUp:()=>P(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>a.createElement(O,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:m,duration:_?.duration??ee,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:r,visibleToasts:h,closeButton:_?.closeButton??l,interacting:N,position:t,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:B,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:ie,expandByDefault:c,gap:y,expanded:j,swipeDirections:e.swipeDirections}))):null}))});export{i as n,y as r,j as t};
1
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{at as n,st as r}from"./vendor-base-ui-CzHs0bHY.js";var i=e({Toaster:()=>j,toast:()=>y}),a=t(r(),1),o=t(n(),1);function s(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var c=e=>{switch(e){case`success`:return d;case`info`:return p;case`warning`:return f;case`error`:return m;default:return null}},l=Array(12).fill(0),u=({visible:e,className:t})=>a.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},a.createElement(`div`,{className:`sonner-spinner`},l.map((e,t)=>a.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),d=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),f=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),p=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),m=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ee=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},a.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),a.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),te=()=>{let[e,t]=a.useState(document.hidden);return a.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},h=1,g=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:h++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,o,s=r.then(async e=>{if(o=[`resolve`,e],a.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(v(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||h++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_=(e,t)=>{let n=t?.id||h++;return g.addToast({title:e,...t,id:n}),n},v=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,y=Object.assign(_,{success:g.success,info:g.info,warning:g.warning,error:g.error,custom:g.custom,message:g.message,promise:g.promise,dismiss:g.dismiss,loading:g.loading},{getHistory:()=>g.toasts,getToasts:()=>g.getActiveToasts()});s(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function b(e){return e.label!==void 0}var ne=3,x=`24px`,S=`16px`,C=4e3,w=356,re=14,T=45,E=200;function D(...e){return e.filter(Boolean).join(` `)}function ie(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var O=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:o,visibleToasts:s,heights:l,index:d,toasts:f,expanded:p,removeToast:m,defaultRichColors:h,closeButton:g,style:_,cancelButtonStyle:v,actionButtonStyle:y,className:ne=``,descriptionClassName:x=``,duration:S,position:w,gap:re,expandByDefault:O,classNames:k,icons:A,closeButtonAriaLabel:j=`Close toast`}=e,[M,N]=a.useState(null),[P,ae]=a.useState(null),[F,I]=a.useState(!1),[L,R]=a.useState(!1),[z,B]=a.useState(!1),[V,oe]=a.useState(!1),[se,H]=a.useState(!1),[ce,U]=a.useState(0),[le,ue]=a.useState(0),W=a.useRef(n.duration||S||C),de=a.useRef(null),G=a.useRef(null),fe=d===0,pe=d+1<=s,K=n.type,q=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,J=a.useMemo(()=>l.findIndex(e=>e.toastId===n.id)||0,[l,n.id]),ge=a.useMemo(()=>n.closeButton??g,[n.closeButton,g]),_e=a.useMemo(()=>n.duration||S||C,[n.duration,S]),Y=a.useRef(0),X=a.useRef(0),ve=a.useRef(0),Z=a.useRef(null),[ye,be]=w.split(`-`),xe=a.useMemo(()=>l.reduce((e,t,n)=>n>=J?e:e+t.height,0),[l,J]),Se=te(),Ce=n.invert||t,Q=K===`loading`;X.current=a.useMemo(()=>J*re+xe,[J,xe]),a.useEffect(()=>{W.current=_e},[_e]),a.useEffect(()=>{I(!0)},[]),a.useEffect(()=>{let e=G.current;if(e){let t=e.getBoundingClientRect().height;return ue(t),o(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>o(e=>e.filter(e=>e.toastId!==n.id))}},[o,n.id]),a.useLayoutEffect(()=>{if(!F)return;let e=G.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ue(r),o(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[F,n.title,n.description,o,n.id,n.jsx,n.action,n.cancel]);let $=a.useCallback(()=>{R(!0),U(X.current),o(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{m(n)},E)},[n,m,o,X]);a.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return p||i||Se?(()=>{if(ve.current<Y.current){let e=new Date().getTime()-Y.current;W.current-=e}ve.current=new Date().getTime()})():W.current!==1/0&&(Y.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[p,i,n,K,Se,$]),a.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return A?.loading?a.createElement(`div`,{className:D(k?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},A.loading):a.createElement(u,{className:D(k?.loader,n?.classNames?.loader),visible:K===`loading`})}let Te=n.icon||A?.[K]||c(K);return a.createElement(`li`,{tabIndex:0,ref:G,className:D(ne,me,k?.toast,n?.classNames?.toast,k?.default,k?.[K],n?.classNames?.[K]),"data-sonner-toast":``,"data-rich-colors":n.richColors??h,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":F,"data-promise":!!n.promise,"data-swiped":se,"data-removed":L,"data-visible":pe,"data-y-position":ye,"data-x-position":be,"data-index":d,"data-front":fe,"data-swiping":z,"data-dismissible":q,"data-type":K,"data-invert":Ce,"data-swipe-out":V,"data-swipe-direction":P,"data-expanded":!!(p||O&&F),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${L?ce:X.current}px`,"--initial-height":O?`auto`:`${le}px`,..._,...n.style},onDragEnd:()=>{B(!1),N(null),Z.current=null},onPointerDown:e=>{e.button!==2&&(Q||!q||(de.current=new Date,U(X.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(B(!0),Z.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(V||!q)return;Z.current=null;let e=Number(G.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(G.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=M===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=T||a>.11){U(X.current),n.onDismiss==null||n.onDismiss.call(n,n),ae(M===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),oe(!0);return}var o,s;(o=G.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=G.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),H(!1),B(!1),N(null)},onPointerMove:t=>{var n,r;if(!Z.current||!q||window.getSelection()?.toString().length>0)return;let i=t.clientY-Z.current.y,a=t.clientX-Z.current.x,o=e.swipeDirections??ie(w);!M&&(Math.abs(a)>1||Math.abs(i)>1)&&N(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(M===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(M===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&H(!0),(n=G.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=G.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx&&K!==`loading`?a.createElement(`button`,{"aria-label":j,"data-disabled":Q,"data-close-button":!0,onClick:Q||!q?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:D(k?.closeButton,n?.classNames?.closeButton)},A?.close??ee):null,(K||n.icon||n.promise)&&n.icon!==null&&(A?.[K]!==null||n.icon)?a.createElement(`div`,{"data-icon":``,className:D(k?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,a.createElement(`div`,{"data-content":``,className:D(k?.content,n?.classNames?.content)},a.createElement(`div`,{"data-title":``,className:D(k?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?a.createElement(`div`,{"data-description":``,className:D(x,he,k?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),a.isValidElement(n.cancel)?n.cancel:n.cancel&&b(n.cancel)?a.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||v,onClick:e=>{b(n.cancel)&&q&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:D(k?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,a.isValidElement(n.action)?n.action:n.action&&b(n.action)?a.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||y,onClick:e=>{b(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:D(k?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function k(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function A(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?S:x;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var j=a.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:m,duration:ee,style:te,visibleToasts:h=ne,toastOptions:_,dir:v=k(),gap:y=re,icons:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=a.useState([]),T=a.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),E=a.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,ie]=a.useState([]),[j,M]=a.useState(!1),[N,P]=a.useState(!1),[ae,F]=a.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),I=a.useRef(null),L=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),R=a.useRef(null),z=a.useRef(!1),B=a.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||g.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return a.useEffect(()=>g.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{o.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),a.useEffect(()=>{if(p!==`system`){F(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?F(`dark`):F(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{F(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{F(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),a.useEffect(()=>{S.length<=1&&M(!1)},[S]),a.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;M(!0),(t=I.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===I.current||I.current?.contains(document.activeElement))&&M(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),a.useEffect(()=>{if(I.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,z.current=!1)}},[I.current]),a.createElement(`section`,{ref:t,"aria-label":`${x} ${L}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[i,o]=t.split(`-`);return T.length?a.createElement(`ol`,{key:t,dir:v===`auto`?k():v,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":ae,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${w}px`,"--gap":`${y}px`,...te,...A(d,f)},onBlur:e=>{z.current&&!e.currentTarget.contains(e.relatedTarget)&&(z.current=!1,R.current&&=(R.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||z.current||(z.current=!0,R.current=e.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{N||M(!1)},onDragEnd:()=>M(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||P(!0)},onPointerUp:()=>P(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>a.createElement(O,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:m,duration:_?.duration??ee,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:r,visibleToasts:h,closeButton:_?.closeButton??l,interacting:N,position:t,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:B,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:ie,expandByDefault:c,gap:y,expanded:j,swipeDirections:e.swipeDirections}))):null}))});export{i as n,y as r,j as t};